| [3120] | 1 | This is automake.info, produced by makeinfo version 4.5.93 from
|
|---|
| 2 | automake.texi.
|
|---|
| 3 |
|
|---|
| 4 | INFO-DIR-SECTION Software development
|
|---|
| 5 | START-INFO-DIR-ENTRY
|
|---|
| 6 | * automake: (automake). Making Makefile.in's.
|
|---|
| 7 | END-INFO-DIR-ENTRY
|
|---|
| 8 |
|
|---|
| 9 | INFO-DIR-SECTION Individual utilities
|
|---|
| 10 | START-INFO-DIR-ENTRY
|
|---|
| 11 | * aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
|
|---|
| 12 | END-INFO-DIR-ENTRY
|
|---|
| 13 |
|
|---|
| 14 | This file documents GNU automake 1.7.9
|
|---|
| 15 |
|
|---|
| 16 | Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free
|
|---|
| 17 | Software Foundation, Inc.
|
|---|
| 18 |
|
|---|
| 19 | Permission is granted to make and distribute verbatim copies of this
|
|---|
| 20 | manual provided the copyright notice and this permission notice are
|
|---|
| 21 | preserved on all copies.
|
|---|
| 22 |
|
|---|
| 23 | Permission is granted to copy and distribute modified versions of
|
|---|
| 24 | this manual under the conditions for verbatim copying, provided that
|
|---|
| 25 | the entire resulting derived work is distributed under the terms of a
|
|---|
| 26 | permission notice identical to this one.
|
|---|
| 27 |
|
|---|
| 28 | Permission is granted to copy and distribute translations of this
|
|---|
| 29 | manual into another language, under the above conditions for modified
|
|---|
| 30 | versions, except that this permission notice may be stated in a
|
|---|
| 31 | translation approved by the Foundation.
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 | File: automake.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
|
|---|
| 35 |
|
|---|
| 36 | GNU Automake
|
|---|
| 37 | ************
|
|---|
| 38 |
|
|---|
| 39 | This file documents the GNU Automake package. Automake is a program
|
|---|
| 40 | which creates GNU standards-compliant Makefiles from template files.
|
|---|
| 41 | This edition documents version 1.7.9.
|
|---|
| 42 |
|
|---|
| 43 | * Menu:
|
|---|
| 44 |
|
|---|
| 45 | * Introduction:: Automake's purpose
|
|---|
| 46 | * Generalities:: General ideas
|
|---|
| 47 | * Examples:: Some example packages
|
|---|
| 48 | * Invoking Automake:: Creating a Makefile.in
|
|---|
| 49 | * configure:: Scanning configure.ac or configure.in
|
|---|
| 50 | * Top level:: The top-level Makefile.am
|
|---|
| 51 | * Alternative:: An alternative approach to subdirectories
|
|---|
| 52 | * Rebuilding:: Automatic rebuilding of Makefile
|
|---|
| 53 | * Programs:: Building programs and libraries
|
|---|
| 54 | * Other objects:: Other derived objects
|
|---|
| 55 | * Other GNU Tools:: Other GNU Tools
|
|---|
| 56 | * Documentation:: Building documentation
|
|---|
| 57 | * Install:: What gets installed
|
|---|
| 58 | * Clean:: What gets cleaned
|
|---|
| 59 | * Dist:: What goes in a distribution
|
|---|
| 60 | * Tests:: Support for test suites
|
|---|
| 61 | * Options:: Changing Automake's behavior
|
|---|
| 62 | * Miscellaneous:: Miscellaneous rules
|
|---|
| 63 | * Include:: Including extra files in an Automake template.
|
|---|
| 64 | * Conditionals:: Conditionals
|
|---|
| 65 | * Gnits:: The effect of `--gnu' and `--gnits'
|
|---|
| 66 | * Cygnus:: The effect of `--cygnus'
|
|---|
| 67 | * Extending:: Extending Automake
|
|---|
| 68 | * Distributing:: Distributing the Makefile.in
|
|---|
| 69 | * API versioning:: About compatibility between Automake versions
|
|---|
| 70 | * FAQ:: Frequently Asked Questions
|
|---|
| 71 | * Macro and Variable Index::
|
|---|
| 72 | * General Index::
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 | File: automake.info, Node: Introduction, Next: Generalities, Prev: Top, Up: Top
|
|---|
| 76 |
|
|---|
| 77 | Introduction
|
|---|
| 78 | ************
|
|---|
| 79 |
|
|---|
| 80 | Automake is a tool for automatically generating `Makefile.in's from
|
|---|
| 81 | files called `Makefile.am'. Each `Makefile.am' is basically a series
|
|---|
| 82 | of `make' variable definitions(1), with rules being thrown in
|
|---|
| 83 | occasionally. The generated `Makefile.in's are compliant with the GNU
|
|---|
| 84 | Makefile standards.
|
|---|
| 85 |
|
|---|
| 86 | The GNU Makefile Standards Document (*note Makefile Conventions:
|
|---|
| 87 | (standards)Makefile Conventions.) is long, complicated, and subject to
|
|---|
| 88 | change. The goal of Automake is to remove the burden of Makefile
|
|---|
| 89 | maintenance from the back of the individual GNU maintainer (and put it
|
|---|
| 90 | on the back of the Automake maintainer).
|
|---|
| 91 |
|
|---|
| 92 | The typical Automake input file is simply a series of variable
|
|---|
| 93 | definitions. Each such file is processed to create a `Makefile.in'.
|
|---|
| 94 | There should generally be one `Makefile.am' per directory of a project.
|
|---|
| 95 |
|
|---|
| 96 | Automake does constrain a project in certain ways; for instance it
|
|---|
| 97 | assumes that the project uses Autoconf (*note Introduction:
|
|---|
| 98 | (autoconf)Top.), and enforces certain restrictions on the
|
|---|
| 99 | `configure.in' contents(2).
|
|---|
| 100 |
|
|---|
| 101 | Automake requires `perl' in order to generate the `Makefile.in's.
|
|---|
| 102 | However, the distributions created by Automake are fully GNU
|
|---|
| 103 | standards-compliant, and do not require `perl' in order to be built.
|
|---|
| 104 |
|
|---|
| 105 | Mail suggestions and bug reports for Automake to
|
|---|
| 106 | <[email protected]>.
|
|---|
| 107 |
|
|---|
| 108 | ---------- Footnotes ----------
|
|---|
| 109 |
|
|---|
| 110 | (1) These variables are also called "make macros" in Make
|
|---|
| 111 | terminology, however in this manual we reserve the term "macro" for
|
|---|
| 112 | Autoconf's macros.
|
|---|
| 113 |
|
|---|
| 114 | (2) Autoconf 2.50 promotes `configure.ac' over `configure.in'. The
|
|---|
| 115 | rest of this documentation will refer to `configure.in' as this use is
|
|---|
| 116 | not yet spread, but Automake supports `configure.ac' too.
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 | File: automake.info, Node: Generalities, Next: Examples, Prev: Introduction, Up: Top
|
|---|
| 120 |
|
|---|
| 121 | General ideas
|
|---|
| 122 | *************
|
|---|
| 123 |
|
|---|
| 124 | The following sections cover a few basic ideas that will help you
|
|---|
| 125 | understand how Automake works.
|
|---|
| 126 |
|
|---|
| 127 | * Menu:
|
|---|
| 128 |
|
|---|
| 129 | * General Operation:: General operation of Automake
|
|---|
| 130 | * Strictness:: Standards conformance checking
|
|---|
| 131 | * Uniform:: The Uniform Naming Scheme
|
|---|
| 132 | * Canonicalization:: How derived variables are named
|
|---|
| 133 | * User Variables:: Variables reserved for the user
|
|---|
| 134 | * Auxiliary Programs:: Programs automake might require
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 | File: automake.info, Node: General Operation, Next: Strictness, Prev: Generalities, Up: Generalities
|
|---|
| 138 |
|
|---|
| 139 | General Operation
|
|---|
| 140 | =================
|
|---|
| 141 |
|
|---|
| 142 | Automake works by reading a `Makefile.am' and generating a
|
|---|
| 143 | `Makefile.in'. Certain variables and targets defined in the
|
|---|
| 144 | `Makefile.am' instruct Automake to generate more specialized code; for
|
|---|
| 145 | instance, a `bin_PROGRAMS' variable definition will cause targets for
|
|---|
| 146 | compiling and linking programs to be generated.
|
|---|
| 147 |
|
|---|
| 148 | The variable definitions and targets in the `Makefile.am' are copied
|
|---|
| 149 | verbatim into the generated file. This allows you to add arbitrary code
|
|---|
| 150 | into the generated `Makefile.in'. For instance the Automake
|
|---|
| 151 | distribution includes a non-standard `cvs-dist' target, which the
|
|---|
| 152 | Automake maintainer uses to make distributions from his source control
|
|---|
| 153 | system.
|
|---|
| 154 |
|
|---|
| 155 | Note that most GNU make extensions are not recognized by Automake.
|
|---|
| 156 | Using such extensions in a `Makefile.am' will lead to errors or
|
|---|
| 157 | confusing behavior.
|
|---|
| 158 |
|
|---|
| 159 | A special exception is that the GNU make append operator, `+=', is
|
|---|
| 160 | supported. This operator appends its right hand argument to the
|
|---|
| 161 | variable specified on the left. Automake will translate the operator
|
|---|
| 162 | into an ordinary `=' operator; `+=' will thus work with any make
|
|---|
| 163 | program.
|
|---|
| 164 |
|
|---|
| 165 | Automake tries to keep comments grouped with any adjoining targets or
|
|---|
| 166 | variable definitions.
|
|---|
| 167 |
|
|---|
| 168 | A target defined in `Makefile.am' generally overrides any such
|
|---|
| 169 | target of a similar name that would be automatically generated by
|
|---|
| 170 | `automake'. Although this is a supported feature, it is generally best
|
|---|
| 171 | to avoid making use of it, as sometimes the generated rules are very
|
|---|
| 172 | particular.
|
|---|
| 173 |
|
|---|
| 174 | Similarly, a variable defined in `Makefile.am' or `AC_SUBST''ed from
|
|---|
| 175 | `configure.in' will override any definition of the variable that
|
|---|
| 176 | `automake' would ordinarily create. This feature is more often useful
|
|---|
| 177 | than the ability to override a target definition. Be warned that many
|
|---|
| 178 | of the variables generated by `automake' are considered to be for
|
|---|
| 179 | internal use only, and their names might change in future releases.
|
|---|
| 180 |
|
|---|
| 181 | When examining a variable definition, Automake will recursively
|
|---|
| 182 | examine variables referenced in the definition. For example, if
|
|---|
| 183 | Automake is looking at the content of `foo_SOURCES' in this snippet
|
|---|
| 184 |
|
|---|
| 185 | xs = a.c b.c
|
|---|
| 186 | foo_SOURCES = c.c $(xs)
|
|---|
| 187 |
|
|---|
| 188 | it would use the files `a.c', `b.c', and `c.c' as the contents of
|
|---|
| 189 | `foo_SOURCES'.
|
|---|
| 190 |
|
|---|
| 191 | Automake also allows a form of comment which is _not_ copied into
|
|---|
| 192 | the output; all lines beginning with `##' (leading spaces allowed) are
|
|---|
| 193 | completely ignored by Automake.
|
|---|
| 194 |
|
|---|
| 195 | It is customary to make the first line of `Makefile.am' read:
|
|---|
| 196 |
|
|---|
| 197 | ## Process this file with automake to produce Makefile.in
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 | File: automake.info, Node: Strictness, Next: Uniform, Prev: General Operation, Up: Generalities
|
|---|
| 201 |
|
|---|
| 202 | Strictness
|
|---|
| 203 | ==========
|
|---|
| 204 |
|
|---|
| 205 | While Automake is intended to be used by maintainers of GNU packages, it
|
|---|
| 206 | does make some effort to accommodate those who wish to use it, but do
|
|---|
| 207 | not want to use all the GNU conventions.
|
|---|
| 208 |
|
|---|
| 209 | To this end, Automake supports three levels of "strictness"--the
|
|---|
| 210 | strictness indicating how stringently Automake should check standards
|
|---|
| 211 | conformance.
|
|---|
| 212 |
|
|---|
| 213 | The valid strictness levels are:
|
|---|
| 214 |
|
|---|
| 215 | `foreign'
|
|---|
| 216 | Automake will check for only those things which are absolutely
|
|---|
| 217 | required for proper operations. For instance, whereas GNU
|
|---|
| 218 | standards dictate the existence of a `NEWS' file, it will not be
|
|---|
| 219 | required in this mode. The name comes from the fact that Automake
|
|---|
| 220 | is intended to be used for GNU programs; these relaxed rules are
|
|---|
| 221 | not the standard mode of operation.
|
|---|
| 222 |
|
|---|
| 223 | `gnu'
|
|---|
| 224 | Automake will check--as much as possible--for compliance to the GNU
|
|---|
| 225 | standards for packages. This is the default.
|
|---|
| 226 |
|
|---|
| 227 | `gnits'
|
|---|
| 228 | Automake will check for compliance to the as-yet-unwritten "Gnits
|
|---|
| 229 | standards". These are based on the GNU standards, but are even
|
|---|
| 230 | more detailed. Unless you are a Gnits standards contributor, it is
|
|---|
| 231 | recommended that you avoid this option until such time as the Gnits
|
|---|
| 232 | standard is actually published (which may never happen).
|
|---|
| 233 |
|
|---|
| 234 | For more information on the precise implications of the strictness
|
|---|
| 235 | level, see *Note Gnits::.
|
|---|
| 236 |
|
|---|
| 237 | Automake also has a special "cygnus" mode which is similar to
|
|---|
| 238 | strictness but handled differently. This mode is useful for packages
|
|---|
| 239 | which are put into a "Cygnus" style tree (e.g., the GCC tree). For
|
|---|
| 240 | more information on this mode, see *Note Cygnus::.
|
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 | File: automake.info, Node: Uniform, Next: Canonicalization, Prev: Strictness, Up: Generalities
|
|---|
| 244 |
|
|---|
| 245 | The Uniform Naming Scheme
|
|---|
| 246 | =========================
|
|---|
| 247 |
|
|---|
| 248 | Automake variables generally follow a "uniform naming scheme" that
|
|---|
| 249 | makes it easy to decide how programs (and other derived objects) are
|
|---|
| 250 | built, and how they are installed. This scheme also supports
|
|---|
| 251 | `configure' time determination of what should be built.
|
|---|
| 252 |
|
|---|
| 253 | At `make' time, certain variables are used to determine which
|
|---|
| 254 | objects are to be built. The variable names are made of several pieces
|
|---|
| 255 | which are concatenated together.
|
|---|
| 256 |
|
|---|
| 257 | The piece which tells automake what is being built is commonly called
|
|---|
| 258 | the "primary". For instance, the primary `PROGRAMS' holds a list of
|
|---|
| 259 | programs which are to be compiled and linked.
|
|---|
| 260 |
|
|---|
| 261 | A different set of names is used to decide where the built objects
|
|---|
| 262 | should be installed. These names are prefixes to the primary which
|
|---|
| 263 | indicate which standard directory should be used as the installation
|
|---|
| 264 | directory. The standard directory names are given in the GNU standards
|
|---|
| 265 | (*note Directory Variables: (standards)Directory Variables.). Automake
|
|---|
| 266 | extends this list with `pkglibdir', `pkgincludedir', and `pkgdatadir';
|
|---|
| 267 | these are the same as the non-`pkg' versions, but with `@PACKAGE@'
|
|---|
| 268 | appended. For instance, `pkglibdir' is defined as
|
|---|
| 269 | `$(libdir)/@PACKAGE@'.
|
|---|
| 270 |
|
|---|
| 271 | For each primary, there is one additional variable named by
|
|---|
| 272 | prepending `EXTRA_' to the primary name. This variable is used to list
|
|---|
| 273 | objects which may or may not be built, depending on what `configure'
|
|---|
| 274 | decides. This variable is required because Automake must statically
|
|---|
| 275 | know the entire list of objects that may be built in order to generate
|
|---|
| 276 | a `Makefile.in' that will work in all cases.
|
|---|
| 277 |
|
|---|
| 278 | For instance, `cpio' decides at configure time which programs are
|
|---|
| 279 | built. Some of the programs are installed in `bindir', and some are
|
|---|
| 280 | installed in `sbindir':
|
|---|
| 281 |
|
|---|
| 282 | EXTRA_PROGRAMS = mt rmt
|
|---|
| 283 | bin_PROGRAMS = cpio pax
|
|---|
| 284 | sbin_PROGRAMS = @MORE_PROGRAMS@
|
|---|
| 285 |
|
|---|
| 286 | Defining a primary without a prefix as a variable, e.g., `PROGRAMS',
|
|---|
| 287 | is an error.
|
|---|
| 288 |
|
|---|
| 289 | Note that the common `dir' suffix is left off when constructing the
|
|---|
| 290 | variable names; thus one writes `bin_PROGRAMS' and not
|
|---|
| 291 | `bindir_PROGRAMS'.
|
|---|
| 292 |
|
|---|
| 293 | Not every sort of object can be installed in every directory.
|
|---|
| 294 | Automake will flag those attempts it finds in error. Automake will
|
|---|
| 295 | also diagnose obvious misspellings in directory names.
|
|---|
| 296 |
|
|---|
| 297 | Sometimes the standard directories--even as augmented by Automake--
|
|---|
| 298 | are not enough. In particular it is sometimes useful, for clarity, to
|
|---|
| 299 | install objects in a subdirectory of some predefined directory. To this
|
|---|
| 300 | end, Automake allows you to extend the list of possible installation
|
|---|
| 301 | directories. A given prefix (e.g. `zar') is valid if a variable of the
|
|---|
| 302 | same name with `dir' appended is defined (e.g. `zardir').
|
|---|
| 303 |
|
|---|
| 304 | For instance, until HTML support is part of Automake, you could use
|
|---|
| 305 | this to install raw HTML documentation:
|
|---|
| 306 |
|
|---|
| 307 | htmldir = $(prefix)/html
|
|---|
| 308 | html_DATA = automake.html
|
|---|
| 309 |
|
|---|
| 310 | The special prefix `noinst' indicates that the objects in question
|
|---|
| 311 | should be built but not installed at all. This is usually used for
|
|---|
| 312 | objects required to build the rest of your package, for instance static
|
|---|
| 313 | libraries (*note A Library::), or helper scripts.
|
|---|
| 314 |
|
|---|
| 315 | The special prefix `check' indicates that the objects in question
|
|---|
| 316 | should not be built until the `make check' command is run. Those
|
|---|
| 317 | objects are not installed either.
|
|---|
| 318 |
|
|---|
| 319 | The current primary names are `PROGRAMS', `LIBRARIES', `LISP',
|
|---|
| 320 | `PYTHON', `JAVA', `SCRIPTS', `DATA', `HEADERS', `MANS', and `TEXINFOS'.
|
|---|
| 321 |
|
|---|
| 322 | Some primaries also allow additional prefixes which control other
|
|---|
| 323 | aspects of `automake''s behavior. The currently defined prefixes are
|
|---|
| 324 | `dist_', `nodist_', and `nobase_'. These prefixes are explained later
|
|---|
| 325 | (*note Program and Library Variables::).
|
|---|
| 326 |
|
|---|
| 327 |
|
|---|
| 328 | File: automake.info, Node: Canonicalization, Next: User Variables, Prev: Uniform, Up: Generalities
|
|---|
| 329 |
|
|---|
| 330 | How derived variables are named
|
|---|
| 331 | ===============================
|
|---|
| 332 |
|
|---|
| 333 | Sometimes a Makefile variable name is derived from some text the
|
|---|
| 334 | maintainer supplies. For instance, a program name listed in
|
|---|
| 335 | `_PROGRAMS' is rewritten into the name of a `_SOURCES' variable. In
|
|---|
| 336 | cases like this, Automake canonicalizes the text, so that program names
|
|---|
| 337 | and the like do not have to follow Makefile variable naming rules. All
|
|---|
| 338 | characters in the name except for letters, numbers, the strudel (@),
|
|---|
| 339 | and the underscore are turned into underscores when making variable
|
|---|
| 340 | references.
|
|---|
| 341 |
|
|---|
| 342 | For example, if your program is named `sniff-glue', the derived
|
|---|
| 343 | variable name would be `sniff_glue_SOURCES', not `sniff-glue_SOURCES'.
|
|---|
| 344 | Similarly the sources for a library named `libmumble++.a' should be
|
|---|
| 345 | listed in the `libmumble___a_SOURCES' variable.
|
|---|
| 346 |
|
|---|
| 347 | The strudel is an addition, to make the use of Autoconf
|
|---|
| 348 | substitutions in variable names less obfuscating.
|
|---|
| 349 |
|
|---|
| 350 |
|
|---|
| 351 | File: automake.info, Node: User Variables, Next: Auxiliary Programs, Prev: Canonicalization, Up: Generalities
|
|---|
| 352 |
|
|---|
| 353 | Variables reserved for the user
|
|---|
| 354 | ===============================
|
|---|
| 355 |
|
|---|
| 356 | Some `Makefile' variables are reserved by the GNU Coding Standards for
|
|---|
| 357 | the use of the "user" - the person building the package. For instance,
|
|---|
| 358 | `CFLAGS' is one such variable.
|
|---|
| 359 |
|
|---|
| 360 | Sometimes package developers are tempted to set user variables such
|
|---|
| 361 | as `CFLAGS' because it appears to make their job easier - they don't
|
|---|
| 362 | have to introduce a second variable into every target.
|
|---|
| 363 |
|
|---|
| 364 | However, the package itself should never set a user variable,
|
|---|
| 365 | particularly not to include switches which are required for proper
|
|---|
| 366 | compilation of the package. Since these variables are documented as
|
|---|
| 367 | being for the package builder, that person rightfully expects to be able
|
|---|
| 368 | to override any of these variables at build time.
|
|---|
| 369 |
|
|---|
| 370 | To get around this problem, automake introduces an automake-specific
|
|---|
| 371 | shadow variable for each user flag variable. (Shadow variables are not
|
|---|
| 372 | introduced for variables like `CC', where they would make no sense.)
|
|---|
| 373 | The shadow variable is named by prepending `AM_' to the user variable's
|
|---|
| 374 | name. For instance, the shadow variable for `YFLAGS' is `AM_YFLAGS'.
|
|---|
| 375 |
|
|---|
| 376 |
|
|---|
| 377 | File: automake.info, Node: Auxiliary Programs, Prev: User Variables, Up: Generalities
|
|---|
| 378 |
|
|---|
| 379 | Programs automake might require
|
|---|
| 380 | ===============================
|
|---|
| 381 |
|
|---|
| 382 | Automake sometimes requires helper programs so that the generated
|
|---|
| 383 | `Makefile' can do its work properly. There are a fairly large number
|
|---|
| 384 | of them, and we list them here.
|
|---|
| 385 |
|
|---|
| 386 | `ansi2knr.c'
|
|---|
| 387 | `ansi2knr.1'
|
|---|
| 388 | These two files are used by the automatic de-ANSI-fication support
|
|---|
| 389 | (*note ANSI::).
|
|---|
| 390 |
|
|---|
| 391 | `compile'
|
|---|
| 392 | This is a wrapper for compilers which don't accept both `-c' and
|
|---|
| 393 | `-o' at the same time. It is only used when absolutely required.
|
|---|
| 394 | Such compilers are rare.
|
|---|
| 395 |
|
|---|
| 396 | `config.guess'
|
|---|
| 397 | `config.sub'
|
|---|
| 398 | These programs compute the canonical triplets for the given build,
|
|---|
| 399 | host, or target architecture. These programs are updated
|
|---|
| 400 | regularly to support new architectures and fix probes broken by
|
|---|
| 401 | changes in new kernel versions. You are encouraged to fetch the
|
|---|
| 402 | latest versions of these files from
|
|---|
| 403 | <ftp://ftp.gnu.org/gnu/config/> before making a release.
|
|---|
| 404 |
|
|---|
| 405 | `depcomp'
|
|---|
| 406 | This program understands how to run a compiler so that it will
|
|---|
| 407 | generate not only the desired output but also dependency
|
|---|
| 408 | information which is then used by the automatic dependency
|
|---|
| 409 | tracking feature.
|
|---|
| 410 |
|
|---|
| 411 | `elisp-comp'
|
|---|
| 412 | This program is used to byte-compile Emacs Lisp code.
|
|---|
| 413 |
|
|---|
| 414 | `install-sh'
|
|---|
| 415 | This is a replacement for the `install' program which works on
|
|---|
| 416 | platforms where `install' is unavailable or unusable.
|
|---|
| 417 |
|
|---|
| 418 | `mdate-sh'
|
|---|
| 419 | This script is used to generate a `version.texi' file. It examines
|
|---|
| 420 | a file and prints some date information about it.
|
|---|
| 421 |
|
|---|
| 422 | `missing'
|
|---|
| 423 | This wraps a number of programs which are typically only required
|
|---|
| 424 | by maintainers. If the program in question doesn't exist,
|
|---|
| 425 | `missing' prints an informative warning and attempts to fix things
|
|---|
| 426 | so that the build can continue.
|
|---|
| 427 |
|
|---|
| 428 | `mkinstalldirs'
|
|---|
| 429 | This works around the fact that `mkdir -p' is not portable.
|
|---|
| 430 |
|
|---|
| 431 | `py-compile'
|
|---|
| 432 | This is used to byte-compile Python scripts.
|
|---|
| 433 |
|
|---|
| 434 | `texinfo.tex'
|
|---|
| 435 | Not a program, this file is required for `make dvi', `make ps' and
|
|---|
| 436 | `make pdf' to work when Texinfo sources are in the package.
|
|---|
| 437 |
|
|---|
| 438 | `ylwrap'
|
|---|
| 439 | This program wraps `lex' and `yacc' and ensures that, for
|
|---|
| 440 | instance, multiple `yacc' instances can be invoked in a single
|
|---|
| 441 | directory in parallel.
|
|---|
| 442 |
|
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 | File: automake.info, Node: Examples, Next: Invoking Automake, Prev: Generalities, Up: Top
|
|---|
| 446 |
|
|---|
| 447 | Some example packages
|
|---|
| 448 | *********************
|
|---|
| 449 |
|
|---|
| 450 | * Menu:
|
|---|
| 451 |
|
|---|
| 452 | * Complete:: A simple example, start to finish
|
|---|
| 453 | * Hello:: A classic program
|
|---|
| 454 | * true:: Building true and false
|
|---|
| 455 |
|
|---|
| 456 |
|
|---|
| 457 | File: automake.info, Node: Complete, Next: Hello, Prev: Examples, Up: Examples
|
|---|
| 458 |
|
|---|
| 459 | A simple example, start to finish
|
|---|
| 460 | =================================
|
|---|
| 461 |
|
|---|
| 462 | Let's suppose you just finished writing `zardoz', a program to make
|
|---|
| 463 | your head float from vortex to vortex. You've been using Autoconf to
|
|---|
| 464 | provide a portability framework, but your `Makefile.in's have been
|
|---|
| 465 | ad-hoc. You want to make them bulletproof, so you turn to Automake.
|
|---|
| 466 |
|
|---|
| 467 | The first step is to update your `configure.in' to include the
|
|---|
| 468 | commands that `automake' needs. The way to do this is to add an
|
|---|
| 469 | `AM_INIT_AUTOMAKE' call just after `AC_INIT':
|
|---|
| 470 |
|
|---|
| 471 | AC_INIT(zardoz, 1.0)
|
|---|
| 472 | AM_INIT_AUTOMAKE
|
|---|
| 473 | ...
|
|---|
| 474 |
|
|---|
| 475 | Since your program doesn't have any complicating factors (e.g., it
|
|---|
| 476 | doesn't use `gettext', it doesn't want to build a shared library),
|
|---|
| 477 | you're done with this part. That was easy!
|
|---|
| 478 |
|
|---|
| 479 | Now you must regenerate `configure'. But to do that, you'll need to
|
|---|
| 480 | tell `autoconf' how to find the new macro you've used. The easiest way
|
|---|
| 481 | to do this is to use the `aclocal' program to generate your
|
|---|
| 482 | `aclocal.m4' for you. But wait... maybe you already have an
|
|---|
| 483 | `aclocal.m4', because you had to write some hairy macros for your
|
|---|
| 484 | program. The `aclocal' program lets you put your own macros into
|
|---|
| 485 | `acinclude.m4', so simply rename and then run:
|
|---|
| 486 |
|
|---|
| 487 | mv aclocal.m4 acinclude.m4
|
|---|
| 488 | aclocal
|
|---|
| 489 | autoconf
|
|---|
| 490 |
|
|---|
| 491 | Now it is time to write your `Makefile.am' for `zardoz'. Since
|
|---|
| 492 | `zardoz' is a user program, you want to install it where the rest of
|
|---|
| 493 | the user programs go: `bindir'. Additionally, `zardoz' has some
|
|---|
| 494 | Texinfo documentation. Your `configure.in' script uses
|
|---|
| 495 | `AC_REPLACE_FUNCS', so you need to link against `$(LIBOBJS)'. So
|
|---|
| 496 | here's what you'd write:
|
|---|
| 497 |
|
|---|
| 498 | bin_PROGRAMS = zardoz
|
|---|
| 499 | zardoz_SOURCES = main.c head.c float.c vortex9.c gun.c
|
|---|
| 500 | zardoz_LDADD = $(LIBOBJS)
|
|---|
| 501 |
|
|---|
| 502 | info_TEXINFOS = zardoz.texi
|
|---|
| 503 |
|
|---|
| 504 | Now you can run `automake --add-missing' to generate your
|
|---|
| 505 | `Makefile.in' and grab any auxiliary files you might need, and you're
|
|---|
| 506 | done!
|
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 | File: automake.info, Node: Hello, Next: true, Prev: Complete, Up: Examples
|
|---|
| 510 |
|
|---|
| 511 | A classic program
|
|---|
| 512 | =================
|
|---|
| 513 |
|
|---|
| 514 | GNU hello (ftp://prep.ai.mit.edu/pub/gnu/hello-1.3.tar.gz) is renowned
|
|---|
| 515 | for its classic simplicity and versatility. This section shows how
|
|---|
| 516 | Automake could be used with the GNU Hello package. The examples below
|
|---|
| 517 | are from the latest beta version of GNU Hello, but with all of the
|
|---|
| 518 | maintainer-only code stripped out, as well as all copyright comments.
|
|---|
| 519 |
|
|---|
| 520 | Of course, GNU Hello is somewhat more featureful than your
|
|---|
| 521 | traditional two-liner. GNU Hello is internationalized, does option
|
|---|
| 522 | processing, and has a manual and a test suite.
|
|---|
| 523 |
|
|---|
| 524 | Here is the `configure.in' from GNU Hello. *Please note:* The calls
|
|---|
| 525 | to `AC_INIT' and `AM_INIT_AUTOMAKE' in this example use a deprecated
|
|---|
| 526 | syntax. For the current approach, see the description of
|
|---|
| 527 | `AM_INIT_AUTOMAKE' in *Note Public macros::.
|
|---|
| 528 |
|
|---|
| 529 | dnl Process this file with autoconf to produce a configure script.
|
|---|
| 530 | AC_INIT(src/hello.c)
|
|---|
| 531 | AM_INIT_AUTOMAKE(hello, 1.3.11)
|
|---|
| 532 | AM_CONFIG_HEADER(config.h)
|
|---|
| 533 |
|
|---|
| 534 | dnl Set of available languages.
|
|---|
| 535 | ALL_LINGUAS="de fr es ko nl no pl pt sl sv"
|
|---|
| 536 |
|
|---|
| 537 | dnl Checks for programs.
|
|---|
| 538 | AC_PROG_CC
|
|---|
| 539 | AC_ISC_POSIX
|
|---|
| 540 |
|
|---|
| 541 | dnl Checks for libraries.
|
|---|
| 542 |
|
|---|
| 543 | dnl Checks for header files.
|
|---|
| 544 | AC_STDC_HEADERS
|
|---|
| 545 | AC_HAVE_HEADERS(string.h fcntl.h sys/file.h sys/param.h)
|
|---|
| 546 |
|
|---|
| 547 | dnl Checks for library functions.
|
|---|
| 548 | AC_FUNC_ALLOCA
|
|---|
| 549 |
|
|---|
| 550 | dnl Check for st_blksize in struct stat
|
|---|
| 551 | AC_ST_BLKSIZE
|
|---|
| 552 |
|
|---|
| 553 | dnl internationalization macros
|
|---|
| 554 | AM_GNU_GETTEXT
|
|---|
| 555 | AC_OUTPUT([Makefile doc/Makefile intl/Makefile po/Makefile.in \
|
|---|
| 556 | src/Makefile tests/Makefile tests/hello],
|
|---|
| 557 | [chmod +x tests/hello])
|
|---|
| 558 |
|
|---|
| 559 | The `AM_' macros are provided by Automake (or the Gettext library);
|
|---|
| 560 | the rest are standard Autoconf macros.
|
|---|
| 561 |
|
|---|
| 562 | The top-level `Makefile.am':
|
|---|
| 563 |
|
|---|
| 564 | EXTRA_DIST = BUGS ChangeLog.O
|
|---|
| 565 | SUBDIRS = doc intl po src tests
|
|---|
| 566 |
|
|---|
| 567 | As you can see, all the work here is really done in subdirectories.
|
|---|
| 568 |
|
|---|
| 569 | The `po' and `intl' directories are automatically generated using
|
|---|
| 570 | `gettextize'; they will not be discussed here.
|
|---|
| 571 |
|
|---|
| 572 | In `doc/Makefile.am' we see:
|
|---|
| 573 |
|
|---|
| 574 | info_TEXINFOS = hello.texi
|
|---|
| 575 | hello_TEXINFOS = gpl.texi
|
|---|
| 576 |
|
|---|
| 577 | This is sufficient to build, install, and distribute the GNU Hello
|
|---|
| 578 | manual.
|
|---|
| 579 |
|
|---|
| 580 | Here is `tests/Makefile.am':
|
|---|
| 581 |
|
|---|
| 582 | TESTS = hello
|
|---|
| 583 | EXTRA_DIST = hello.in testdata
|
|---|
| 584 |
|
|---|
| 585 | The script `hello' is generated by `configure', and is the only test
|
|---|
| 586 | case. `make check' will run this test.
|
|---|
| 587 |
|
|---|
| 588 | Last we have `src/Makefile.am', where all the real work is done:
|
|---|
| 589 |
|
|---|
| 590 | bin_PROGRAMS = hello
|
|---|
| 591 | hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h
|
|---|
| 592 | hello_LDADD = @INTLLIBS@ @ALLOCA@
|
|---|
| 593 | localedir = $(datadir)/locale
|
|---|
| 594 | INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
|
|---|
| 595 |
|
|---|
| 596 |
|
|---|
| 597 | File: automake.info, Node: true, Prev: Hello, Up: Examples
|
|---|
| 598 |
|
|---|
| 599 | Building true and false
|
|---|
| 600 | =======================
|
|---|
| 601 |
|
|---|
| 602 | Here is another, trickier example. It shows how to generate two
|
|---|
| 603 | programs (`true' and `false') from the same source file (`true.c').
|
|---|
| 604 | The difficult part is that each compilation of `true.c' requires
|
|---|
| 605 | different `cpp' flags.
|
|---|
| 606 |
|
|---|
| 607 | bin_PROGRAMS = true false
|
|---|
| 608 | false_SOURCES =
|
|---|
| 609 | false_LDADD = false.o
|
|---|
| 610 |
|
|---|
| 611 | true.o: true.c
|
|---|
| 612 | $(COMPILE) -DEXIT_CODE=0 -c true.c
|
|---|
| 613 |
|
|---|
| 614 | false.o: true.c
|
|---|
| 615 | $(COMPILE) -DEXIT_CODE=1 -o false.o -c true.c
|
|---|
| 616 |
|
|---|
| 617 | Note that there is no `true_SOURCES' definition. Automake will
|
|---|
| 618 | implicitly assume that there is a source file named `true.c', and
|
|---|
| 619 | define rules to compile `true.o' and link `true'. The `true.o: true.c'
|
|---|
| 620 | rule supplied by the above `Makefile.am', will override the Automake
|
|---|
| 621 | generated rule to build `true.o'.
|
|---|
| 622 |
|
|---|
| 623 | `false_SOURCES' is defined to be empty--that way no implicit value
|
|---|
| 624 | is substituted. Because we have not listed the source of `false', we
|
|---|
| 625 | have to tell Automake how to link the program. This is the purpose of
|
|---|
| 626 | the `false_LDADD' line. A `false_DEPENDENCIES' variable, holding the
|
|---|
| 627 | dependencies of the `false' target will be automatically generated by
|
|---|
| 628 | Automake from the content of `false_LDADD'.
|
|---|
| 629 |
|
|---|
| 630 | The above rules won't work if your compiler doesn't accept both `-c'
|
|---|
| 631 | and `-o'. The simplest fix for this is to introduce a bogus dependency
|
|---|
| 632 | (to avoid problems with a parallel `make'):
|
|---|
| 633 |
|
|---|
| 634 | true.o: true.c false.o
|
|---|
| 635 | $(COMPILE) -DEXIT_CODE=0 -c true.c
|
|---|
| 636 |
|
|---|
| 637 | false.o: true.c
|
|---|
| 638 | $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true.o false.o
|
|---|
| 639 |
|
|---|
| 640 | Also, these explicit rules do not work if the de-ANSI-fication
|
|---|
| 641 | feature is used (*note ANSI::). Supporting de-ANSI-fication requires a
|
|---|
| 642 | little more work:
|
|---|
| 643 |
|
|---|
| 644 | true._o: true._c false.o
|
|---|
| 645 | $(COMPILE) -DEXIT_CODE=0 -c true.c
|
|---|
| 646 |
|
|---|
| 647 | false._o: true._c
|
|---|
| 648 | $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true._o false.o
|
|---|
| 649 |
|
|---|
| 650 | As it turns out, there is also a much easier way to do this same
|
|---|
| 651 | task. Some of the above techniques are useful enough that we've kept
|
|---|
| 652 | the example in the manual. However if you were to build `true' and
|
|---|
| 653 | `false' in real life, you would probably use per-program compilation
|
|---|
| 654 | flags, like so:
|
|---|
| 655 |
|
|---|
| 656 | bin_PROGRAMS = false true
|
|---|
| 657 |
|
|---|
| 658 | false_SOURCES = true.c
|
|---|
| 659 | false_CPPFLAGS = -DEXIT_CODE=1
|
|---|
| 660 |
|
|---|
| 661 | true_SOURCES = true.c
|
|---|
| 662 | true_CPPFLAGS = -DEXIT_CODE=0
|
|---|
| 663 |
|
|---|
| 664 | In this case Automake will cause `true.c' to be compiled twice, with
|
|---|
| 665 | different flags. De-ANSI-fication will work automatically. In this
|
|---|
| 666 | instance, the names of the object files would be chosen by automake;
|
|---|
| 667 | they would be `false-true.o' and `true-true.o'. (The name of the
|
|---|
| 668 | object files rarely matters.)
|
|---|
| 669 |
|
|---|
| 670 |
|
|---|
| 671 | File: automake.info, Node: Invoking Automake, Next: configure, Prev: Examples, Up: Top
|
|---|
| 672 |
|
|---|
| 673 | Creating a `Makefile.in'
|
|---|
| 674 | ************************
|
|---|
| 675 |
|
|---|
| 676 | To create all the `Makefile.in's for a package, run the `automake'
|
|---|
| 677 | program in the top level directory, with no arguments. `automake' will
|
|---|
| 678 | automatically find each appropriate `Makefile.am' (by scanning
|
|---|
| 679 | `configure.in'; *note configure::) and generate the corresponding
|
|---|
| 680 | `Makefile.in'. Note that `automake' has a rather simplistic view of
|
|---|
| 681 | what constitutes a package; it assumes that a package has only one
|
|---|
| 682 | `configure.in', at the top. If your package has multiple
|
|---|
| 683 | `configure.in's, then you must run `automake' in each directory holding
|
|---|
| 684 | a `configure.in'. (Alternatively, you may rely on Autoconf's
|
|---|
| 685 | `autoreconf', which is able to recurse your package tree and run
|
|---|
| 686 | `automake' where appropriate.)
|
|---|
| 687 |
|
|---|
| 688 | You can optionally give `automake' an argument; `.am' is appended to
|
|---|
| 689 | the argument and the result is used as the name of the input file.
|
|---|
| 690 | This feature is generally only used to automatically rebuild an
|
|---|
| 691 | out-of-date `Makefile.in'. Note that `automake' must always be run
|
|---|
| 692 | from the topmost directory of a project, even if being used to
|
|---|
| 693 | regenerate the `Makefile.in' in some subdirectory. This is necessary
|
|---|
| 694 | because `automake' must scan `configure.in', and because `automake'
|
|---|
| 695 | uses the knowledge that a `Makefile.in' is in a subdirectory to change
|
|---|
| 696 | its behavior in some cases.
|
|---|
| 697 |
|
|---|
| 698 | Automake will run `autoconf' to scan `configure.in' and its
|
|---|
| 699 | dependencies (`aclocal.m4'), therefore `autoconf' must be in your
|
|---|
| 700 | `PATH'. If there is an `AUTOCONF' variable in your environment it will
|
|---|
| 701 | be used instead of `autoconf', this allows you to select a particular
|
|---|
| 702 | version of Autoconf. By the way, don't misunderstand this paragraph:
|
|---|
| 703 | Automake runs `autoconf' to *scan* your `configure.in', this won't build
|
|---|
| 704 | `configure' and you still have to run `autoconf' yourself for this
|
|---|
| 705 | purpose.
|
|---|
| 706 |
|
|---|
| 707 | `automake' accepts the following options:
|
|---|
| 708 |
|
|---|
| 709 | `-a'
|
|---|
| 710 | `--add-missing'
|
|---|
| 711 | Automake requires certain common files to exist in certain
|
|---|
| 712 | situations; for instance `config.guess' is required if
|
|---|
| 713 | `configure.in' runs `AC_CANONICAL_HOST'. Automake is distributed
|
|---|
| 714 | with several of these files (*note Auxiliary Programs::); this
|
|---|
| 715 | option will cause the missing ones to be automatically added to
|
|---|
| 716 | the package, whenever possible. In general if Automake tells you
|
|---|
| 717 | a file is missing, try using this option. By default Automake
|
|---|
| 718 | tries to make a symbolic link pointing to its own copy of the
|
|---|
| 719 | missing file; this can be changed with `--copy'.
|
|---|
| 720 |
|
|---|
| 721 | Many of the potentially-missing files are common scripts whose
|
|---|
| 722 | location may be specified via the `AC_CONFIG_AUX_DIR' macro.
|
|---|
| 723 | Therefore, `AC_CONFIG_AUX_DIR''s setting affects whether a file is
|
|---|
| 724 | considered missing, and where the missing file is added (*note
|
|---|
| 725 | Optional::).
|
|---|
| 726 |
|
|---|
| 727 | `--libdir=DIR'
|
|---|
| 728 | Look for Automake data files in directory DIR instead of in the
|
|---|
| 729 | installation directory. This is typically used for debugging.
|
|---|
| 730 |
|
|---|
| 731 | `-c'
|
|---|
| 732 | `--copy'
|
|---|
| 733 | When used with `--add-missing', causes installed files to be
|
|---|
| 734 | copied. The default is to make a symbolic link.
|
|---|
| 735 |
|
|---|
| 736 | `--cygnus'
|
|---|
| 737 | Causes the generated `Makefile.in's to follow Cygnus rules, instead
|
|---|
| 738 | of GNU or Gnits rules. For more information, see *Note Cygnus::.
|
|---|
| 739 |
|
|---|
| 740 | `-f'
|
|---|
| 741 | `--force-missing'
|
|---|
| 742 | When used with `--add-missing', causes standard files to be
|
|---|
| 743 | reinstalled even if they already exist in the source tree. This
|
|---|
| 744 | involves removing the file from the source tree before creating
|
|---|
| 745 | the new symlink (or, with `--copy', copying the new file).
|
|---|
| 746 |
|
|---|
| 747 | `--foreign'
|
|---|
| 748 | Set the global strictness to `foreign'. For more information, see
|
|---|
| 749 | *Note Strictness::.
|
|---|
| 750 |
|
|---|
| 751 | `--gnits'
|
|---|
| 752 | Set the global strictness to `gnits'. For more information, see
|
|---|
| 753 | *Note Gnits::.
|
|---|
| 754 |
|
|---|
| 755 | `--gnu'
|
|---|
| 756 | Set the global strictness to `gnu'. For more information, see
|
|---|
| 757 | *Note Gnits::. This is the default strictness.
|
|---|
| 758 |
|
|---|
| 759 | `--help'
|
|---|
| 760 | Print a summary of the command line options and exit.
|
|---|
| 761 |
|
|---|
| 762 | `-i'
|
|---|
| 763 | `--ignore-deps'
|
|---|
| 764 | This disables the dependency tracking feature in generated
|
|---|
| 765 | `Makefile's; see *Note Dependencies::.
|
|---|
| 766 |
|
|---|
| 767 | `--include-deps'
|
|---|
| 768 | This enables the dependency tracking feature. This feature is
|
|---|
| 769 | enabled by default. This option is provided for historical
|
|---|
| 770 | reasons only and probably should not be used.
|
|---|
| 771 |
|
|---|
| 772 | `--no-force'
|
|---|
| 773 | Ordinarily `automake' creates all `Makefile.in's mentioned in
|
|---|
| 774 | `configure.in'. This option causes it to only update those
|
|---|
| 775 | `Makefile.in's which are out of date with respect to one of their
|
|---|
| 776 | dependents.
|
|---|
| 777 |
|
|---|
| 778 | Due to a bug in its implementation, this option is currently
|
|---|
| 779 | ignored. It will be fixed in Automake 1.8.
|
|---|
| 780 |
|
|---|
| 781 | `-o DIR'
|
|---|
| 782 | `--output-dir=DIR'
|
|---|
| 783 | Put the generated `Makefile.in' in the directory DIR. Ordinarily
|
|---|
| 784 | each `Makefile.in' is created in the directory of the
|
|---|
| 785 | corresponding `Makefile.am'. This option is deprecated and will be
|
|---|
| 786 | removed in a future release.
|
|---|
| 787 |
|
|---|
| 788 | `-v'
|
|---|
| 789 | `--verbose'
|
|---|
| 790 | Cause Automake to print information about which files are being
|
|---|
| 791 | read or created.
|
|---|
| 792 |
|
|---|
| 793 | `--version'
|
|---|
| 794 | Print the version number of Automake and exit.
|
|---|
| 795 |
|
|---|
| 796 | `-W CATEGORY'
|
|---|
| 797 |
|
|---|
| 798 | `--warnings=CATEGORY'
|
|---|
| 799 | Output warnings falling in CATEGORY. CATEGORY can be one of:
|
|---|
| 800 | `gnu'
|
|---|
| 801 | warnings related to the GNU Coding Standards (*note Top:
|
|---|
| 802 | (standards)Top.).
|
|---|
| 803 |
|
|---|
| 804 | `obsolete'
|
|---|
| 805 | obsolete features or constructions
|
|---|
| 806 |
|
|---|
| 807 | `portability'
|
|---|
| 808 | portability issues (e.g., use of Make features which are
|
|---|
| 809 | known not portable)
|
|---|
| 810 |
|
|---|
| 811 | `syntax'
|
|---|
| 812 | weird syntax, unused variables, typos
|
|---|
| 813 |
|
|---|
| 814 | `unsupported'
|
|---|
| 815 | unsupported or incomplete features
|
|---|
| 816 |
|
|---|
| 817 | `all'
|
|---|
| 818 | all the warnings
|
|---|
| 819 |
|
|---|
| 820 | `none'
|
|---|
| 821 | turn off all the warnings
|
|---|
| 822 |
|
|---|
| 823 | `error'
|
|---|
| 824 | treat warnings as errors
|
|---|
| 825 |
|
|---|
| 826 | A category can be turned off by prefixing its name with `no-'. For
|
|---|
| 827 | instance `-Wno-syntax' will hide the warnings about unused
|
|---|
| 828 | variables.
|
|---|
| 829 |
|
|---|
| 830 | The categories output by default are `syntax' and `unsupported'.
|
|---|
| 831 | Additionally, `gnu' is enabled in `--gnu' and `--gnits' strictness.
|
|---|
| 832 |
|
|---|
| 833 | `portability' warnings are currently disabled by default, but they
|
|---|
| 834 | will be enabled in `--gnu' and `--gnits' strictness in a future
|
|---|
| 835 | release.
|
|---|
| 836 |
|
|---|
| 837 | The environment variable `WARNINGS' can contain a comma separated
|
|---|
| 838 | list of categories to enable. It will be taken into account
|
|---|
| 839 | before the command-line switches, this way `-Wnone' will also
|
|---|
| 840 | ignore any warning category enabled by `WARNINGS'. This variable
|
|---|
| 841 | is also used by other tools like `autoconf'; unknown categories
|
|---|
| 842 | are ignored for this reason.
|
|---|
| 843 |
|
|---|
| 844 |
|
|---|
| 845 |
|
|---|
| 846 | File: automake.info, Node: configure, Next: Top level, Prev: Invoking Automake, Up: Top
|
|---|
| 847 |
|
|---|
| 848 | Scanning `configure.in'
|
|---|
| 849 | ***********************
|
|---|
| 850 |
|
|---|
| 851 | Automake scans the package's `configure.in' to determine certain
|
|---|
| 852 | information about the package. Some `autoconf' macros are required and
|
|---|
| 853 | some variables must be defined in `configure.in'. Automake will also
|
|---|
| 854 | use information from `configure.in' to further tailor its output.
|
|---|
| 855 |
|
|---|
| 856 | Automake also supplies some Autoconf macros to make the maintenance
|
|---|
| 857 | easier. These macros can automatically be put into your `aclocal.m4'
|
|---|
| 858 | using the `aclocal' program.
|
|---|
| 859 |
|
|---|
| 860 | * Menu:
|
|---|
| 861 |
|
|---|
| 862 | * Requirements:: Configuration requirements
|
|---|
| 863 | * Optional:: Other things Automake recognizes
|
|---|
| 864 | * Invoking aclocal:: Auto-generating aclocal.m4
|
|---|
| 865 | * aclocal options:: aclocal command line arguments
|
|---|
| 866 | * Macro search path:: Modifying aclocal's search path
|
|---|
| 867 | * Macros:: Autoconf macros supplied with Automake
|
|---|
| 868 | * Extending aclocal:: Writing your own aclocal macros
|
|---|
| 869 |
|
|---|
| 870 |
|
|---|
| 871 | File: automake.info, Node: Requirements, Next: Optional, Prev: configure, Up: configure
|
|---|
| 872 |
|
|---|
| 873 | Configuration requirements
|
|---|
| 874 | ==========================
|
|---|
| 875 |
|
|---|
| 876 | The one real requirement of Automake is that your `configure.in' call
|
|---|
| 877 | `AM_INIT_AUTOMAKE'. This macro does several things which are required
|
|---|
| 878 | for proper Automake operation (*note Macros::).
|
|---|
| 879 |
|
|---|
| 880 | Here are the other macros which Automake requires but which are not
|
|---|
| 881 | run by `AM_INIT_AUTOMAKE':
|
|---|
| 882 |
|
|---|
| 883 | `AC_CONFIG_FILES'
|
|---|
| 884 | `AC_OUTPUT'
|
|---|
| 885 | Automake uses these to determine which files to create (*note
|
|---|
| 886 | Creating Output Files: (autoconf)Output.). A listed file is
|
|---|
| 887 | considered to be an Automake generated `Makefile' if there exists
|
|---|
| 888 | a file with the same name and the `.am' extension appended.
|
|---|
| 889 | Typically, `AC_CONFIG_FILES([foo/Makefile])' will cause Automake to
|
|---|
| 890 | generate `foo/Makefile.in' if `foo/Makefile.am' exists.
|
|---|
| 891 |
|
|---|
| 892 | These files are all removed by `make distclean'.
|
|---|
| 893 |
|
|---|
| 894 |
|
|---|
| 895 | File: automake.info, Node: Optional, Next: Invoking aclocal, Prev: Requirements, Up: configure
|
|---|
| 896 |
|
|---|
| 897 | Other things Automake recognizes
|
|---|
| 898 | ================================
|
|---|
| 899 |
|
|---|
| 900 | Every time Automake is run it calls Autoconf to trace `configure.in'.
|
|---|
| 901 | This way it can recognize the use of certain macros and tailor the
|
|---|
| 902 | generated `Makefile.in' appropriately. Currently recognized macros and
|
|---|
| 903 | their effects are:
|
|---|
| 904 |
|
|---|
| 905 | `AC_CONFIG_HEADERS'
|
|---|
| 906 | Automake will generate rules to rebuild these headers. Older
|
|---|
| 907 | versions of Automake required the use of `AM_CONFIG_HEADER' (*note
|
|---|
| 908 | Macros::); this is no longer the case today.
|
|---|
| 909 |
|
|---|
| 910 | `AC_CONFIG_AUX_DIR'
|
|---|
| 911 | Automake will look for various helper scripts, such as
|
|---|
| 912 | `mkinstalldirs', in the directory named in this macro invocation.
|
|---|
| 913 | (The full list of scripts is: `config.guess', `config.sub',
|
|---|
| 914 | `depcomp', `elisp-comp', `compile', `install-sh', `ltmain.sh',
|
|---|
| 915 | `mdate-sh', `missing', `mkinstalldirs', `py-compile',
|
|---|
| 916 | `texinfo.tex', and `ylwrap'.) Not all scripts are always searched
|
|---|
| 917 | for; some scripts will only be sought if the generated
|
|---|
| 918 | `Makefile.in' requires them.
|
|---|
| 919 |
|
|---|
| 920 | If `AC_CONFIG_AUX_DIR' is not given, the scripts are looked for in
|
|---|
| 921 | their `standard' locations. For `mdate-sh', `texinfo.tex', and
|
|---|
| 922 | `ylwrap', the standard location is the source directory
|
|---|
| 923 | corresponding to the current `Makefile.am'. For the rest, the
|
|---|
| 924 | standard location is the first one of `.', `..', or `../..'
|
|---|
| 925 | (relative to the top source directory) that provides any one of
|
|---|
| 926 | the helper scripts. *Note Finding `configure' Input:
|
|---|
| 927 | (autoconf)Input.
|
|---|
| 928 |
|
|---|
| 929 | Required files from `AC_CONFIG_AUX_DIR' are automatically
|
|---|
| 930 | distributed, even if there is no `Makefile.am' in this directory.
|
|---|
| 931 |
|
|---|
| 932 | `AC_CANONICAL_HOST'
|
|---|
| 933 | Automake will ensure that `config.guess' and `config.sub' exist.
|
|---|
| 934 | Also, the `Makefile' variables `host_alias' and `host_triplet' are
|
|---|
| 935 | introduced. See *Note Getting the Canonical System Type:
|
|---|
| 936 | (autoconf)Canonicalizing.
|
|---|
| 937 |
|
|---|
| 938 | `AC_CANONICAL_SYSTEM'
|
|---|
| 939 | This is similar to `AC_CANONICAL_HOST', but also defines the
|
|---|
| 940 | `Makefile' variables `build_alias' and `target_alias'. *Note
|
|---|
| 941 | Getting the Canonical System Type: (autoconf)Canonicalizing.
|
|---|
| 942 |
|
|---|
| 943 | `AC_LIBSOURCE'
|
|---|
| 944 | `AC_LIBSOURCES'
|
|---|
| 945 | `AC_LIBOBJ'
|
|---|
| 946 | Automake will automatically distribute any file listed in
|
|---|
| 947 | `AC_LIBSOURCE' or `AC_LIBSOURCES'.
|
|---|
| 948 |
|
|---|
| 949 | Note that the `AC_LIBOBJ' macro calls `AC_LIBSOURCE'. So if an
|
|---|
| 950 | Autoconf macro is documented to call `AC_LIBOBJ([file])', then
|
|---|
| 951 | `file.c' will be distributed automatically by Automake. This
|
|---|
| 952 | encompasses many macros like `AC_FUNC_ALLOCA', `AC_FUNC_MEMCMP',
|
|---|
| 953 | `AC_REPLACE_FUNCS', and others.
|
|---|
| 954 |
|
|---|
| 955 | By the way, direct assignments to `LIBOBJS' are no longer
|
|---|
| 956 | supported. You should always use `AC_LIBOBJ' for this purpose.
|
|---|
| 957 | *Note `AC_LIBOBJ' vs. `LIBOBJS': (autoconf)AC_LIBOBJ vs LIBOBJS.
|
|---|
| 958 |
|
|---|
| 959 | `AC_PROG_RANLIB'
|
|---|
| 960 | This is required if any libraries are built in the package. *Note
|
|---|
| 961 | Particular Program Checks: (autoconf)Particular Programs.
|
|---|
| 962 |
|
|---|
| 963 | `AC_PROG_CXX'
|
|---|
| 964 | This is required if any C++ source is included. *Note Particular
|
|---|
| 965 | Program Checks: (autoconf)Particular Programs.
|
|---|
| 966 |
|
|---|
| 967 | `AC_PROG_F77'
|
|---|
| 968 | This is required if any Fortran 77 source is included. This macro
|
|---|
| 969 | is distributed with Autoconf version 2.13 and later. *Note
|
|---|
| 970 | Particular Program Checks: (autoconf)Particular Programs.
|
|---|
| 971 |
|
|---|
| 972 | `AC_F77_LIBRARY_LDFLAGS'
|
|---|
| 973 | This is required for programs and shared libraries that are a
|
|---|
| 974 | mixture of languages that include Fortran 77 (*note Mixing Fortran
|
|---|
| 975 | 77 With C and C++::). *Note Autoconf macros supplied with
|
|---|
| 976 | Automake: Macros.
|
|---|
| 977 |
|
|---|
| 978 | `AC_PROG_LIBTOOL'
|
|---|
| 979 | Automake will turn on processing for `libtool' (*note
|
|---|
| 980 | Introduction: (libtool)Top.).
|
|---|
| 981 |
|
|---|
| 982 | `AC_PROG_YACC'
|
|---|
| 983 | If a Yacc source file is seen, then you must either use this macro
|
|---|
| 984 | or define the variable `YACC' in `configure.in'. The former is
|
|---|
| 985 | preferred (*note Particular Program Checks: (autoconf)Particular
|
|---|
| 986 | Programs.).
|
|---|
| 987 |
|
|---|
| 988 | `AC_PROG_LEX'
|
|---|
| 989 | If a Lex source file is seen, then this macro must be used. *Note
|
|---|
| 990 | Particular Program Checks: (autoconf)Particular Programs.
|
|---|
| 991 |
|
|---|
| 992 | `AC_SUBST'
|
|---|
| 993 | The first argument is automatically defined as a variable in each
|
|---|
| 994 | generated `Makefile.in'. *Note Setting Output Variables:
|
|---|
| 995 | (autoconf)Setting Output Variables.
|
|---|
| 996 |
|
|---|
| 997 | If the Autoconf manual says that a macro calls `AC_SUBST' for VAR,
|
|---|
| 998 | or defines the output variable VAR then VAR will be defined in
|
|---|
| 999 | each `Makefile.in' generated by Automake. E.g. `AC_PATH_XTRA'
|
|---|
| 1000 | defines `X_CFLAGS' and `X_LIBS', so you can use these variables in
|
|---|
| 1001 | any `Makefile.am' if `AC_PATH_XTRA' is called.
|
|---|
| 1002 |
|
|---|
| 1003 | `AM_C_PROTOTYPES'
|
|---|
| 1004 | This is required when using automatic de-ANSI-fication; see *Note
|
|---|
| 1005 | ANSI::.
|
|---|
| 1006 |
|
|---|
| 1007 | `AM_GNU_GETTEXT'
|
|---|
| 1008 | This macro is required for packages which use GNU gettext (*note
|
|---|
| 1009 | gettext::). It is distributed with gettext. If Automake sees
|
|---|
| 1010 | this macro it ensures that the package meets some of gettext's
|
|---|
| 1011 | requirements.
|
|---|
| 1012 |
|
|---|
| 1013 | `AM_MAINTAINER_MODE'
|
|---|
| 1014 | This macro adds a `--enable-maintainer-mode' option to
|
|---|
| 1015 | `configure'. If this is used, `automake' will cause
|
|---|
| 1016 | `maintainer-only' rules to be turned off by default in the
|
|---|
| 1017 | generated `Makefile.in's. This macro defines the `MAINTAINER_MODE'
|
|---|
| 1018 | conditional, which you can use in your own `Makefile.am'.
|
|---|
| 1019 |
|
|---|
| 1020 |
|
|---|
| 1021 |
|
|---|
| 1022 | File: automake.info, Node: Invoking aclocal, Next: aclocal options, Prev: Optional, Up: configure
|
|---|
| 1023 |
|
|---|
| 1024 | Auto-generating aclocal.m4
|
|---|
| 1025 | ==========================
|
|---|
| 1026 |
|
|---|
| 1027 | Automake includes a number of Autoconf macros which can be used in your
|
|---|
| 1028 | package; some of them are actually required by Automake in certain
|
|---|
| 1029 | situations. These macros must be defined in your `aclocal.m4';
|
|---|
| 1030 | otherwise they will not be seen by `autoconf'.
|
|---|
| 1031 |
|
|---|
| 1032 | The `aclocal' program will automatically generate `aclocal.m4' files
|
|---|
| 1033 | based on the contents of `configure.in'. This provides a convenient
|
|---|
| 1034 | way to get Automake-provided macros, without having to search around.
|
|---|
| 1035 | Also, the `aclocal' mechanism allows other packages to supply their own
|
|---|
| 1036 | macros.
|
|---|
| 1037 |
|
|---|
| 1038 | At startup, `aclocal' scans all the `.m4' files it can find, looking
|
|---|
| 1039 | for macro definitions (*note Macro search path::). Then it scans
|
|---|
| 1040 | `configure.in'. Any mention of one of the macros found in the first
|
|---|
| 1041 | step causes that macro, and any macros it in turn requires, to be put
|
|---|
| 1042 | into `aclocal.m4'.
|
|---|
| 1043 |
|
|---|
| 1044 | The contents of `acinclude.m4', if it exists, are also automatically
|
|---|
| 1045 | included in `aclocal.m4'. This is useful for incorporating local
|
|---|
| 1046 | macros into `configure'.
|
|---|
| 1047 |
|
|---|
| 1048 | `aclocal' tries to be smart about looking for new `AC_DEFUN's in the
|
|---|
| 1049 | files it scans. It also tries to copy the full text of the scanned
|
|---|
| 1050 | file into `aclocal.m4', including both `#' and `dnl' comments. If you
|
|---|
| 1051 | want to make a comment which will be completely ignored by `aclocal',
|
|---|
| 1052 | use `##' as the comment leader.
|
|---|
| 1053 |
|
|---|
| 1054 | * Menu:
|
|---|
| 1055 |
|
|---|
| 1056 | * aclocal options:: Options supported by aclocal
|
|---|
| 1057 | * Macro search path:: How aclocal finds .m4 files
|
|---|
| 1058 |
|
|---|
| 1059 |
|
|---|
| 1060 | File: automake.info, Node: aclocal options, Next: Macro search path, Prev: Invoking aclocal, Up: configure
|
|---|
| 1061 |
|
|---|
| 1062 | aclocal options
|
|---|
| 1063 | ===============
|
|---|
| 1064 |
|
|---|
| 1065 | `aclocal' accepts the following options:
|
|---|
| 1066 |
|
|---|
| 1067 | `--acdir=DIR'
|
|---|
| 1068 | Look for the macro files in DIR instead of the installation
|
|---|
| 1069 | directory. This is typically used for debugging.
|
|---|
| 1070 |
|
|---|
| 1071 | `--help'
|
|---|
| 1072 | Print a summary of the command line options and exit.
|
|---|
| 1073 |
|
|---|
| 1074 | `-I DIR'
|
|---|
| 1075 | Add the directory DIR to the list of directories searched for
|
|---|
| 1076 | `.m4' files.
|
|---|
| 1077 |
|
|---|
| 1078 | `--output=FILE'
|
|---|
| 1079 | Cause the output to be put into FILE instead of `aclocal.m4'.
|
|---|
| 1080 |
|
|---|
| 1081 | `--print-ac-dir'
|
|---|
| 1082 | Prints the name of the directory which `aclocal' will search to
|
|---|
| 1083 | find third-party `.m4' files. When this option is given, normal
|
|---|
| 1084 | processing is suppressed. This option can be used by a package to
|
|---|
| 1085 | determine where to install a macro file.
|
|---|
| 1086 |
|
|---|
| 1087 | `--verbose'
|
|---|
| 1088 | Print the names of the files it examines.
|
|---|
| 1089 |
|
|---|
| 1090 | `--version'
|
|---|
| 1091 | Print the version number of Automake and exit.
|
|---|
| 1092 |
|
|---|
| 1093 |
|
|---|
| 1094 | File: automake.info, Node: Macro search path, Next: Macros, Prev: aclocal options, Up: configure
|
|---|
| 1095 |
|
|---|
| 1096 | Macro search path
|
|---|
| 1097 | =================
|
|---|
| 1098 |
|
|---|
| 1099 | By default, `aclocal' searches for `.m4' files in the following
|
|---|
| 1100 | directories, in this order:
|
|---|
| 1101 |
|
|---|
| 1102 | `ACDIR-APIVERSION'
|
|---|
| 1103 | This is where the `.m4' macros distributed with automake itself
|
|---|
| 1104 | are stored. APIVERSION depends on the automake release used; for
|
|---|
| 1105 | automake 1.6.x, APIVERSION = `1.6'.
|
|---|
| 1106 |
|
|---|
| 1107 | `ACDIR'
|
|---|
| 1108 | This directory is intended for third party `.m4' files, and is
|
|---|
| 1109 | configured when `automake' itself is built. This is
|
|---|
| 1110 | `@datadir@/aclocal/', which typically expands to
|
|---|
| 1111 | `${prefix}/share/aclocal/'. To find the compiled-in value of
|
|---|
| 1112 | ACDIR, use the `--print-ac-dir' option (*note aclocal options::).
|
|---|
| 1113 |
|
|---|
| 1114 | As an example, suppose that automake-1.6.2 was configured with
|
|---|
| 1115 | `--prefix=/usr/local'. Then, the search path would be:
|
|---|
| 1116 |
|
|---|
| 1117 | 1. `/usr/local/share/aclocal-1.6/'
|
|---|
| 1118 |
|
|---|
| 1119 | 2. `/usr/local/share/aclocal/'
|
|---|
| 1120 |
|
|---|
| 1121 | As explained in (*note aclocal options::), there are several options
|
|---|
| 1122 | that can be used to change or extend this search path.
|
|---|
| 1123 |
|
|---|
| 1124 | Modifying the macro search path: `--acdir'
|
|---|
| 1125 | ------------------------------------------
|
|---|
| 1126 |
|
|---|
| 1127 | The most obvious option to modify the search path is `--acdir=DIR',
|
|---|
| 1128 | which changes default directory and drops the APIVERSION directory.
|
|---|
| 1129 | For example, if one specifies `--acdir=/opt/private/', then the search
|
|---|
| 1130 | path becomes:
|
|---|
| 1131 |
|
|---|
| 1132 | 1. `/opt/private/'
|
|---|
| 1133 |
|
|---|
| 1134 | Note that this option, `--acdir', is intended for use by the
|
|---|
| 1135 | internal automake test suite only; it is not ordinarily needed by
|
|---|
| 1136 | end-users.
|
|---|
| 1137 |
|
|---|
| 1138 | Modifying the macro search path: `-I DIR'
|
|---|
| 1139 | -----------------------------------------
|
|---|
| 1140 |
|
|---|
| 1141 | Any extra directories specified using `-I' options (*note aclocal
|
|---|
| 1142 | options::) are _prepended_ to this search list. Thus, `aclocal -I /foo
|
|---|
| 1143 | -I /bar' results in the following search path:
|
|---|
| 1144 |
|
|---|
| 1145 | 1. `/foo'
|
|---|
| 1146 |
|
|---|
| 1147 | 2. `/bar'
|
|---|
| 1148 |
|
|---|
| 1149 | 3. ACDIR-APIVERSION
|
|---|
| 1150 |
|
|---|
| 1151 | 4. ACDIR
|
|---|
| 1152 |
|
|---|
| 1153 | Modifying the macro search path: `dirlist'
|
|---|
| 1154 | ------------------------------------------
|
|---|
| 1155 |
|
|---|
| 1156 | There is a third mechanism for customizing the search path. If a
|
|---|
| 1157 | `dirlist' file exists in ACDIR, then that file is assumed to contain a
|
|---|
| 1158 | list of directories, one per line, to be added to the search list.
|
|---|
| 1159 | These directories are searched _after_ all other directories.
|
|---|
| 1160 |
|
|---|
| 1161 | For example, suppose `ACDIR/dirlist' contains the following:
|
|---|
| 1162 |
|
|---|
| 1163 | /test1
|
|---|
| 1164 | /test2
|
|---|
| 1165 |
|
|---|
| 1166 | and that `aclocal' was called with the `-I /foo -I /bar' options.
|
|---|
| 1167 | Then, the search path would be
|
|---|
| 1168 |
|
|---|
| 1169 | 1. `/foo'
|
|---|
| 1170 |
|
|---|
| 1171 | 2. `/bar'
|
|---|
| 1172 |
|
|---|
| 1173 | 3. ACDIR-APIVERSION
|
|---|
| 1174 |
|
|---|
| 1175 | 4. ACDIR
|
|---|
| 1176 |
|
|---|
| 1177 | 5. `/test1'
|
|---|
| 1178 |
|
|---|
| 1179 | 6. `/test2'
|
|---|
| 1180 |
|
|---|
| 1181 | If the `--acdir=DIR' option is used, then `aclocal' will search for
|
|---|
| 1182 | the `dirlist' file in DIR. In the `--acdir=/opt/private/' example
|
|---|
| 1183 | above, `aclocal' would look for `/opt/private/dirlist'. Again,
|
|---|
| 1184 | however, the `--acdir' option is intended for use by the internal
|
|---|
| 1185 | automake test suite only; `--acdir' is not ordinarily needed by
|
|---|
| 1186 | end-users.
|
|---|
| 1187 |
|
|---|
| 1188 | `dirlist' is useful in the following situation: suppose that
|
|---|
| 1189 | `automake' version `1.6.2' is installed with $prefix=/usr by the system
|
|---|
| 1190 | vendor. Thus, the default search directories are
|
|---|
| 1191 |
|
|---|
| 1192 | 1. `/usr/share/aclocal-1.6/'
|
|---|
| 1193 |
|
|---|
| 1194 | 2. `/usr/share/aclocal/'
|
|---|
| 1195 |
|
|---|
| 1196 | However, suppose further that many packages have been manually
|
|---|
| 1197 | installed on the system, with $prefix=/usr/local, as is typical. In
|
|---|
| 1198 | that case, many of these "extra" `.m4' files are in
|
|---|
| 1199 | `/usr/local/share/aclocal'. The only way to force `/usr/bin/aclocal'
|
|---|
| 1200 | to find these "extra" `.m4' files is to always call `aclocal -I
|
|---|
| 1201 | /usr/local/share/aclocal'. This is inconvenient. With `dirlist', one
|
|---|
| 1202 | may create the file
|
|---|
| 1203 |
|
|---|
| 1204 | `/usr/share/aclocal/dirlist'
|
|---|
| 1205 |
|
|---|
| 1206 | which contains only the single line
|
|---|
| 1207 |
|
|---|
| 1208 | `/usr/local/share/aclocal'
|
|---|
| 1209 |
|
|---|
| 1210 | Now, the "default" search path on the affected system is
|
|---|
| 1211 |
|
|---|
| 1212 | 1. `/usr/share/aclocal-1.6/'
|
|---|
| 1213 |
|
|---|
| 1214 | 2. `/usr/share/aclocal/'
|
|---|
| 1215 |
|
|---|
| 1216 | 3. `/usr/local/share/aclocal/'
|
|---|
| 1217 |
|
|---|
| 1218 | without the need for `-I' options; `-I' options can be reserved for
|
|---|
| 1219 | project-specific needs (`my-source-dir/m4/'), rather than using it to
|
|---|
| 1220 | work around local system-dependent tool installation directories.
|
|---|
| 1221 |
|
|---|
| 1222 | Similarly, `dirlist' can be handy if you have installed a local copy
|
|---|
| 1223 | Automake on your account and want `aclocal' to look for macros
|
|---|
| 1224 | installed at other places on the system.
|
|---|
| 1225 |
|
|---|
| 1226 |
|
|---|
| 1227 | File: automake.info, Node: Macros, Next: Extending aclocal, Prev: Macro search path, Up: configure
|
|---|
| 1228 |
|
|---|
| 1229 | Autoconf macros supplied with Automake
|
|---|
| 1230 | ======================================
|
|---|
| 1231 |
|
|---|
| 1232 | Automake ships with several Autoconf macros that you can use from your
|
|---|
| 1233 | `configure.in'. When you use one of them it will be included by
|
|---|
| 1234 | `aclocal' in `aclocal.m4'.
|
|---|
| 1235 |
|
|---|
| 1236 | * Menu:
|
|---|
| 1237 |
|
|---|
| 1238 | * Public macros:: Macros that you can use.
|
|---|
| 1239 | * Private macros:: Macros that you should not use.
|
|---|
| 1240 |
|
|---|
| 1241 |
|
|---|
| 1242 | File: automake.info, Node: Public macros, Next: Private macros, Prev: Macros, Up: Macros
|
|---|
| 1243 |
|
|---|
| 1244 | Public macros
|
|---|
| 1245 | -------------
|
|---|
| 1246 |
|
|---|
| 1247 | `AM_CONFIG_HEADER'
|
|---|
| 1248 | Automake will generate rules to automatically regenerate the config
|
|---|
| 1249 | header. This obsolete macro is a synonym of `AC_CONFIG_HEADERS'
|
|---|
| 1250 | today (*note Optional::).
|
|---|
| 1251 |
|
|---|
| 1252 | `AM_ENABLE_MULTILIB'
|
|---|
| 1253 | This is used when a "multilib" library is being built. The first
|
|---|
| 1254 | optional argument is the name of the `Makefile' being generated; it
|
|---|
| 1255 | defaults to `Makefile'. The second option argument is used to find
|
|---|
| 1256 | the top source directory; it defaults to the empty string
|
|---|
| 1257 | (generally this should not be used unless you are familiar with
|
|---|
| 1258 | the internals). *Note Multilibs::.
|
|---|
| 1259 |
|
|---|
| 1260 | `AM_C_PROTOTYPES'
|
|---|
| 1261 | Check to see if function prototypes are understood by the
|
|---|
| 1262 | compiler. If so, define `PROTOTYPES' and set the output variables
|
|---|
| 1263 | `U' and `ANSI2KNR' to the empty string. Otherwise, set `U' to `_'
|
|---|
| 1264 | and `ANSI2KNR' to `./ansi2knr'. Automake uses these values to
|
|---|
| 1265 | implement automatic de-ANSI-fication.
|
|---|
| 1266 |
|
|---|
| 1267 | `AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL'
|
|---|
| 1268 | If the use of `TIOCGWINSZ' requires `<sys/ioctl.h>', then define
|
|---|
| 1269 | `GWINSZ_IN_SYS_IOCTL'. Otherwise `TIOCGWINSZ' can be found in
|
|---|
| 1270 | `<termios.h>'.
|
|---|
| 1271 |
|
|---|
| 1272 | `AM_INIT_AUTOMAKE([OPTIONS])'
|
|---|
| 1273 | `AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])'
|
|---|
| 1274 | Runs many macros required for proper operation of the generated
|
|---|
| 1275 | Makefiles.
|
|---|
| 1276 |
|
|---|
| 1277 | This macro has two forms, the first of which is preferred. In
|
|---|
| 1278 | this form, `AM_INIT_AUTOMAKE' is called with a single argument --
|
|---|
| 1279 | a space-separated list of Automake options which should be applied
|
|---|
| 1280 | to every `Makefile.am' in the tree. The effect is as if each
|
|---|
| 1281 | option were listed in `AUTOMAKE_OPTIONS'.
|
|---|
| 1282 |
|
|---|
| 1283 | The second, deprecated, form of `AM_INIT_AUTOMAKE' has two required
|
|---|
| 1284 | arguments: the package and the version number. This form is
|
|---|
| 1285 | obsolete because the PACKAGE and VERSION can be obtained from
|
|---|
| 1286 | Autoconf's `AC_INIT' macro (which itself has an old and a new
|
|---|
| 1287 | form).
|
|---|
| 1288 |
|
|---|
| 1289 | If your `configure.in' has:
|
|---|
| 1290 | AC_INIT(src/foo.c)
|
|---|
| 1291 | AM_INIT_AUTOMAKE(mumble, 1.5)
|
|---|
| 1292 | you can modernize it as follows:
|
|---|
| 1293 | AC_INIT(mumble, 1.5)
|
|---|
| 1294 | AC_CONFIG_SRCDIR(src/foo.c)
|
|---|
| 1295 | AM_INIT_AUTOMAKE
|
|---|
| 1296 |
|
|---|
| 1297 | Note that if you're upgrading your `configure.in' from an earlier
|
|---|
| 1298 | version of Automake, it is not always correct to simply move the
|
|---|
| 1299 | package and version arguments from `AM_INIT_AUTOMAKE' directly to
|
|---|
| 1300 | `AC_INIT', as in the example above. The first argument to
|
|---|
| 1301 | `AC_INIT' should be the name of your package (e.g. `GNU Automake'),
|
|---|
| 1302 | not the tarball name (e.g. `automake') that you used to pass to
|
|---|
| 1303 | `AM_INIT_AUTOMAKE'. Autoconf tries to derive a tarball name from
|
|---|
| 1304 | the package name, which should work for most but not all package
|
|---|
| 1305 | names. (If it doesn't work for yours, you can use the
|
|---|
| 1306 | four-argument form of `AC_INIT' -- supported in Autoconf versions
|
|---|
| 1307 | greater than 2.52g -- to provide the tarball name explicitly).
|
|---|
| 1308 |
|
|---|
| 1309 | By default this macro `AC_DEFINE''s `PACKAGE' and `VERSION'. This
|
|---|
| 1310 | can be avoided by passing the `no-define' option, as in:
|
|---|
| 1311 | AM_INIT_AUTOMAKE([gnits 1.5 no-define dist-bzip2])
|
|---|
| 1312 | or by passing a third non-empty argument to the obsolete form.
|
|---|
| 1313 |
|
|---|
| 1314 | `AM_PATH_LISPDIR'
|
|---|
| 1315 | Searches for the program `emacs', and, if found, sets the output
|
|---|
| 1316 | variable `lispdir' to the full path to Emacs' site-lisp directory.
|
|---|
| 1317 |
|
|---|
| 1318 | Note that this test assumes the `emacs' found to be a version that
|
|---|
| 1319 | supports Emacs Lisp (such as GNU Emacs or XEmacs). Other emacsen
|
|---|
| 1320 | can cause this test to hang (some, like old versions of MicroEmacs,
|
|---|
| 1321 | start up in interactive mode, requiring `C-x C-c' to exit, which
|
|---|
| 1322 | is hardly obvious for a non-emacs user). In most cases, however,
|
|---|
| 1323 | you should be able to use `C-c' to kill the test. In order to
|
|---|
| 1324 | avoid problems, you can set `EMACS' to "no" in the environment, or
|
|---|
| 1325 | use the `--with-lispdir' option to `configure' to explicitly set
|
|---|
| 1326 | the correct path (if you're sure you have an `emacs' that supports
|
|---|
| 1327 | Emacs Lisp.
|
|---|
| 1328 |
|
|---|
| 1329 | `AM_PROG_AS'
|
|---|
| 1330 | Use this macro when you have assembly code in your project. This
|
|---|
| 1331 | will choose the assembler for you (by default the C compiler) and
|
|---|
| 1332 | set `CCAS', and will also set `CCASFLAGS' if required.
|
|---|
| 1333 |
|
|---|
| 1334 | `AM_PROG_CC_C_O'
|
|---|
| 1335 | This is like `AC_PROG_CC_C_O', but it generates its results in the
|
|---|
| 1336 | manner required by automake. You must use this instead of
|
|---|
| 1337 | `AC_PROG_CC_C_O' when you need this functionality.
|
|---|
| 1338 |
|
|---|
| 1339 | `AM_PROG_CC_STDC'
|
|---|
| 1340 | If the C compiler is not in ANSI C mode by default, try to add an
|
|---|
| 1341 | option to output variable `CC' to make it so. This macro tries
|
|---|
| 1342 | various options that select ANSI C on some system or another. It
|
|---|
| 1343 | considers the compiler to be in ANSI C mode if it handles function
|
|---|
| 1344 | prototypes correctly.
|
|---|
| 1345 |
|
|---|
| 1346 | If you use this macro, you should check after calling it whether
|
|---|
| 1347 | the C compiler has been set to accept ANSI C; if not, the shell
|
|---|
| 1348 | variable `am_cv_prog_cc_stdc' is set to `no'. If you wrote your
|
|---|
| 1349 | source code in ANSI C, you can make an un-ANSIfied copy of it by
|
|---|
| 1350 | using the `ansi2knr' option (*note ANSI::).
|
|---|
| 1351 |
|
|---|
| 1352 | This macro is a relic from the time Autoconf didn't offer such a
|
|---|
| 1353 | feature. `AM_PROG_CC_STDC''s logic has now been merged into
|
|---|
| 1354 | Autoconf's `AC_PROG_CC' macro, therefore you should use the latter
|
|---|
| 1355 | instead. Chances are you are already using `AC_PROG_CC', so you
|
|---|
| 1356 | can simply remove the `AM_PROG_CC_STDC' call and turn all
|
|---|
| 1357 | occurrences of `$am_cv_prog_cc_stdc' into `$ac_cv_prog_cc_stdc'.
|
|---|
| 1358 | `AM_PROG_CC_STDC' will be marked as obsolete (in the Autoconf
|
|---|
| 1359 | sense) in Automake 1.8.
|
|---|
| 1360 |
|
|---|
| 1361 | `AM_PROG_LEX'
|
|---|
| 1362 | Like `AC_PROG_LEX' (*note Particular Program Checks:
|
|---|
| 1363 | (autoconf)Particular Programs.), but uses the `missing' script on
|
|---|
| 1364 | systems that do not have `lex'. `HP-UX 10' is one such system.
|
|---|
| 1365 |
|
|---|
| 1366 | `AM_PROG_GCJ'
|
|---|
| 1367 | This macro finds the `gcj' program or causes an error. It sets
|
|---|
| 1368 | `GCJ' and `GCJFLAGS'. `gcj' is the Java front-end to the GNU
|
|---|
| 1369 | Compiler Collection.
|
|---|
| 1370 |
|
|---|
| 1371 | `AM_SYS_POSIX_TERMIOS'
|
|---|
| 1372 | Check to see if POSIX termios headers and functions are available
|
|---|
| 1373 | on the system. If so, set the shell variable
|
|---|
| 1374 | `am_cv_sys_posix_termios' to `yes'. If not, set the variable to
|
|---|
| 1375 | `no'.
|
|---|
| 1376 |
|
|---|
| 1377 | `AM_WITH_DMALLOC'
|
|---|
| 1378 | Add support for the dmalloc
|
|---|
| 1379 | (ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz) package. If
|
|---|
| 1380 | the user configures with `--with-dmalloc', then define
|
|---|
| 1381 | `WITH_DMALLOC' and add `-ldmalloc' to `LIBS'.
|
|---|
| 1382 |
|
|---|
| 1383 | `AM_WITH_REGEX'
|
|---|
| 1384 | Adds `--with-regex' to the `configure' command line. If specified
|
|---|
| 1385 | (the default), then the `regex' regular expression library is
|
|---|
| 1386 | used, `regex.o' is put into `LIBOBJS', and `WITH_REGEX' is
|
|---|
| 1387 | defined. If `--without-regex' is given, then the `rx' regular
|
|---|
| 1388 | expression library is used, and `rx.o' is put into `LIBOBJS'.
|
|---|
| 1389 |
|
|---|
| 1390 |
|
|---|
| 1391 |
|
|---|
| 1392 | File: automake.info, Node: Private macros, Prev: Public macros, Up: Macros
|
|---|
| 1393 |
|
|---|
| 1394 | Private macros
|
|---|
| 1395 | --------------
|
|---|
| 1396 |
|
|---|
| 1397 | The following macros are private macros you should not call directly.
|
|---|
| 1398 | They are called by the other public macros when appropriate. Do not
|
|---|
| 1399 | rely on them, as they might be changed in a future version. Consider
|
|---|
| 1400 | them as implementation details; or better, do not consider them at all:
|
|---|
| 1401 | skip this section!
|
|---|
| 1402 |
|
|---|
| 1403 | `_AM_DEPENDENCIES'
|
|---|
| 1404 | `AM_SET_DEPDIR'
|
|---|
| 1405 | `AM_DEP_TRACK'
|
|---|
| 1406 | `AM_OUTPUT_DEPENDENCY_COMMANDS'
|
|---|
| 1407 | These macros are used to implement Automake's automatic dependency
|
|---|
| 1408 | tracking scheme. They are called automatically by automake when
|
|---|
| 1409 | required, and there should be no need to invoke them manually.
|
|---|
| 1410 |
|
|---|
| 1411 | `AM_MAKE_INCLUDE'
|
|---|
| 1412 | This macro is used to discover how the user's `make' handles
|
|---|
| 1413 | `include' statements. This macro is automatically invoked when
|
|---|
| 1414 | needed; there should be no need to invoke it manually.
|
|---|
| 1415 |
|
|---|
| 1416 | `AM_PROG_INSTALL_STRIP'
|
|---|
| 1417 | This is used to find a version of `install' which can be used to
|
|---|
| 1418 | `strip' a program at installation time. This macro is
|
|---|
| 1419 | automatically included when required.
|
|---|
| 1420 |
|
|---|
| 1421 | `AM_SANITY_CHECK'
|
|---|
| 1422 | This checks to make sure that a file created in the build
|
|---|
| 1423 | directory is newer than a file in the source directory. This can
|
|---|
| 1424 | fail on systems where the clock is set incorrectly. This macro is
|
|---|
| 1425 | automatically run from `AM_INIT_AUTOMAKE'.
|
|---|
| 1426 |
|
|---|
| 1427 |
|
|---|
| 1428 |
|
|---|
| 1429 | File: automake.info, Node: Extending aclocal, Prev: Macros, Up: configure
|
|---|
| 1430 |
|
|---|
| 1431 | Writing your own aclocal macros
|
|---|
| 1432 | ===============================
|
|---|
| |
|---|