Copyright (C) 2000-2012 |
GNU Info (autoconf.info)OutputCreating Output Files ===================== Every Autoconf-generated `configure' script must finish by calling `AC_OUTPUT'. It is the macro that creates the `Makefile's and optional other files resulting from configuration. The only other required macro is `AC_INIT' (Note: Input). - Macro: AC_OUTPUT ([FILE... [, EXTRA-CMDS [, INIT-CMDS]]]) Create output files. Call this macro once, at the end of `configure.in'. The FILE... argument is a whitespace-separated list of output files; it may be empty. This macro creates each file `FILE' by copying an input file (by default named `FILE.in'), substituting the output variable values. Note: Makefile Substitutions, for more information on using output variables. Note: Setting Output Variables, for more information on creating them. This macro creates the directory that the file is in if it doesn't exist (but not the parents of that directory). Usually, `Makefile's are created this way, but other files, such as `.gdbinit', can be specified as well. If `AC_CONFIG_HEADER', `AC_LINK_FILES', or `AC_CONFIG_SUBDIRS' has been called, this macro also creates the files named as their arguments. A typical call to `AC_OUTPUT' looks like this: AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile) You can override an input file name by appending to FILE a colon-separated list of input files. Examples: AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk) AC_OUTPUT(Makefile:templates/vars.mk:Makefile.in:templates/rules.mk) Doing this allows you to keep your file names acceptable to MS-DOS, or to prepend and/or append boilerplate to the file. If you pass EXTRA-CMDS, those commands will be inserted into `config.status' to be run after all its other processing. If INIT-CMDS are given, they are inserted just before EXTRA-CMDS, with shell variable, command, and backslash substitutions performed on them in `configure'. You can use INIT-CMDS to pass variables from `configure' to the EXTRA-CMDS. If `AC_OUTPUT_COMMANDS' has been called, the commands given to it are run just before the commands passed to this macro. - Macro: AC_OUTPUT_COMMANDS (EXTRA-CMDS [, INIT-CMDS]) Specify additional shell commands to run at the end of `config.status', and shell commands to initialize any variables from `configure'. This macro may be called multiple times. Here is an unrealistic example: fubar=27 AC_OUTPUT_COMMANDS([echo this is extra $fubar, and so on.], fubar=$fubar) AC_OUTPUT_COMMANDS([echo this is another, extra, bit], [echo init bit]) If you run `make' on subdirectories, you should run it using the `make' variable `MAKE'. Most versions of `make' set `MAKE' to the name of the `make' program plus any options it was given. (But many do not include in it the values of any variables set on the command line, so those are not passed on automatically.) Some old versions of `make' do not set this variable. The following macro allows you to use it even with those versions. - Macro: AC_PROG_MAKE_SET If `make' predefines the variable `MAKE', define output variable `SET_MAKE' to be empty. Otherwise, define `SET_MAKE' to contain `MAKE=make'. Calls `AC_SUBST' for `SET_MAKE'. To use this macro, place a line like this in each `Makefile.in' that runs `MAKE' on other directories: @SET_MAKE@ automatically generated by info2www version 1.2.2.9 |