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 | <bug-automake@gnu.org>.
|
---|
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 | ===============================
|
---|
1433 |
|
---|
1434 | The `aclocal' program doesn't have any built-in knowledge of any
|
---|
1435 | macros, so it is easy to extend it with your own macros.
|
---|
1436 |
|
---|
1437 | This can be used by libraries which want to supply their own Autoconf
|
---|
1438 | macros for use by other programs. For instance the `gettext' library
|
---|
1439 | supplies a macro `AM_GNU_GETTEXT' which should be used by any package
|
---|
1440 | using `gettext'. When the library is installed, it installs this macro
|
---|
1441 | so that `aclocal' will find it.
|
---|
1442 |
|
---|
1443 | A macro file's name should end in `.m4'. Such files should be
|
---|
1444 | installed in `$(datadir)/aclocal'. This is as simple as writing:
|
---|
1445 |
|
---|
1446 | aclocaldir = $(datadir)/aclocal
|
---|
1447 | aclocal_DATA = mymacro.m4 myothermacro.m4
|
---|
1448 |
|
---|
1449 | A file of macros should be a series of properly quoted `AC_DEFUN''s
|
---|
1450 | (*note Macro Definitions: (autoconf)Macro Definitions.). The `aclocal'
|
---|
1451 | programs also understands `AC_REQUIRE' (*note Prerequisite Macros:
|
---|
1452 | (autoconf)Prerequisite Macros.), so it is safe to put each macro in a
|
---|
1453 | separate file. Each file should have no side effects but macro
|
---|
1454 | definitions. Especially, any call to `AC_PREREQ' should be done inside
|
---|
1455 | the defined macro, not at the beginning of the file.
|
---|
1456 |
|
---|
1457 | Starting with Automake 1.8, `aclocal' will warn about all
|
---|
1458 | underquoted calls to `AC_DEFUN'. We realize this will annoy a lot of
|
---|
1459 | people, because `aclocal' was not so strict in the past and many third
|
---|
1460 | party macros are underquoted; and we have to apologize for this
|
---|
1461 | temporary inconvenience. The reason we have to be stricter is that a
|
---|
1462 | future implementation of `aclocal' will have to temporary include all
|
---|
1463 | these third party `.m4' files, maybe several times, even those which
|
---|
1464 | are not actually needed. Doing so should alleviate many problem of the
|
---|
1465 | current implementation, however it requires a stricter style from the
|
---|
1466 | macro authors. Hopefully it is easy to revise the existing macros.
|
---|
1467 | For instance
|
---|
1468 | # bad style
|
---|
1469 | AC_PREREQ(2.57)
|
---|
1470 | AC_DEFUN(AX_FOOBAR,
|
---|
1471 | [AC_REQUIRE([AX_SOMETHING])dnl
|
---|
1472 | AX_FOO
|
---|
1473 | AX_BAR
|
---|
1474 | ])
|
---|
1475 |
|
---|
1476 | should be rewritten as
|
---|
1477 | AC_DEFUN([AX_FOOBAR],
|
---|
1478 | [AC_PREREQ(2.57)dnl
|
---|
1479 | AC_REQUIRE([AX_SOMETHING])dnl
|
---|
1480 | AX_FOO
|
---|
1481 | AX_BAR
|
---|
1482 | ])
|
---|
1483 |
|
---|
1484 | Wrapping the `AC_PREREQ' call inside the macro ensures that Autoconf
|
---|
1485 | 2.57 will not be required if `AX_FOOBAR' is not actually used. Most
|
---|
1486 | importantly, quoting the first argument of `AC_DEFUN' allows the macro
|
---|
1487 | to be redefined or included twice (otherwise this first argument would
|
---|
1488 | be expansed during the second definition).
|
---|
1489 |
|
---|
1490 | If you have been directed here by the `aclocal' diagnostic but are
|
---|
1491 | not the maintainer of the implicated macro, you will want to contact
|
---|
1492 | the maintainer of that macro. Please make sure you have the last
|
---|
1493 | version of the macro and that the problem already hasn't been reported
|
---|
1494 | before doing so: people tend to work faster when they aren't flooded by
|
---|
1495 | mails.
|
---|
1496 |
|
---|
1497 |
|
---|
1498 | File: automake.info, Node: Top level, Next: Alternative, Prev: configure, Up: Top
|
---|
1499 |
|
---|
1500 | The top-level `Makefile.am'
|
---|
1501 | ***************************
|
---|
1502 |
|
---|
1503 | Recursing subdirectories
|
---|
1504 | ========================
|
---|
1505 |
|
---|
1506 | In packages with subdirectories, the top level `Makefile.am' must tell
|
---|
1507 | Automake which subdirectories are to be built. This is done via the
|
---|
1508 | `SUBDIRS' variable.
|
---|
1509 |
|
---|
1510 | The `SUBDIRS' variable holds a list of subdirectories in which
|
---|
1511 | building of various sorts can occur. Many targets (e.g. `all') in the
|
---|
1512 | generated `Makefile' will run both locally and in all specified
|
---|
1513 | subdirectories. Note that the directories listed in `SUBDIRS' are not
|
---|
1514 | required to contain `Makefile.am's; only `Makefile's (after
|
---|
1515 | configuration). This allows inclusion of libraries from packages which
|
---|
1516 | do not use Automake (such as `gettext').
|
---|
1517 |
|
---|
1518 | In packages that use subdirectories, the top-level `Makefile.am' is
|
---|
1519 | often very short. For instance, here is the `Makefile.am' from the GNU
|
---|
1520 | Hello distribution:
|
---|
1521 |
|
---|
1522 | EXTRA_DIST = BUGS ChangeLog.O README-alpha
|
---|
1523 | SUBDIRS = doc intl po src tests
|
---|
1524 |
|
---|
1525 | When Automake invokes `make' in a subdirectory, it uses the value of
|
---|
1526 | the `MAKE' variable. It passes the value of the variable
|
---|
1527 | `AM_MAKEFLAGS' to the `make' invocation; this can be set in
|
---|
1528 | `Makefile.am' if there are flags you must always pass to `make'.
|
---|
1529 |
|
---|
1530 | The directories mentioned in `SUBDIRS' must be direct children of
|
---|
1531 | the current directory. For instance, you cannot put `src/subdir' into
|
---|
1532 | `SUBDIRS'. Instead you should put `SUBDIRS = subdir' into
|
---|
1533 | `src/Makefile.am'. Automake can be used to construct packages of
|
---|
1534 | arbitrary depth this way.
|
---|
1535 |
|
---|
1536 | By default, Automake generates `Makefiles' which work depth-first
|
---|
1537 | (`postfix'). However, it is possible to change this ordering. You can
|
---|
1538 | do this by putting `.' into `SUBDIRS'. For instance, putting `.'
|
---|
1539 | first will cause a `prefix' ordering of directories. All `clean'
|
---|
1540 | targets are run in reverse order of build targets.
|
---|
1541 |
|
---|
1542 | Conditional subdirectories
|
---|
1543 | ==========================
|
---|
1544 |
|
---|
1545 | It is possible to define the `SUBDIRS' variable conditionally if, like
|
---|
1546 | in the case of GNU `Inetutils', you want to only build a subset of the
|
---|
1547 | entire package.
|
---|
1548 |
|
---|
1549 | To illustrate how this works, let's assume we have two directories
|
---|
1550 | `src/' and `opt/'. `src/' should always be built, but we want to
|
---|
1551 | decide in `./configure' whether `opt/' will be built or not. (For this
|
---|
1552 | example we will assume that `opt/' should be built when the variable
|
---|
1553 | `$want_opt' was set to `yes'.)
|
---|
1554 |
|
---|
1555 | Running `make' should thus recurse into `src/' always, and then
|
---|
1556 | maybe in `opt/'.
|
---|
1557 |
|
---|
1558 | However `make dist' should always recurse into both `src/' and
|
---|
1559 | `opt/'. Because `opt/' should be distributed even if it is not needed
|
---|
1560 | in the current configuration. This means `opt/Makefile' should be
|
---|
1561 | created unconditionally. (1)
|
---|
1562 |
|
---|
1563 | There are two ways to setup a project like this. You can use
|
---|
1564 | Automake conditionals (*note Conditionals::) or use Autoconf `AC_SUBST'
|
---|
1565 | variables (*note Setting Output Variables: (autoconf)Setting Output
|
---|
1566 | Variables.). Using Automake conditionals is the preferred solution.
|
---|
1567 |
|
---|
1568 | Conditional subdirectories with `AM_CONDITIONAL'
|
---|
1569 | ------------------------------------------------
|
---|
1570 |
|
---|
1571 | `configure' should output the `Makefile' for each directory and define
|
---|
1572 | a condition into which `opt/' should be built.
|
---|
1573 |
|
---|
1574 | ...
|
---|
1575 | AM_CONDITIONAL([COND_OPT], [test "$want_opt" = yes])
|
---|
1576 | AC_CONFIG_FILES([Makefile src/Makefile opt/Makefile])
|
---|
1577 | ...
|
---|
1578 |
|
---|
1579 | Then `SUBDIRS' can be defined in the top-level `Makefile.am' as
|
---|
1580 | follows.
|
---|
1581 |
|
---|
1582 | if COND_OPT
|
---|
1583 | MAYBE_OPT = opt
|
---|
1584 | endif
|
---|
1585 | SUBDIRS = src $(MAYBE_OPT)
|
---|
1586 |
|
---|
1587 | As you can see, running `make' will rightly recurse into `src/' and
|
---|
1588 | maybe `opt/'.
|
---|
1589 |
|
---|
1590 | As you can't see, running `make dist' will recurse into both `src/'
|
---|
1591 | and `opt/' directories because `make dist', unlike `make all', doesn't
|
---|
1592 | use the `SUBDIRS' variable. It uses the `DIST_SUBDIRS' variable.
|
---|
1593 |
|
---|
1594 | In this case Automake will define `DIST_SUBDIRS = src opt'
|
---|
1595 | automatically because it knows that `MAYBE_OPT' can contain `opt' in
|
---|
1596 | some condition.
|
---|
1597 |
|
---|
1598 | Conditional subdirectories with `AC_SUBST'
|
---|
1599 | ------------------------------------------
|
---|
1600 |
|
---|
1601 | Another idea is to define `MAYBE_OPT' from `./configure' using
|
---|
1602 | `AC_SUBST':
|
---|
1603 |
|
---|
1604 | ...
|
---|
1605 | if test "$want_opt" = yes; then
|
---|
1606 | MAYBE_OPT=opt
|
---|
1607 | else
|
---|
1608 | MAYBE_OPT=
|
---|
1609 | fi
|
---|
1610 | AC_SUBST([MAYBE_OPT])
|
---|
1611 | AC_CONFIG_FILES([Makefile src/Makefile opt/Makefile])
|
---|
1612 | ...
|
---|
1613 |
|
---|
1614 | In this case the top-level `Makefile.am' should look as follows.
|
---|
1615 |
|
---|
1616 | SUBDIRS = src $(MAYBE_OPT)
|
---|
1617 | DIST_SUBDIRS = src opt
|
---|
1618 |
|
---|
1619 | The drawback is that since Automake cannot guess what the possible
|
---|
1620 | values of `MAYBE_OPT' are, it is necessary to define `DIST_SUBDIRS'.
|
---|
1621 |
|
---|
1622 | How `DIST_SUBDIRS' is used
|
---|
1623 | --------------------------
|
---|
1624 |
|
---|
1625 | As shown in the above examples, `DIST_SUBDIRS' is used by targets that
|
---|
1626 | need to recurse in all directories, even those which have been
|
---|
1627 | conditionally left out of the build.
|
---|
1628 |
|
---|
1629 | Precisely, `DIST_SUBDIRS' is used by `make dist', `make distclean',
|
---|
1630 | and `make maintainer-clean'. All other recursive targets use `SUBDIRS'.
|
---|
1631 |
|
---|
1632 | Automake will define `DIST_SUBDIRS' automatically from the possibles
|
---|
1633 | values of `SUBDIRS' in all conditions.
|
---|
1634 |
|
---|
1635 | If `SUBDIRS' contains `AC_SUBST' variables, `DIST_SUBDIRS' will not
|
---|
1636 | be defined correctly because Automake doesn't know the possible values
|
---|
1637 | of these variables. In this case `DIST_SUBDIRS' needs to be defined
|
---|
1638 | manually.
|
---|
1639 |
|
---|
1640 | ---------- Footnotes ----------
|
---|
1641 |
|
---|
1642 | (1) Don't try seeking a solution where `opt/Makefile' is created
|
---|
1643 | conditionally, this is a lot trickier than the solutions presented here.
|
---|
1644 |
|
---|
1645 |
|
---|
1646 | File: automake.info, Node: Alternative, Next: Rebuilding, Prev: Top level, Up: Top
|
---|
1647 |
|
---|
1648 | An Alternative Approach to Subdirectories
|
---|
1649 | *****************************************
|
---|
1650 |
|
---|
1651 | If you've ever read Peter Miller's excellent paper, Recursive Make
|
---|
1652 | Considered Harmful
|
---|
1653 | (http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html), the
|
---|
1654 | preceding section on the use of subdirectories will probably come as
|
---|
1655 | unwelcome advice. For those who haven't read the paper, Miller's main
|
---|
1656 | thesis is that recursive `make' invocations are both slow and
|
---|
1657 | error-prone.
|
---|
1658 |
|
---|
1659 | Automake provides sufficient cross-directory support (1) to enable
|
---|
1660 | you to write a single `Makefile.am' for a complex multi-directory
|
---|
1661 | package.
|
---|
1662 |
|
---|
1663 | By default an installable file specified in a subdirectory will have
|
---|
1664 | its directory name stripped before installation. For instance, in this
|
---|
1665 | example, the header file will be installed as `$(includedir)/stdio.h':
|
---|
1666 |
|
---|
1667 | include_HEADERS = inc/stdio.h
|
---|
1668 |
|
---|
1669 | However, the `nobase_' prefix can be used to circumvent this path
|
---|
1670 | stripping. In this example, the header file will be installed as
|
---|
1671 | `$(includedir)/sys/types.h':
|
---|
1672 |
|
---|
1673 | nobase_include_HEADERS = sys/types.h
|
---|
1674 |
|
---|
1675 | `nobase_' should be specified first when used in conjunction with
|
---|
1676 | either `dist_' or `nodist_' (*note Dist::). For instance:
|
---|
1677 |
|
---|
1678 | nobase_dist_pkgdata_DATA = images/vortex.pgm
|
---|
1679 |
|
---|
1680 | ---------- Footnotes ----------
|
---|
1681 |
|
---|
1682 | (1) We believe. This work is new and there are probably warts.
|
---|
1683 | *Note Introduction::, for information on reporting bugs.
|
---|
1684 |
|
---|
1685 |
|
---|
1686 | File: automake.info, Node: Rebuilding, Next: Programs, Prev: Alternative, Up: Top
|
---|
1687 |
|
---|
1688 | Rebuilding Makefiles
|
---|
1689 | ********************
|
---|
1690 |
|
---|
1691 | Automake generates rules to automatically rebuild `Makefile's,
|
---|
1692 | `configure', and other derived files like `Makefile.in'.
|
---|
1693 |
|
---|
1694 | If you are using `AM_MAINTAINER_MODE' in `configure.in', then these
|
---|
1695 | automatic rebuilding rules are only enabled in maintainer mode.
|
---|
1696 |
|
---|
1697 | Sometimes you need to run `aclocal' with an argument like `-I' to
|
---|
1698 | tell it where to find `.m4' files. Since sometimes `make' will
|
---|
1699 | automatically run `aclocal', you need a way to specify these arguments.
|
---|
1700 | You can do this by defining `ACLOCAL_AMFLAGS'; this holds arguments
|
---|
1701 | which are passed verbatim to `aclocal'. This variable is only useful
|
---|
1702 | in the top-level `Makefile.am'.
|
---|
1703 |
|
---|
1704 |
|
---|
1705 | File: automake.info, Node: Programs, Next: Other objects, Prev: Rebuilding, Up: Top
|
---|
1706 |
|
---|
1707 | Building Programs and Libraries
|
---|
1708 | *******************************
|
---|
1709 |
|
---|
1710 | A large part of Automake's functionality is dedicated to making it easy
|
---|
1711 | to build programs and libraries.
|
---|
1712 |
|
---|
1713 | * Menu:
|
---|
1714 |
|
---|
1715 | * A Program:: Building a program
|
---|
1716 | * A Library:: Building a library
|
---|
1717 | * A Shared Library:: Building a Libtool library
|
---|
1718 | * Program and Library Variables:: Variables controlling program and
|
---|
1719 | library builds
|
---|
1720 | * LIBOBJS:: Special handling for LIBOBJS and ALLOCA
|
---|
1721 | * Program variables:: Variables used when building a program
|
---|
1722 | * Yacc and Lex:: Yacc and Lex support
|
---|
1723 | * C++ Support::
|
---|
1724 | * Assembly Support::
|
---|
1725 | * Fortran 77 Support::
|
---|
1726 | * Java Support::
|
---|
1727 | * Support for Other Languages::
|
---|
1728 | * ANSI:: Automatic de-ANSI-fication
|
---|
1729 | * Dependencies:: Automatic dependency tracking
|
---|
1730 | * EXEEXT:: Support for executable extensions
|
---|
1731 |
|
---|
1732 |
|
---|
1733 | File: automake.info, Node: A Program, Next: A Library, Prev: Programs, Up: Programs
|
---|
1734 |
|
---|
1735 | Building a program
|
---|
1736 | ==================
|
---|
1737 |
|
---|
1738 | In order to build a program, you need to tell Automake which sources
|
---|
1739 | are part of it, and which libraries it should be linked with.
|
---|
1740 |
|
---|
1741 | This section also covers conditional compilation of sources or
|
---|
1742 | programs. Most of the comments about these also apply to libraries
|
---|
1743 | (*note A Library::) and libtool libraries (*note A Shared Library::).
|
---|
1744 |
|
---|
1745 | * Menu:
|
---|
1746 |
|
---|
1747 | * Program Sources:: Defining program sources
|
---|
1748 | * Linking:: Linking with libraries or extra objects
|
---|
1749 | * Conditional Sources:: Handling conditional sources
|
---|
1750 | * Conditional Programs:: Building program conditionally
|
---|
1751 |
|
---|
1752 |
|
---|
1753 | File: automake.info, Node: Program Sources, Next: Linking, Prev: A Program, Up: A Program
|
---|
1754 |
|
---|
1755 | Defining program sources
|
---|
1756 | ------------------------
|
---|
1757 |
|
---|
1758 | In a directory containing source that gets built into a program (as
|
---|
1759 | opposed to a library or a script), the `PROGRAMS' primary is used.
|
---|
1760 | Programs can be installed in `bindir', `sbindir', `libexecdir',
|
---|
1761 | `pkglibdir', or not at all (`noinst'). They can also be built only for
|
---|
1762 | `make check', in which case the prefix is `check'.
|
---|
1763 |
|
---|
1764 | For instance:
|
---|
1765 |
|
---|
1766 | bin_PROGRAMS = hello
|
---|
1767 |
|
---|
1768 | In this simple case, the resulting `Makefile.in' will contain code
|
---|
1769 | to generate a program named `hello'.
|
---|
1770 |
|
---|
1771 | Associated with each program are several assisting variables which
|
---|
1772 | are named after the program. These variables are all optional, and have
|
---|
1773 | reasonable defaults. Each variable, its use, and default is spelled out
|
---|
1774 | below; we use the "hello" example throughout.
|
---|
1775 |
|
---|
1776 | The variable `hello_SOURCES' is used to specify which source files
|
---|
1777 | get built into an executable:
|
---|
1778 |
|
---|
1779 | hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h
|
---|
1780 |
|
---|
1781 | This causes each mentioned `.c' file to be compiled into the
|
---|
1782 | corresponding `.o'. Then all are linked to produce `hello'.
|
---|
1783 |
|
---|
1784 | If `hello_SOURCES' is not specified, then it defaults to the single
|
---|
1785 | file `hello.c'; that is, the default is to compile a single C file
|
---|
1786 | whose base name is the name of the program itself. (This is a terrible
|
---|
1787 | default but we are stuck with it for historical reasons.)
|
---|
1788 |
|
---|
1789 | Multiple programs can be built in a single directory. Multiple
|
---|
1790 | programs can share a single source file, which must be listed in each
|
---|
1791 | `_SOURCES' definition.
|
---|
1792 |
|
---|
1793 | Header files listed in a `_SOURCES' definition will be included in
|
---|
1794 | the distribution but otherwise ignored. In case it isn't obvious, you
|
---|
1795 | should not include the header file generated by `configure' in a
|
---|
1796 | `_SOURCES' variable; this file should not be distributed. Lex (`.l')
|
---|
1797 | and Yacc (`.y') files can also be listed; see *Note Yacc and Lex::.
|
---|
1798 |
|
---|
1799 |
|
---|
1800 | File: automake.info, Node: Linking, Next: Conditional Sources, Prev: Program Sources, Up: A Program
|
---|
1801 |
|
---|
1802 | Linking the program
|
---|
1803 | -------------------
|
---|
1804 |
|
---|
1805 | If you need to link against libraries that are not found by
|
---|
1806 | `configure', you can use `LDADD' to do so. This variable is used to
|
---|
1807 | specify additional objects or libraries to link with; it is
|
---|
1808 | inappropriate for specifying specific linker flags, you should use
|
---|
1809 | `AM_LDFLAGS' for this purpose.
|
---|
1810 |
|
---|
1811 | Sometimes, multiple programs are built in one directory but do not
|
---|
1812 | share the same link-time requirements. In this case, you can use the
|
---|
1813 | `PROG_LDADD' variable (where PROG is the name of the program as it
|
---|
1814 | appears in some `_PROGRAMS' variable, and usually written in lowercase)
|
---|
1815 | to override the global `LDADD'. If this variable exists for a given
|
---|
1816 | program, then that program is not linked using `LDADD'.
|
---|
1817 |
|
---|
1818 | For instance, in GNU cpio, `pax', `cpio' and `mt' are linked against
|
---|
1819 | the library `libcpio.a'. However, `rmt' is built in the same
|
---|
1820 | directory, and has no such link requirement. Also, `mt' and `rmt' are
|
---|
1821 | only built on certain architectures. Here is what cpio's
|
---|
1822 | `src/Makefile.am' looks like (abridged):
|
---|
1823 |
|
---|
1824 | bin_PROGRAMS = cpio pax @MT@
|
---|
1825 | libexec_PROGRAMS = @RMT@
|
---|
1826 | EXTRA_PROGRAMS = mt rmt
|
---|
1827 |
|
---|
1828 | LDADD = ../lib/libcpio.a @INTLLIBS@
|
---|
1829 | rmt_LDADD =
|
---|
1830 |
|
---|
1831 | cpio_SOURCES = ...
|
---|
1832 | pax_SOURCES = ...
|
---|
1833 | mt_SOURCES = ...
|
---|
1834 | rmt_SOURCES = ...
|
---|
1835 |
|
---|
1836 | `PROG_LDADD' is inappropriate for passing program-specific linker
|
---|
1837 | flags (except for `-l', `-L', `-dlopen' and `-dlpreopen'). So, use the
|
---|
1838 | `PROG_LDFLAGS' variable for this purpose.
|
---|
1839 |
|
---|
1840 | It is also occasionally useful to have a program depend on some other
|
---|
1841 | target which is not actually part of that program. This can be done
|
---|
1842 | using the `PROG_DEPENDENCIES' variable. Each program depends on the
|
---|
1843 | contents of such a variable, but no further interpretation is done.
|
---|
1844 |
|
---|
1845 | If `PROG_DEPENDENCIES' is not supplied, it is computed by Automake.
|
---|
1846 | The automatically-assigned value is the contents of `PROG_LDADD', with
|
---|
1847 | most configure substitutions, `-l', `-L', `-dlopen' and `-dlpreopen'
|
---|
1848 | options removed. The configure substitutions that are left in are only
|
---|
1849 | `@LIBOBJS@' and `@ALLOCA@'; these are left because it is known that
|
---|
1850 | they will not cause an invalid value for `PROG_DEPENDENCIES' to be
|
---|
1851 | generated.
|
---|
1852 |
|
---|
1853 |
|
---|
1854 | File: automake.info, Node: Conditional Sources, Next: Conditional Programs, Prev: Linking, Up: A Program
|
---|
1855 |
|
---|
1856 | Conditional compilation of sources
|
---|
1857 | ----------------------------------
|
---|
1858 |
|
---|
1859 | You can't put a configure substitution (e.g., `@FOO@') into a
|
---|
1860 | `_SOURCES' variable. The reason for this is a bit hard to explain, but
|
---|
1861 | suffice to say that it simply won't work. Automake will give an error
|
---|
1862 | if you try to do this.
|
---|
1863 |
|
---|
1864 | Fortunately there are two other ways to achieve the same result.
|
---|
1865 | One is to use configure substitutions in `_LDADD' variables, the other
|
---|
1866 | is to use an Automake conditional.
|
---|
1867 |
|
---|
1868 | Conditional compilation using `_LDADD' substitutions
|
---|
1869 | ....................................................
|
---|
1870 |
|
---|
1871 | Automake must know all the source files that could possibly go into a
|
---|
1872 | program, even if not all the files are built in every circumstance. Any
|
---|
1873 | files which are only conditionally built should be listed in the
|
---|
1874 | appropriate `EXTRA_' variable. For instance, if `hello-linux.c' or
|
---|
1875 | `hello-generic.c' were conditionally included in `hello', the
|
---|
1876 | `Makefile.am' would contain:
|
---|
1877 |
|
---|
1878 | bin_PROGRAMS = hello
|
---|
1879 | hello_SOURCES = hello-common.c
|
---|
1880 | EXTRA_hello_SOURCES = hello-linux.c hello-generic.c
|
---|
1881 | hello_LDADD = @HELLO_SYSTEM@
|
---|
1882 | hello_DEPENDENCIES = @HELLO_SYSTEM@
|
---|
1883 |
|
---|
1884 | You can then setup the `@HELLO_SYSTEM@' substitution from
|
---|
1885 | `configure.in':
|
---|
1886 |
|
---|
1887 | ...
|
---|
1888 | case $host in
|
---|
1889 | *linux*) HELLO_SYSTEM='hello-linux.$(OBJEXT)' ;;
|
---|
1890 | *) HELLO_SYSTEM='hello-generic.$(OBJEXT)' ;;
|
---|
1891 | esac
|
---|
1892 | AC_SUBST([HELLO_SYSTEM])
|
---|
1893 | ...
|
---|
1894 |
|
---|
1895 | In this case, `HELLO_SYSTEM' should be replaced by `hello-linux.o'
|
---|
1896 | or `hello-bsd.o', and added to `hello_DEPENDENCIES' and `hello_LDADD'
|
---|
1897 | in order to be built and linked in.
|
---|
1898 |
|
---|
1899 | Conditional compilation using Automake conditionals
|
---|
1900 | ...................................................
|
---|
1901 |
|
---|
1902 | An often simpler way to compile source files conditionally is to use
|
---|
1903 | Automake conditionals. For instance, you could use this `Makefile.am'
|
---|
1904 | construct to build the same `hello' example:
|
---|
1905 |
|
---|
1906 | bin_PROGRAMS = hello
|
---|
1907 | if LINUX
|
---|
1908 | hello_SOURCES = hello-linux.c hello-common.c
|
---|
1909 | else
|
---|
1910 | hello_SOURCES = hello-generic.c hello-common.c
|
---|
1911 | endif
|
---|
1912 |
|
---|
1913 | In this case, your `configure.in' should setup the `LINUX'
|
---|
1914 | conditional using `AM_CONDITIONAL' (*note Conditionals::).
|
---|
1915 |
|
---|
1916 | When using conditionals like this you don't need to use the `EXTRA_'
|
---|
1917 | variable, because Automake will examine the contents of each variable
|
---|
1918 | to construct the complete list of source files.
|
---|
1919 |
|
---|
1920 | If your program uses a lot of files, you will probably prefer a
|
---|
1921 | conditional `+='.
|
---|
1922 |
|
---|
1923 | bin_PROGRAMS = hello
|
---|
1924 | hello_SOURCES = hello-common.c
|
---|
1925 | if LINUX
|
---|
1926 | hello_SOURCES += hello-linux.c
|
---|
1927 | else
|
---|
1928 | hello_SOURCES += hello-generic.c
|
---|
1929 | endif
|
---|
1930 |
|
---|
1931 |
|
---|
1932 | File: automake.info, Node: Conditional Programs, Prev: Conditional Sources, Up: A Program
|
---|
1933 |
|
---|
1934 | Conditional compilation of programs
|
---|
1935 | -----------------------------------
|
---|
1936 |
|
---|
1937 | Sometimes it is useful to determine the programs that are to be built
|
---|
1938 | at configure time. For instance, GNU `cpio' only builds `mt' and `rmt'
|
---|
1939 | under special circumstances. The means to achieve conditional
|
---|
1940 | compilation of programs are the same you can use to compile source
|
---|
1941 | files conditionally: substitutions or conditionals.
|
---|
1942 |
|
---|
1943 | Conditional programs using `configure' substitutions
|
---|
1944 | ....................................................
|
---|
1945 |
|
---|
1946 | In this case, you must notify Automake of all the programs that can
|
---|
1947 | possibly be built, but at the same time cause the generated
|
---|
1948 | `Makefile.in' to use the programs specified by `configure'. This is
|
---|
1949 | done by having `configure' substitute values into each `_PROGRAMS'
|
---|
1950 | definition, while listing all optionally built programs in
|
---|
1951 | `EXTRA_PROGRAMS'.
|
---|
1952 |
|
---|
1953 | bin_PROGRAMS = cpio pax $(MT)
|
---|
1954 | libexec_PROGRAMS = $(RMT)
|
---|
1955 | EXTRA_PROGRAMS = mt rmt
|
---|
1956 |
|
---|
1957 | As explained in *Note EXEEXT::, Automake will rewrite
|
---|
1958 | `bin_PROGRAMS', `libexec_PROGRAMS', and `EXTRA_PROGRAMS', appending
|
---|
1959 | `$(EXEEXT)' to each binary. Obviously it cannot rewrite values
|
---|
1960 | obtained at run-time through `configure' substitutions, therefore you
|
---|
1961 | should take care of appending `$(EXEEXT)' yourself, as in
|
---|
1962 | `AC_SUBST([MT], ['mt${EXEEXT}'])'.
|
---|
1963 |
|
---|
1964 | Conditional programs using Automake conditionals
|
---|
1965 | ................................................
|
---|
1966 |
|
---|
1967 | You can also use Automake conditionals (*note Conditionals::) to select
|
---|
1968 | programs to be built. In this case you don't have to worry about
|
---|
1969 | `$(EXEEXT)' or `EXTRA_PROGRAMS'.
|
---|
1970 |
|
---|
1971 | bin_PROGRAMS = cpio pax
|
---|
1972 | if WANT_MT
|
---|
1973 | bin_PROGRAMS += mt
|
---|
1974 | endif
|
---|
1975 | if WANT_RMT
|
---|
1976 | libexec_PROGRAMS = rmt
|
---|
1977 | endif
|
---|
1978 |
|
---|
1979 |
|
---|
1980 | File: automake.info, Node: A Library, Next: A Shared Library, Prev: A Program, Up: Programs
|
---|
1981 |
|
---|
1982 | Building a library
|
---|
1983 | ==================
|
---|
1984 |
|
---|
1985 | Building a library is much like building a program. In this case, the
|
---|
1986 | name of the primary is `LIBRARIES'. Libraries can be installed in
|
---|
1987 | `libdir' or `pkglibdir'.
|
---|
1988 |
|
---|
1989 | *Note A Shared Library::, for information on how to build shared
|
---|
1990 | libraries using libtool and the `LTLIBRARIES' primary.
|
---|
1991 |
|
---|
1992 | Each `_LIBRARIES' variable is a list of the libraries to be built.
|
---|
1993 | For instance to create a library named `libcpio.a', but not install it,
|
---|
1994 | you would write:
|
---|
1995 |
|
---|
1996 | noinst_LIBRARIES = libcpio.a
|
---|
1997 |
|
---|
1998 | The sources that go into a library are determined exactly as they are
|
---|
1999 | for programs, via the `_SOURCES' variables. Note that the library name
|
---|
2000 | is canonicalized (*note Canonicalization::), so the `_SOURCES' variable
|
---|
2001 | corresponding to `liblob.a' is `liblob_a_SOURCES', not
|
---|
2002 | `liblob.a_SOURCES'.
|
---|
2003 |
|
---|
2004 | Extra objects can be added to a library using the `LIBRARY_LIBADD'
|
---|
2005 | variable. This should be used for objects determined by `configure'.
|
---|
2006 | Again from `cpio':
|
---|
2007 |
|
---|
2008 | libcpio_a_LIBADD = $(LIBOBJS) $(ALLOCA)
|
---|
2009 |
|
---|
2010 | In addition, sources for extra objects that will not exist until
|
---|
2011 | configure-time must be added to the `BUILT_SOURCES' variable (*note
|
---|
2012 | Sources::).
|
---|
2013 |
|
---|
2014 |
|
---|
2015 | File: automake.info, Node: A Shared Library, Next: Program and Library Variables, Prev: A Library, Up: Programs
|
---|
2016 |
|
---|
2017 | Building a Shared Library
|
---|
2018 | =========================
|
---|
2019 |
|
---|
2020 | Building shared libraries portably is a relatively complex matter. For
|
---|
2021 | this reason, GNU Libtool (*note Introduction: (libtool)Top.) was
|
---|
2022 | created to help build shared libraries in a platform-independent way.
|
---|
2023 |
|
---|
2024 | * Menu:
|
---|
2025 |
|
---|
2026 | * Libtool Concept:: Introducing Libtool
|
---|
2027 | * Libtool Libraries:: Declaring Libtool Libraries
|
---|
2028 | * Conditional Libtool Libraries:: Building Libtool Libraries Conditionally
|
---|
2029 | * Conditional Libtool Sources:: Choosing Library Sources Conditionally
|
---|
2030 | * Libtool Convenience Libraries:: Building Convenience Libtool Libraries
|
---|
2031 | * Libtool Modules:: Building Libtool Modules
|
---|
2032 | * Libtool Flags:: Using _LIBADD and _LDFLAGS
|
---|
2033 | * LTLIBOBJ:: Using $(LTLIBOBJ)
|
---|
2034 | * Libtool Issues:: Common Issues Related to Libtool's Use
|
---|
2035 |
|
---|
2036 |
|
---|
2037 | File: automake.info, Node: Libtool Concept, Next: Libtool Libraries, Prev: A Shared Library, Up: A Shared Library
|
---|
2038 |
|
---|
2039 | The Libtool Concept
|
---|
2040 | -------------------
|
---|
2041 |
|
---|
2042 | Libtool abstracts shared and static libraries into a unified concept
|
---|
2043 | henceforth called "libtool libraries". Libtool libraries are files
|
---|
2044 | using the `.la' suffix, and can designate a static library, a shared
|
---|
2045 | library, or maybe both. Their exact nature cannot be determined until
|
---|
2046 | `./configure' is run: not all platforms support all kinds of libraries,
|
---|
2047 | and users can explicitly select which libraries should be built.
|
---|
2048 | (However the package's maintainers can tune the default, *Note The
|
---|
2049 | `AC_PROG_LIBTOOL' macro: (libtool)AC_PROG_LIBTOOL.)
|
---|
2050 |
|
---|
2051 | Because object files for shared and static libraries must be compiled
|
---|
2052 | differently, libtool is also used during compilation. Object files
|
---|
2053 | built by libtool are called "libtool objects": these are files using
|
---|
2054 | the `.lo' suffix. Libtool libraries are built from these libtool
|
---|
2055 | objects.
|
---|
2056 |
|
---|
2057 | You should not assume anything about the structure of `.la' or `.lo'
|
---|
2058 | files and how libtool constructs them: this is libtool's concern, and
|
---|
2059 | the last thing one wants is to learn about libtool's guts. However the
|
---|
2060 | existence of these files matters, because they are used as targets and
|
---|
2061 | dependencies in `Makefile's when building libtool libraries. There are
|
---|
2062 | situations where you may have to refer to these, for instance when
|
---|
2063 | expressing dependencies for building source files conditionally (*note
|
---|
2064 | Conditional Libtool Sources::).
|
---|
2065 |
|
---|
2066 | People considering writing a plug-in system, with dynamically loaded
|
---|
2067 | modules, should look into `libltdl': libtool's dlopening library (*note
|
---|
2068 | Using libltdl: (libtool)Using libltdl.). This offers a portable
|
---|
2069 | dlopening facility to load libtool libraries dynamically, and can also
|
---|
2070 | achieve static linking where unavoidable.
|
---|
2071 |
|
---|
2072 | Before we discuss how to use libtool with Automake in details, it
|
---|
2073 | should be noted that the libtool manual also has a section about how to
|
---|
2074 | use Automake with libtool (*note Using Automake with Libtool:
|
---|
2075 | (libtool)Using Automake.).
|
---|
2076 |
|
---|
2077 |
|
---|
2078 | File: automake.info, Node: Libtool Libraries, Next: Conditional Libtool Libraries, Prev: Libtool Concept, Up: A Shared Library
|
---|
2079 |
|
---|
2080 | Building Libtool Libraries
|
---|
2081 | --------------------------
|
---|
2082 |
|
---|
2083 | Automake uses libtool to build libraries declared with the
|
---|
2084 | `LTLIBRARIES' primary. Each `_LTLIBRARIES' variable is a list of
|
---|
2085 | libtool libraries to build. For instance, to create a libtool library
|
---|
2086 | named `libgettext.la', and install it in `libdir', write:
|
---|
2087 |
|
---|
2088 | lib_LTLIBRARIES = libgettext.la
|
---|
2089 | libgettext_la_SOURCES = gettext.c gettext.h ...
|
---|
2090 |
|
---|
2091 | Automake predefines the variable `pkglibdir', so you can use
|
---|
2092 | `pkglib_LTLIBRARIES' to install libraries in `$(libdir)/@PACKAGE@/'.
|
---|
2093 |
|
---|
2094 |
|
---|
2095 | File: automake.info, Node: Conditional Libtool Libraries, Next: Conditional Libtool Sources, Prev: Libtool Libraries, Up: A Shared Library
|
---|
2096 |
|
---|
2097 | Building Libtool Libraries Conditionally
|
---|
2098 | ----------------------------------------
|
---|
2099 |
|
---|
2100 | Like conditional programs (*note Conditional Programs::), there are two
|
---|
2101 | main ways to build conditional libraries: using Automake conditionals
|
---|
2102 | or using Autoconf `AC_SUBST'itutions.
|
---|
2103 |
|
---|
2104 | The important implementation detail you have to be aware of is that
|
---|
2105 | the place where a library will be installed matters to libtool: it
|
---|
2106 | needs to be indicated _at link-time_ using the `-rpath' option.
|
---|
2107 |
|
---|
2108 | For libraries whose destination directory is known when Automake
|
---|
2109 | runs, Automake will automatically supply the appropriate `-rpath'
|
---|
2110 | option to libtool. This is the case for libraries listed explicitly in
|
---|
2111 | some installable `_LTLIBRARIES' variables such as `lib_LTLIBRARIES'.
|
---|
2112 |
|
---|
2113 | However, for libraries determined at configure time (and thus
|
---|
2114 | mentioned in `EXTRA_LTLIBRARIES'), Automake does not know the final
|
---|
2115 | installation directory. For such libraries you must add the `-rpath'
|
---|
2116 | option to the appropriate `_LDFLAGS' variable by hand.
|
---|
2117 |
|
---|
2118 | The examples below illustrate the differences between these two
|
---|
2119 | methods.
|
---|
2120 |
|
---|
2121 | Here is an example where `$(WANTEDLIBS)' is an `AC_SUBST'ed variable
|
---|
2122 | set at `./configure'-time to either `libfoo.la', `libbar.la', both, or
|
---|
2123 | none. Although `$(WANTEDLIBS)' appears in the `lib_LTLIBRARIES',
|
---|
2124 | Automake cannot guess it relates to `libfoo.la' or `libbar.la' by the
|
---|
2125 | time it creates the link rule for these two libraries. Therefore the
|
---|
2126 | `-rpath' argument must be explicitly supplied.
|
---|
2127 |
|
---|
2128 | EXTRA_LTLIBRARIES = libfoo.la libbar.la
|
---|
2129 | lib_LTLIBRARIES = $(WANTEDLIBS)
|
---|
2130 | libfoo_la_SOURCES = foo.c ...
|
---|
2131 | libfoo_la_LDFLAGS = -rpath '$(libdir)'
|
---|
2132 | libbar_la_SOURCES = bar.c ...
|
---|
2133 | libbar_la_LDFLAGS = -rpath '$(libdir)'
|
---|
2134 |
|
---|
2135 | Here is how the same `Makefile.am' would look using Automake
|
---|
2136 | conditionals named `WANT_LIBFOO' and `WANT_LIBBAR'. Now Automake is
|
---|
2137 | able to compute the `-rpath' setting itself, because it's clear that
|
---|
2138 | both libraries will end up in `$(libdir)' if they are installed.
|
---|
2139 |
|
---|
2140 | lib_LTLIBRARIES =
|
---|
2141 | if WANT_LIBFOO
|
---|
2142 | lib_LTLIBRARIES += libfoo.la
|
---|
2143 | endif
|
---|
2144 | if WANT_LIBBAR
|
---|
2145 | lib_LTLIBRARIES += libbar.la
|
---|
2146 | endif
|
---|
2147 | libfoo_la_SOURCES = foo.c ...
|
---|
2148 | libbar_la_SOURCES = bar.c ...
|
---|
2149 |
|
---|
2150 |
|
---|
2151 | File: automake.info, Node: Conditional Libtool Sources, Next: Libtool Convenience Libraries, Prev: Conditional Libtool Libraries, Up: A Shared Library
|
---|
2152 |
|
---|
2153 | Libtool Libraries with Conditional Sources
|
---|
2154 | ------------------------------------------
|
---|
2155 |
|
---|
2156 | Conditional compilation of sources in a library can be achieved in the
|
---|
2157 | same way as conditional compilation of sources in a program (*note
|
---|
2158 | Conditional Sources::). The only difference is that `_LIBADD' should
|
---|
2159 | be used instead of `_LDADD' and that it should mention libtool objects
|
---|
2160 | (`.lo' files).
|
---|
2161 |
|
---|
2162 | So, to mimic the `hello' example from *Note Conditional Sources::,
|
---|
2163 | we could build a `libhello.la' library using either `hello-linux.c' or
|
---|
2164 | `hello-generic.c' with the following `Makefile.am'.
|
---|
2165 |
|
---|
2166 | lib_LTLIBRARIES = libhello.la
|
---|
2167 | libhello_la_SOURCES = hello-common.c
|
---|
2168 | EXTRA_libhello_la_SOURCES = hello-linux.c hello-generic.c
|
---|
2169 | libhello_la_LIBADD = $(HELLO_SYSTEM)
|
---|
2170 | libhello_la_DEPENDENCIES = $(HELLO_SYSTEM)
|
---|
2171 |
|
---|
2172 | And make sure `$(HELLO_SYSTEM)' is set to either `hello-linux.lo' or
|
---|
2173 | `hello-generic.lo' in `./configure'.
|
---|
2174 |
|
---|
2175 | Or we could simply use an Automake conditional as follows.
|
---|
2176 |
|
---|
2177 | lib_LTLIBRARIES = libhello.la
|
---|
2178 | libhello_la_SOURCES = hello-common.c
|
---|
2179 | if LINUX
|
---|
2180 | libhello_la_SOURCES += hello-linux.c
|
---|
2181 | else
|
---|
2182 | libhello_la_SOURCES += hello-generic.c
|
---|
2183 | endif
|
---|
2184 |
|
---|
2185 |
|
---|
2186 | File: automake.info, Node: Libtool Convenience Libraries, Next: Libtool Modules, Prev: Conditional Libtool Sources, Up: A Shared Library
|
---|
2187 |
|
---|
2188 | Libtool Convenience Libraries
|
---|
2189 | -----------------------------
|
---|
2190 |
|
---|
2191 | Sometimes you want to build libtool libraries which should not be
|
---|
2192 | installed. These are called "libtool convenience libraries" and are
|
---|
2193 | typically used to encapsulate many sublibraries, later gathered into
|
---|
2194 | one big installed library.
|
---|
2195 |
|
---|
2196 | Libtool convenience libraries are declared by `noinst_LTLIBRARIES',
|
---|
2197 | `check_LTLIBRARIES', or even `EXTRA_LTLIBRARIES'. Unlike installed
|
---|
2198 | libtool libraries they do not need an `-rpath' flag at link time
|
---|
2199 | (actually this is the only difference).
|
---|
2200 |
|
---|
2201 | Convenience libraries listed in `noinst_LTLIBRARIES' are always
|
---|
2202 | built. Those listed in `check_LTLIBRARIES' are built only upon `make
|
---|
2203 | check'. Finally, libraries listed in `EXTRA_LTLIBRARIES' are never
|
---|
2204 | built explicitly: Automake outputs rules to build them, but if the
|
---|
2205 | library does not appear as a Makefile dependency anywhere it won't be
|
---|
2206 | built (this is why `EXTRA_LTLIBRARIES' is used for conditional
|
---|
2207 | compilation).
|
---|
2208 |
|
---|
2209 | Here is a sample setup merging libtool convenience libraries from
|
---|
2210 | subdirectories into one main `libtop.la' library.
|
---|
2211 |
|
---|
2212 | # -- Top-level Makefile.am --
|
---|
2213 | SUBDIRS = sub1 sub2 ...
|
---|
2214 | lib_LTLIBRARIES = libtop.la
|
---|
2215 | libtop_la_SOURCES =
|
---|
2216 | libtop_la_LIBADD = \
|
---|
2217 | sub1/libsub1.la \
|
---|
2218 | sub2/libsub2.la \
|
---|
2219 | ...
|
---|
2220 |
|
---|
2221 | # -- sub1/Makefile.am --
|
---|
2222 | noinst_LTLIBRARIES = libsub1.la
|
---|
2223 | libsub1_la_SOURCES = ...
|
---|
2224 |
|
---|
2225 | # -- sub2/Makefile.am --
|
---|
2226 | # showing nested convenience libraries
|
---|
2227 | SUBDIRS = sub2.1 sub2.2 ...
|
---|
2228 | noinst_LTLIBRARIES = libsub2.la
|
---|
2229 | libsub2_la_SOURCES =
|
---|
2230 | libsub2_la_LIBADD = \
|
---|
2231 | sub21/libsub21.la \
|
---|
2232 | sub22/libsub22.la \
|
---|
2233 | ...
|
---|
2234 |
|
---|
2235 |
|
---|
2236 | File: automake.info, Node: Libtool Modules, Next: Libtool Flags, Prev: Libtool Convenience Libraries, Up: A Shared Library
|
---|
2237 |
|
---|
2238 | Libtool Modules
|
---|
2239 | ---------------
|
---|
2240 |
|
---|
2241 | These are libtool libraries meant to be dlopened. They are indicated
|
---|
2242 | to libtool by passing `-module' at link-time.
|
---|
2243 |
|
---|
2244 | pkglib_LTLIBRARIES = mymodule.la
|
---|
2245 | mymodule_la_SOURCES = doit.c
|
---|
2246 | mymodule_LDFLAGS = -module
|
---|
2247 |
|
---|
2248 | Ordinarily, Automake requires that a Library's name starts with
|
---|
2249 | `lib'. However, when building a dynamically loadable module you might
|
---|
2250 | wish to use a "nonstandard" name.
|
---|
2251 |
|
---|
2252 |
|
---|
2253 | File: automake.info, Node: Libtool Flags, Next: LTLIBOBJ, Prev: Libtool Modules, Up: A Shared Library
|
---|
2254 |
|
---|
2255 | _LIBADD and _LDFLAGS
|
---|
2256 | --------------------
|
---|
2257 |
|
---|
2258 | As shown in previous sections, the `LIBRARY_LIBADD' variable should be
|
---|
2259 | used to list extra libtool objects (`.lo' files) or libtool libraries
|
---|
2260 | (`.la') to add to LIBRARY.
|
---|
2261 |
|
---|
2262 | The `LIBRARY_LDFLAGS' variable is the place to list additional
|
---|
2263 | libtool flags, such as `-version-info', `-static', and a lot more. See
|
---|
2264 | *Note Using libltdl: (libtool)Link mode.
|
---|
2265 |
|
---|
2266 |
|
---|
2267 | File: automake.info, Node: LTLIBOBJ, Next: Libtool Issues, Prev: Libtool Flags, Up: A Shared Library
|
---|
2268 |
|
---|
2269 | `LTLIBOBJS'
|
---|
2270 | -----------
|
---|
2271 |
|
---|
2272 | Where an ordinary library might include `$(LIBOBJS)', a libtool library
|
---|
2273 | must use `$(LTLIBOBJS)'. This is required because the object files
|
---|
2274 | that libtool operates on do not necessarily end in `.o'.
|
---|
2275 |
|
---|
2276 | Nowadays, the computation of `LTLIBOBJS' from `LIBOBJS' is performed
|
---|
2277 | automatically by Autoconf (*note `AC_LIBOBJ' vs. `LIBOBJS':
|
---|
2278 | (autoconf)AC_LIBOBJ vs LIBOBJS.).
|
---|
2279 |
|
---|
2280 |
|
---|
2281 | File: automake.info, Node: Libtool Issues, Prev: LTLIBOBJ, Up: A Shared Library
|
---|
2282 |
|
---|
2283 | Common Issues Related to Libtool's Use
|
---|
2284 | --------------------------------------
|
---|
2285 |
|
---|
2286 | `required file `./ltmain.sh' not found'
|
---|
2287 | .......................................
|
---|
2288 |
|
---|
2289 | Libtool comes with a tool called `libtoolize' that will install
|
---|
2290 | libtool's supporting files into a package. Running this command will
|
---|
2291 | install `ltmain.sh'. You should execute it before `aclocal' and
|
---|
2292 | `automake'.
|
---|
2293 |
|
---|
2294 | People upgrading old packages to newer autotools are likely to face
|
---|
2295 | this issue because older Automake versions used to call `libtoolize'.
|
---|
2296 | Therefore old build scripts do not call `libtoolize'.
|
---|
2297 |
|
---|
2298 | Since Automake 1.6, it has been decided that running `libtoolize'
|
---|
2299 | was none of Automake's business. Instead, that functionality has been
|
---|
2300 | moved into the `autoreconf' command (*note Using `autoreconf':
|
---|
2301 | (autoconf)autoreconf Invocation.). If you do not want to remember what
|
---|
2302 | to run and when, just learn the `autoreconf' command. Hopefully,
|
---|
2303 | replacing existing `bootstrap.sh' or `autogen.sh' scripts by a call to
|
---|
2304 | `autoreconf' should also free you from any similar incompatible change
|
---|
2305 | in the future.
|
---|
2306 |
|
---|
2307 | Objects `created with both libtool and without'
|
---|
2308 | ...............................................
|
---|
2309 |
|
---|
2310 | Sometimes, the same source file is used both to build a libtool library
|
---|
2311 | and to build another non-libtool target (be it a program or another
|
---|
2312 | library).
|
---|
2313 |
|
---|
2314 | Let's consider the following `Makefile.am'.
|
---|
2315 |
|
---|
2316 | bin_PROGRAMS = prog
|
---|
2317 | prog_SOURCES = prog.c foo.c ...
|
---|
2318 |
|
---|
2319 | lib_LTLIBRARIES = libfoo.la
|
---|
2320 | libfoo_la_SOURCES = foo.c ...
|
---|
2321 |
|
---|
2322 | (In this trivial case the issue could be avoided by linking `libfoo.la'
|
---|
2323 | with `prog' instead of listing `foo.c' in `prog_SOURCES'. But let's
|
---|
2324 | assume we really want to keep `prog' and `libfoo.la' separate.)
|
---|
2325 |
|
---|
2326 | Technically, it means that we should build `foo.$(OBJEXT)' for
|
---|
2327 | `prog', and `foo.lo' for `libfoo.la'. The problem is that in the
|
---|
2328 | course of creating `foo.lo', libtool may erase (or replace)
|
---|
2329 | `foo.$(OBJEXT)' - and this cannot be avoided.
|
---|
2330 |
|
---|
2331 | Therefore, when Automake detects this situation it will complain
|
---|
2332 | with a message such as
|
---|
2333 | object `foo.$(OBJEXT)' created both with libtool and without
|
---|
2334 |
|
---|
2335 | A workaround for this issue is to ensure that these two objects get
|
---|
2336 | different basenames. As explained in *Note renamed objects::, this
|
---|
2337 | happens automatically when per-targets flags are used.
|
---|
2338 |
|
---|
2339 | bin_PROGRAMS = prog
|
---|
2340 | prog_SOURCES = prog.c foo.c ...
|
---|
2341 | prog_CFLAGS = $(AM_CFLAGS)
|
---|
2342 |
|
---|
2343 | lib_LTLIBRARIES = libfoo.la
|
---|
2344 | libfoo_la_SOURCES = foo.c ...
|
---|
2345 |
|
---|
2346 | Adding `prog_CFLAGS = $(AM_CFLAGS)' is almost a no-op, because when the
|
---|
2347 | `prog_CFLAGS' is defined, it is used instead of `AM_CFLAGS'. However
|
---|
2348 | as a side effect it will cause `prog.c' and `foo.c' to be compiled as
|
---|
2349 | `prog-prog.$(OBJEXT)' and `prog-foo.$(OBJEXT)' which solves the issue.
|
---|
2350 |
|
---|
2351 |
|
---|
2352 | File: automake.info, Node: Program and Library Variables, Next: LIBOBJS, Prev: A Shared Library, Up: Programs
|
---|
2353 |
|
---|
2354 | Program and Library Variables
|
---|
2355 | =============================
|
---|
2356 |
|
---|
2357 | Associated with each program are a collection of variables which can be
|
---|
2358 | used to modify how that program is built. There is a similar list of
|
---|
2359 | such variables for each library. The canonical name of the program (or
|
---|
2360 | library) is used as a base for naming these variables.
|
---|
2361 |
|
---|
2362 | In the list below, we use the name "maude" to refer to the program or
|
---|
2363 | library. In your `Makefile.am' you would replace this with the
|
---|
2364 | canonical name of your program. This list also refers to "maude" as a
|
---|
2365 | program, but in general the same rules apply for both static and dynamic
|
---|
2366 | libraries; the documentation below notes situations where programs and
|
---|
2367 | libraries differ.
|
---|
2368 |
|
---|
2369 | `maude_SOURCES'
|
---|
2370 | This variable, if it exists, lists all the source files which are
|
---|
2371 | compiled to build the program. These files are added to the
|
---|
2372 | distribution by default. When building the program, Automake will
|
---|
2373 | cause each source file to be compiled to a single `.o' file (or
|
---|
2374 | `.lo' when using libtool). Normally these object files are named
|
---|
2375 | after the source file, but other factors can change this. If a
|
---|
2376 | file in the `_SOURCES' variable has an unrecognized extension,
|
---|
2377 | Automake will do one of two things with it. If a suffix rule
|
---|
2378 | exists for turning files with the unrecognized extension into `.o'
|
---|
2379 | files, then automake will treat this file as it will any other
|
---|
2380 | source file (*note Support for Other Languages::). Otherwise, the
|
---|
2381 | file will be ignored as though it were a header file.
|
---|
2382 |
|
---|
2383 | The prefixes `dist_' and `nodist_' can be used to control whether
|
---|
2384 | files listed in a `_SOURCES' variable are distributed. `dist_' is
|
---|
2385 | redundant, as sources are distributed by default, but it can be
|
---|
2386 | specified for clarity if desired.
|
---|
2387 |
|
---|
2388 | It is possible to have both `dist_' and `nodist_' variants of a
|
---|
2389 | given `_SOURCES' variable at once; this lets you easily distribute
|
---|
2390 | some files and not others, for instance:
|
---|
2391 |
|
---|
2392 | nodist_maude_SOURCES = nodist.c
|
---|
2393 | dist_maude_SOURCES = dist-me.c
|
---|
2394 |
|
---|
2395 | By default the output file (on Unix systems, the `.o' file) will be
|
---|
2396 | put into the current build directory. However, if the option
|
---|
2397 | `subdir-objects' is in effect in the current directory then the
|
---|
2398 | `.o' file will be put into the subdirectory named after the source
|
---|
2399 | file. For instance, with `subdir-objects' enabled,
|
---|
2400 | `sub/dir/file.c' will be compiled to `sub/dir/file.o'. Some
|
---|
2401 | people prefer this mode of operation. You can specify
|
---|
2402 | `subdir-objects' in `AUTOMAKE_OPTIONS' (*note Options::).
|
---|
2403 |
|
---|
2404 | `EXTRA_maude_SOURCES'
|
---|
2405 | Automake needs to know the list of files you intend to compile
|
---|
2406 | _statically_. For one thing, this is the only way Automake has of
|
---|
2407 | knowing what sort of language support a given `Makefile.in'
|
---|
2408 | requires. (1) This means that, for example, you can't put a
|
---|
2409 | configure substitution like `@my_sources@' into a `_SOURCES'
|
---|
2410 | variable. If you intend to conditionally compile source files and
|
---|
2411 | use `configure' to substitute the appropriate object names into,
|
---|
2412 | e.g., `_LDADD' (see below), then you should list the corresponding
|
---|
2413 | source files in the `EXTRA_' variable.
|
---|
2414 |
|
---|
2415 | This variable also supports `dist_' and `nodist_' prefixes, e.g.,
|
---|
2416 | `nodist_EXTRA_maude_SOURCES'.
|
---|
2417 |
|
---|
2418 | `maude_AR'
|
---|
2419 | A static library is created by default by invoking `$(AR) cru'
|
---|
2420 | followed by the name of the library and then the objects being put
|
---|
2421 | into the library. You can override this by setting the `_AR'
|
---|
2422 | variable. This is usually used with C++; some C++ compilers
|
---|
2423 | require a special invocation in order to instantiate all the
|
---|
2424 | templates which should go into a library. For instance, the SGI
|
---|
2425 | C++ compiler likes this variable set like so:
|
---|
2426 | libmaude_a_AR = $(CXX) -ar -o
|
---|
2427 |
|
---|
2428 | `maude_LIBADD'
|
---|
2429 | Extra objects can be added to a _library_ using the `_LIBADD'
|
---|
2430 | variable. For instance this should be used for objects determined
|
---|
2431 | by `configure' (*note A Library::).
|
---|
2432 |
|
---|
2433 | `maude_LDADD'
|
---|
2434 | Extra objects can be added to a _program_ by listing them in the
|
---|
2435 | `_LDADD' variable. For instance this should be used for objects
|
---|
2436 | determined by `configure' (*note Linking::).
|
---|
2437 |
|
---|
2438 | `_LDADD' and `_LIBADD' are inappropriate for passing
|
---|
2439 | program-specific linker flags (except for `-l', `-L', `-dlopen'
|
---|
2440 | and `-dlpreopen'). Use the `_LDFLAGS' variable for this purpose.
|
---|
2441 |
|
---|
2442 | For instance, if your `configure.in' uses `AC_PATH_XTRA', you
|
---|
2443 | could link your program against the X libraries like so:
|
---|
2444 |
|
---|
2445 | maude_LDADD = $(X_PRE_LIBS) $(X_LIBS) $(X_EXTRA_LIBS)
|
---|
2446 |
|
---|
2447 | `maude_LDFLAGS'
|
---|
2448 | This variable is used to pass extra flags to the link step of a
|
---|
2449 | program or a shared library.
|
---|
2450 |
|
---|
2451 | `maude_DEPENDENCIES'
|
---|
2452 | It is also occasionally useful to have a program depend on some
|
---|
2453 | other target which is not actually part of that program. This can
|
---|
2454 | be done using the `_DEPENDENCIES' variable. Each program depends
|
---|
2455 | on the contents of such a variable, but no further interpretation
|
---|
2456 | is done.
|
---|
2457 |
|
---|
2458 | If `_DEPENDENCIES' is not supplied, it is computed by Automake.
|
---|
2459 | The automatically-assigned value is the contents of `_LDADD' or
|
---|
2460 | `_LIBADD', with most configure substitutions, `-l', `-L',
|
---|
2461 | `-dlopen' and `-dlpreopen' options removed. The configure
|
---|
2462 | substitutions that are left in are only `$(LIBOBJS)' and
|
---|
2463 | `$(ALLOCA)'; these are left because it is known that they will not
|
---|
2464 | cause an invalid value for `_DEPENDENCIES' to be generated.
|
---|
2465 |
|
---|
2466 | `maude_LINK'
|
---|
2467 | You can override the linker on a per-program basis. By default the
|
---|
2468 | linker is chosen according to the languages used by the program.
|
---|
2469 | For instance, a program that includes C++ source code would use
|
---|
2470 | the C++ compiler to link. The `_LINK' variable must hold the name
|
---|
2471 | of a command which can be passed all the `.o' file names as
|
---|
2472 | arguments. Note that the name of the underlying program is _not_
|
---|
2473 | passed to `_LINK'; typically one uses `$@':
|
---|
2474 |
|
---|
2475 | maude_LINK = $(CCLD) -magic -o $@
|
---|
2476 |
|
---|
2477 | `maude_CCASFLAGS'
|
---|
2478 | `maude_CFLAGS'
|
---|
2479 | `maude_CPPFLAGS'
|
---|
2480 | `maude_CXXFLAGS'
|
---|
2481 | `maude_FFLAGS'
|
---|
2482 | `maude_GCJFLAGS'
|
---|
2483 | `maude_LFLAGS'
|
---|
2484 | `maude_OBJCFLAGS'
|
---|
2485 | `maude_RFLAGS'
|
---|
2486 | `maude_YFLAGS'
|
---|
2487 | Automake allows you to set compilation flags on a per-program (or
|
---|
2488 | per-library) basis. A single source file can be included in
|
---|
2489 | several programs, and it will potentially be compiled with
|
---|
2490 | different flags for each program. This works for any language
|
---|
2491 | directly supported by Automake. These "per-target compilation
|
---|
2492 | flags" are `_CCASFLAGS', `_CFLAGS', `_CPPFLAGS', `_CXXFLAGS',
|
---|
2493 | `_FFLAGS', `_GCJFLAGS', `_LFLAGS', `_OBJCFLAGS', `_RFLAGS', and
|
---|
2494 | `_YFLAGS'.
|
---|
2495 |
|
---|
2496 | When using a per-target compilation flag, Automake will choose a
|
---|
2497 | different name for the intermediate object files. Ordinarily a
|
---|
2498 | file like `sample.c' will be compiled to produce `sample.o'.
|
---|
2499 | However, if the program's `_CFLAGS' variable is set, then the
|
---|
2500 | object file will be named, for instance, `maude-sample.o'. (See
|
---|
2501 | also *Note renamed objects::.)
|
---|
2502 |
|
---|
2503 | In compilations with per-target flags, the ordinary `AM_' form of
|
---|
2504 | the flags variable is _not_ automatically included in the
|
---|
2505 | compilation (however, the user form of the variable _is_ included).
|
---|
2506 | So for instance, if you want the hypothetical `maude' compilations
|
---|
2507 | to also use the value of `AM_CFLAGS', you would need to write:
|
---|
2508 |
|
---|
2509 | maude_CFLAGS = ... your flags ... $(AM_CFLAGS)
|
---|
2510 |
|
---|
2511 | `maude_DEPENDENCIES'
|
---|
2512 | It is also occasionally useful to have a program depend on some
|
---|
2513 | other target which is not actually part of that program. This can
|
---|
2514 | be done using the `_DEPENDENCIES' variable. Each program depends
|
---|
2515 | on the contents of such a variable, but no further interpretation
|
---|
2516 | is done.
|
---|
2517 |
|
---|
2518 | If `_DEPENDENCIES' is not supplied, it is computed by Automake.
|
---|
2519 | The automatically-assigned value is the contents of `_LDADD' or
|
---|
2520 | `_LIBADD', with most configure substitutions, `-l', `-L',
|
---|
2521 | `-dlopen' and `-dlpreopen' options removed. The configure
|
---|
2522 | substitutions that are left in are only `@LIBOBJS@' and
|
---|
2523 | `@ALLOCA@'; these are left because it is known that they will not
|
---|
2524 | cause an invalid value for `_DEPENDENCIES' to be generated.
|
---|
2525 |
|
---|
2526 | `maude_SHORTNAME'
|
---|
2527 | On some platforms the allowable file names are very short. In
|
---|
2528 | order to support these systems and per-program compilation flags
|
---|
2529 | at the same time, Automake allows you to set a "short name" which
|
---|
2530 | will influence how intermediate object files are named. For
|
---|
2531 | instance, if you set `maude_SHORTNAME' to `m', then in the above
|
---|
2532 | per-program compilation flag example the object file would be named
|
---|
2533 | `m-sample.o' rather than `maude-sample.o'. This facility is
|
---|
2534 | rarely needed in practice, and we recommend avoiding it until you
|
---|
2535 | find it is required.
|
---|
2536 |
|
---|
2537 | ---------- Footnotes ----------
|
---|
2538 |
|
---|
2539 | (1) There are other, more obscure reasons reasons for this
|
---|
2540 | limitation as well.
|
---|
2541 |
|
---|
2542 |
|
---|
2543 | File: automake.info, Node: LIBOBJS, Next: Program variables, Prev: Program and Library Variables, Up: Programs
|
---|
2544 |
|
---|
2545 | Special handling for LIBOBJS and ALLOCA
|
---|
2546 | =======================================
|
---|
2547 |
|
---|
2548 | Automake explicitly recognizes the use of `$(LIBOBJS)' and `$(ALLOCA)',
|
---|
2549 | and uses this information, plus the list of `LIBOBJS' files derived
|
---|
2550 | from `configure.in' to automatically include the appropriate source
|
---|
2551 | files in the distribution (*note Dist::). These source files are also
|
---|
2552 | automatically handled in the dependency-tracking scheme; see *Note
|
---|
2553 | Dependencies::.
|
---|
2554 |
|
---|
2555 | `$(LIBOBJS)' and `$(ALLOCA)' are specially recognized in any
|
---|
2556 | `_LDADD' or `_LIBADD' variable.
|
---|
2557 |
|
---|
2558 |
|
---|
2559 | File: automake.info, Node: Program variables, Next: Yacc and Lex, Prev: LIBOBJS, Up: Programs
|
---|
2560 |
|
---|
2561 | Variables used when building a program
|
---|
2562 | ======================================
|
---|
2563 |
|
---|
2564 | Occasionally it is useful to know which `Makefile' variables Automake
|
---|
2565 | uses for compilations; for instance you might need to do your own
|
---|
2566 | compilation in some special cases.
|
---|
2567 |
|
---|
2568 | Some variables are inherited from Autoconf; these are `CC',
|
---|
2569 | `CFLAGS', `CPPFLAGS', `DEFS', `LDFLAGS', and `LIBS'.
|
---|
2570 |
|
---|
2571 | There are some additional variables which Automake itself defines:
|
---|
2572 |
|
---|
2573 | `AM_CPPFLAGS'
|
---|
2574 | The contents of this variable are passed to every compilation
|
---|
2575 | which invokes the C preprocessor; it is a list of arguments to the
|
---|
2576 | preprocessor. For instance, `-I' and `-D' options should be
|
---|
2577 | listed here.
|
---|
2578 |
|
---|
2579 | Automake already provides some `-I' options automatically. In
|
---|
2580 | particular it generates `-I$(srcdir)', `-I.', and a `-I' pointing
|
---|
2581 | to the directory holding `config.h' (if you've used
|
---|
2582 | `AC_CONFIG_HEADERS' or `AM_CONFIG_HEADER'). You can disable the
|
---|
2583 | default `-I' options using the `nostdinc' option.
|
---|
2584 |
|
---|
2585 | `AM_CPPFLAGS' is ignored in preference to a per-executable (or
|
---|
2586 | per-library) `_CPPFLAGS' variable if it is defined.
|
---|
2587 |
|
---|
2588 | `INCLUDES'
|
---|
2589 | This does the same job as `AM_CPPFLAGS'. It is an older name for
|
---|
2590 | the same functionality. This variable is deprecated; we suggest
|
---|
2591 | using `AM_CPPFLAGS' instead.
|
---|
2592 |
|
---|
2593 | `AM_CFLAGS'
|
---|
2594 | This is the variable which the `Makefile.am' author can use to pass
|
---|
2595 | in additional C compiler flags. It is more fully documented
|
---|
2596 | elsewhere. In some situations, this is not used, in preference to
|
---|
2597 | the per-executable (or per-library) `_CFLAGS'.
|
---|
2598 |
|
---|
2599 | `COMPILE'
|
---|
2600 | This is the command used to actually compile a C source file. The
|
---|
2601 | filename is appended to form the complete command line.
|
---|
2602 |
|
---|
2603 | `AM_LDFLAGS'
|
---|
2604 | This is the variable which the `Makefile.am' author can use to pass
|
---|
2605 | in additional linker flags. In some situations, this is not used,
|
---|
2606 | in preference to the per-executable (or per-library) `_LDFLAGS'.
|
---|
2607 |
|
---|
2608 | `LINK'
|
---|
2609 | This is the command used to actually link a C program. It already
|
---|
2610 | includes `-o $@' and the usual variable references (for instance,
|
---|
2611 | `CFLAGS'); it takes as "arguments" the names of the object files
|
---|
2612 | and libraries to link in.
|
---|
2613 |
|
---|
2614 |
|
---|
2615 | File: automake.info, Node: Yacc and Lex, Next: C++ Support, Prev: Program variables, Up: Programs
|
---|
2616 |
|
---|
2617 | Yacc and Lex support
|
---|
2618 | ====================
|
---|
2619 |
|
---|
2620 | Automake has somewhat idiosyncratic support for Yacc and Lex.
|
---|
2621 |
|
---|
2622 | Automake assumes that the `.c' file generated by `yacc' (or `lex')
|
---|
2623 | should be named using the basename of the input file. That is, for a
|
---|
2624 | yacc source file `foo.y', Automake will cause the intermediate file to
|
---|
2625 | be named `foo.c' (as opposed to `y.tab.c', which is more traditional).
|
---|
2626 |
|
---|
2627 | The extension of a yacc source file is used to determine the
|
---|
2628 | extension of the resulting `C' or `C++' file. Files with the extension
|
---|
2629 | `.y' will be turned into `.c' files; likewise, `.yy' will become `.cc';
|
---|
2630 | `.y++', `c++'; and `.yxx', `.cxx'.
|
---|
2631 |
|
---|
2632 | Likewise, lex source files can be used to generate `C' or `C++'; the
|
---|
2633 | extensions `.l', `.ll', `.l++', and `.lxx' are recognized.
|
---|
2634 |
|
---|
2635 | You should never explicitly mention the intermediate (`C' or `C++')
|
---|
2636 | file in any `SOURCES' variable; only list the source file.
|
---|
2637 |
|
---|
2638 | The intermediate files generated by `yacc' (or `lex') will be
|
---|
2639 | included in any distribution that is made. That way the user doesn't
|
---|
2640 | need to have `yacc' or `lex'.
|
---|
2641 |
|
---|
2642 | If a `yacc' source file is seen, then your `configure.in' must
|
---|
2643 | define the variable `YACC'. This is most easily done by invoking the
|
---|
2644 | macro `AC_PROG_YACC' (*note Particular Program Checks:
|
---|
2645 | (autoconf)Particular Programs.).
|
---|
2646 |
|
---|
2647 | When `yacc' is invoked, it is passed `YFLAGS' and `AM_YFLAGS'. The
|
---|
2648 | former is a user variable and the latter is intended for the
|
---|
2649 | `Makefile.am' author.
|
---|
2650 |
|
---|
2651 | `AM_YFLAGS' is usually used to pass the `-d' option to `yacc'.
|
---|
2652 | Automake knows what this means and will automatically adjust its rules
|
---|
2653 | to update and distribute the header file built by `yacc -d'. What
|
---|
2654 | Automake cannot guess, though, is where this header will be used: it is
|
---|
2655 | up to you to ensure the header gets built before it is first used.
|
---|
2656 | Typically this is necessary in order for dependency tracking to work
|
---|
2657 | when the header is included by another file. The common solution is
|
---|
2658 | listing the header file in `BUILT_SOURCES' (*note Sources::) as follows.
|
---|
2659 |
|
---|
2660 | BUILT_SOURCES = parser.h
|
---|
2661 | AM_YFLAGS = -d
|
---|
2662 | bin_PROGRAMS = foo
|
---|
2663 | foo_SOURCES = ... parser.y ...
|
---|
2664 |
|
---|
2665 | If a `lex' source file is seen, then your `configure.in' must define
|
---|
2666 | the variable `LEX'. You can use `AC_PROG_LEX' to do this (*note
|
---|
2667 | Particular Program Checks: (autoconf)Particular Programs.), but using
|
---|
2668 | `AM_PROG_LEX' macro (*note Macros::) is recommended.
|
---|
2669 |
|
---|
2670 | When `lex' is invoked, it is passed `LFLAGS' and `AM_LFLAGS'. The
|
---|
2671 | former is a user variable and the latter is intended for the
|
---|
2672 | `Makefile.am' author.
|
---|
2673 |
|
---|
2674 | Automake makes it possible to include multiple `yacc' (or `lex')
|
---|
2675 | source files in a single program. When there is more than one distinct
|
---|
2676 | `yacc' (or `lex') source file in a directory, Automake uses a small
|
---|
2677 | program called `ylwrap' to run `yacc' (or `lex') in a subdirectory.
|
---|
2678 | This is necessary because yacc's output filename is fixed, and a
|
---|
2679 | parallel make could conceivably invoke more than one instance of `yacc'
|
---|
2680 | simultaneously. The `ylwrap' program is distributed with Automake. It
|
---|
2681 | should appear in the directory specified by `AC_CONFIG_AUX_DIR' (*note
|
---|
2682 | Finding `configure' Input: (autoconf)Input.), or the current directory
|
---|
2683 | if that macro is not used in `configure.in'.
|
---|
2684 |
|
---|
2685 | For `yacc', simply managing locking is insufficient. The output of
|
---|
2686 | `yacc' always uses the same symbol names internally, so it isn't
|
---|
2687 | possible to link two `yacc' parsers into the same executable.
|
---|
2688 |
|
---|
2689 | We recommend using the following renaming hack used in `gdb':
|
---|
2690 | #define yymaxdepth c_maxdepth
|
---|
2691 | #define yyparse c_parse
|
---|
2692 | #define yylex c_lex
|
---|
2693 | #define yyerror c_error
|
---|
2694 | #define yylval c_lval
|
---|
2695 | #define yychar c_char
|
---|
2696 | #define yydebug c_debug
|
---|
2697 | #define yypact c_pact
|
---|
2698 | #define yyr1 c_r1
|
---|
2699 | #define yyr2 c_r2
|
---|
2700 | #define yydef c_def
|
---|
2701 | #define yychk c_chk
|
---|
2702 | #define yypgo c_pgo
|
---|
2703 | #define yyact c_act
|
---|
2704 | #define yyexca c_exca
|
---|
2705 | #define yyerrflag c_errflag
|
---|
2706 | #define yynerrs c_nerrs
|
---|
2707 | #define yyps c_ps
|
---|
2708 | #define yypv c_pv
|
---|
2709 | #define yys c_s
|
---|
2710 | #define yy_yys c_yys
|
---|
2711 | #define yystate c_state
|
---|
2712 | #define yytmp c_tmp
|
---|
2713 | #define yyv c_v
|
---|
2714 | #define yy_yyv c_yyv
|
---|
2715 | #define yyval c_val
|
---|
2716 | #define yylloc c_lloc
|
---|
2717 | #define yyreds c_reds
|
---|
2718 | #define yytoks c_toks
|
---|
2719 | #define yylhs c_yylhs
|
---|
2720 | #define yylen c_yylen
|
---|
2721 | #define yydefred c_yydefred
|
---|
2722 | #define yydgoto c_yydgoto
|
---|
2723 | #define yysindex c_yysindex
|
---|
2724 | #define yyrindex c_yyrindex
|
---|
2725 | #define yygindex c_yygindex
|
---|
2726 | #define yytable c_yytable
|
---|
2727 | #define yycheck c_yycheck
|
---|
2728 | #define yyname c_yyname
|
---|
2729 | #define yyrule c_yyrule
|
---|
2730 |
|
---|
2731 | For each define, replace the `c_' prefix with whatever you like.
|
---|
2732 | These defines work for `bison', `byacc', and traditional `yacc's. If
|
---|
2733 | you find a parser generator that uses a symbol not covered here, please
|
---|
2734 | report the new name so it can be added to the list.
|
---|
2735 |
|
---|
2736 |
|
---|
2737 | File: automake.info, Node: C++ Support, Next: Assembly Support, Prev: Yacc and Lex, Up: Programs
|
---|
2738 |
|
---|
2739 | C++ Support
|
---|
2740 | ===========
|
---|
2741 |
|
---|
2742 | Automake includes full support for C++.
|
---|
2743 |
|
---|
2744 | Any package including C++ code must define the output variable `CXX'
|
---|
2745 | in `configure.in'; the simplest way to do this is to use the
|
---|
2746 | `AC_PROG_CXX' macro (*note Particular Program Checks:
|
---|
2747 | (autoconf)Particular Programs.).
|
---|
2748 |
|
---|
2749 | A few additional variables are defined when a C++ source file is
|
---|
2750 | seen:
|
---|
2751 |
|
---|
2752 | `CXX'
|
---|
2753 | The name of the C++ compiler.
|
---|
2754 |
|
---|
2755 | `CXXFLAGS'
|
---|
2756 | Any flags to pass to the C++ compiler.
|
---|
2757 |
|
---|
2758 | `AM_CXXFLAGS'
|
---|
2759 | The maintainer's variant of `CXXFLAGS'.
|
---|
2760 |
|
---|
2761 | `CXXCOMPILE'
|
---|
2762 | The command used to actually compile a C++ source file. The file
|
---|
2763 | name is appended to form the complete command line.
|
---|
2764 |
|
---|
2765 | `CXXLINK'
|
---|
2766 | The command used to actually link a C++ program.
|
---|
2767 |
|
---|
2768 |
|
---|
2769 | File: automake.info, Node: Assembly Support, Next: Fortran 77 Support, Prev: C++ Support, Up: Programs
|
---|
2770 |
|
---|
2771 | Assembly Support
|
---|
2772 | ================
|
---|
2773 |
|
---|
2774 | Automake includes some support for assembly code.
|
---|
2775 |
|
---|
2776 | The variable `CCAS' holds the name of the compiler used to build
|
---|
2777 | assembly code. This compiler must work a bit like a C compiler; in
|
---|
2778 | particular it must accept `-c' and `-o'. The value of `CCASFLAGS' is
|
---|
2779 | passed to the compilation.
|
---|
2780 |
|
---|
2781 | You are required to set `CCAS' and `CCASFLAGS' via `configure.in'.
|
---|
2782 | The autoconf macro `AM_PROG_AS' will do this for you. Unless they are
|
---|
2783 | already set, it simply sets `CCAS' to the C compiler and `CCASFLAGS' to
|
---|
2784 | the C compiler flags.
|
---|
2785 |
|
---|
2786 | Only the suffixes `.s' and `.S' are recognized by `automake' as
|
---|
2787 | being files containing assembly code.
|
---|
2788 |
|
---|
2789 |
|
---|
2790 | File: automake.info, Node: Fortran 77 Support, Next: Java Support, Prev: Assembly Support, Up: Programs
|
---|
2791 |
|
---|
2792 | Fortran 77 Support
|
---|
2793 | ==================
|
---|
2794 |
|
---|
2795 | Automake includes full support for Fortran 77.
|
---|
2796 |
|
---|
2797 | Any package including Fortran 77 code must define the output variable
|
---|
2798 | `F77' in `configure.in'; the simplest way to do this is to use the
|
---|
2799 | `AC_PROG_F77' macro (*note Particular Program Checks:
|
---|
2800 | (autoconf)Particular Programs.). *Note Fortran 77 and Autoconf::.
|
---|
2801 |
|
---|
2802 | A few additional variables are defined when a Fortran 77 source file
|
---|
2803 | is seen:
|
---|
2804 |
|
---|
2805 | `F77'
|
---|
2806 | The name of the Fortran 77 compiler.
|
---|
2807 |
|
---|
2808 | `FFLAGS'
|
---|
2809 | Any flags to pass to the Fortran 77 compiler.
|
---|
2810 |
|
---|
2811 | `AM_FFLAGS'
|
---|
2812 | The maintainer's variant of `FFLAGS'.
|
---|
2813 |
|
---|
2814 | `RFLAGS'
|
---|
2815 | Any flags to pass to the Ratfor compiler.
|
---|
2816 |
|
---|
2817 | `AM_RFLAGS'
|
---|
2818 | The maintainer's variant of `RFLAGS'.
|
---|
2819 |
|
---|
2820 | `F77COMPILE'
|
---|
2821 | The command used to actually compile a Fortran 77 source file.
|
---|
2822 | The file name is appended to form the complete command line.
|
---|
2823 |
|
---|
2824 | `FLINK'
|
---|
2825 | The command used to actually link a pure Fortran 77 program or
|
---|
2826 | shared library.
|
---|
2827 |
|
---|
2828 |
|
---|
2829 | Automake can handle preprocessing Fortran 77 and Ratfor source files
|
---|
2830 | in addition to compiling them(1). Automake also contains some support
|
---|
2831 | for creating programs and shared libraries that are a mixture of
|
---|
2832 | Fortran 77 and other languages (*note Mixing Fortran 77 With C and
|
---|
2833 | C++::).
|
---|
2834 |
|
---|
2835 | These issues are covered in the following sections.
|
---|
2836 |
|
---|
2837 | * Menu:
|
---|
2838 |
|
---|
2839 | * Preprocessing Fortran 77::
|
---|
2840 | * Compiling Fortran 77 Files::
|
---|
2841 | * Mixing Fortran 77 With C and C++::
|
---|
2842 | * Fortran 77 and Autoconf::
|
---|
2843 |
|
---|
2844 | ---------- Footnotes ----------
|
---|
2845 |
|
---|
2846 | (1) Much, if not most, of the information in the following sections
|
---|
2847 | pertaining to preprocessing Fortran 77 programs was taken almost
|
---|
2848 | verbatim from *Note Catalogue of Rules: (make)Catalogue of Rules.
|
---|
2849 |
|
---|
2850 |
|
---|
2851 | File: automake.info, Node: Preprocessing Fortran 77, Next: Compiling Fortran 77 Files, Prev: Fortran 77 Support, Up: Fortran 77 Support
|
---|
2852 |
|
---|
2853 | Preprocessing Fortran 77
|
---|
2854 | ------------------------
|
---|
2855 |
|
---|
2856 | `N.f' is made automatically from `N.F' or `N.r'. This rule runs just
|
---|
2857 | the preprocessor to convert a preprocessable Fortran 77 or Ratfor
|
---|
2858 | source file into a strict Fortran 77 source file. The precise command
|
---|
2859 | used is as follows:
|
---|
2860 |
|
---|
2861 | `.F'
|
---|
2862 | `$(F77) -F $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
|
---|
2863 | $(AM_FFLAGS) $(FFLAGS)'
|
---|
2864 |
|
---|
2865 | `.r'
|
---|
2866 | `$(F77) -F $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)'
|
---|
2867 |
|
---|
2868 |
|
---|
2869 |
|
---|
2870 | File: automake.info, Node: Compiling Fortran 77 Files, Next: Mixing Fortran 77 With C and C++, Prev: Preprocessing Fortran 77, Up: Fortran 77 Support
|
---|
2871 |
|
---|
2872 | Compiling Fortran 77 Files
|
---|
2873 | --------------------------
|
---|
2874 |
|
---|
2875 | `N.o' is made automatically from `N.f', `N.F' or `N.r' by running the
|
---|
2876 | Fortran 77 compiler. The precise command used is as follows:
|
---|
2877 |
|
---|
2878 | `.f'
|
---|
2879 | `$(F77) -c $(AM_FFLAGS) $(FFLAGS)'
|
---|
2880 |
|
---|
2881 | `.F'
|
---|
2882 | `$(F77) -c $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
|
---|
2883 | $(AM_FFLAGS) $(FFLAGS)'
|
---|
2884 |
|
---|
2885 | `.r'
|
---|
2886 | `$(F77) -c $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)'
|
---|
2887 |
|
---|
2888 |
|
---|
2889 |
|
---|
2890 | File: automake.info, Node: Mixing Fortran 77 With C and C++, Next: Fortran 77 and Autoconf, Prev: Compiling Fortran 77 Files, Up: Fortran 77 Support
|
---|
2891 |
|
---|
2892 | Mixing Fortran 77 With C and C++
|
---|
2893 | --------------------------------
|
---|
2894 |
|
---|
2895 | Automake currently provides _limited_ support for creating programs and
|
---|
2896 | shared libraries that are a mixture of Fortran 77 and C and/or C++.
|
---|
2897 | However, there are many other issues related to mixing Fortran 77 with
|
---|
2898 | other languages that are _not_ (currently) handled by Automake, but
|
---|
2899 | that are handled by other packages(1).
|
---|
2900 |
|
---|
2901 | Automake can help in two ways:
|
---|
2902 |
|
---|
2903 | 1. Automatic selection of the linker depending on which combinations
|
---|
2904 | of source code.
|
---|
2905 |
|
---|
2906 | 2. Automatic selection of the appropriate linker flags (e.g. `-L' and
|
---|
2907 | `-l') to pass to the automatically selected linker in order to link
|
---|
2908 | in the appropriate Fortran 77 intrinsic and run-time libraries.
|
---|
2909 |
|
---|
2910 | These extra Fortran 77 linker flags are supplied in the output
|
---|
2911 | variable `FLIBS' by the `AC_F77_LIBRARY_LDFLAGS' Autoconf macro
|
---|
2912 | supplied with newer versions of Autoconf (Autoconf version 2.13 and
|
---|
2913 | later). *Note Fortran 77 Compiler Characteristics:
|
---|
2914 | (autoconf)Fortran 77 Compiler Characteristics.
|
---|
2915 |
|
---|
2916 | If Automake detects that a program or shared library (as mentioned in
|
---|
2917 | some `_PROGRAMS' or `_LTLIBRARIES' primary) contains source code that
|
---|
2918 | is a mixture of Fortran 77 and C and/or C++, then it requires that the
|
---|
2919 | macro `AC_F77_LIBRARY_LDFLAGS' be called in `configure.in', and that
|
---|
2920 | either `$(FLIBS)' or `@FLIBS@' appear in the appropriate `_LDADD' (for
|
---|
2921 | programs) or `_LIBADD' (for shared libraries) variables. It is the
|
---|
2922 | responsibility of the person writing the `Makefile.am' to make sure
|
---|
2923 | that `$(FLIBS)' or `@FLIBS@' appears in the appropriate `_LDADD' or
|
---|
2924 | `_LIBADD' variable.
|
---|
2925 |
|
---|
2926 | For example, consider the following `Makefile.am':
|
---|
2927 |
|
---|
2928 | bin_PROGRAMS = foo
|
---|
2929 | foo_SOURCES = main.cc foo.f
|
---|
2930 | foo_LDADD = libfoo.la @FLIBS@
|
---|
2931 |
|
---|
2932 | pkglib_LTLIBRARIES = libfoo.la
|
---|
2933 | libfoo_la_SOURCES = bar.f baz.c zardoz.cc
|
---|
2934 | libfoo_la_LIBADD = $(FLIBS)
|
---|
2935 |
|
---|
2936 | In this case, Automake will insist that `AC_F77_LIBRARY_LDFLAGS' is
|
---|
2937 | mentioned in `configure.in'. Also, if `@FLIBS@' hadn't been mentioned
|
---|
2938 | in `foo_LDADD' and `libfoo_la_LIBADD', then Automake would have issued
|
---|
2939 | a warning.
|
---|
2940 |
|
---|
2941 | * Menu:
|
---|
2942 |
|
---|
2943 | * How the Linker is Chosen::
|
---|
2944 |
|
---|
2945 | ---------- Footnotes ----------
|
---|
2946 |
|
---|
2947 | (1) For example, the cfortran package
|
---|
2948 | (http://www-zeus.desy.de/~burow/cfortran/) addresses all of these
|
---|
2949 | inter-language issues, and runs under nearly all Fortran 77, C and C++
|
---|
2950 | compilers on nearly all platforms. However, `cfortran' is not yet Free
|
---|
2951 | Software, but it will be in the next major release.
|
---|
2952 |
|
---|
2953 |
|
---|
2954 | File: automake.info, Node: How the Linker is Chosen, Prev: Mixing Fortran 77 With C and C++, Up: Mixing Fortran 77 With C and C++
|
---|
2955 |
|
---|
2956 | How the Linker is Chosen
|
---|
2957 | ........................
|
---|
2958 |
|
---|
2959 | The following diagram demonstrates under what conditions a particular
|
---|
2960 | linker is chosen by Automake.
|
---|
2961 |
|
---|
2962 | For example, if Fortran 77, C and C++ source code were to be compiled
|
---|
2963 | into a program, then the C++ linker will be used. In this case, if the
|
---|
2964 | C or Fortran 77 linkers required any special libraries that weren't
|
---|
2965 | included by the C++ linker, then they must be manually added to an
|
---|
2966 | `_LDADD' or `_LIBADD' variable by the user writing the `Makefile.am'.
|
---|
2967 |
|
---|
2968 | \ Linker
|
---|
2969 | source \
|
---|
2970 | code \ C C++ Fortran
|
---|
2971 | ----------------- +---------+---------+---------+
|
---|
2972 | | | | |
|
---|
2973 | C | x | | |
|
---|
2974 | | | | |
|
---|
2975 | +---------+---------+---------+
|
---|
2976 | | | | |
|
---|
2977 | C++ | | x | |
|
---|
2978 | | | | |
|
---|
2979 | +---------+---------+---------+
|
---|
2980 | | | | |
|
---|
2981 | Fortran | | | x |
|
---|
2982 | | | | |
|
---|
2983 | +---------+---------+---------+
|
---|
2984 | | | | |
|
---|
2985 | C + C++ | | x | |
|
---|
2986 | | | | |
|
---|
2987 | +---------+---------+---------+
|
---|
2988 | | | | |
|
---|
2989 | C + Fortran | | | x |
|
---|
2990 | | | | |
|
---|
2991 | +---------+---------+---------+
|
---|
2992 | | | | |
|
---|
2993 | C++ + Fortran | | x | |
|
---|
2994 | | | | |
|
---|
2995 | +---------+---------+---------+
|
---|
2996 | | | | |
|
---|
2997 | C + C++ + Fortran | | x | |
|
---|
2998 | | | | |
|
---|
2999 | +---------+---------+---------+
|
---|
3000 |
|
---|
3001 |
|
---|
3002 | File: automake.info, Node: Fortran 77 and Autoconf, Prev: Mixing Fortran 77 With C and C++, Up: Fortran 77 Support
|
---|
3003 |
|
---|
3004 | Fortran 77 and Autoconf
|
---|
3005 | -----------------------
|
---|
3006 |
|
---|
3007 | The current Automake support for Fortran 77 requires a recent enough
|
---|
3008 | version of Autoconf that also includes support for Fortran 77. Full
|
---|
3009 | Fortran 77 support was added to Autoconf 2.13, so you will want to use
|
---|
3010 | that version of Autoconf or later.
|
---|
3011 |
|
---|
3012 |
|
---|
3013 | File: automake.info, Node: Java Support, Next: Support for Other Languages, Prev: Fortran 77 Support, Up: Programs
|
---|
3014 |
|
---|
3015 | Java Support
|
---|
3016 | ============
|
---|
3017 |
|
---|
3018 | Automake includes support for compiled Java, using `gcj', the Java
|
---|
3019 | front end to the GNU Compiler Collection.
|
---|
3020 |
|
---|
3021 | Any package including Java code to be compiled must define the output
|
---|
3022 | variable `GCJ' in `configure.in'; the variable `GCJFLAGS' must also be
|
---|
3023 | defined somehow (either in `configure.in' or `Makefile.am'). The
|
---|
3024 | simplest way to do this is to use the `AM_PROG_GCJ' macro.
|
---|
3025 |
|
---|
3026 | By default, programs including Java source files are linked with
|
---|
3027 | `gcj'.
|
---|
3028 |
|
---|
3029 | As always, the contents of `AM_GCJFLAGS' are passed to every
|
---|
3030 | compilation invoking `gcj' (in its role as an ahead-of-time compiler -
|
---|
3031 | when invoking it to create `.class' files, `AM_JAVACFLAGS' is used
|
---|
3032 | instead). If it is necessary to pass options to `gcj' from
|
---|
3033 | `Makefile.am', this variable, and not the user variable `GCJFLAGS',
|
---|
3034 | should be used.
|
---|
3035 |
|
---|
3036 | `gcj' can be used to compile `.java', `.class', `.zip', or `.jar'
|
---|
3037 | files.
|
---|
3038 |
|
---|
3039 | When linking, `gcj' requires that the main class be specified using
|
---|
3040 | the `--main=' option. The easiest way to do this is to use the
|
---|
3041 | `_LDFLAGS' variable for the program.
|
---|
3042 |
|
---|
3043 |
|
---|
3044 | File: automake.info, Node: Support for Other Languages, Next: ANSI, Prev: Java Support, Up: Programs
|
---|
3045 |
|
---|
3046 | Support for Other Languages
|
---|
3047 | ===========================
|
---|
3048 |
|
---|
3049 | Automake currently only includes full support for C, C++ (*note C++
|
---|
3050 | Support::), Fortran 77 (*note Fortran 77 Support::), and Java (*note
|
---|
3051 | Java Support::). There is only rudimentary support for other
|
---|
3052 | languages, support for which will be improved based on user demand.
|
---|
3053 |
|
---|
3054 | Some limited support for adding your own languages is available via
|
---|
3055 | the suffix rule handling; see *Note Suffixes::.
|
---|
3056 |
|
---|
3057 |
|
---|
3058 | File: automake.info, Node: ANSI, Next: Dependencies, Prev: Support for Other Languages, Up: Programs
|
---|
3059 |
|
---|
3060 | Automatic de-ANSI-fication
|
---|
3061 | ==========================
|
---|
3062 |
|
---|
3063 | Although the GNU standards allow the use of ANSI C, this can have the
|
---|
3064 | effect of limiting portability of a package to some older compilers
|
---|
3065 | (notably the SunOS C compiler).
|
---|
3066 |
|
---|
3067 | Automake allows you to work around this problem on such machines by
|
---|
3068 | "de-ANSI-fying" each source file before the actual compilation takes
|
---|
3069 | place.
|
---|
3070 |
|
---|
3071 | If the `Makefile.am' variable `AUTOMAKE_OPTIONS' (*note Options::)
|
---|
3072 | contains the option `ansi2knr' then code to handle de-ANSI-fication is
|
---|
3073 | inserted into the generated `Makefile.in'.
|
---|
3074 |
|
---|
3075 | This causes each C source file in the directory to be treated as
|
---|
3076 | ANSI C. If an ANSI C compiler is available, it is used. If no ANSI C
|
---|
3077 | compiler is available, the `ansi2knr' program is used to convert the
|
---|
3078 | source files into K&R C, which is then compiled.
|
---|
3079 |
|
---|
3080 | The `ansi2knr' program is simple-minded. It assumes the source code
|
---|
3081 | will be formatted in a particular way; see the `ansi2knr' man page for
|
---|
3082 | details.
|
---|
3083 |
|
---|
3084 | Support for de-ANSI-fication requires the source files `ansi2knr.c'
|
---|
3085 | and `ansi2knr.1' to be in the same package as the ANSI C source; these
|
---|
3086 | files are distributed with Automake. Also, the package `configure.in'
|
---|
3087 | must call the macro `AM_C_PROTOTYPES' (*note Macros::).
|
---|
3088 |
|
---|
3089 | Automake also handles finding the `ansi2knr' support files in some
|
---|
3090 | other directory in the current package. This is done by prepending the
|
---|
3091 | relative path to the appropriate directory to the `ansi2knr' option.
|
---|
3092 | For instance, suppose the package has ANSI C code in the `src' and
|
---|
3093 | `lib' subdirectories. The files `ansi2knr.c' and `ansi2knr.1' appear
|
---|
3094 | in `lib'. Then this could appear in `src/Makefile.am':
|
---|
3095 |
|
---|
3096 | AUTOMAKE_OPTIONS = ../lib/ansi2knr
|
---|
3097 |
|
---|
3098 | If no directory prefix is given, the files are assumed to be in the
|
---|
3099 | current directory.
|
---|
3100 |
|
---|
3101 | Note that automatic de-ANSI-fication will not work when the package
|
---|
3102 | is being built for a different host architecture. That is because
|
---|
3103 | automake currently has no way to build `ansi2knr' for the build machine.
|
---|
3104 |
|
---|
3105 | Using `LIBOBJS' with source de-ANSI-fication used to require
|
---|
3106 | hand-crafted code in `configure' to append `$U' to basenames in
|
---|
3107 | `LIBOBJS'. This is no longer true today. Starting with version 2.54,
|
---|
3108 | Autoconf takes care of rewriting `LIBOBJS' and `LTLIBOBJS'. (*note
|
---|
3109 | `AC_LIBOBJ' vs. `LIBOBJS': (autoconf)AC_LIBOBJ vs LIBOBJS.)
|
---|
3110 |
|
---|
3111 |
|
---|
3112 | File: automake.info, Node: Dependencies, Next: EXEEXT, Prev: ANSI, Up: Programs
|
---|
3113 |
|
---|
3114 | Automatic dependency tracking
|
---|
3115 | =============================
|
---|
3116 |
|
---|
3117 | As a developer it is often painful to continually update the
|
---|
3118 | `Makefile.in' whenever the include-file dependencies change in a
|
---|
3119 | project. Automake supplies a way to automatically track dependency
|
---|
3120 | changes.
|
---|
3121 |
|
---|
3122 | Automake always uses complete dependencies for a compilation,
|
---|
3123 | including system headers. Automake's model is that dependency
|
---|
3124 | computation should be a side effect of the build. To this end,
|
---|
3125 | dependencies are computed by running all compilations through a special
|
---|
3126 | wrapper program called `depcomp'. `depcomp' understands how to coax
|
---|
3127 | many different C and C++ compilers into generating dependency
|
---|
3128 | information in the format it requires. `automake -a' will install
|
---|
3129 | `depcomp' into your source tree for you. If `depcomp' can't figure out
|
---|
3130 | how to properly invoke your compiler, dependency tracking will simply
|
---|
3131 | be disabled for your build.
|
---|
3132 |
|
---|
3133 | Experience with earlier versions of Automake (1) taught us that it
|
---|
3134 | is not reliable to generate dependencies only on the maintainer's
|
---|
3135 | system, as configurations vary too much. So instead Automake
|
---|
3136 | implements dependency tracking at build time.
|
---|
3137 |
|
---|
3138 | Automatic dependency tracking can be suppressed by putting
|
---|
3139 | `no-dependencies' in the variable `AUTOMAKE_OPTIONS', or passing
|
---|
3140 | `no-dependencies' as an argument to `AM_INIT_AUTOMAKE' (this should be
|
---|
3141 | the preferred way). Or, you can invoke `automake' with the `-i'
|
---|
3142 | option. Dependency tracking is enabled by default.
|
---|
3143 |
|
---|
3144 | The person building your package also can choose to disable
|
---|
3145 | dependency tracking by configuring with `--disable-dependency-tracking'.
|
---|
3146 |
|
---|
3147 | ---------- Footnotes ----------
|
---|
3148 |
|
---|
3149 | (1) See `http://sources.redhat.com/automake/dependencies.html' for
|
---|
3150 | more information on the history and experiences with automatic
|
---|
3151 | dependency tracking in Automake
|
---|
3152 |
|
---|
3153 |
|
---|
3154 | File: automake.info, Node: EXEEXT, Prev: Dependencies, Up: Programs
|
---|
3155 |
|
---|
3156 | Support for executable extensions
|
---|
3157 | =================================
|
---|
3158 |
|
---|
3159 | On some platforms, such as Windows, executables are expected to have an
|
---|
3160 | extension such as `.exe'. On these platforms, some compilers (GCC
|
---|
3161 | among them) will automatically generate `foo.exe' when asked to
|
---|
3162 | generate `foo'.
|
---|
3163 |
|
---|
3164 | Automake provides mostly-transparent support for this. Unfortunately
|
---|
3165 | _mostly_ doesn't yet mean _fully_. Until the English dictionary is
|
---|
3166 | revised, you will have to assist Automake if your package must support
|
---|
3167 | those platforms.
|
---|
3168 |
|
---|
3169 | One thing you must be aware of is that, internally, Automake rewrites
|
---|
3170 | something like this:
|
---|
3171 |
|
---|
3172 | bin_PROGRAMS = liver
|
---|
3173 |
|
---|
3174 | to this:
|
---|
3175 |
|
---|
3176 | bin_PROGRAMS = liver$(EXEEXT)
|
---|
3177 |
|
---|
3178 | The targets Automake generates are likewise given the `$(EXEEXT)'
|
---|
3179 | extension. `EXEEXT'
|
---|
3180 |
|
---|
3181 | However, Automake cannot apply this rewriting to `configure'
|
---|
3182 | substitutions. This means that if you are conditionally building a
|
---|
3183 | program using such a substitution, then your `configure.in' must take
|
---|
3184 | care to add `$(EXEEXT)' when constructing the output variable.
|
---|
3185 |
|
---|
3186 | With Autoconf 2.13 and earlier, you must explicitly use `AC_EXEEXT'
|
---|
3187 | to get this support. With Autoconf 2.50, `AC_EXEEXT' is run
|
---|
3188 | automatically if you configure a compiler (say, through `AC_PROG_CC').
|
---|
3189 |
|
---|
3190 | Sometimes maintainers like to write an explicit link rule for their
|
---|
3191 | program. Without executable extension support, this is easy--you
|
---|
3192 | simply write a target with the same name as the program. However, when
|
---|
3193 | executable extension support is enabled, you must instead add the
|
---|
3194 | `$(EXEEXT)' suffix.
|
---|
3195 |
|
---|
3196 | Unfortunately, due to the change in Autoconf 2.50, this means you
|
---|
3197 | must always add this extension. However, this is a problem for
|
---|
3198 | maintainers who know their package will never run on a platform that
|
---|
3199 | has executable extensions. For those maintainers, the `no-exeext'
|
---|
3200 | option (*note Options::) will disable this feature. This works in a
|
---|
3201 | fairly ugly way; if `no-exeext' is seen, then the presence of a target
|
---|
3202 | named `foo' in `Makefile.am' will override an automake-generated target
|
---|
3203 | of the form `foo$(EXEEXT)'. Without the `no-exeext' option, this use
|
---|
3204 | will give an error.
|
---|
3205 |
|
---|
3206 |
|
---|
3207 | File: automake.info, Node: Other objects, Next: Other GNU Tools, Prev: Programs, Up: Top
|
---|
3208 |
|
---|
3209 | Other Derived Objects
|
---|
3210 | *********************
|
---|
3211 |
|
---|
3212 | Automake can handle derived objects which are not C programs. Sometimes
|
---|
3213 | the support for actually building such objects must be explicitly
|
---|
3214 | supplied, but Automake will still automatically handle installation and
|
---|
3215 | distribution.
|
---|
3216 |
|
---|
3217 | * Menu:
|
---|
3218 |
|
---|
3219 | * Scripts:: Executable scripts
|
---|
3220 | * Headers:: Header files
|
---|
3221 | * Data:: Architecture-independent data files
|
---|
3222 | * Sources:: Derived sources
|
---|
3223 |
|
---|
3224 |
|
---|
3225 | File: automake.info, Node: Scripts, Next: Headers, Prev: Other objects, Up: Other objects
|
---|
3226 |
|
---|
3227 | Executable Scripts
|
---|
3228 | ==================
|
---|
3229 |
|
---|
3230 | It is possible to define and install programs which are scripts. Such
|
---|
3231 | programs are listed using the `SCRIPTS' primary name. Automake doesn't
|
---|
3232 | define any dependencies for scripts; the `Makefile.am' should include
|
---|
3233 | the appropriate rules.
|
---|
3234 |
|
---|
3235 | Automake does not assume that scripts are derived objects; such
|
---|
3236 | objects must be deleted by hand (*note Clean::).
|
---|
3237 |
|
---|
3238 | The `automake' program itself is a Perl script that is generated at
|
---|
3239 | configure time from `automake.in'. Here is how this is handled:
|
---|
3240 |
|
---|
3241 | bin_SCRIPTS = automake
|
---|
3242 |
|
---|
3243 | Since `automake' appears in the `AC_OUTPUT' macro, a target for it
|
---|
3244 | is automatically generated, and it is also automatically cleaned
|
---|
3245 | (despite the fact it's a script).
|
---|
3246 |
|
---|
3247 | Script objects can be installed in `bindir', `sbindir',
|
---|
3248 | `libexecdir', or `pkgdatadir'.
|
---|
3249 |
|
---|
3250 | Scripts that need not being installed can be listed in
|
---|
3251 | `noinst_SCRIPTS', and among them, those which are needed only by `make
|
---|
3252 | check' should go in `check_SCRIPTS'.
|
---|
3253 |
|
---|
3254 |
|
---|
3255 | File: automake.info, Node: Headers, Next: Data, Prev: Scripts, Up: Other objects
|
---|
3256 |
|
---|
3257 | Header files
|
---|
3258 | ============
|
---|
3259 |
|
---|
3260 | Header files are specified by the `HEADERS' family of variables.
|
---|
3261 | Generally header files are not installed, so the `noinst_HEADERS'
|
---|
3262 | variable will be the most used. (1)
|
---|
3263 |
|
---|
3264 | All header files must be listed somewhere; missing ones will not
|
---|
3265 | appear in the distribution. Often it is clearest to list uninstalled
|
---|
3266 | headers with the rest of the sources for a program. *Note A Program::.
|
---|
3267 | Headers listed in a `_SOURCES' variable need not be listed in any
|
---|
3268 | `_HEADERS' variable.
|
---|
3269 |
|
---|
3270 | Headers can be installed in `includedir', `oldincludedir', or
|
---|
3271 | `pkgincludedir'.
|
---|
3272 |
|
---|
3273 | ---------- Footnotes ----------
|
---|
3274 |
|
---|
3275 | (1) However, for the case of a non-installed header file that is
|
---|
3276 | actually used by a particular program, we recommend listing it in the
|
---|
3277 | program's `_SOURCES' variable instead of in `noinst_HEADERS'. We
|
---|
3278 | believe this is more clear.
|
---|
3279 |
|
---|
3280 |
|
---|
3281 | File: automake.info, Node: Data, Next: Sources, Prev: Headers, Up: Other objects
|
---|
3282 |
|
---|
3283 | Architecture-independent data files
|
---|
3284 | ===================================
|
---|
3285 |
|
---|
3286 | Automake supports the installation of miscellaneous data files using the
|
---|
3287 | `DATA' family of variables.
|
---|
3288 |
|
---|
3289 | Such data can be installed in the directories `datadir',
|
---|
3290 | `sysconfdir', `sharedstatedir', `localstatedir', or `pkgdatadir'.
|
---|
3291 |
|
---|
3292 | By default, data files are _not_ included in a distribution. Of
|
---|
3293 | course, you can use the `dist_' prefix to change this on a per-variable
|
---|
3294 | basis.
|
---|
3295 |
|
---|
3296 | Here is how Automake declares its auxiliary data files:
|
---|
3297 |
|
---|
3298 | dist_pkgdata_DATA = clean-kr.am clean.am ...
|
---|
3299 |
|
---|
3300 |
|
---|
3301 | File: automake.info, Node: Sources, Prev: Data, Up: Other objects
|
---|
3302 |
|
---|
3303 | Built sources
|
---|
3304 | =============
|
---|
3305 |
|
---|
3306 | Because Automake's automatic dependency tracking works as a side-effect
|
---|
3307 | of compilation (*note Dependencies::) there is a bootstrap issue: a
|
---|
3308 | target should not be compiled before its dependencies are made, but
|
---|
3309 | these dependencies are unknown until the target is first compiled.
|
---|
3310 |
|
---|
3311 | Ordinarily this is not a problem, because dependencies are
|
---|
3312 | distributed sources: they preexist and do not need to be built.
|
---|
3313 | Suppose that `foo.c' includes `foo.h'. When it first compiles `foo.o',
|
---|
3314 | `make' only knows that `foo.o' depends on `foo.c'. As a side-effect of
|
---|
3315 | this compilation `depcomp' records the `foo.h' dependency so that
|
---|
3316 | following invocations of `make' will honor it. In these conditions,
|
---|
3317 | it's clear there is no problem: either `foo.o' doesn't exist and has to
|
---|
3318 | be built (regardless of the dependencies), either accurate dependencies
|
---|
3319 | exist and they can be used to decide whether `foo.o' should be rebuilt.
|
---|
3320 |
|
---|
3321 | It's a different story if `foo.h' doesn't exist by the first `make'
|
---|
3322 | run. For instance there might be a rule to build `foo.h'. This time
|
---|
3323 | `file.o''s build will fail because the compiler can't find `foo.h'.
|
---|
3324 | `make' failed to trigger the rule to build `foo.h' first by lack of
|
---|
3325 | dependency information.
|
---|
3326 |
|
---|
3327 | The `BUILT_SOURCES' variable is a workaround for this problem. A
|
---|
3328 | source file listed in `BUILT_SOURCES' is made on `make all' or `make
|
---|
3329 | check' (or even `make install') before other targets are processed.
|
---|
3330 | However, such a source file is not _compiled_ unless explicitly
|
---|
3331 | requested by mentioning it in some other `_SOURCES' variable.
|
---|
3332 |
|
---|
3333 | So, to conclude our introductory example, we could use
|
---|
3334 | `BUILT_SOURCES = foo.h' to ensure `foo.h' gets built before any other
|
---|
3335 | target (including `foo.o') during `make all' or `make check'.
|
---|
3336 |
|
---|
3337 | `BUILT_SOURCES' is actually a bit of a misnomer, as any file which
|
---|
3338 | must be created early in the build process can be listed in this
|
---|
3339 | variable. Moreover, all built sources do not necessarily have to be
|
---|
3340 | listed in `BUILT_SOURCES'. For instance a generated `.c' file doesn't
|
---|
3341 | need to appear in `BUILT_SOURCES' (unless it is included by another
|
---|
3342 | source), because it's a known dependency of the associated object.
|
---|
3343 |
|
---|
3344 | It might be important to emphasize that `BUILT_SOURCES' is honored
|
---|
3345 | only by `make all', `make check' and `make install'. This means you
|
---|
3346 | cannot build a specific target (e.g., `make foo') in a clean tree if it
|
---|
3347 | depends on a built source. However it will succeed if you have run
|
---|
3348 | `make all' earlier, because accurate dependencies are already available.
|
---|
3349 |
|
---|
3350 | The next section illustrates and discusses the handling of built
|
---|
3351 | sources on a toy example.
|
---|
3352 |
|
---|
3353 | * Menu:
|
---|
3354 |
|
---|
3355 | * Built sources example:: Several ways to handle built sources.
|
---|
3356 |
|
---|
3357 |
|
---|
3358 | File: automake.info, Node: Built sources example, Prev: Sources, Up: Sources
|
---|
3359 |
|
---|
3360 | Built sources example
|
---|
3361 | ---------------------
|
---|
3362 |
|
---|
3363 | Suppose that `foo.c' includes `bindir.h', which is
|
---|
3364 | installation-dependent and not distributed: it needs to be built. Here
|
---|
3365 | `bindir.h' defines the preprocessor macro `bindir' to the value of the
|
---|
3366 | `make' variable `bindir' (inherited from `configure').
|
---|
3367 |
|
---|
3368 | We suggest several implementations below. It's not meant to be an
|
---|
3369 | exhaustive listing of all ways to handle built sources, but it will give
|
---|
3370 | you a few ideas if you encounter this issue.
|
---|
3371 |
|
---|
3372 | First try
|
---|
3373 | ---------
|
---|
3374 |
|
---|
3375 | This first implementation will illustrate the bootstrap issue mentioned
|
---|
3376 | in the previous section (*note Sources::).
|
---|
3377 |
|
---|
3378 | Here is a tentative `Makefile.am'.
|
---|
3379 |
|
---|
3380 | # This won't work.
|
---|
3381 | bin_PROGRAMS = foo
|
---|
3382 | foo_SOURCES = foo.c
|
---|
3383 | nodist_foo_SOURCES = bindir.h
|
---|
3384 | CLEANFILES = bindir.h
|
---|
3385 | bindir.h: Makefile
|
---|
3386 | echo '#define bindir "$(bindir)"' >$@
|
---|
3387 |
|
---|
3388 | This setup doesn't work, because Automake doesn't know that `foo.c'
|
---|
3389 | includes `bindir.h'. Remember, automatic dependency tracking works as
|
---|
3390 | a side-effect of compilation, so the dependencies of `foo.o' will be
|
---|
3391 | known only after `foo.o' has been compiled (*note Dependencies::). The
|
---|
3392 | symptom is as follows.
|
---|
3393 |
|
---|
3394 | % make
|
---|
3395 | source='foo.c' object='foo.o' libtool=no \
|
---|
3396 | depfile='.deps/foo.Po' tmpdepfile='.deps/foo.TPo' \
|
---|
3397 | depmode=gcc /bin/sh ./depcomp \
|
---|
3398 | gcc -I. -I. -g -O2 -c `test -f 'foo.c' || echo './'`foo.c
|
---|
3399 | foo.c:2: bindir.h: No such file or directory
|
---|
3400 | make: *** [foo.o] Error 1
|
---|
3401 |
|
---|
3402 | Using `BUILT_SOURCES'
|
---|
3403 | ---------------------
|
---|
3404 |
|
---|
3405 | A solution is to require `bindir.h' to be built before anything else.
|
---|
3406 | This is what `BUILT_SOURCES' is meant for (*note Sources::).
|
---|
3407 |
|
---|
3408 | bin_PROGRAMS = foo
|
---|
3409 | foo_SOURCES = foo.c
|
---|
3410 | BUILT_SOURCES = bindir.h
|
---|
3411 | CLEANFILES = bindir.h
|
---|
3412 | bindir.h: Makefile
|
---|
3413 | echo '#define bindir "$(bindir)"' >$@
|
---|
3414 |
|
---|
3415 | See how `bindir.h' get built first:
|
---|
3416 |
|
---|
3417 | % make
|
---|
3418 | echo '#define bindir "/usr/local/bin"' >bindir.h
|
---|
3419 | make all-am
|
---|
3420 | make[1]: Entering directory `/home/adl/tmp'
|
---|
3421 | source='foo.c' object='foo.o' libtool=no \
|
---|
3422 | depfile='.deps/foo.Po' tmpdepfile='.deps/foo.TPo' \
|
---|
3423 | depmode=gcc /bin/sh ./depcomp \
|
---|
3424 | gcc -I. -I. -g -O2 -c `test -f 'foo.c' || echo './'`foo.c
|
---|
3425 | gcc -g -O2 -o foo foo.o
|
---|
3426 | make[1]: Leaving directory `/home/adl/tmp'
|
---|
3427 |
|
---|
3428 | However, as said earlier, `BUILT_SOURCES' applies only to the `all',
|
---|
3429 | `check', and `install' targets. It still fails if you try to run `make
|
---|
3430 | foo' explicitly:
|
---|
3431 |
|
---|
3432 | % make clean
|
---|
3433 | test -z "bindir.h" || rm -f bindir.h
|
---|
3434 | test -z "foo" || rm -f foo
|
---|
3435 | rm -f *.o core *.core
|
---|
3436 | % : > .deps/foo.Po # Suppress previously recorded dependencies
|
---|
3437 | % make foo
|
---|
3438 | source='foo.c' object='foo.o' libtool=no \
|
---|
3439 | depfile='.deps/foo.Po' tmpdepfile='.deps/foo.TPo' \
|
---|
3440 | depmode=gcc /bin/sh ./depcomp \
|
---|
3441 | gcc -I. -I. -g -O2 -c `test -f 'foo.c' || echo './'`foo.c
|
---|
3442 | foo.c:2: bindir.h: No such file or directory
|
---|
3443 | make: *** [foo.o] Error 1
|
---|
3444 |
|
---|
3445 | Recording dependencies manually
|
---|
3446 | -------------------------------
|
---|
3447 |
|
---|
3448 | Usually people are happy enough with `BUILT_SOURCES' because they never
|
---|
3449 | run targets such as `make foo' before `make all', as in the previous
|
---|
3450 | example. However if this matters to you, you can avoid `BUILT_SOURCES'
|
---|
3451 | and record such dependencies explicitly in the `Makefile.am'.
|
---|
3452 |
|
---|
3453 | bin_PROGRAMS = foo
|
---|
3454 | foo_SOURCES = foo.c
|
---|
3455 | foo.$(OBJEXT): bindir.h
|
---|
3456 | CLEANFILES = bindir.h
|
---|
3457 | bindir.h: Makefile
|
---|
3458 | echo '#define bindir "$(bindir)"' >$@
|
---|
3459 |
|
---|
3460 | You don't have to list _all_ the dependencies of `foo.o' explicitly,
|
---|
3461 | only those which might need to be built. If a dependency already
|
---|
3462 | exists, it will not hinder the first compilation and will be recorded
|
---|
3463 | by the normal dependency tracking code. (Note that after this first
|
---|
3464 | compilation the dependency tracking code will also have recorded the
|
---|
3465 | dependency between `foo.o' and `bindir.h'; so our explicit dependency
|
---|
3466 | is really useful to the first build only.)
|
---|
3467 |
|
---|
3468 | Adding explicit dependencies like this can be a bit dangerous if you
|
---|
3469 | are not careful enough. This is due to the way Automake tries not to
|
---|
3470 | overwrite your rules (it assumes you know better than it).
|
---|
3471 | `foo.$(OBJEXT): bindir.h' supersedes any rule Automake may want to
|
---|
3472 | output to build `foo.$(OBJEXT)'. It happens to work in this case
|
---|
3473 | because Automake doesn't have to output any `foo.$(OBJEXT):' target: it
|
---|
3474 | relies on a suffix rule instead (i.e., `.c.$(OBJEXT):'). Always check
|
---|
3475 | the generated `Makefile.in' if you do this.
|
---|
3476 |
|
---|
3477 | Build `bindir.h' from `configure'
|
---|
3478 | ---------------------------------
|
---|
3479 |
|
---|
3480 | It's possible to define this preprocessor macro from `configure',
|
---|
3481 | either in `config.h' (*note Defining Directories: (autoconf)Defining
|
---|
3482 | Directories.), or by processing a `bindir.h.in' file using
|
---|
3483 | `AC_CONFIG_FILES' (*note Configuration Actions: (autoconf)Configuration
|
---|
3484 | Actions.).
|
---|
3485 |
|
---|
3486 | At this point it should be clear that building `bindir.h' from
|
---|
3487 | `configure' work well for this example. `bindir.h' will exist before
|
---|
3488 | you build any target, hence will not cause any dependency issue.
|
---|
3489 |
|
---|
3490 | The Makefile can be shrunk as follows. We do not even have to
|
---|
3491 | mention `bindir.h'.
|
---|
3492 |
|
---|
3493 | bin_PROGRAMS = foo
|
---|
3494 | foo_SOURCES = foo.c
|
---|
3495 |
|
---|
3496 | However, it's not always possible to build sources from `configure',
|
---|
3497 | especially when these sources are generated by a tool that needs to be
|
---|
3498 | built first...
|
---|
3499 |
|
---|
3500 | Build `bindir.c', not `bindir.h'.
|
---|
3501 | ---------------------------------
|
---|
3502 |
|
---|
3503 | Another attractive idea is to define `bindir' as a variable or function
|
---|
3504 | exported from `bindir.o', and build `bindir.c' instead of `bindir.h'.
|
---|
3505 |
|
---|
3506 | noinst_PROGRAMS = foo
|
---|
3507 | foo_SOURCES = foo.c bindir.h
|
---|
3508 | nodist_foo_SOURCES = bindir.c
|
---|
3509 | CLEANFILES = bindir.c
|
---|
3510 | bindir.c: Makefile
|
---|
3511 | echo 'const char bindir[] = "$(bindir)";' >$
|
---|
3512 |
|
---|
3513 | `bindir.h' contains just the variable's declaration and doesn't need
|
---|
3514 | to be built, so it won't cause any trouble. `bindir.o' is always
|
---|
3515 | dependent on `bindir.c', so `bindir.c' will get built first.
|
---|
3516 |
|
---|
3517 | Which is best?
|
---|
3518 | --------------
|
---|
3519 |
|
---|
3520 | There is no panacea, of course. Each solution has its merits and
|
---|
3521 | drawbacks.
|
---|
3522 |
|
---|
3523 | You cannot use `BUILT_SOURCES' if the ability to run `make foo' on a
|
---|
3524 | clean tree is important to you.
|
---|
3525 |
|
---|
3526 | You won't add explicit dependencies if you are leery of overriding
|
---|
3527 | an Automake target by mistake.
|
---|
3528 |
|
---|
3529 | Building files from `./configure' is not always possible, neither is
|
---|
3530 | converting `.h' files into `.c' files.
|
---|
3531 |
|
---|
3532 |
|
---|
3533 | File: automake.info, Node: Other GNU Tools, Next: Documentation, Prev: Other objects, Up: Top
|
---|
3534 |
|
---|
3535 | Other GNU Tools
|
---|
3536 | ***************
|
---|
3537 |
|
---|
3538 | Since Automake is primarily intended to generate `Makefile.in's for use
|
---|
3539 | in GNU programs, it tries hard to interoperate with other GNU tools.
|
---|
3540 |
|
---|
3541 | * Menu:
|
---|
3542 |
|
---|
3543 | * Emacs Lisp:: Emacs Lisp
|
---|
3544 | * gettext:: Gettext
|
---|
3545 | * Libtool:: Libtool
|
---|
3546 | * Java:: Java
|
---|
3547 | * Python:: Python
|
---|
3548 |
|
---|
3549 |
|
---|
3550 | File: automake.info, Node: Emacs Lisp, Next: gettext, Prev: Other GNU Tools, Up: Other GNU Tools
|
---|
3551 |
|
---|
3552 | Emacs Lisp
|
---|
3553 | ==========
|
---|
3554 |
|
---|
3555 | Automake provides some support for Emacs Lisp. The `LISP' primary is
|
---|
3556 | used to hold a list of `.el' files. Possible prefixes for this primary
|
---|
3557 | are `lisp_' and `noinst_'. Note that if `lisp_LISP' is defined, then
|
---|
3558 | `configure.in' must run `AM_PATH_LISPDIR' (*note Macros::).
|
---|
3559 |
|
---|
3560 | By default Automake will byte-compile all Emacs Lisp source files
|
---|
3561 | using the Emacs found by `AM_PATH_LISPDIR'. If you wish to avoid
|
---|
3562 | byte-compiling, simply define the variable `ELCFILES' to be empty.
|
---|
3563 | Byte-compiled Emacs Lisp files are not portable among all versions of
|
---|
3564 | Emacs, so it makes sense to turn this off if you expect sites to have
|
---|
3565 | more than one version of Emacs installed. Furthermore, many packages
|
---|
3566 | don't actually benefit from byte-compilation. Still, we recommend that
|
---|
3567 | you leave it enabled by default. It is probably better for sites with
|
---|
3568 | strange setups to cope for themselves than to make the installation less
|
---|
3569 | nice for everybody else.
|
---|
3570 |
|
---|
3571 | Lisp sources are not distributed by default. You can prefix the
|
---|
3572 | `LISP' primary with `dist_', as in `dist_lisp_LISP' or
|
---|
3573 | `dist_noinst_LISP', to indicate that these files should be distributed.
|
---|
3574 |
|
---|
3575 |
|
---|
3576 | File: automake.info, Node: gettext, Next: Libtool, Prev: Emacs Lisp, Up: Other GNU Tools
|
---|
3577 |
|
---|
3578 | Gettext
|
---|
3579 | =======
|
---|
3580 |
|
---|
3581 | If `AM_GNU_GETTEXT' is seen in `configure.in', then Automake turns on
|
---|
3582 | support for GNU gettext, a message catalog system for
|
---|
3583 | internationalization (*note GNU Gettext: (gettext)GNU Gettext.).
|
---|
3584 |
|
---|
3585 | The `gettext' support in Automake requires the addition of two
|
---|
3586 | subdirectories to the package, `intl' and `po'. Automake insures that
|
---|
3587 | these directories exist and are mentioned in `SUBDIRS'.
|
---|
3588 |
|
---|
3589 |
|
---|
3590 | File: automake.info, Node: Libtool, Next: Java, Prev: gettext, Up: Other GNU Tools
|
---|
3591 |
|
---|
3592 | Libtool
|
---|
3593 | =======
|
---|
3594 |
|
---|
3595 | Automake provides support for GNU Libtool (*note Introduction:
|
---|
3596 | (libtool)Top.) with the `LTLIBRARIES' primary. *Note A Shared
|
---|
3597 | Library::.
|
---|
3598 |
|
---|
3599 |
|
---|
3600 | File: automake.info, Node: Java, Next: Python, Prev: Libtool, Up: Other GNU Tools
|
---|
3601 |
|
---|
3602 | Java
|
---|
3603 | ====
|
---|
3604 |
|
---|
3605 | Automake provides some minimal support for Java compilation with the
|
---|
3606 | `JAVA' primary.
|
---|
3607 |
|
---|
3608 | Any `.java' files listed in a `_JAVA' variable will be compiled with
|
---|
3609 | `JAVAC' at build time. By default, `.class' files are not included in
|
---|
3610 | the distribution.
|
---|
3611 |
|
---|
3612 | Currently Automake enforces the restriction that only one `_JAVA'
|
---|
3613 | primary can be used in a given `Makefile.am'. The reason for this
|
---|
3614 | restriction is that, in general, it isn't possible to know which
|
---|
3615 | `.class' files were generated from which `.java' files - so it would be
|
---|
3616 | impossible to know which files to install where. For instance, a
|
---|
3617 | `.java' file can define multiple classes; the resulting `.class' file
|
---|
3618 | names cannot be predicted without parsing the `.java' file.
|
---|
3619 |
|
---|
3620 | There are a few variables which are used when compiling Java sources:
|
---|
3621 |
|
---|
3622 | `JAVAC'
|
---|
3623 | The name of the Java compiler. This defaults to `javac'.
|
---|
3624 |
|
---|
3625 | `JAVACFLAGS'
|
---|
3626 | The flags to pass to the compiler. This is considered to be a user
|
---|
3627 | variable (*note User Variables::).
|
---|
3628 |
|
---|
3629 | `AM_JAVACFLAGS'
|
---|
3630 | More flags to pass to the Java compiler. This, and not
|
---|
3631 | `JAVACFLAGS', should be used when it is necessary to put Java
|
---|
3632 | compiler flags into `Makefile.am'.
|
---|
3633 |
|
---|
3634 | `JAVAROOT'
|
---|
3635 | The value of this variable is passed to the `-d' option to
|
---|
3636 | `javac'. It defaults to `$(top_builddir)'.
|
---|
3637 |
|
---|
3638 | `CLASSPATH_ENV'
|
---|
3639 | This variable is an `sh' expression which is used to set the
|
---|
3640 | `CLASSPATH' environment variable on the `javac' command line. (In
|
---|
3641 | the future we will probably handle class path setting differently.)
|
---|
3642 |
|
---|
3643 |
|
---|
3644 | File: automake.info, Node: Python, Prev: Java, Up: Other GNU Tools
|
---|
3645 |
|
---|
3646 | Python
|
---|
3647 | ======
|
---|
3648 |
|
---|
3649 | Automake provides support for Python compilation with the `PYTHON'
|
---|
3650 | primary.
|
---|
3651 |
|
---|
3652 | Any files listed in a `_PYTHON' variable will be byte-compiled with
|
---|
3653 | `py-compile' at install time. `py-compile' actually creates both
|
---|
3654 | standard (`.pyc') and byte-compiled (`.pyo') versions of the source
|
---|
3655 | files. Note that because byte-compilation occurs at install time, any
|
---|
3656 | files listed in `noinst_PYTHON' will not be compiled. Python source
|
---|
3657 | files are included in the distribution by default.
|
---|
3658 |
|
---|
3659 | Automake ships with an Autoconf macro called `AM_PATH_PYTHON' which
|
---|
3660 | will determine some Python-related directory variables (see below). If
|
---|
3661 | you have called `AM_PATH_PYTHON' from `configure.in', then you may use
|
---|
3662 | the following variables to list you Python source files in your
|
---|
3663 | variables: `python_PYTHON', `pkgpython_PYTHON', `pyexecdir_PYTHON',
|
---|
3664 | `pkgpyexecdir_PYTHON', depending where you want your files installed.
|
---|
3665 |
|
---|
3666 | `AM_PATH_PYTHON' takes a single optional argument. This argument,
|
---|
3667 | if present, is the minimum version of Python which can be used for this
|
---|
3668 | package. If the version of Python found on the system is older than the
|
---|
3669 | required version, then `AM_PATH_PYTHON' will cause an error.
|
---|
3670 |
|
---|
3671 | `AM_PATH_PYTHON' creates several output variables based on the
|
---|
3672 | Python installation found during configuration.
|
---|
3673 |
|
---|
3674 | `PYTHON'
|
---|
3675 | The name of the Python executable.
|
---|
3676 |
|
---|
3677 | `PYTHON_VERSION'
|
---|
3678 | The Python version number, in the form MAJOR.MINOR (e.g. `1.5').
|
---|
3679 | This is currently the value of `sys.version[:3]'.
|
---|
3680 |
|
---|
3681 | `PYTHON_PREFIX'
|
---|
3682 | The string `${prefix}'. This term may be used in future work
|
---|
3683 | which needs the contents of Python's `sys.prefix', but general
|
---|
3684 | consensus is to always use the value from configure.
|
---|
3685 |
|
---|
3686 | `PYTHON_EXEC_PREFIX'
|
---|
3687 | The string `${exec_prefix}'. This term may be used in future work
|
---|
3688 | which needs the contents of Python's `sys.exec_prefix', but general
|
---|
3689 | consensus is to always use the value from configure.
|
---|
3690 |
|
---|
3691 | `PYTHON_PLATFORM'
|
---|
3692 | The canonical name used by Python to describe the operating
|
---|
3693 | system, as given by `sys.platform'. This value is sometimes
|
---|
3694 | needed when building Python extensions.
|
---|
3695 |
|
---|
3696 | `pythondir'
|
---|
3697 | The directory name for the `site-packages' subdirectory of the
|
---|
3698 | standard Python install tree.
|
---|
3699 |
|
---|
3700 | `pkgpythondir'
|
---|
3701 | This is is the directory under `pythondir' which is named after the
|
---|
3702 | package. That is, it is `$(pythondir)/$(PACKAGE)'. It is provided
|
---|
3703 | as a convenience.
|
---|
3704 |
|
---|
3705 | `pyexecdir'
|
---|
3706 | This is the directory where Python extension modules (shared
|
---|
3707 | libraries) should be installed.
|
---|
3708 |
|
---|
3709 | `pkgpyexecdir'
|
---|
3710 | This is a convenience variable which is defined as
|
---|
3711 | `$(pyexecdir)/$(PACKAGE)'.
|
---|
3712 |
|
---|
3713 | All these directory variables have values that start with either
|
---|
3714 | `${prefix}' or `${exec_prefix}' unexpanded. This works fine in
|
---|
3715 | `Makefiles', but it makes these variables hard to use in `configure'.
|
---|
3716 | This is mandated by the GNU coding standards, so that the user can run
|
---|
3717 | `make prefix=/foo install'. The Autoconf manual has a section with
|
---|
3718 | more details on this topic (*note Installation Directory Variables:
|
---|
3719 | (autoconf)Installation Directory Variables.).
|
---|
3720 |
|
---|
3721 |
|
---|
3722 | File: automake.info, Node: Documentation, Next: Install, Prev: Other GNU Tools, Up: Top
|
---|
3723 |
|
---|
3724 | Building documentation
|
---|
3725 | **********************
|
---|
3726 |
|
---|
3727 | Currently Automake provides support for Texinfo and man pages.
|
---|
3728 |
|
---|
3729 | * Menu:
|
---|
3730 |
|
---|
3731 | * Texinfo:: Texinfo
|
---|
3732 | * Man pages:: Man pages
|
---|
3733 |
|
---|
3734 |
|
---|
3735 | File: automake.info, Node: Texinfo, Next: Man pages, Prev: Documentation, Up: Documentation
|
---|
3736 |
|
---|
3737 | Texinfo
|
---|
3738 | =======
|
---|
3739 |
|
---|
3740 | If the current directory contains Texinfo source, you must declare it
|
---|
3741 | with the `TEXINFOS' primary. Generally Texinfo files are converted
|
---|
3742 | into info, and thus the `info_TEXINFOS' variable is most commonly used
|
---|
3743 | here. Any Texinfo source file must end in the `.texi', `.txi', or
|
---|
3744 | `.texinfo' extension. We recommend `.texi' for new manuals.
|
---|
3745 |
|
---|
3746 | Automake generates rules to build `.info', `.dvi', `.ps', and `.pdf'
|
---|
3747 | files from your Texinfo sources. The `.info' files are built by `make
|
---|
3748 | all' and installed by `make install' (unless you use `no-installinfo',
|
---|
3749 | see below). The other files can be built on request by `make dvi',
|
---|
3750 | `make ps', and `make pdf'.
|
---|
3751 |
|
---|
3752 | If the `.texi' file `@include's `version.texi', then that file will
|
---|
3753 | be automatically generated. The file `version.texi' defines four
|
---|
3754 | Texinfo flag you can reference using `@value{EDITION}',
|
---|
3755 | `@value{VERSION}', `@value{UPDATED}', and `@value{UPDATED-MONTH}'.
|
---|
3756 |
|
---|
3757 | `EDITION'
|
---|
3758 | `VERSION'
|
---|
3759 | Both of these flags hold the version number of your program. They
|
---|
3760 | are kept separate for clarity.
|
---|
3761 |
|
---|
3762 | `UPDATED'
|
---|
3763 | This holds the date the primary `.texi' file was last modified.
|
---|
3764 |
|
---|
3765 | `UPDATED-MONTH'
|
---|
3766 | This holds the name of the month in which the primary `.texi' file
|
---|
3767 | was last modified.
|
---|
3768 |
|
---|
3769 | The `version.texi' support requires the `mdate-sh' program; this
|
---|
3770 | program is supplied with Automake and automatically included when
|
---|
3771 | `automake' is invoked with the `--add-missing' option.
|
---|
3772 |
|
---|
3773 | If you have multiple Texinfo files, and you want to use the
|
---|
3774 | `version.texi' feature, then you have to have a separate version file
|
---|
3775 | for each Texinfo file. Automake will treat any include in a Texinfo
|
---|
3776 | file that matches `vers*.texi' just as an automatically generated
|
---|
3777 | version file.
|
---|
3778 |
|
---|
3779 | When an info file is rebuilt, the program named by the `MAKEINFO'
|
---|
3780 | variable is used to invoke it. If the `makeinfo' program is found on
|
---|
3781 | the system then it will be used by default; otherwise `missing' will be
|
---|
3782 | used instead. The flags in the variables `MAKEINFOFLAGS' and
|
---|
3783 | `AM_MAKEINFOFLAGS' will be passed to the `makeinfo' invocation; the
|
---|
3784 | first of these is intended for use by the user (*note User Variables::)
|
---|
3785 | and the second by the `Makefile.am' writer.
|
---|
3786 |
|
---|
3787 | Sometimes an info file actually depends on more than one `.texi'
|
---|
3788 | file. For instance, in GNU Hello, `hello.texi' includes the file
|
---|
3789 | `gpl.texi'. You can tell Automake about these dependencies using the
|
---|
3790 | `TEXI_TEXINFOS' variable. Here is how GNU Hello does it:
|
---|
3791 |
|
---|
3792 | info_TEXINFOS = hello.texi
|
---|
3793 | hello_TEXINFOS = gpl.texi
|
---|
3794 |
|
---|
3795 | By default, Automake requires the file `texinfo.tex' to appear in
|
---|
3796 | the same directory as the Texinfo source. However, if you used
|
---|
3797 | `AC_CONFIG_AUX_DIR' in `configure.in' (*note Finding `configure' Input:
|
---|
3798 | (autoconf)Input.), then `texinfo.tex' is looked for there. Automake
|
---|
3799 | supplies `texinfo.tex' if `--add-missing' is given.
|
---|
3800 |
|
---|
3801 | If your package has Texinfo files in many directories, you can use
|
---|
3802 | the variable `TEXINFO_TEX' to tell Automake where to find the canonical
|
---|
3803 | `texinfo.tex' for your package. The value of this variable should be
|
---|
3804 | the relative path from the current `Makefile.am' to `texinfo.tex':
|
---|
3805 |
|
---|
3806 | TEXINFO_TEX = ../doc/texinfo.tex
|
---|
3807 |
|
---|
3808 | The option `no-texinfo.tex' can be used to eliminate the requirement
|
---|
3809 | for `texinfo.tex'. Use of the variable `TEXINFO_TEX' is preferable,
|
---|
3810 | however, because that allows the `dvi', `ps', and `pdf' targets to
|
---|
3811 | still work.
|
---|
3812 |
|
---|
3813 | Automake generates an `install-info' target; some people apparently
|
---|
3814 | use this. By default, info pages are installed by `make install'.
|
---|
3815 | This can be prevented via the `no-installinfo' option.
|
---|
3816 |
|
---|
3817 |
|
---|
3818 | File: automake.info, Node: Man pages, Prev: Texinfo, Up: Documentation
|
---|
3819 |
|
---|
3820 | Man pages
|
---|
3821 | =========
|
---|
3822 |
|
---|
3823 | A package can also include man pages (but see the GNU standards on this
|
---|
3824 | matter, *Note Man Pages: (standards)Man Pages.) Man pages are declared
|
---|
3825 | using the `MANS' primary. Generally the `man_MANS' variable is used.
|
---|
3826 | Man pages are automatically installed in the correct subdirectory of
|
---|
3827 | `mandir', based on the file extension.
|
---|
3828 |
|
---|
3829 | File extensions such as `.1c' are handled by looking for the valid
|
---|
3830 | part of the extension and using that to determine the correct
|
---|
3831 | subdirectory of `mandir'. Valid section names are the digits `0'
|
---|
3832 | through `9', and the letters `l' and `n'.
|
---|
3833 |
|
---|
3834 | Sometimes developers prefer to name a man page something like
|
---|
3835 | `foo.man' in the source, and then rename it to have the correct suffix,
|
---|
3836 | e.g. `foo.1', when installing the file. Automake also supports this
|
---|
3837 | mode. For a valid section named SECTION, there is a corresponding
|
---|
3838 | directory named `manSECTIONdir', and a corresponding `_MANS' variable.
|
---|
3839 | Files listed in such a variable are installed in the indicated section.
|
---|
3840 | If the file already has a valid suffix, then it is installed as-is;
|
---|
3841 | otherwise the file suffix is changed to match the section.
|
---|
3842 |
|
---|
3843 | For instance, consider this example:
|
---|
3844 | man1_MANS = rename.man thesame.1 alsothesame.1c
|
---|
3845 |
|
---|
3846 | In this case, `rename.man' will be renamed to `rename.1' when
|
---|
3847 | installed, but the other files will keep their names.
|
---|
3848 |
|
---|
3849 | By default, man pages are installed by `make install'. However,
|
---|
3850 | since the GNU project does not require man pages, many maintainers do
|
---|
3851 | not expend effort to keep the man pages up to date. In these cases, the
|
---|
3852 | `no-installman' option will prevent the man pages from being installed
|
---|
3853 | by default. The user can still explicitly install them via `make
|
---|
3854 | install-man'.
|
---|
3855 |
|
---|
3856 | Here is how the man pages are handled in GNU `cpio' (which includes
|
---|
3857 | both Texinfo documentation and man pages):
|
---|
3858 |
|
---|
3859 | man_MANS = cpio.1 mt.1
|
---|
3860 | EXTRA_DIST = $(man_MANS)
|
---|
3861 |
|
---|
3862 | Man pages are not currently considered to be source, because it is
|
---|
3863 | not uncommon for man pages to be automatically generated. Therefore
|
---|
3864 | they are not automatically included in the distribution. However, this
|
---|
3865 | can be changed by use of the `dist_' prefix.
|
---|
3866 |
|
---|
3867 | The `nobase_' prefix is meaningless for man pages and is disallowed.
|
---|
3868 |
|
---|
3869 |
|
---|
3870 | File: automake.info, Node: Install, Next: Clean, Prev: Documentation, Up: Top
|
---|
3871 |
|
---|
3872 | What Gets Installed
|
---|
3873 | *******************
|
---|
3874 |
|
---|
3875 | Basics of installation
|
---|
3876 | ======================
|
---|
3877 |
|
---|
3878 | Naturally, Automake handles the details of actually installing your
|
---|
3879 | program once it has been built. All files named by the various
|
---|
3880 | primaries are automatically installed in the appropriate places when the
|
---|
3881 | user runs `make install'.
|
---|
3882 |
|
---|
3883 | A file named in a primary is installed by copying the built file into
|
---|
3884 | the appropriate directory. The base name of the file is used when
|
---|
3885 | installing.
|
---|
3886 |
|
---|
3887 | bin_PROGRAMS = hello subdir/goodbye
|
---|
3888 |
|
---|
3889 | In this example, both `hello' and `goodbye' will be installed in
|
---|
3890 | `$(bindir)'.
|
---|
3891 |
|
---|
3892 | Sometimes it is useful to avoid the basename step at install time.
|
---|
3893 | For instance, you might have a number of header files in subdirectories
|
---|
3894 | of the source tree which are laid out precisely how you want to install
|
---|
3895 | them. In this situation you can use the `nobase_' prefix to suppress
|
---|
3896 | the base name step. For example:
|
---|
3897 |
|
---|
3898 | nobase_include_HEADERS = stdio.h sys/types.h
|
---|
3899 |
|
---|
3900 | Will install `stdio.h' in `$(includedir)' and `types.h' in
|
---|
3901 | `$(includedir)/sys'.
|
---|
3902 |
|
---|
3903 | The two parts of install
|
---|
3904 | ========================
|
---|
3905 |
|
---|
3906 | Automake generates separate `install-data' and `install-exec' targets,
|
---|
3907 | in case the installer is installing on multiple machines which share
|
---|
3908 | directory structure--these targets allow the machine-independent parts
|
---|
3909 | to be installed only once. `install-exec' installs platform-dependent
|
---|
3910 | files, and `install-data' installs platform-independent files. The
|
---|
3911 | `install' target depends on both of these targets. While Automake
|
---|
3912 | tries to automatically segregate objects into the correct category, the
|
---|
3913 | `Makefile.am' author is, in the end, responsible for making sure this
|
---|
3914 | is done correctly.
|
---|
3915 |
|
---|
3916 | Variables using the standard directory prefixes `data', `info',
|
---|
3917 | `man', `include', `oldinclude', `pkgdata', or `pkginclude' (e.g.
|
---|
3918 | `data_DATA') are installed by `install-data'.
|
---|
3919 |
|
---|
3920 | Variables using the standard directory prefixes `bin', `sbin',
|
---|
3921 | `libexec', `sysconf', `localstate', `lib', or `pkglib' (e.g.
|
---|
3922 | `bin_PROGRAMS') are installed by `install-exec'.
|
---|
3923 |
|
---|
3924 | Any variable using a user-defined directory prefix with `exec' in
|
---|
3925 | the name (e.g. `myexecbin_PROGRAMS' is installed by `install-exec'.
|
---|
3926 | All other user-defined prefixes are installed by `install-data'.
|
---|
3927 |
|
---|
3928 | Extending installation
|
---|
3929 | ======================
|
---|
3930 |
|
---|
3931 | It is possible to extend this mechanism by defining an
|
---|
3932 | `install-exec-local' or `install-data-local' target. If these targets
|
---|
3933 | exist, they will be run at `make install' time. These rules can do
|
---|
3934 | almost anything; care is required.
|
---|
3935 |
|
---|
3936 | Automake also supports two install hooks, `install-exec-hook' and
|
---|
3937 | `install-data-hook'. These hooks are run after all other install rules
|
---|
3938 | of the appropriate type, exec or data, have completed. So, for
|
---|
3939 | instance, it is possible to perform post-installation modifications
|
---|
3940 | using an install hook.
|
---|
3941 |
|
---|
3942 | Staged installs
|
---|
3943 | ===============
|
---|
3944 |
|
---|
3945 | Automake generates support for the `DESTDIR' variable in all install
|
---|
3946 | rules. `DESTDIR' is used during the `make install' step to relocate
|
---|
3947 | install objects into a staging area. Each object and path is prefixed
|
---|
3948 | with the value of `DESTDIR' before being copied into the install area.
|
---|
3949 | Here is an example of typical DESTDIR usage:
|
---|
3950 |
|
---|
3951 | make DESTDIR=/tmp/staging install
|
---|
3952 |
|
---|
3953 | This places install objects in a directory tree built under
|
---|
3954 | `/tmp/staging'. If `/gnu/bin/foo' and `/gnu/share/aclocal/foo.m4' are
|
---|
3955 | to be installed, the above command would install
|
---|
3956 | `/tmp/staging/gnu/bin/foo' and `/tmp/staging/gnu/share/aclocal/foo.m4'.
|
---|
3957 |
|
---|
3958 | This feature is commonly used to build install images and packages.
|
---|
3959 | For more information, see *Note Makefile Conventions:
|
---|
3960 | (standards)Makefile Conventions.
|
---|
3961 |
|
---|
3962 | Support for `DESTDIR' is implemented by coding it directly into the
|
---|
3963 | install rules. If your `Makefile.am' uses a local install rule (e.g.,
|
---|
3964 | `install-exec-local') or an install hook, then you must write that code
|
---|
3965 | to respect `DESTDIR'.
|
---|
3966 |
|
---|
3967 | Rules for the user
|
---|
3968 | ==================
|
---|
3969 |
|
---|
3970 | Automake also generates an `uninstall' target, an `installdirs' target,
|
---|
3971 | and an `install-strip' target.
|
---|
3972 |
|
---|
3973 | Automake supports `uninstall-local' and `uninstall-hook'. There is
|
---|
3974 | no notion of separate uninstalls for "exec" and "data", as these
|
---|
3975 | features would not provide additional functionality.
|
---|
3976 |
|
---|
3977 | Note that `uninstall' is not meant as a replacement for a real
|
---|
3978 | packaging tool.
|
---|
3979 |
|
---|
3980 |
|
---|
3981 | File: automake.info, Node: Clean, Next: Dist, Prev: Install, Up: Top
|
---|
3982 |
|
---|
3983 | What Gets Cleaned
|
---|
3984 | *****************
|
---|
3985 |
|
---|
3986 | The GNU Makefile Standards specify a number of different clean rules.
|
---|
3987 | See *Note Standard Targets for Users: (standards)Standard Targets.
|
---|
3988 |
|
---|
3989 | Generally the files that can be cleaned are determined automatically
|
---|
3990 | by Automake. Of course, Automake also recognizes some variables that
|
---|
3991 | can be defined to specify additional files to clean. These variables
|
---|
3992 | are `MOSTLYCLEANFILES', `CLEANFILES', `DISTCLEANFILES', and
|
---|
3993 | `MAINTAINERCLEANFILES'.
|
---|
3994 |
|
---|
3995 | As the GNU Standards aren't always explicit as to which files should
|
---|
3996 | be removed by which target, we've adopted a heuristic which we believe
|
---|
3997 | was first formulated by Franc,ois Pinard:
|
---|
3998 |
|
---|
3999 | * If `make' built it, and it is commonly something that one would
|
---|
4000 | want to rebuild (for instance, a `.o' file), then `mostlyclean'
|
---|
4001 | should delete it.
|
---|
4002 |
|
---|
4003 | * Otherwise, if `make' built it, then `clean' should delete it.
|
---|
4004 |
|
---|
4005 | * If `configure' built it, then `distclean' should delete it.
|
---|
4006 |
|
---|
4007 | * If the maintainer built it (for instance, a `.info' file), then
|
---|
4008 | `maintainer-clean' should delete it. However `maintainer-clean'
|
---|
4009 | should not delete anything that needs to exist in order to run
|
---|
4010 | `./configure && make'.
|
---|
4011 |
|
---|
4012 | We recommend that you follow this same set of heuristics in your
|
---|
4013 | `Makefile.am'.
|
---|
4014 |
|
---|
4015 |
|
---|
4016 | File: automake.info, Node: Dist, Next: Tests, Prev: Clean, Up: Top
|
---|
4017 |
|
---|
4018 | What Goes in a Distribution
|
---|
4019 | ***************************
|
---|
4020 |
|
---|
4021 | Basics of distribution
|
---|
4022 | ======================
|
---|
4023 |
|
---|
4024 | The `dist' target in the generated `Makefile.in' can be used to
|
---|
4025 | generate a gzip'd `tar' file and other flavors of archive for
|
---|
4026 | distribution. The files is named based on the `PACKAGE' and `VERSION'
|
---|
4027 | variables defined by `AM_INIT_AUTOMAKE' (*note Macros::); more
|
---|
4028 | precisely the gzip'd `tar' file is named `PACKAGE-VERSION.tar.gz'. You
|
---|
4029 | can use the `make' variable `GZIP_ENV' to control how gzip is run. The
|
---|
4030 | default setting is `--best'.
|
---|
4031 |
|
---|
4032 | For the most part, the files to distribute are automatically found by
|
---|
4033 | Automake: all source files are automatically included in a distribution,
|
---|
4034 | as are all `Makefile.am's and `Makefile.in's. Automake also has a
|
---|
4035 | built-in list of commonly used files which are automatically included
|
---|
4036 | if they are found in the current directory (either physically, or as
|
---|
4037 | the target of a `Makefile.am' rule). This list is printed by `automake
|
---|
4038 | --help'. Also, files which are read by `configure' (i.e. the source
|
---|
4039 | files corresponding to the files specified in various Autoconf macros
|
---|
4040 | such as `AC_CONFIG_FILES' and siblings) are automatically distributed.
|
---|
4041 | Helper scripts installed with `automake --add-missing' are also
|
---|
4042 | distributed.
|
---|
4043 |
|
---|
4044 | Still, sometimes there are files which must be distributed, but which
|
---|
4045 | are not covered in the automatic rules. These files should be listed in
|
---|
4046 | the `EXTRA_DIST' variable. You can mention files from subdirectories
|
---|
4047 | in `EXTRA_DIST'.
|
---|
4048 |
|
---|
4049 | You can also mention a directory in `EXTRA_DIST'; in this case the
|
---|
4050 | entire directory will be recursively copied into the distribution.
|
---|
4051 | Please note that this will also copy _everything_ in the directory,
|
---|
4052 | including CVS/RCS version control files. We recommend against using
|
---|
4053 | this feature.
|
---|
4054 |
|
---|
4055 | If you define `SUBDIRS', Automake will recursively include the
|
---|
4056 | subdirectories in the distribution. If `SUBDIRS' is defined
|
---|
4057 | conditionally (*note Conditionals::), Automake will normally include all
|
---|
4058 | directories that could possibly appear in `SUBDIRS' in the
|
---|
4059 | distribution. If you need to specify the set of directories
|
---|
4060 | conditionally, you can set the variable `DIST_SUBDIRS' to the exact
|
---|
4061 | list of subdirectories to include in the distribution (*note Top
|
---|
4062 | level::).
|
---|
4063 |
|
---|
4064 | Fine-grained distribution control
|
---|
4065 | =================================
|
---|
4066 |
|
---|
4067 | Sometimes you need tighter control over what does _not_ go into the
|
---|
4068 | distribution; for instance you might have source files which are
|
---|
4069 | generated and which you do not want to distribute. In this case
|
---|
4070 | Automake gives fine-grained control using the `dist' and `nodist'
|
---|
4071 | prefixes. Any primary or `_SOURCES' variable can be prefixed with
|
---|
4072 | `dist_' to add the listed files to the distribution. Similarly,
|
---|
4073 | `nodist_' can be used to omit the files from the distribution.
|
---|
4074 |
|
---|
4075 | As an example, here is how you would cause some data to be
|
---|
4076 | distributed while leaving some source code out of the distribution:
|
---|
4077 |
|
---|
4078 | dist_data_DATA = distribute-this
|
---|
4079 | bin_PROGRAMS = foo
|
---|
4080 | nodist_foo_SOURCES = do-not-distribute.c
|
---|
4081 |
|
---|
4082 | The dist hook
|
---|
4083 | =============
|
---|
4084 |
|
---|
4085 | Occasionally it is useful to be able to change the distribution before
|
---|
4086 | it is packaged up. If the `dist-hook' target exists, it is run after
|
---|
4087 | the distribution directory is filled, but before the actual tar (or
|
---|
4088 | shar) file is created. One way to use this is for distributing files
|
---|
4089 | in subdirectories for which a new `Makefile.am' is overkill:
|
---|
4090 |
|
---|
4091 | dist-hook:
|
---|
4092 | mkdir $(distdir)/random
|
---|
4093 | cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random
|
---|
4094 |
|
---|
4095 | Another way to to use this is for removing unnecessary files that get
|
---|
4096 | recursively included by specifying a directory in EXTRA_DIST:
|
---|
4097 |
|
---|
4098 | EXTRA_DIST = doc
|
---|
4099 |
|
---|
4100 | dist-hook:
|
---|
4101 | rm -rf `find $(distdir)/doc -name CVS`
|
---|
4102 |
|
---|
4103 | Checking the distribution
|
---|
4104 | =========================
|
---|
4105 |
|
---|
4106 | Automake also generates a `distcheck' target which can be of help to
|
---|
4107 | ensure that a given distribution will actually work. `distcheck' makes
|
---|
4108 | a distribution, then tries to do a `VPATH' build, run the test suite,
|
---|
4109 | and finally make another tarfile to ensure the distribution is
|
---|
4110 | self-contained.
|
---|
4111 |
|
---|
4112 | Building the package involves running `./configure'. If you need to
|
---|
4113 | supply additional flags to `configure', define them in the
|
---|
4114 | `DISTCHECK_CONFIGURE_FLAGS' variable, either in your top-level
|
---|
4115 | `Makefile.am', or on the command line when invoking `make'.
|
---|
4116 |
|
---|
4117 | If the target `distcheck-hook' is defined in your `Makefile.am',
|
---|
4118 | then it will be invoked by `distcheck' after the new distribution has
|
---|
4119 | been unpacked, but before the unpacked copy is configured and built.
|
---|
4120 | Your `distcheck-hook' can do almost anything, though as always caution
|
---|
4121 | is advised. Generally this hook is used to check for potential
|
---|
4122 | distribution errors not caught by the standard mechanism.
|
---|
4123 |
|
---|
4124 | Speaking about potential distribution errors, `distcheck' will also
|
---|
4125 | ensure that the `distclean' target actually removes all built files.
|
---|
4126 | This is done by running `make distcleancheck' at the end of the `VPATH'
|
---|
4127 | build. By default, `distcleancheck' will run `distclean' and then make
|
---|
4128 | sure the build tree has been emptied by running
|
---|
4129 | `$(distcleancheck_listfiles)'. Usually this check will find generated
|
---|
4130 | files that you forgot to add to the `DISTCLEANFILES' variable (*note
|
---|
4131 | Clean::).
|
---|
4132 |
|
---|
4133 | The `distcleancheck' behavior should be OK for most packages,
|
---|
4134 | otherwise you have the possibility to override the definition of either
|
---|
4135 | the `distcleancheck' target, or the `$(distcleancheck_listfiles)'
|
---|
4136 | variable. For instance to disable `distcleancheck' completely, add the
|
---|
4137 | following rule to your top-level `Makefile.am':
|
---|
4138 |
|
---|
4139 | distcleancheck:
|
---|
4140 | @:
|
---|
4141 |
|
---|
4142 | If you want `distcleancheck' to ignore built files which have not
|
---|
4143 | been cleaned because they are also part of the distribution, add the
|
---|
4144 | following definition instead:
|
---|
4145 |
|
---|
4146 | distcleancheck_listfiles = \
|
---|
4147 | find -type f -exec sh -c 'test -f $(srcdir)/{} || echo {}' ';'
|
---|
4148 |
|
---|
4149 | The above definition is not the default because it's usually an
|
---|
4150 | error if your Makefiles cause some distributed files to be rebuilt when
|
---|
4151 | the user build the package. (Think about the user missing the tool
|
---|
4152 | required to build the file; or if the required tool is built by your
|
---|
4153 | package, consider the cross-compilation case where it can't be run.)
|
---|
4154 | There is a FAQ entry about this (*note distcleancheck::), make sure you
|
---|
4155 | read it before playing with `distcleancheck_listfiles'.
|
---|
4156 |
|
---|
4157 | `distcheck' also checks that the `uninstall' target works properly,
|
---|
4158 | both for ordinary and `DESTDIR' builds. It does this by invoking `make
|
---|
4159 | uninstall', and then it checks the install tree to see if any files are
|
---|
4160 | left over. This check will make sure that you correctly coded your
|
---|
4161 | `uninstall'-related targets.
|
---|
4162 |
|
---|
4163 | By default, the checking is done by the `distuninstallcheck' target,
|
---|
4164 | and the list of files in the install tree is generated by
|
---|
4165 | `$(distuninstallcheck_listfiles') (this is a variable whose value is a
|
---|
4166 | shell command to run that prints the list of files to stdout).
|
---|
4167 |
|
---|
4168 | Either of these can be overridden to modify the behavior of
|
---|
4169 | `distcheck'. For instance, to disable this check completely, you would
|
---|
4170 | write:
|
---|
4171 |
|
---|
4172 | distuninstallcheck:
|
---|
4173 | @:
|
---|
4174 |
|
---|
4175 | The types of distributions
|
---|
4176 | ==========================
|
---|
4177 |
|
---|
4178 | Automake generates a `.tar.gz' file when asked to create a distribution
|
---|
4179 | and other archives formats, *Note Options::. The target `dist-gzip'
|
---|
4180 | generates the `.tar.gz' file only.
|
---|
4181 |
|
---|
4182 |
|
---|
4183 | File: automake.info, Node: Tests, Next: Options, Prev: Dist, Up: Top
|
---|
4184 |
|
---|
4185 | Support for test suites
|
---|
4186 | ***********************
|
---|
4187 |
|
---|
4188 | Automake supports two forms of test suites.
|
---|
4189 |
|
---|
4190 | Simple Tests
|
---|
4191 | ============
|
---|
4192 |
|
---|
4193 | If the variable `TESTS' is defined, its value is taken to be a list of
|
---|
4194 | programs to run in order to do the testing. The programs can either be
|
---|
4195 | derived objects or source objects; the generated rule will look both in
|
---|
4196 | `srcdir' and `.'. Programs needing data files should look for them in
|
---|
4197 | `srcdir' (which is both an environment variable and a make variable) so
|
---|
4198 | they work when building in a separate directory (*note Build
|
---|
4199 | Directories: (autoconf)Build Directories.), and in particular for the
|
---|
4200 | `distcheck' target (*note Dist::).
|
---|
4201 |
|
---|
4202 | The number of failures will be printed at the end of the run. If a
|
---|
4203 | given test program exits with a status of 77, then its result is ignored
|
---|
4204 | in the final count. This feature allows non-portable tests to be
|
---|
4205 | ignored in environments where they don't make sense.
|
---|
4206 |
|
---|
4207 | The variable `TESTS_ENVIRONMENT' can be used to set environment
|
---|
4208 | variables for the test run; the environment variable `srcdir' is set in
|
---|
4209 | the rule. If all your test programs are scripts, you can also set
|
---|
4210 | `TESTS_ENVIRONMENT' to an invocation of the shell (e.g. `$(SHELL)
|
---|
4211 | -x'); this can be useful for debugging the tests.
|
---|
4212 |
|
---|
4213 | You may define the variable `XFAIL_TESTS' to a list of tests
|
---|
4214 | (usually a subset of `TESTS') that are expected to fail. This will
|
---|
4215 | reverse the result of those tests.
|
---|
4216 |
|
---|
4217 | Automake ensures that each program listed in `TESTS' is built before
|
---|
4218 | any tests are run; you can list both source and derived programs in
|
---|
4219 | `TESTS'. For instance, you might want to run a C program as a test.
|
---|
4220 | To do this you would list its name in `TESTS' and also in
|
---|
4221 | `check_PROGRAMS', and then specify it as you would any other program.
|
---|
4222 |
|
---|
4223 | DejaGnu Tests
|
---|
4224 | =============
|
---|
4225 |
|
---|
4226 | If `dejagnu' (ftp://ftp.gnu.org/gnu/dejagnu/) appears in
|
---|
4227 | `AUTOMAKE_OPTIONS', then a `dejagnu'-based test suite is assumed. The
|
---|
4228 | variable `DEJATOOL' is a list of names which are passed, one at a time,
|
---|
4229 | as the `--tool' argument to `runtest' invocations; it defaults to the
|
---|
4230 | name of the package.
|
---|
4231 |
|
---|
4232 | The variable `RUNTESTDEFAULTFLAGS' holds the `--tool' and `--srcdir'
|
---|
4233 | flags that are passed to dejagnu by default; this can be overridden if
|
---|
4234 | necessary.
|
---|
4235 |
|
---|
4236 | The variables `EXPECT' and `RUNTEST' can also be overridden to
|
---|
4237 | provide project-specific values. For instance, you will need to do
|
---|
4238 | this if you are testing a compiler toolchain, because the default
|
---|
4239 | values do not take into account host and target names.
|
---|
4240 |
|
---|
4241 | The contents of the variable `RUNTESTFLAGS' are passed to the
|
---|
4242 | `runtest' invocation. This is considered a "user variable" (*note User
|
---|
4243 | Variables::). If you need to set `runtest' flags in `Makefile.am', you
|
---|
4244 | can use `AM_RUNTESTFLAGS' instead.
|
---|
4245 |
|
---|
4246 | Automake will generate rules to create a local `site.exp' file,
|
---|
4247 | defining various variables detected by `./configure'. This file is
|
---|
4248 | automatically read by DejaGnu. It is OK for the user of a package to
|
---|
4249 | edit this file in order to tune the test suite. However this is not
|
---|
4250 | the place where the test suite author should define new variables: this
|
---|
4251 | should be done elsewhere in the real test suite code. Especially,
|
---|
4252 | `site.exp' should not be distributed.
|
---|
4253 |
|
---|
4254 | For more information regarding DejaGnu test suites, see *Note Top:
|
---|
4255 | (dejagnu)Top.
|
---|
4256 |
|
---|
4257 | In either case, the testing is done via `make check'.
|
---|
4258 |
|
---|
4259 | Install Tests
|
---|
4260 | =============
|
---|
4261 |
|
---|
4262 | The `installcheck' target is available to the user as a way to run any
|
---|
4263 | tests after the package has been installed. You can add tests to this
|
---|
4264 | by writing an `installcheck-local' target.
|
---|
4265 |
|
---|
4266 |
|
---|
4267 | File: automake.info, Node: Options, Next: Miscellaneous, Prev: Tests, Up: Top
|
---|
4268 |
|
---|
4269 | Changing Automake's Behavior
|
---|
4270 | ****************************
|
---|
4271 |
|
---|
4272 | Various features of Automake can be controlled by options in the
|
---|
4273 | `Makefile.am'. Such options are applied on a per-`Makefile' basis when
|
---|
4274 | listed in a special `Makefile' variable named `AUTOMAKE_OPTIONS'. They
|
---|
4275 | are applied globally to all processed `Makefiles' when listed in the
|
---|
4276 | first argument of `AM_INIT_AUTOMAKE' in `configure.in'. Currently
|
---|
4277 | understood options are:
|
---|
4278 |
|
---|
4279 | `gnits'
|
---|
4280 | `gnu'
|
---|
4281 | `foreign'
|
---|
4282 | `cygnus'
|
---|
4283 | Set the strictness as appropriate. The `gnits' option also implies
|
---|
4284 | `readme-alpha' and `check-news'.
|
---|
4285 |
|
---|
4286 | `ansi2knr'
|
---|
4287 | `PATH/ansi2knr'
|
---|
4288 | Turn on automatic de-ANSI-fication. *Note ANSI::. If preceded by
|
---|
4289 | a path, the generated `Makefile.in' will look in the specified
|
---|
4290 | directory to find the `ansi2knr' program. The path should be a
|
---|
4291 | relative path to another directory in the same distribution
|
---|
4292 | (Automake currently does not check this).
|
---|
4293 |
|
---|
4294 | `check-news'
|
---|
4295 | Cause `make dist' to fail unless the current version number appears
|
---|
4296 | in the first few lines of the `NEWS' file.
|
---|
4297 |
|
---|
4298 | `dejagnu'
|
---|
4299 | Cause `dejagnu'-specific rules to be generated. *Note Tests::.
|
---|
4300 |
|
---|
4301 | `dist-bzip2'
|
---|
4302 | Generate a `dist-bzip2' target, creating a bzip2 tar archive of the
|
---|
4303 | distribution. `dist' will create it in addition to the other
|
---|
4304 | formats. bzip2 archives are frequently smaller than gzipped
|
---|
4305 | archives.
|
---|
4306 |
|
---|
4307 | `dist-shar'
|
---|
4308 | Generate a `dist-shar' target, creating a shar archive of the
|
---|
4309 | distribution. `dist' will create it in addition to the other
|
---|
4310 | formats.
|
---|
4311 |
|
---|
4312 | `dist-zip'
|
---|
4313 | Generate a `dist-zip' target, creating a zip archive of the
|
---|
4314 | distribution. `dist' will create it in addition to the other
|
---|
4315 | formats.
|
---|
4316 |
|
---|
4317 | `dist-tarZ'
|
---|
4318 | Generate a `dist-tarZ' target, creating a compressed tar archive of
|
---|
4319 | the distribution. `dist' will create it in addition to the other
|
---|
4320 | formats.
|
---|
4321 |
|
---|
4322 | `no-define'
|
---|
4323 | This options is meaningful only when passed as an argument to
|
---|
4324 | `AM_INIT_AUTOMAKE'. It will prevent the `PACKAGE' and `VERSION'
|
---|
4325 | variables to be `AC_DEFINE'd.
|
---|
4326 |
|
---|
4327 | `no-dependencies'
|
---|
4328 | This is similar to using `--include-deps' on the command line, but
|
---|
4329 | is useful for those situations where you don't have the necessary
|
---|
4330 | bits to make automatic dependency tracking work *Note
|
---|
4331 | Dependencies::. In this case the effect is to effectively disable
|
---|
4332 | automatic dependency tracking.
|
---|
4333 |
|
---|
4334 | `no-exeext'
|
---|
4335 | If your `Makefile.am' defines a target `foo', it will override a
|
---|
4336 | target named `foo$(EXEEXT)'. This is necessary when `EXEEXT' is
|
---|
4337 | found to be empty. However, by default automake will generate an
|
---|
4338 | error for this use. The `no-exeext' option will disable this
|
---|
4339 | error. This is intended for use only where it is known in advance
|
---|
4340 | that the package will not be ported to Windows, or any other
|
---|
4341 | operating system using extensions on executables.
|
---|
4342 |
|
---|
4343 | `no-installinfo'
|
---|
4344 | The generated `Makefile.in' will not cause info pages to be built
|
---|
4345 | or installed by default. However, `info' and `install-info'
|
---|
4346 | targets will still be available. This option is disallowed at
|
---|
4347 | `GNU' strictness and above.
|
---|
4348 |
|
---|
4349 | `no-installman'
|
---|
4350 | The generated `Makefile.in' will not cause man pages to be
|
---|
4351 | installed by default. However, an `install-man' target will still
|
---|
4352 | be available for optional installation. This option is disallowed
|
---|
4353 | at `GNU' strictness and above.
|
---|
4354 |
|
---|
4355 | `nostdinc'
|
---|
4356 | This option can be used to disable the standard `-I' options which
|
---|
4357 | are ordinarily automatically provided by Automake.
|
---|
4358 |
|
---|
4359 | `no-texinfo.tex'
|
---|
4360 | Don't require `texinfo.tex', even if there are texinfo files in
|
---|
4361 | this directory.
|
---|
4362 |
|
---|
4363 | `readme-alpha'
|
---|
4364 | If this release is an alpha release, and the file `README-alpha'
|
---|
4365 | exists, then it will be added to the distribution. If this option
|
---|
4366 | is given, version numbers are expected to follow one of two forms.
|
---|
4367 | The first form is `MAJOR.MINOR.ALPHA', where each element is a
|
---|
4368 | number; the final period and number should be left off for
|
---|
4369 | non-alpha releases. The second form is `MAJOR.MINORALPHA', where
|
---|
4370 | ALPHA is a letter; it should be omitted for non-alpha releases.
|
---|
4371 |
|
---|
4372 | `std-options'
|
---|
4373 | Make the `installcheck' target check that installed scripts and
|
---|
4374 | programs support the `--help' and `--version' options. This also
|
---|
4375 | provides a basic check that the program's run-time dependencies
|
---|
4376 | are satisfied after installation.
|
---|
4377 |
|
---|
4378 | In a few situations, programs (or scripts) have to be exempted
|
---|
4379 | from this test. For instance `false' (from GNU sh-utils) is never
|
---|
4380 | successful, even for `--help' or `--version'. You can list such
|
---|
4381 | programs in the variable `AM_INSTALLCHECK_STD_OPTIONS_EXEMPT'.
|
---|
4382 | Programs (not scripts) listed in this variable should be suffixed
|
---|
4383 | by `$(EXEEXT)' for the sake of Win32 or OS/2. For instance
|
---|
4384 | suppose we build `false' as a program but `true.sh' as a script,
|
---|
4385 | and that neither of them support `--help' or `--version':
|
---|
4386 |
|
---|
4387 | AUTOMAKE_OPTIONS = std-options
|
---|
4388 | bin_PROGRAMS = false ...
|
---|
4389 | bin_SCRIPTS = true.sh ...
|
---|
4390 | AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = false$(EXEEXT) true.sh
|
---|
4391 |
|
---|
4392 | `subdir-objects'
|
---|
4393 | If this option is specified, then objects are placed into the
|
---|
4394 | subdirectory of the build directory corresponding to the
|
---|
4395 | subdirectory of the source file. For instance if the source file
|
---|
4396 | is `subdir/file.cxx', then the output file would be
|
---|
4397 | `subdir/file.o'.
|
---|
4398 |
|
---|
4399 | VERSION
|
---|
4400 | A version number (e.g. `0.30') can be specified. If Automake is
|
---|
4401 | not newer than the version specified, creation of the `Makefile.in'
|
---|
4402 | will be suppressed.
|
---|
4403 |
|
---|
4404 | `-WCATEGORY' or `--warnings=CATEGORY'
|
---|
4405 | These options behave exactly like their command-line counterpart
|
---|
4406 | (*note Invoking Automake::). This allows you to enable or disable
|
---|
4407 | some warning categories on a per-file basis. You can also setup
|
---|
4408 | some warnings for your entire project; for instance try
|
---|
4409 | `AM_INIT_AUTOMAKE([-Wall])' in your `configure.in'.
|
---|
4410 |
|
---|
4411 |
|
---|
4412 | Unrecognized options are diagnosed by `automake'.
|
---|
4413 |
|
---|
4414 | If you want an option to apply to all the files in the tree, you can
|
---|
4415 | use the `AM_INIT_AUTOMAKE' macro in `configure.in'. *Note Macros::.
|
---|
4416 |
|
---|
4417 |
|
---|
4418 | File: automake.info, Node: Miscellaneous, Next: Include, Prev: Options, Up: Top
|
---|
4419 |
|
---|
4420 | Miscellaneous Rules
|
---|
4421 | *******************
|
---|
4422 |
|
---|
4423 | There are a few rules and variables that didn't fit anywhere else.
|
---|
4424 |
|
---|
4425 | * Menu:
|
---|
4426 |
|
---|
4427 | * Tags:: Interfacing to etags and mkid
|
---|
4428 | * Suffixes:: Handling new file extensions
|
---|
4429 | * Multilibs:: Support for multilibs.
|
---|
4430 |
|
---|
4431 |
|
---|
4432 | File: automake.info, Node: Tags, Next: Suffixes, Prev: Miscellaneous, Up: Miscellaneous
|
---|
4433 |
|
---|
4434 | Interfacing to `etags'
|
---|
4435 | ======================
|
---|
4436 |
|
---|
4437 | Automake will generate rules to generate `TAGS' files for use with GNU
|
---|
4438 | Emacs under some circumstances.
|
---|
4439 |
|
---|
4440 | If any C, C++ or Fortran 77 source code or headers are present, then
|
---|
4441 | `tags' and `TAGS' targets will be generated for the directory.
|
---|
4442 |
|
---|
4443 | At the topmost directory of a multi-directory package, a `tags'
|
---|
4444 | target file will be generated which, when run, will generate a `TAGS'
|
---|
4445 | file that includes by reference all `TAGS' files from subdirectories.
|
---|
4446 |
|
---|
4447 | The `tags' target will also be generated if the variable
|
---|
4448 | `ETAGS_ARGS' is defined. This variable is intended for use in
|
---|
4449 | directories which contain taggable source that `etags' does not
|
---|
4450 | understand. The user can use the `ETAGSFLAGS' to pass additional flags
|
---|
4451 | to `etags'; `AM_ETAGSFLAGS' is also available for use in `Makefile.am'.
|
---|
4452 |
|
---|
4453 | Here is how Automake generates tags for its source, and for nodes in
|
---|
4454 | its Texinfo file:
|
---|
4455 |
|
---|
4456 | ETAGS_ARGS = automake.in --lang=none \
|
---|
4457 | --regex='/^@node[ \t]+\([^,]+\)/\1/' automake.texi
|
---|
4458 |
|
---|
4459 | If you add filenames to `ETAGS_ARGS', you will probably also want to
|
---|
4460 | set `TAGS_DEPENDENCIES'. The contents of this variable are added
|
---|
4461 | directly to the dependencies for the `tags' target.
|
---|
4462 |
|
---|
4463 | Automake also generates a `ctags' target which can be used to build
|
---|
4464 | `vi'-style `tags' files. The variable `CTAGS' is the name of the
|
---|
4465 | program to invoke (by default `ctags'); `CTAGSFLAGS' can be used by the
|
---|
4466 | user to pass additional flags, and `AM_CTAGSFLAGS' can be used by the
|
---|
4467 | `Makefile.am'.
|
---|
4468 |
|
---|
4469 | Automake will also generate an `ID' target which will run `mkid' on
|
---|
4470 | the source. This is only supported on a directory-by-directory basis.
|
---|
4471 |
|
---|
4472 | Automake also supports the GNU Global Tags program
|
---|
4473 | (http://www.gnu.org/software/global/). The `GTAGS' target runs Global
|
---|
4474 | Tags automatically and puts the result in the top build directory. The
|
---|
4475 | variable `GTAGS_ARGS' holds arguments which are passed to `gtags'.
|
---|
4476 |
|
---|
4477 |
|
---|
4478 | File: automake.info, Node: Suffixes, Next: Multilibs, Prev: Tags, Up: Miscellaneous
|
---|
4479 |
|
---|
4480 | Handling new file extensions
|
---|
4481 | ============================
|
---|
4482 |
|
---|
4483 | It is sometimes useful to introduce a new implicit rule to handle a file
|
---|
4484 | type that Automake does not know about.
|
---|
4485 |
|
---|
4486 | For instance, suppose you had a compiler which could compile `.foo'
|
---|
4487 | files to `.o' files. You would simply define an suffix rule for your
|
---|
4488 | language:
|
---|
4489 |
|
---|
4490 | .foo.o:
|
---|
4491 | foocc -c -o $@ $<
|
---|
4492 |
|
---|
4493 | Then you could directly use a `.foo' file in a `_SOURCES' variable
|
---|
4494 | and expect the correct results:
|
---|
4495 |
|
---|
4496 | bin_PROGRAMS = doit
|
---|
4497 | doit_SOURCES = doit.foo
|
---|
4498 |
|
---|
4499 | This was the simpler and more common case. In other cases, you will
|
---|
4500 | have to help Automake to figure which extensions you are defining your
|
---|
4501 | suffix rule for. This usually happens when your extensions does not
|
---|
4502 | start with a dot. Then, all you have to do is to put a list of new
|
---|
4503 | suffixes in the `SUFFIXES' variable *before* you define your implicit
|
---|
4504 | rule.
|
---|
4505 |
|
---|
4506 | For instance the following definition prevents Automake to
|
---|
4507 | misinterpret `.idlC.cpp:' as an attempt to transform `.idlC' into
|
---|
4508 | `.cpp'.
|
---|
4509 |
|
---|
4510 | SUFFIXES = .idl C.cpp
|
---|
4511 | .idlC.cpp:
|
---|
4512 | # whatever
|
---|
4513 |
|
---|
4514 | As you may have noted, the `SUFFIXES' variable behaves like the
|
---|
4515 | `.SUFFIXES' special target of `make'. You should not touch `.SUFFIXES'
|
---|
4516 | yourself, but use `SUFFIXES' instead and let Automake generate the
|
---|
4517 | suffix list for `.SUFFIXES'. Any given `SUFFIXES' go at the start of
|
---|
4518 | the generated suffixes list, followed by Automake generated suffixes
|
---|
4519 | not already in the list.
|
---|
4520 |
|
---|
4521 |
|
---|
4522 | File: automake.info, Node: Multilibs, Prev: Suffixes, Up: Miscellaneous
|
---|
4523 |
|
---|
4524 | Support for Multilibs
|
---|
4525 | =====================
|
---|
4526 |
|
---|
4527 | Automake has support for an obscure feature called multilibs. A
|
---|
4528 | "multilib" is a library which is built for multiple different ABIs at a
|
---|
4529 | single time; each time the library is built with a different target
|
---|
4530 | flag combination. This is only useful when the library is intended to
|
---|
4531 | be cross-compiled, and it is almost exclusively used for compiler
|
---|
4532 | support libraries.
|
---|
4533 |
|
---|
4534 | The multilib support is still experimental. Only use it if you are
|
---|
4535 | familiar with multilibs and can debug problems you might encounter.
|
---|
4536 |
|
---|
4537 |
|
---|
4538 | File: automake.info, Node: Include, Next: Conditionals, Prev: Miscellaneous, Up: Top
|
---|
4539 |
|
---|
4540 | Include
|
---|
4541 | *******
|
---|
4542 |
|
---|
4543 | Automake supports an `include' directive which can be used to include
|
---|
4544 | other `Makefile' fragments when `automake' is run. Note that these
|
---|
4545 | fragments are read and interpreted by `automake', not by `make'. As
|
---|
4546 | with conditionals, `make' has no idea that `include' is in use.
|
---|
4547 |
|
---|
4548 | There are two forms of `include':
|
---|
4549 |
|
---|
4550 | `include $(srcdir)/file'
|
---|
4551 | Include a fragment which is found relative to the current source
|
---|
4552 | directory.
|
---|
4553 |
|
---|
4554 | `include $(top_srcdir)/file'
|
---|
4555 | Include a fragment which is found relative to the top source
|
---|
4556 | directory.
|
---|
4557 |
|
---|
4558 | Note that if a fragment is included inside a conditional, then the
|
---|
4559 | condition applies to the entire contents of that fragment.
|
---|
4560 |
|
---|
4561 | Makefile fragments included this way are always distributed because
|
---|
4562 | there are needed to rebuild `Makefile.in'.
|
---|
4563 |
|
---|
4564 |
|
---|
4565 | File: automake.info, Node: Conditionals, Next: Gnits, Prev: Include, Up: Top
|
---|
4566 |
|
---|
4567 | Conditionals
|
---|
4568 | ************
|
---|
4569 |
|
---|
4570 | Automake supports a simple type of conditionals.
|
---|
4571 |
|
---|
4572 | Before using a conditional, you must define it by using
|
---|
4573 | `AM_CONDITIONAL' in the `configure.in' file (*note Macros::).
|
---|
4574 |
|
---|
4575 | - Macro: AM_CONDITIONAL (CONDITIONAL, CONDITION)
|
---|
4576 | The conditional name, CONDITIONAL, should be a simple string
|
---|
4577 | starting with a letter and containing only letters, digits, and
|
---|
4578 | underscores. It must be different from `TRUE' and `FALSE' which
|
---|
4579 | are reserved by Automake.
|
---|
4580 |
|
---|
4581 | The shell CONDITION (suitable for use in a shell `if' statement)
|
---|
4582 | is evaluated when `configure' is run. Note that you must arrange
|
---|
4583 | for _every_ `AM_CONDITIONAL' to be invoked every time `configure'
|
---|
4584 | is run - if `AM_CONDITIONAL' is run conditionally (e.g., in a
|
---|
4585 | shell `if' statement), then the result will confuse automake.
|
---|
4586 |
|
---|
4587 | Conditionals typically depend upon options which the user provides to
|
---|
4588 | the `configure' script. Here is an example of how to write a
|
---|
4589 | conditional which is true if the user uses the `--enable-debug' option.
|
---|
4590 |
|
---|
4591 | AC_ARG_ENABLE(debug,
|
---|
4592 | [ --enable-debug Turn on debugging],
|
---|
4593 | [case "${enableval}" in
|
---|
4594 | yes) debug=true ;;
|
---|
4595 | no) debug=false ;;
|
---|
4596 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
|
---|
4597 | esac],[debug=false])
|
---|
4598 | AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
|
---|
4599 |
|
---|
4600 | Here is an example of how to use that conditional in `Makefile.am':
|
---|
4601 |
|
---|
4602 | if DEBUG
|
---|
4603 | DBG = debug
|
---|
4604 | else
|
---|
4605 | DBG =
|
---|
4606 | endif
|
---|
4607 | noinst_PROGRAMS = $(DBG)
|
---|
4608 |
|
---|
4609 | This trivial example could also be handled using EXTRA_PROGRAMS
|
---|
4610 | (*note Conditional Programs::).
|
---|
4611 |
|
---|
4612 | You may only test a single variable in an `if' statement, possibly
|
---|
4613 | negated using `!'. The `else' statement may be omitted. Conditionals
|
---|
4614 | may be nested to any depth. You may specify an argument to `else' in
|
---|
4615 | which case it must be the negation of the condition used for the
|
---|
4616 | current `if'. Similarly you may specify the condition which is closed
|
---|
4617 | by an `end':
|
---|
4618 |
|
---|
4619 | if DEBUG
|
---|
4620 | DBG = debug
|
---|
4621 | else !DEBUG
|
---|
4622 | DBG =
|
---|
4623 | endif !DEBUG
|
---|
4624 |
|
---|
4625 | Unbalanced conditions are errors.
|
---|
4626 |
|
---|
4627 | Note that conditionals in Automake are not the same as conditionals
|
---|
4628 | in GNU Make. Automake conditionals are checked at configure time by the
|
---|
4629 | `configure' script, and affect the translation from `Makefile.in' to
|
---|
4630 | `Makefile'. They are based on options passed to `configure' and on
|
---|
4631 | results that `configure' has discovered about the host system. GNU
|
---|
4632 | Make conditionals are checked at `make' time, and are based on
|
---|
4633 | variables passed to the make program or defined in the `Makefile'.
|
---|
4634 |
|
---|
4635 | Automake conditionals will work with any make program.
|
---|
4636 |
|
---|
4637 |
|
---|
4638 | File: automake.info, Node: Gnits, Next: Cygnus, Prev: Conditionals, Up: Top
|
---|
4639 |
|
---|
4640 | The effect of `--gnu' and `--gnits'
|
---|
4641 | ***********************************
|
---|
4642 |
|
---|
4643 | The `--gnu' option (or `gnu' in the `AUTOMAKE_OPTIONS' variable) causes
|
---|
4644 | `automake' to check the following:
|
---|
4645 |
|
---|
4646 | * The files `INSTALL', `NEWS', `README', `AUTHORS', and `ChangeLog',
|
---|
4647 | plus one of `COPYING.LIB', `COPYING.LESSER' or `COPYING', are
|
---|
4648 | required at the topmost directory of the package.
|
---|
4649 |
|
---|
4650 | * The options `no-installman' and `no-installinfo' are prohibited.
|
---|
4651 |
|
---|
4652 | Note that this option will be extended in the future to do even more
|
---|
4653 | checking; it is advisable to be familiar with the precise requirements
|
---|
4654 | of the GNU standards. Also, `--gnu' can require certain non-standard
|
---|
4655 | GNU programs to exist for use by various maintainer-only targets; for
|
---|
4656 | instance in the future `pathchk' might be required for `make dist'.
|
---|
4657 |
|
---|
4658 | The `--gnits' option does everything that `--gnu' does, and checks
|
---|
4659 | the following as well:
|
---|
4660 |
|
---|
4661 | * `make installcheck' will check to make sure that the `--help' and
|
---|
4662 | `--version' really print a usage message and a version string,
|
---|
4663 | respectively. This is the `std-options' option (*note Options::).
|
---|
4664 |
|
---|
4665 | * `make dist' will check to make sure the `NEWS' file has been
|
---|
4666 | updated to the current version.
|
---|
4667 |
|
---|
4668 | * `VERSION' is checked to make sure its format complies with Gnits
|
---|
4669 | standards.
|
---|
4670 |
|
---|
4671 | * If `VERSION' indicates that this is an alpha release, and the file
|
---|
4672 | `README-alpha' appears in the topmost directory of a package, then
|
---|
4673 | it is included in the distribution. This is done in `--gnits'
|
---|
4674 | mode, and no other, because this mode is the only one where version
|
---|
4675 | number formats are constrained, and hence the only mode where
|
---|
4676 | Automake can automatically determine whether `README-alpha' should
|
---|
4677 | be included.
|
---|
4678 |
|
---|
4679 | * The file `THANKS' is required.
|
---|
4680 |
|
---|
4681 |
|
---|
4682 | File: automake.info, Node: Cygnus, Next: Extending, Prev: Gnits, Up: Top
|
---|
4683 |
|
---|
4684 | The effect of `--cygnus'
|
---|
4685 | ************************
|
---|
4686 |
|
---|
4687 | Some packages, notably GNU GCC and GNU gdb, have a build environment
|
---|
4688 | originally written at Cygnus Support (subsequently renamed Cygnus
|
---|
4689 | Solutions, and then later purchased by Red Hat). Packages with this
|
---|
4690 | ancestry are sometimes referred to as "Cygnus" trees.
|
---|
4691 |
|
---|
4692 | A Cygnus tree has slightly different rules for how a `Makefile.in'
|
---|
4693 | is to be constructed. Passing `--cygnus' to `automake' will cause any
|
---|
4694 | generated `Makefile.in' to comply with Cygnus rules.
|
---|
4695 |
|
---|
4696 | Here are the precise effects of `--cygnus':
|
---|
4697 |
|
---|
4698 | * Info files are always created in the build directory, and not in
|
---|
4699 | the source directory.
|
---|
4700 |
|
---|
4701 | * `texinfo.tex' is not required if a Texinfo source file is
|
---|
4702 | specified. The assumption is that the file will be supplied, but
|
---|
4703 | in a place that Automake cannot find. This assumption is an
|
---|
4704 | artifact of how Cygnus packages are typically bundled.
|
---|
4705 |
|
---|
4706 | * `make dist' is not supported, and the rules for it are not
|
---|
4707 | generated. Cygnus-style trees use their own distribution
|
---|
4708 | mechanism.
|
---|
4709 |
|
---|
4710 | * Certain tools will be searched for in the build tree as well as in
|
---|
4711 | the user's `PATH'. These tools are `runtest', `expect',
|
---|
4712 | `makeinfo' and `texi2dvi'.
|
---|
4713 |
|
---|
4714 | * `--foreign' is implied.
|
---|
4715 |
|
---|
4716 | * The options `no-installinfo' and `no-dependencies' are implied.
|
---|
4717 |
|
---|
4718 | * The macros `AM_MAINTAINER_MODE' and `AM_CYGWIN32' are required.
|
---|
4719 |
|
---|
4720 | * The `check' target doesn't depend on `all'.
|
---|
4721 |
|
---|
4722 | GNU maintainers are advised to use `gnu' strictness in preference to
|
---|
4723 | the special Cygnus mode. Some day, perhaps, the differences between
|
---|
4724 | Cygnus trees and GNU trees will disappear (for instance, as GCC is made
|
---|
4725 | more standards compliant). At that time the special Cygnus mode will be
|
---|
4726 | removed.
|
---|
4727 |
|
---|
4728 |
|
---|
4729 | File: automake.info, Node: Extending, Next: Distributing, Prev: Cygnus, Up: Top
|
---|
4730 |
|
---|
4731 | When Automake Isn't Enough
|
---|
4732 | **************************
|
---|
4733 |
|
---|
4734 | Automake's implicit copying semantics means that many problems can be
|
---|
4735 | worked around by simply adding some `make' targets and rules to
|
---|
4736 | `Makefile.in'. Automake will ignore these additions.
|
---|
4737 |
|
---|
4738 | There are some caveats to doing this. Although you can overload a
|
---|
4739 | target already used by Automake, it is often inadvisable, particularly
|
---|
4740 | in the topmost directory of a package with subdirectories. However,
|
---|
4741 | various useful targets have a `-local' version you can specify in your
|
---|
4742 | `Makefile.in'. Automake will supplement the standard target with these
|
---|
4743 | user-supplied targets.
|
---|
4744 |
|
---|
4745 | The targets that support a local version are `all', `info', `dvi',
|
---|
4746 | `ps', `pdf', `check', `install-data', `install-exec', `uninstall',
|
---|
4747 | `installdirs', `installcheck' and the various `clean' targets
|
---|
4748 | (`mostlyclean', `clean', `distclean', and `maintainer-clean'). Note
|
---|
4749 | that there are no `uninstall-exec-local' or `uninstall-data-local'
|
---|
4750 | targets; just use `uninstall-local'. It doesn't make sense to
|
---|
4751 | uninstall just data or just executables.
|
---|
4752 |
|
---|
4753 | For instance, here is one way to install a file in `/etc':
|
---|
4754 |
|
---|
4755 | install-data-local:
|
---|
4756 | $(INSTALL_DATA) $(srcdir)/afile $(DESTDIR)/etc/afile
|
---|
4757 |
|
---|
4758 | Some targets also have a way to run another target, called a "hook",
|
---|
4759 | after their work is done. The hook is named after the principal target,
|
---|
4760 | with `-hook' appended. The targets allowing hooks are `install-data',
|
---|
4761 | `install-exec', `uninstall', `dist', and `distcheck'.
|
---|
4762 |
|
---|
4763 | For instance, here is how to create a hard link to an installed
|
---|
4764 | program:
|
---|
4765 |
|
---|
4766 | install-exec-hook:
|
---|
4767 | ln $(DESTDIR)$(bindir)/program$(EXEEXT) \
|
---|
4768 | $(DESTDIR)$(bindir)/proglink$(EXEEXT)
|
---|
4769 |
|
---|
4770 | Although cheaper and more portable than symbolic links, hard links
|
---|
4771 | will not work everywhere (for instance OS/2 does not have `ln').
|
---|
4772 | Ideally you should fall back to `cp -p' when `ln' does not work. An
|
---|
4773 | easy way, if symbolic links are acceptable to you, is to add
|
---|
4774 | `AC_PROG_LN_S' to `configure.in' (*note Particular Program Checks:
|
---|
4775 | (autoconf)Particular Programs.) and use `$(LN_S)' in `Makefile.am'.
|
---|
4776 |
|
---|
4777 | For instance, here is how you could install a versioned copy of a
|
---|
4778 | program using `$(LN_S)':
|
---|
4779 |
|
---|
4780 | install-exec-hook:
|
---|
4781 | cd $(DESTDIR)$(bindir) && \
|
---|
4782 | mv -f prog$(EXEEXT) prog-$(VERSION)$(EXEEXT) && \
|
---|
4783 | $(LN_S) prog-$(VERSION)$(EXEEXT) prog$(EXEEXT)
|
---|
4784 |
|
---|
4785 | Note that we rename the program so that a new version will erase the
|
---|
4786 | symbolic link, not the real binary. Also we `cd' into the destination
|
---|
4787 | directory in order to create relative links.
|
---|
4788 |
|
---|
4789 |
|
---|
4790 | File: automake.info, Node: Distributing, Next: API versioning, Prev: Extending, Up: Top
|
---|
4791 |
|
---|
4792 | Distributing `Makefile.in's
|
---|
4793 | ***************************
|
---|
4794 |
|
---|
4795 | Automake places no restrictions on the distribution of the resulting
|
---|
4796 | `Makefile.in's. We still encourage software authors to distribute
|
---|
4797 | their work under terms like those of the GPL, but doing so is not
|
---|
4798 | required to use Automake.
|
---|
4799 |
|
---|
4800 | Some of the files that can be automatically installed via the
|
---|
4801 | `--add-missing' switch do fall under the GPL. However, these also have
|
---|
4802 | a special exception allowing you to distribute them with your package,
|
---|
4803 | regardless of the licensing you choose.
|
---|
4804 |
|
---|
4805 |
|
---|
4806 | File: automake.info, Node: API versioning, Next: FAQ, Prev: Distributing, Up: Top
|
---|
4807 |
|
---|
4808 | Automake API versioning
|
---|
4809 | ***********************
|
---|
4810 |
|
---|
4811 | New Automake releases usually include bug fixes and new features.
|
---|
4812 | Unfortunately they may also introduce new bugs and incompatibilities.
|
---|
4813 | This makes four reasons why a package may require a particular Automake
|
---|
4814 | version.
|
---|
4815 |
|
---|
4816 | Things get worse when maintaining a large tree of packages, each one
|
---|
4817 | requiring a different version of Automake. In the past, this meant that
|
---|
4818 | any developer (and sometime users) had to install several versions of
|
---|
4819 | Automake in different places, and switch `$PATH' appropriately for each
|
---|
4820 | package.
|
---|
4821 |
|
---|
4822 | Starting with version 1.6, Automake installs versioned binaries.
|
---|
4823 | This means you can install several versions of Automake in the same
|
---|
4824 | `$prefix', and can select an arbitrary Automake version by running
|
---|
4825 | `automake-1.6' or `automake-1.7' without juggling with `$PATH'.
|
---|
4826 | Furthermore, `Makefile''s generated by Automake 1.6 will use
|
---|
4827 | `automake-1.6' explicitly in their rebuild rules.
|
---|
4828 |
|
---|
4829 | Note that `1.6' in `automake-1.6' is Automake's API version, not
|
---|
4830 | Automake's version. If a bug fix release is made, for instance
|
---|
4831 | Automake 1.6.1, the API version will remain 1.6. This means that a
|
---|
4832 | package which work with Automake 1.6 should also work with 1.6.1; after
|
---|
4833 | all, this is what people expect from bug fix releases.
|
---|
4834 |
|
---|
4835 | Note that if your package relies on a feature or a bug fix
|
---|
4836 | introduced in a release, you can pass this version as an option to
|
---|
4837 | Automake to ensure older releases will not be used. For instance, use
|
---|
4838 | this in your `configure.in':
|
---|
4839 |
|
---|
4840 | AM_INIT_AUTOMAKE(1.6.1) dnl Require Automake 1.6.1 or better.
|
---|
4841 |
|
---|
4842 | or, in a particular `Makefile.am':
|
---|
4843 |
|
---|
4844 | AUTOMAKE_OPTIONS = 1.6.1 # Require Automake 1.6.1 or better.
|
---|
4845 |
|
---|
4846 | Automake will print an error message if its version is older than the
|
---|
4847 | requested version.
|
---|
4848 |
|
---|
4849 | What is in the API
|
---|
4850 | ==================
|
---|
4851 |
|
---|
4852 | Automake's programming interface is not easy to define. Basically it
|
---|
4853 | should include at least all *documented* variables and targets that a
|
---|
4854 | `Makefile.am' author can use, any behavior associated with them (e.g.
|
---|
4855 | the places where `-hook''s are run), the command line interface of
|
---|
4856 | `automake' and `aclocal', ...
|
---|
4857 |
|
---|
4858 | What is not in the API
|
---|
4859 | ======================
|
---|
4860 |
|
---|
4861 | Every undocumented variable, target, or command line option, is not part
|
---|
4862 | of the API. You should avoid using them, as they could change from one
|
---|
4863 | version to the other (even in bug fix releases, if this helps to fix a
|
---|
4864 | bug).
|
---|
4865 |
|
---|
4866 | If it turns out you need to use such a undocumented feature, contact
|
---|
4867 | <automake@gnu.org> and try to get it documented and exercised by the
|
---|
4868 | test-suite.
|
---|
4869 |
|
---|
4870 |
|
---|
4871 | File: automake.info, Node: FAQ, Next: Macro and Variable Index, Prev: API versioning, Up: Top
|
---|
4872 |
|
---|
4873 | Frequently Asked Questions about Automake
|
---|
4874 | *****************************************
|
---|
4875 |
|
---|
4876 | This chapter covers some questions that often come up on the mailing
|
---|
4877 | lists.
|
---|
4878 |
|
---|
4879 | * Menu:
|
---|
4880 |
|
---|
4881 | * CVS:: CVS and generated files
|
---|
4882 | * maintainer-mode:: missing and AM_MAINTAINER_MODE
|
---|
4883 | * wildcards:: Why doesn't Automake support wildcards?
|
---|
4884 | * distcleancheck:: Files left in build directory after distclean
|
---|
4885 | * renamed objects:: Why are object files sometimes renamed?
|
---|
4886 |
|
---|
4887 |
|
---|
4888 | File: automake.info, Node: CVS, Next: maintainer-mode, Prev: FAQ, Up: FAQ
|
---|
4889 |
|
---|
4890 | CVS and generated files
|
---|
4891 | =======================
|
---|
4892 |
|
---|
4893 | Background: distributed generated files
|
---|
4894 | ---------------------------------------
|
---|
4895 |
|
---|
4896 | Packages made with Autoconf and Automake ship with some generated files
|
---|
4897 | like `configure' or `Makefile.in'. These files were generated on the
|
---|
4898 | developer's host and are distributed so that end-users do not have to
|
---|
4899 | install the maintainer tools required to rebuild them. Other generated
|
---|
4900 | files like Lex scanners, Yacc parsers, or Info documentation, are
|
---|
4901 | usually distributed on similar grounds.
|
---|
4902 |
|
---|
4903 | Automake outputs rules in `Makefile's to rebuild these files. For
|
---|
4904 | instance `make' will run `autoconf' to rebuild `configure' whenever
|
---|
4905 | `configure.in' is changed. This makes development safer by ensuring a
|
---|
4906 | `configure' is never out-of-date with respect to `configure.in'.
|
---|
4907 |
|
---|
4908 | As generated files shipped in packages are up-to-date, and because
|
---|
4909 | `tar' preserves timestamps, these rebuild rules are not triggered when
|
---|
4910 | a user unpacks and builds a package.
|
---|
4911 |
|
---|
4912 | Background: CVS and timestamps
|
---|
4913 | ------------------------------
|
---|
4914 |
|
---|
4915 | Unless you use CVS keywords (in which case files must be updated at
|
---|
4916 | commit time), CVS preserves timestamps during `cvs commit' and `cvs
|
---|
4917 | import -d' operations.
|
---|
4918 |
|
---|
4919 | When you check out a file using `cvs checkout' its timestamp is set
|
---|
4920 | to that of the revision which is being checked out.
|
---|
4921 |
|
---|
4922 | However, during `cvs update', files will have the date of the
|
---|
4923 | update, not the original timestamp of this revision. This is meant to
|
---|
4924 | make sure that `make' notices sources files have been updated.
|
---|
4925 |
|
---|
4926 | This timestamp shift is troublesome when both sources and generated
|
---|
4927 | files are kept under CVS. Because CVS processes files in alphabetical
|
---|
4928 | order, `configure.in' will appear older than `configure' after a `cvs
|
---|
4929 | update' that updates both files, even if `configure' was newer than
|
---|
4930 | `configure.in' when it was checked in. Calling `make' will then
|
---|
4931 | trigger a spurious rebuild of `configure'.
|
---|
4932 |
|
---|
4933 | Living with CVS in Autoconfiscated projects
|
---|
4934 | -------------------------------------------
|
---|
4935 |
|
---|
4936 | There are basically two clans amongst maintainers: those who keep all
|
---|
4937 | distributed files under CVS, including generated files, and those who
|
---|
4938 | keep generated files _out_ of CVS.
|
---|
4939 |
|
---|
4940 | All files in CVS
|
---|
4941 | ................
|
---|
4942 |
|
---|
4943 | * The CVS repository contains all distributed files so you know
|
---|
4944 | exactly what is distributed, and you can checkout any prior
|
---|
4945 | version entirely.
|
---|
4946 |
|
---|
4947 | * Maintainers can see how generated files evolve (for instance you
|
---|
4948 | can see what happens to your `Makefile.in's when you upgrade
|
---|
4949 | Automake and make sure they look OK).
|
---|
4950 |
|
---|
4951 | * Users do not need the autotools to build a checkout of the
|
---|
4952 | project, it works just like a released tarball.
|
---|
4953 |
|
---|
4954 | * If users use `cvs update' to update their copy, instead of `cvs
|
---|
4955 | checkout' to fetch a fresh one, timestamps will be inaccurate.
|
---|
4956 | Some rebuild rules will be triggered and attempt to run developer
|
---|
4957 | tools such as `autoconf' or `automake'.
|
---|
4958 |
|
---|
4959 | Actually, calls to such tools are all wrapped into a call to the
|
---|
4960 | `missing' script discussed later (*note maintainer-mode::).
|
---|
4961 | `missing' will take care of fixing the timestamps when these tools
|
---|
4962 | are not installed, so that the build can continue.
|
---|
4963 |
|
---|
4964 | * In distributed development, developers are likely to have different
|
---|
4965 | version of the maintainer tools installed. In this case rebuilds
|
---|
4966 | triggered by timestamp lossage will lead to spurious changes to
|
---|
4967 | generated files. There are several solutions to this:
|
---|
4968 |
|
---|
4969 | * All developers should use the same versions, so that the
|
---|
4970 | rebuilt files are identical to files in CVS. (This starts to
|
---|
4971 | be difficult when each project you work on uses different
|
---|
4972 | versions.)
|
---|
4973 |
|
---|
4974 | * Or people use a script to fix the timestamp after a checkout
|
---|
4975 | (the GCC folks have such a script).
|
---|
4976 |
|
---|
4977 | * Or `configure.in' uses `AM_MAINTAINER_MODE', which will
|
---|
4978 | disable all these rebuild rules by default. This is further
|
---|
4979 | discussed in *Note maintainer-mode::.
|
---|
4980 |
|
---|
4981 | * Although we focused on spurious rebuilds, the converse can also
|
---|
4982 | happen. CVS's timestamp handling can also let you think an
|
---|
4983 | out-of-date file is up-to-date.
|
---|
4984 |
|
---|
4985 | For instance, suppose a developer has modified `Makefile.am' and
|
---|
4986 | rebuilt `Makefile.in', and then decide to do a last-minute change
|
---|
4987 | to `Makefile.am' right before checking in both files (without
|
---|
4988 | rebuilding `Makefile.in' to account for the change).
|
---|
4989 |
|
---|
4990 | This last change to `Makefile.am' make the copy of `Makefile.in'
|
---|
4991 | out-of-date. Since CVS processes files alphabetically, when
|
---|
4992 | another developer `cvs update' his or her tree, `Makefile.in' will
|
---|
4993 | happen to be newer than `Makefile.am'. This other developer will
|
---|
4994 | not see `Makefile.in' is out-of-date.
|
---|
4995 |
|
---|
4996 |
|
---|
4997 | Generated files out of CVS
|
---|
4998 | ..........................
|
---|
4999 |
|
---|
5000 | One way to get CVS and `make' working peacefully is to never store
|
---|
5001 | generated files in CVS, i.e., do not CVS-control files which are
|
---|
5002 | `Makefile' targets (or _derived_ files in Make terminology).
|
---|
5003 |
|
---|
5004 | This way developers are not annoyed by changes to generated files.
|
---|
5005 | It does not matter if they all have different versions (assuming they
|
---|
5006 | are compatible, of course). And finally, timestamps are not lost,
|
---|
5007 | changes to sources files can't be missed as in the
|
---|
5008 | `Makefile.am'/`Makefile.in' example discussed earlier.
|
---|
5009 |
|
---|
5010 | The drawback is that the CVS repository is not an exact copy of what
|
---|
5011 | is distributed and that users now need to install various development
|
---|
5012 | tools (maybe even specific versions) before they can build a checkout.
|
---|
5013 | But, after all, CVS's job is versioning, not distribution.
|
---|
5014 |
|
---|
5015 | Allowing developers to use different versions of their tools can also
|
---|
5016 | hide bugs during distributed development. Indeed, developers will be
|
---|
5017 | using (hence testing) their own generated files, instead of the
|
---|
5018 | generated files that will be released actually. The developer who
|
---|
5019 | prepares the tarball might be using a version of the tool that produces
|
---|
5020 | bogus output (for instance a non-portable C file), something other
|
---|
5021 | developers could have noticed if they weren't using their own versions
|
---|
5022 | of this tool.
|
---|
5023 |
|
---|
5024 | Third-party files
|
---|
5025 | -----------------
|
---|
5026 |
|
---|
5027 | Another class of files not discussed here (because they do not cause
|
---|
5028 | timestamp issues) are files which are shipped with a package, but
|
---|
5029 | maintained elsewhere. For instance tools like `gettextize' and
|
---|
5030 | `autopoint' (from Gettext) or `libtoolize' (from Libtool), will install
|
---|
5031 | or update files in your package.
|
---|
5032 |
|
---|
5033 | These files, whether they are kept under CVS or not, raise similar
|
---|
5034 | concerns about version mismatch between developers' tools. The Gettext
|
---|
5035 | manual has a section about this, see *Note CVS Issues: (gettext)CVS
|
---|
5036 | Issues.
|
---|
5037 |
|
---|
5038 |
|
---|
5039 | File: automake.info, Node: maintainer-mode, Next: wildcards, Prev: CVS, Up: FAQ
|
---|
5040 |
|
---|
5041 | `missing' and `AM_MAINTAINER_MODE'
|
---|
5042 | ==================================
|
---|
5043 |
|
---|
5044 | `missing'
|
---|
5045 | ---------
|
---|
5046 |
|
---|
5047 | The `missing' script is a wrapper around several maintainer tools,
|
---|
5048 | designed to warn users if a maintainer tool is required but missing.
|
---|
5049 | Typical maintainer tools are `autoconf', `automake', `bison', etc.
|
---|
5050 | Because file generated by these tools are shipped with the other
|
---|
5051 | sources of a package, these tools shouldn't be required during a user
|
---|
5052 | build and they are not checked for in `configure'.
|
---|
5053 |
|
---|
5054 | However, if for some reason a rebuild rule is triggered and involves
|
---|
5055 | a missing tool, `missing' will notice it and warn the user. Besides
|
---|
5056 | the warning, when a tool is missing, `missing' will attempt to fix
|
---|
5057 | timestamps in a way which allow the build to continue. For instance
|
---|
5058 | `missing' will touch `configure' if `autoconf' is not installed. When
|
---|
5059 | all distributed files are kept under CVS, this feature of `missing'
|
---|
5060 | allows user _with no maintainer tools_ to build a package off CVS,
|
---|
5061 | bypassing any timestamp inconsistency implied by `cvs update'.
|
---|
5062 |
|
---|
5063 | If the required tool is installed, `missing' will run it and won't
|
---|
5064 | attempt to continue after failures. This is correct during
|
---|
5065 | development: developers love fixing failures. However, users with
|
---|
5066 | wrong versions of maintainer tools may get an error when the rebuild
|
---|
5067 | rule is spuriously triggered, halting the build. This failure to let
|
---|
5068 | the build continue is one of the arguments of the `AM_MAINTAINER_MODE'
|
---|
5069 | advocates.
|
---|
5070 |
|
---|
5071 | `AM_MAINTAINER_MODE'
|
---|
5072 | --------------------
|
---|
5073 |
|
---|
5074 | `AM_MAINTAINER_MODE' disables the so called "rebuild rules" by default.
|
---|
5075 | If you have `AM_MAINTAINER_MODE' in `configure.ac', and run
|
---|
5076 | `./configure && make', then `make' will *never* attempt to rebuilt
|
---|
5077 | `configure', `Makefile.in's, Lex or Yacc outputs, etc. I.e., this
|
---|
5078 | disables build rules for files which are usually distributed and that
|
---|
5079 | users should normally not have to update.
|
---|
5080 |
|
---|
5081 | If you run `./configure --enable-maintainer-mode', then these
|
---|
5082 | rebuild rules will be active.
|
---|
5083 |
|
---|
5084 | People use `AM_MAINTAINER_MODE' either because they do want their
|
---|
5085 | users (or themselves) annoyed by timestamps lossage (*note CVS::), or
|
---|
5086 | because they simply can't stand the rebuild rules and prefer running
|
---|
5087 | maintainer tools explicitly.
|
---|
5088 |
|
---|
5089 | `AM_MAINTAINER_MODE' also allows you to disable some custom build
|
---|
5090 | rules conditionally. Some developers use this feature to disable rules
|
---|
5091 | that need exotic tools that users may not have available.
|
---|
5092 |
|
---|
5093 | Several years ago Franc,ois Pinard pointed out several arguments
|
---|
5094 | against `AM_MAINTAINER_MODE'. Most of them relate to insecurity. By
|
---|
5095 | removing dependencies you get non-dependable builds: change to sources
|
---|
5096 | files can have no effect on generated files and this can be very
|
---|
5097 | confusing when unnoticed. He adds that security shouldn't be reserved
|
---|
5098 | to maintainers (what `--enable-maintainer-mode' suggests), on the
|
---|
5099 | contrary. If one user has to modify a `Makefile.am', then either
|
---|
5100 | `Makefile.in' should be updated or a warning should be output (this is
|
---|
5101 | what Automake uses `missing' for) but the last thing you want is that
|
---|
5102 | nothing happens and the user doesn't notice it (this is what happens
|
---|
5103 | when rebuild rules are disabled by `AM_MAINTAINER_MODE').
|
---|
5104 |
|
---|
5105 | Jim Meyering, the inventor of the `AM_MAINTAINER_MODE' macro was
|
---|
5106 | swayed by Franc,ois's arguments, and got rid of `AM_MAINTAINER_MODE' in
|
---|
5107 | all of his packages.
|
---|
5108 |
|
---|
5109 | Still many people continue to use `AM_MAINTAINER_MODE', because it
|
---|
5110 | helps them working on projects where all files are kept under CVS, and
|
---|
5111 | because `missing' isn't enough if you have the wrong version of the
|
---|
5112 | tools.
|
---|
5113 |
|
---|
5114 |
|
---|
5115 | File: automake.info, Node: wildcards, Next: distcleancheck, Prev: maintainer-mode, Up: FAQ
|
---|
5116 |
|
---|
5117 | Why doesn't Automake support wildcards?
|
---|
5118 | =======================================
|
---|
5119 |
|
---|
5120 | Developers are lazy. They often would like to use wildcards in
|
---|
5121 | `Makefile.am's, so they don't need to remember they have to update
|
---|
5122 | `Makefile.am's every time they add, delete, or rename a file.
|
---|
5123 |
|
---|
5124 | There are several objections to this:
|
---|
5125 | * When using CVS (or similar) developers need to remember they have
|
---|
5126 | to run `cvs add' or `cvs rm' anyway. Updating `Makefile.am'
|
---|
5127 | accordingly quickly becomes a reflex.
|
---|
5128 |
|
---|
5129 | Conversely, if your application doesn't compile because you forgot
|
---|
5130 | to add a file in `Makefile.am', it will help you remember to `cvs
|
---|
5131 | add' it.
|
---|
5132 |
|
---|
5133 | * Using wildcards makes easy to distribute files by mistake. For
|
---|
5134 | instance some code a developer is experimenting with (a test case,
|
---|
5135 | say) but which should not be part of the distribution.
|
---|
5136 |
|
---|
5137 | * Using wildcards it's easy to omit some files by mistake. For
|
---|
5138 | instance one developer creates a new file, uses it at many places,
|
---|
5139 | but forget to commit it. Another developer then checkout the
|
---|
5140 | incomplete project and is able to run `make dist' successfully,
|
---|
5141 | even though a file is missing.
|
---|
5142 |
|
---|
5143 | * Listing files, you control *exactly* what you distribute. If some
|
---|
5144 | file that should be distributed is missing from your tree, `make
|
---|
5145 | dist' will complain. Besides, you don't distribute more than what
|
---|
5146 | you listed.
|
---|
5147 |
|
---|
5148 | * Finally it's really hard to `forget' adding a file to
|
---|
5149 | `Makefile.am', because if you don't add it, it doesn't get
|
---|
5150 | compiled nor installed, so you can't even test it.
|
---|
5151 |
|
---|
5152 | Still, these are philosophical objections, and as such you may
|
---|
5153 | disagree, or find enough value in wildcards to dismiss all of them.
|
---|
5154 | Before you start writing a patch against Automake to teach it about
|
---|
5155 | wildcards, let's see the main technical issue: portability.
|
---|
5156 |
|
---|
5157 | Although `$(wildcard ...)' works with GNU `make', it is not portable
|
---|
5158 | to other `make' implementations.
|
---|
5159 |
|
---|
5160 | The only way Automake could support `$(wildcard ...)' is by
|
---|
5161 | expending `$(wildcard ...)' when `automake' is run. Resulting
|
---|
5162 | `Makefile.in's would be portable since they would list all files and
|
---|
5163 | not use `$(wildcard ...)'. However that means developers need to
|
---|
5164 | remember they must run `automake' each time they add, delete, or rename
|
---|
5165 | files.
|
---|
5166 |
|
---|
5167 | Compared to editing `Makefile.am', this is really little win. Sure,
|
---|
5168 | it's easier and faster to type `automake; make' than to type `emacs
|
---|
5169 | Makefile.am; make'. But nobody bothered enough to write a patch add
|
---|
5170 | support for this syntax. Some people use scripts to generated file
|
---|
5171 | lists in `Makefile.am' or in separate `Makefile' fragments.
|
---|
5172 |
|
---|
5173 | Even if you don't care about portability, and are tempted to use
|
---|
5174 | `$(wildcard ...)' anyway because you target only GNU Make, you should
|
---|
5175 | know there are many places where Automake need to know exactly which
|
---|
5176 | files should be processed. As Automake doesn't know how to expand
|
---|
5177 | `$(wildcard ...)', you cannot use it in these places. `$(wildcard
|
---|
5178 | ...)' is a black box comparable to `AC_SUBST'ed variables as far
|
---|
5179 | Automake is concerned.
|
---|
5180 |
|
---|
5181 | You can get warnings about `$(wildcard ...') constructs using the
|
---|
5182 | `-Wportability' flag.
|
---|
5183 |
|
---|
5184 |
|
---|
5185 | File: automake.info, Node: distcleancheck, Next: renamed objects, Prev: wildcards, Up: FAQ
|
---|
5186 |
|
---|
5187 | Files left in build directory after distclean
|
---|
5188 | =============================================
|
---|
5189 |
|
---|
5190 | This is a diagnostic you might encounter while running `make distcheck'.
|
---|
5191 |
|
---|
5192 | As explained in *Note Dist::, `make distcheck' attempts to build and
|
---|
5193 | check your package for errors like this one.
|
---|
5194 |
|
---|
5195 | `make distcheck' will perform a `VPATH' build of your package, and
|
---|
5196 | then call `make distclean'. Files left in the build directory after
|
---|
5197 | `make distclean' has run are listed after this error.
|
---|
5198 |
|
---|
5199 | This diagnostic really covers two kinds of errors:
|
---|
5200 |
|
---|
5201 | * files that are forgotten by distclean;
|
---|
5202 |
|
---|
5203 | * distributed files that are erroneously rebuilt.
|
---|
5204 |
|
---|
5205 | The former left-over files are not distributed, so the fix is to mark
|
---|
5206 | them for cleaning (*note Clean::), this is obvious and doesn't deserve
|
---|
5207 | more explanations.
|
---|
5208 |
|
---|
5209 | The latter bug is not always easy to understand and fix, so let's
|
---|
5210 | proceed with an example. Suppose our package contains a program for
|
---|
5211 | which we want to build a man page using `help2man'. GNU `help2man'
|
---|
5212 | produces simple manual pages from the `--help' and `--version' output
|
---|
5213 | of other commands (*note Overview: (help2man)Top.). Because we don't
|
---|
5214 | to force want our users to install `help2man', we decide to distribute
|
---|
5215 | the generated man page using the following setup.
|
---|
5216 |
|
---|
5217 | # This Makefile.am is bogus.
|
---|
5218 | bin_PROGRAMS = foo
|
---|
5219 | foo_SOURCES = foo.c
|
---|
5220 | dist_man_MANS = foo.1
|
---|
5221 |
|
---|
5222 | foo.1: foo$(EXEEXT)
|
---|
5223 | help2man --output=foo.1 ./foo$(EXEEXT)
|
---|
5224 |
|
---|
5225 | This will effectively distribute the man page. However, `make
|
---|
5226 | distcheck' will fail with:
|
---|
5227 |
|
---|
5228 | ERROR: files left in build directory after distclean:
|
---|
5229 | ./foo.1
|
---|
5230 |
|
---|
5231 | Why was `foo.1' rebuilt? Because although distributed, `foo.1'
|
---|
5232 | depends on a non-distributed built file: `foo$(EXEEXT)'.
|
---|
5233 | `foo$(EXEEXT)' is built by the user, so it will always appear to be
|
---|
5234 | newer than the distributed `foo.1'.
|
---|
5235 |
|
---|
5236 | `make distcheck' caught an inconsistency in our package. Our intent
|
---|
5237 | was to distribute `foo.1' so users do not need installing `help2man',
|
---|
5238 | however since this our rule causes this file to be always rebuilt,
|
---|
5239 | users _do_ need `help2man'. Either we should ensure that `foo.1' is
|
---|
5240 | not rebuilt by users, or there is no point in distributing `foo.1'.
|
---|
5241 |
|
---|
5242 | More generally, the rule is that distributed files should never
|
---|
5243 | depend on non-distributed built files. If you distribute something
|
---|
5244 | generated, distribute its sources.
|
---|
5245 |
|
---|
5246 | One way to fix the above example, while still distributing `foo.1'
|
---|
5247 | is to not depend on `foo$(EXEEXT)'. For instance, assuming `foo
|
---|
5248 | --version' and `foo --help' do not change unless `foo.c' or
|
---|
5249 | `configure.ac' change, we could write the following `Makefile.am':
|
---|
5250 |
|
---|
5251 | bin_PROGRAMS = foo
|
---|
5252 | foo_SOURCES = foo.c
|
---|
5253 | dist_man_MANS = foo.1
|
---|
5254 |
|
---|
5255 | foo.1: foo.c $(top_srcdir)/configure.ac
|
---|
5256 | $(MAKE) $(AM_MAKEFLAGS) foo$(EXEEXT)
|
---|
5257 | help2man --output=foo.1 ./foo$(EXEEXT)
|
---|
5258 |
|
---|
5259 | This way, `foo.1' will not get rebuilt every time `foo$(EXEEXT)'
|
---|
5260 | changes. The `make' call makes sure `foo$(EXEEXT)' is up-to-date
|
---|
5261 | before `help2man'. Another way to ensure this would be to use separate
|
---|
5262 | directories for binaries and man pages, and set `SUBDIRS' so that
|
---|
5263 | binaries are built before man pages.
|
---|
5264 |
|
---|
5265 | We could also decide not to distribute `foo.1'. In this case it's
|
---|
5266 | fine to have `foo.1' dependent upon `foo$(EXEEXT)', since both will
|
---|
5267 | have to be rebuilt. However it would be impossible to build the
|
---|
5268 | package in a cross-compilation, because building `foo.1' involves an
|
---|
5269 | _execution_ of `foo$(EXEEXT)'.
|
---|
5270 |
|
---|
5271 | Another context where such errors are common is when distributed
|
---|
5272 | files are built by tools which are built by the package. The pattern
|
---|
5273 | is similar:
|
---|
5274 |
|
---|
5275 | distributed-file: built-tools distributed-sources
|
---|
5276 | build-command
|
---|
5277 |
|
---|
5278 | should be changed to
|
---|
5279 |
|
---|
5280 | distributed-file: distributed-sources
|
---|
5281 | $(MAKE) $(AM_MAKEFLAGS) built-tools
|
---|
5282 | build-command
|
---|
5283 |
|
---|
5284 | or you could choose not to distribute `distributed-file', if
|
---|
5285 | cross-compilation does not matter.
|
---|
5286 |
|
---|
5287 | The points made through these examples are worth a summary:
|
---|
5288 |
|
---|
5289 | * Distributed files should never depend upon non-distributed built
|
---|
5290 | files.
|
---|
5291 |
|
---|
5292 | * Distributed files should be distributed will all their
|
---|
5293 | dependencies.
|
---|
5294 |
|
---|
5295 | * If a file is _intended_ be rebuilt by users, there is no point in
|
---|
5296 | distributing it.
|
---|
5297 |
|
---|
5298 | For desperate cases, it's always possible to disable this check by
|
---|
5299 | setting `distcleancheck_listfiles' as documented in *Note Dist::. Make
|
---|
5300 | sure you do understand the reason why `make distcheck' complains before
|
---|
5301 | you do this. `distcleancheck_listfiles' is a way to _hide_ errors, not
|
---|
5302 | to fix them. You can always do better.
|
---|
5303 |
|
---|
5304 |
|
---|
5305 | File: automake.info, Node: renamed objects, Prev: distcleancheck, Up: FAQ
|
---|
5306 |
|
---|
5307 | Why are object files sometimes renamed?
|
---|
5308 | =======================================
|
---|
5309 |
|
---|
5310 | This happens when per-target compilation flags are used. Object files
|
---|
5311 | need to be renamed just in case they would clash with object files
|
---|
5312 | compiled from the same sources, but with different flags. Consider the
|
---|
5313 | following example.
|
---|
5314 |
|
---|
5315 | bin_PROGRAMS = true false
|
---|
5316 | true_SOURCES = generic.c
|
---|
5317 | true_CPPFLAGS = -DEXIT_CODE=0
|
---|
5318 | false_SOURCES = generic.c
|
---|
5319 | false_CPPFLAGS = -DEXIT_CODE=1
|
---|
5320 |
|
---|
5321 | Obviously the two programs are built from the same source, but it would
|
---|
5322 | be bad if they shared the same object, because `generic.o' cannot be
|
---|
5323 | built with both `-DEXIT_CODE=0' *and* `-DEXIT_CODE=1'. Therefore
|
---|
5324 | `automake' outputs rules to build two different objects:
|
---|
5325 | `true-generic.o' and `false-generic.o'.
|
---|
5326 |
|
---|
5327 | `automake' doesn't actually look whether sources files are shared to
|
---|
5328 | decide if it must rename objects. It will just rename all objects of a
|
---|
5329 | target as soon as it sees per-target compilation flags are used.
|
---|
5330 |
|
---|
5331 | It's OK to share object files when per-target compilation flags are
|
---|
5332 | not used. For instance `true' and `false' will both use `version.o' in
|
---|
5333 | the following example.
|
---|
5334 |
|
---|
5335 | AM_CPPFLAGS = -DVERSION=1.0
|
---|
5336 | bin_PROGRAMS = true false
|
---|
5337 | true_SOURCES = true.c version.c
|
---|
5338 | false_SOURCES = false.c version.c
|
---|
5339 |
|
---|
5340 | Note that the renaming of objects is also affected by the
|
---|
5341 | `_SHORTNAME' variable (*note Program and Library Variables::).
|
---|
5342 |
|
---|
5343 |
|
---|
5344 | File: automake.info, Node: Macro and Variable Index, Next: General Index, Prev: FAQ, Up: Top
|
---|
5345 |
|
---|
5346 | Macro and Variable Index
|
---|
5347 | ************************
|
---|
5348 |
|
---|
5349 | * Menu:
|
---|
5350 |
|
---|
5351 | * _LDADD: Linking.
|
---|
5352 | * _LDFLAGS: Linking.
|
---|
5353 | * _LIBADD: A Library.
|
---|
5354 | * _SOURCES: Program Sources.
|
---|
5355 | * _TEXINFOS: Texinfo.
|
---|
5356 | * AC_CANONICAL_HOST: Optional.
|
---|
5357 | * AC_CANONICAL_SYSTEM: Optional.
|
---|
5358 | * AC_CONFIG_AUX_DIR: Optional.
|
---|
5359 | * AC_CONFIG_FILES: Requirements.
|
---|
5360 | * AC_CONFIG_HEADERS: Optional.
|
---|
5361 | * AC_DEFUN: Extending aclocal.
|
---|
5362 | * AC_F77_LIBRARY_LDFLAGS: Optional.
|
---|
5363 | * AC_LIBOBJ <1>: LTLIBOBJ.
|
---|
5364 | * AC_LIBOBJ: Optional.
|
---|
5365 | * AC_LIBSOURCE: Optional.
|
---|
5366 | * AC_LIBSOURCES: Optional.
|
---|
5367 | * AC_OUTPUT: Requirements.
|
---|
5368 | * AC_PREREQ: Extending aclocal.
|
---|
5369 | * AC_PROG_CXX: Optional.
|
---|
5370 | * AC_PROG_F77: Optional.
|
---|
5371 | * AC_PROG_LEX: Optional.
|
---|
5372 | * AC_PROG_LIBTOOL: Optional.
|
---|
5373 | * AC_PROG_RANLIB: Optional.
|
---|
5374 | * AC_PROG_YACC: Optional.
|
---|
5375 | * AC_SUBST: Optional.
|
---|
5376 | * ACLOCAL_AMFLAGS: Rebuilding.
|
---|
5377 | * AM_C_PROTOTYPES <1>: ANSI.
|
---|
5378 | * AM_C_PROTOTYPES <2>: Public macros.
|
---|
5379 | * AM_C_PROTOTYPES: Optional.
|
---|
5380 | * AM_CFLAGS: Program variables.
|
---|
5381 | * AM_CONDITIONAL: Conditionals.
|
---|
5382 | * AM_CONFIG_HEADER: Public macros.
|
---|
5383 | * AM_CPPFLAGS: Program variables.
|
---|
5384 | * am_cv_sys_posix_termios: Public macros.
|
---|
5385 | * AM_CXXFLAGS: C++ Support.
|
---|
5386 | * AM_ETAGSFLAGS: Tags.
|
---|
5387 | * AM_FFLAGS: Fortran 77 Support.
|
---|
5388 | * AM_GCJFLAGS: Java Support.
|
---|
5389 | * AM_GNU_GETTEXT: Optional.
|
---|
5390 | * AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL: Public macros.
|
---|
5391 | * AM_INIT_AUTOMAKE: Requirements.
|
---|
5392 | * AM_INSTALLCHECK_STD_OPTIONS_EXEMPT: Options.
|
---|
5393 | * AM_JAVACFLAGS: Java.
|
---|
5394 | * AM_LDFLAGS <1>: Program variables.
|
---|
5395 | * AM_LDFLAGS: Linking.
|
---|
5396 | * AM_MAINTAINER_MODE <1>: maintainer-mode.
|
---|
5397 | * AM_MAINTAINER_MODE: Optional.
|
---|
5398 | * AM_MAKEINFOFLAGS: Texinfo.
|
---|
5399 | * AM_PATH_LISPDIR: Public macros.
|
---|
5400 | * AM_PROG_GCJ: Public macros.
|
---|
5401 | * AM_RFLAGS: Fortran 77 Support.
|
---|
5402 | * AM_RUNTESTFLAGS: Tests.
|
---|
5403 | * AUTOCONF: Invoking Automake.
|
---|
5404 | * AUTOMAKE_OPTIONS <1>: Options.
|
---|
5405 | * AUTOMAKE_OPTIONS <2>: Dependencies.
|
---|
5406 | * AUTOMAKE_OPTIONS: ANSI.
|
---|
5407 | * bin_PROGRAMS: Program Sources.
|
---|
5408 | * bin_SCRIPTS: Scripts.
|
---|
5409 | * build_alias: Optional.
|
---|
5410 | * BUILT_SOURCES: Sources.
|
---|
5411 | * CC: Program variables.
|
---|
5412 | * CCAS: Assembly Support.
|
---|
5413 | * CCASFLAGS: Assembly Support.
|
---|
5414 | * CFLAGS: Program variables.
|
---|
5415 | * check_LTLIBRARIES: Libtool Convenience Libraries.
|
---|
5416 | * check_PROGRAMS: Program Sources.
|
---|
5417 | * check_SCRIPTS: Scripts.
|
---|
5418 | * CLASSPATH_ENV: Java.
|
---|
5419 | * CLEANFILES: Clean.
|
---|
5420 | * COMPILE: Program variables.
|
---|
5421 | * CPPFLAGS: Program variables.
|
---|
5422 | * CXX: C++ Support.
|
---|
5423 | * CXXCOMPILE: C++ Support.
|
---|
5424 | * CXXFLAGS: C++ Support.
|
---|
5425 | * CXXLINK: C++ Support.
|
---|
5426 | * DATA <1>: Data.
|
---|
5427 | * DATA: Uniform.
|
---|
5428 | * data_DATA: Data.
|
---|
5429 | * DEFS: Program variables.
|
---|
5430 | * DEJATOOL: Tests.
|
---|
5431 | * DESTDIR: Install.
|
---|
5432 | * dist_: Dist.
|
---|
5433 | * dist_lisp_LISP: Emacs Lisp.
|
---|
5434 | * dist_noinst_LISP: Emacs Lisp.
|
---|
5435 | * DIST_SUBDIRS <1>: Dist.
|
---|
5436 | * DIST_SUBDIRS: Top level.
|
---|
5437 | * DISTCHECK_CONFIGURE_FLAGS: Dist.
|
---|
5438 | * distcleancheck_listfiles <1>: distcleancheck.
|
---|
5439 | * distcleancheck_listfiles: Dist.
|
---|
5440 | * DISTCLEANFILES: Clean.
|
---|
5441 | * distuninstallcheck_listfiles: Dist.
|
---|
5442 | * ELCFILES: Emacs Lisp.
|
---|
5443 | * ETAGS_ARGS: Tags.
|
---|
5444 | * ETAGSFLAGS: Tags.
|
---|
5445 | * EXPECT: Tests.
|
---|
5446 | * EXTRA_DIST: Dist.
|
---|
5447 | * EXTRA_PROGRAMS: Conditional Programs.
|
---|
5448 | * F77: Fortran 77 Support.
|
---|
5449 | * F77COMPILE: Fortran 77 Support.
|
---|
5450 | * FFLAGS: Fortran 77 Support.
|
---|
5451 | * FLINK: Fortran 77 Support.
|
---|
5452 | * GCJFLAGS: Java Support.
|
---|
5453 | * GTAGS_ARGS: Tags.
|
---|
5454 | * HEADERS <1>: Headers.
|
---|
5455 | * HEADERS: Uniform.
|
---|
5456 | * host_alias: Optional.
|
---|
5457 | * host_triplet: Optional.
|
---|
5458 | * include_HEADERS: Headers.
|
---|
5459 | * INCLUDES: Program variables.
|
---|
5460 | * info_TEXINFOS: Texinfo.
|
---|
5461 | * JAVA: Uniform.
|
---|
5462 | * JAVAC: Java.
|
---|
5463 | * JAVACFLAGS: Java.
|
---|
5464 | * JAVAROOT: Java.
|
---|
5465 | * LDADD: Linking.
|
---|
5466 | * LDFLAGS: Program variables.
|
---|
5467 | * lib_LIBRARIES: A Library.
|
---|
5468 | * lib_LTLIBRARIES: Libtool Libraries.
|
---|
5469 | * LIBADD: A Library.
|
---|
5470 | * libexec_PROGRAMS: Program Sources.
|
---|
5471 | * libexec_SCRIPTS: Scripts.
|
---|
5472 | * LIBOBJS <1>: LTLIBOBJ.
|
---|
5473 | * LIBOBJS: Optional.
|
---|
5474 | * LIBRARIES: Uniform.
|
---|
5475 | * LIBS: Program variables.
|
---|
5476 | * LINK: Program variables.
|
---|
5477 | * LISP <1>: Emacs Lisp.
|
---|
5478 | * LISP: Uniform.
|
---|
5479 | * lisp_LISP: Emacs Lisp.
|
---|
5480 | * localstate_DATA: Data.
|
---|
5481 | * LTLIBOBJS: LTLIBOBJ.
|
---|
5482 | * MAINTAINERCLEANFILES: Clean.
|
---|
5483 | * MAKE: Top level.
|
---|
5484 | * MAKEFLAGS: Top level.
|
---|
5485 | * MAKEINFO: Texinfo.
|
---|
5486 | * MAKEINFOFLAGS: Texinfo.
|
---|
5487 | * man_MANS: Man pages.
|
---|
5488 | * MANS <1>: Man pages.
|
---|
5489 | * MANS: Uniform.
|
---|
5490 | * MOSTLYCLEANFILES: Clean.
|
---|
5491 | * nodist_: Dist.
|
---|
5492 | * noinst_HEADERS: Headers.
|
---|
5493 | * noinst_LIBRARIES: A Library.
|
---|
5494 | * noinst_LISP: Emacs Lisp.
|
---|
5495 | * noinst_LTLIBRARIES: Libtool Convenience Libraries.
|
---|
5496 | * noinst_PROGRAMS: Program Sources.
|
---|
5497 | * noinst_SCRIPTS: Scripts.
|
---|
5498 | * oldinclude_HEADERS: Headers.
|
---|
5499 | * PACKAGE: Dist.
|
---|
5500 | * PACKAGE, directory: Uniform.
|
---|
5501 | * PACKAGE, prevent definition: Public macros.
|
---|
5502 | * pkgdata_DATA: Data.
|
---|
5503 | * pkgdata_SCRIPTS: Scripts.
|
---|
5504 | * pkgdatadir: Uniform.
|
---|
5505 | * pkginclude_HEADERS: Headers.
|
---|
5506 | * pkgincludedir: Uniform.
|
---|
5507 | * pkglib_LIBRARIES: A Library.
|
---|
5508 | * pkglib_LTLIBRARIES: Libtool Libraries.
|
---|
5509 | * pkglib_PROGRAMS: Program Sources.
|
---|
5510 | * pkglibdir: Uniform.
|
---|
5511 | * pkgpyexecdir: Python.
|
---|
5512 | * pkgpythondir: Python.
|
---|
5513 | * PROGRAMS: Uniform.
|
---|
5514 | * pyexecdir: Python.
|
---|
5515 | * PYTHON <1>: Python.
|
---|
5516 | * PYTHON: Uniform.
|
---|
5517 | * PYTHON_EXEC_PREFIX: Python.
|
---|
5518 | * PYTHON_PLATFORM: Python.
|
---|
5519 | * PYTHON_PREFIX: Python.
|
---|
5520 | * PYTHON_VERSION: Python.
|
---|
5521 | * pythondir: Python.
|
---|
5522 | * RFLAGS: Fortran 77 Support.
|
---|
5523 | * RUNTEST: Tests.
|
---|
5524 | * RUNTESTDEFAULTFLAGS: Tests.
|
---|
5525 | * RUNTESTFLAGS: Tests.
|
---|
5526 | * sbin_PROGRAMS: Program Sources.
|
---|
5527 | * sbin_SCRIPTS: Scripts.
|
---|
5528 | * SCRIPTS <1>: Scripts.
|
---|
5529 | * SCRIPTS: Uniform.
|
---|
5530 | * sharedstate_DATA: Data.
|
---|
5531 | * SOURCES: Program Sources.
|
---|
5532 | * SUBDIRS: Top level.
|
---|
5533 | * SUFFIXES: Suffixes.
|
---|
5534 | * sysconf_DATA: Data.
|
---|
5535 | * TAGS_DEPENDENCIES: Tags.
|
---|
5536 | * target_alias: Optional.
|
---|
5537 | * TESTS: Tests.
|
---|
5538 | * TESTS_ENVIRONMENT: Tests.
|
---|
5539 | * TEXINFO_TEX: Texinfo.
|
---|
5540 | * TEXINFOS <1>: Texinfo.
|
---|
5541 | * TEXINFOS: Uniform.
|
---|
5542 | * VERSION: Dist.
|
---|
5543 | * VERSION, prevent definition: Public macros.
|
---|
5544 | * WARNINGS: Invoking Automake.
|
---|
5545 | * WITH_DMALLOC: Public macros.
|
---|
5546 | * WITH_REGEX: Public macros.
|
---|
5547 | * XFAIL_TESTS: Tests.
|
---|
5548 | * YACC: Optional.
|
---|
5549 |
|
---|
5550 |
|
---|
5551 | File: automake.info, Node: General Index, Prev: Macro and Variable Index, Up: Top
|
---|
5552 |
|
---|
5553 | General Index
|
---|
5554 | *************
|
---|
5555 |
|
---|
5556 | * Menu:
|
---|
5557 |
|
---|
5558 | * ## (special Automake comment): General Operation.
|
---|
5559 | * --acdir: aclocal options.
|
---|
5560 | * --add-missing: Invoking Automake.
|
---|
5561 | * --copy: Invoking Automake.
|
---|
5562 | * --cygnus: Invoking Automake.
|
---|
5563 | * --enable-maintainer-mode: Optional.
|
---|
5564 | * --force-missing: Invoking Automake.
|
---|
5565 | * --foreign: Invoking Automake.
|
---|
5566 | * --gnits: Invoking Automake.
|
---|
5567 | * --gnu: Invoking Automake.
|
---|
5568 | * --help <1>: aclocal options.
|
---|
5569 | * --help: Invoking Automake.
|
---|
5570 | * --include-deps: Invoking Automake.
|
---|
5571 | * --libdir: Invoking Automake.
|
---|
5572 | * --no-force: Invoking Automake.
|
---|
5573 | * --output: aclocal options.
|
---|
5574 | * --output-dir: Invoking Automake.
|
---|
5575 | * --print-ac-dir: aclocal options.
|
---|
5576 | * --verbose <1>: aclocal options.
|
---|
5577 | * --verbose: Invoking Automake.
|
---|
5578 | * --version <1>: aclocal options.
|
---|
5579 | * --version: Invoking Automake.
|
---|
5580 | * --warnings: Invoking Automake.
|
---|
5581 | * --with-dmalloc: Public macros.
|
---|
5582 | * --with-regex: Public macros.
|
---|
5583 | * -a: Invoking Automake.
|
---|
5584 | * -c: Invoking Automake.
|
---|
5585 | * -enable-debug, example: Conditionals.
|
---|
5586 | * -f: Invoking Automake.
|
---|
5587 | * -gnits, complete description: Gnits.
|
---|
5588 | * -gnu, complete description: Gnits.
|
---|
5589 | * -gnu, required files: Gnits.
|
---|
5590 | * -hook targets: Extending.
|
---|
5591 | * -I: aclocal options.
|
---|
5592 | * -i: Invoking Automake.
|
---|
5593 | * -local targets: Extending.
|
---|
5594 | * -module, libtool: Libtool Modules.
|
---|
5595 | * -o: Invoking Automake.
|
---|
5596 | * -v: Invoking Automake.
|
---|
5597 | * -W: Invoking Automake.
|
---|
5598 | * .la suffix, defined: Libtool Concept.
|
---|
5599 | * _DATA primary, defined: Data.
|
---|
5600 | * _DEPENDENCIES, defined: Linking.
|
---|
5601 | * _HEADERS primary, defined: Headers.
|
---|
5602 | * _JAVA primary, defined: Java.
|
---|
5603 | * _LDFLAGS, defined: Linking.
|
---|
5604 | * _LDFLAGS, libtool: Libtool Flags.
|
---|
5605 | * _LIBADD primary, defined: A Library.
|
---|
5606 | * _LIBADD, libtool: Libtool Flags.
|
---|
5607 | * _LIBRARIES primary, defined: A Library.
|
---|
5608 | * _LISP primary, defined: Emacs Lisp.
|
---|
5609 | * _LTLIBRARIES primary, defined: Libtool Libraries.
|
---|
5610 | * _MANS primary, defined: Man pages.
|
---|
5611 | * _PROGRAMS primary variable: Uniform.
|
---|
5612 | * _PYTHON primary, defined: Python.
|
---|
5613 | * _SCRIPTS primary, defined: Scripts.
|
---|
5614 | * _SOURCES and header files: Program Sources.
|
---|
5615 | * _SOURCES primary, defined: Program Sources.
|
---|
5616 | * _TEXINFOS primary, defined: Texinfo.
|
---|
5617 | * AC_SUBST and SUBDIRS: Top level.
|
---|
5618 | * acinclude.m4, defined: Complete.
|
---|
5619 | * aclocal program, introduction: Complete.
|
---|
5620 | * aclocal search path: Macro search path.
|
---|
5621 | * aclocal, extending: Extending aclocal.
|
---|
5622 | * aclocal, Invoking: Invoking aclocal.
|
---|
5623 | * aclocal, Options: aclocal options.
|
---|
5624 | * aclocal.m4, preexisting: Complete.
|
---|
5625 | * Adding new SUFFIXES: Suffixes.
|
---|
5626 | * all: Extending.
|
---|
5627 | * all-local: Extending.
|
---|
5628 | * ALLOCA, special handling: LIBOBJS.
|
---|
5629 | * AM_CONDITIONAL and SUBDIRS: Top level.
|
---|
5630 | * AM_INIT_AUTOMAKE, example use: Complete.
|
---|
5631 | * AM_MAINTAINER_MODE, purpose: maintainer-mode.
|
---|
5632 | * ansi2knr: ANSI.
|
---|
5633 | * ansi2knr and LIBOBJS: ANSI.
|
---|
5634 | * ansi2knr and LTLIBOBJS: ANSI.
|
---|
5635 | * Append operator: General Operation.
|
---|
5636 | * autogen.sh and autoreconf: Libtool Issues.
|
---|
5637 | * Automake constraints: Introduction.
|
---|
5638 | * Automake options: Invoking Automake.
|
---|
5639 | * Automake requirements <1>: Requirements.
|
---|
5640 | * Automake requirements: Introduction.
|
---|
5641 | * Automake, invoking: Invoking Automake.
|
---|
5642 | * Automake, recursive operation: General Operation.
|
---|
5643 | * Automatic dependency tracking: Dependencies.
|
---|
5644 | * Automatic linker selection: How the Linker is Chosen.
|
---|
5645 | * autoreconf and libtoolize: Libtool Issues.
|
---|
5646 | * Auxiliary programs: Auxiliary Programs.
|
---|
5647 | * Avoiding path stripping: Alternative.
|
---|
5648 | * bootstrap.sh and autoreconf: Libtool Issues.
|
---|
5649 | * BUGS, reporting: Introduction.
|
---|
5650 | * BUILT_SOURCES, defined: Sources.
|
---|
5651 | * C++ support: C++ Support.
|
---|
5652 | * canonicalizing Automake variables: Canonicalization.
|
---|
5653 | * cfortran: Mixing Fortran 77 With C and C++.
|
---|
5654 | * check: Extending.
|
---|
5655 | * check primary prefix, definition: Uniform.
|
---|
5656 | * check-local: Extending.
|
---|
5657 | * clean: Extending.
|
---|
5658 | * clean-local: Extending.
|
---|
5659 | * Comment, special to Automake: General Operation.
|
---|
5660 | * Complete example: Complete.
|
---|
5661 | * Conditional example, -enable-debug: Conditionals.
|
---|
5662 | * conditional libtool libraries: Conditional Libtool Libraries.
|
---|
5663 | * Conditional programs: Conditional Programs.
|
---|
5664 | * Conditional subdirectories: Top level.
|
---|
5665 | * Conditional SUBDIRS: Top level.
|
---|
5666 | * Conditionals: Conditionals.
|
---|
5667 | * config.guess: Invoking Automake.
|
---|
5668 | * configure.in, from GNU Hello: Hello.
|
---|
5669 | * configure.in, scanning: configure.
|
---|
5670 | * Constraints of Automake: Introduction.
|
---|
5671 | * convenience libraries, libtool: Libtool Convenience Libraries.
|
---|
5672 | * cpio example: Uniform.
|
---|
5673 | * CVS and generated files: CVS.
|
---|
5674 | * CVS and third-party files: CVS.
|
---|
5675 | * CVS and timestamps: CVS.
|
---|
5676 | * cvs-dist: General Operation.
|
---|
5677 | * cvs-dist, non-standard example: General Operation.
|
---|
5678 | * Cygnus strictness: Cygnus.
|
---|
5679 | * DATA primary, defined: Data.
|
---|
5680 | * de-ANSI-fication, defined: ANSI.
|
---|
5681 | * dejagnu: Tests.
|
---|
5682 | * depcomp: Dependencies.
|
---|
5683 | * dependencies and distributed files: distcleancheck.
|
---|
5684 | * Dependency tracking: Dependencies.
|
---|
5685 | * Dependency tracking, disabling: Dependencies.
|
---|
5686 | * dirlist: Macro search path.
|
---|
5687 | * Disabling dependency tracking: Dependencies.
|
---|
5688 | * dist: Dist.
|
---|
5689 | * dist-bzip2: Options.
|
---|
5690 | * dist-gzip: Dist.
|
---|
5691 | * dist-hook <1>: Extending.
|
---|
5692 | * dist-hook: Dist.
|
---|
5693 | * dist-shar: Options.
|
---|
5694 | * dist-tarZ: Options.
|
---|
5695 | * dist-zip: Options.
|
---|
5696 | * dist_ and nobase_: Alternative.
|
---|
5697 | * DIST_SUBDIRS, explained: Top level.
|
---|
5698 | * distcheck: Dist.
|
---|
5699 | * distclean <1>: distcleancheck.
|
---|
5700 | * distclean: Extending.
|
---|
5701 | * distclean, diagnostic: distcleancheck.
|
---|
5702 | * distclean-local: Extending.
|
---|
5703 | * distcleancheck <1>: distcleancheck.
|
---|
5704 | * distcleancheck: Dist.
|
---|
5705 | * dmalloc, support for: Public macros.
|
---|
5706 | * dvi: Extending.
|
---|
5707 | * dvi-local: Extending.
|
---|
5708 | * E-mail, bug reports: Introduction.
|
---|
5709 | * EDITION Texinfo flag: Texinfo.
|
---|
5710 | * else: Conditionals.
|
---|
5711 | * endif: Conditionals.
|
---|
5712 | * Example conditional -enable-debug: Conditionals.
|
---|
5713 | * Example of recursive operation: General Operation.
|
---|
5714 | * Example of shared libraries: Libtool Libraries.
|
---|
5715 | * Example, EXTRA_PROGRAMS: Uniform.
|
---|
5716 | * Example, false and true: true.
|
---|
5717 | * Example, GNU Hello: Hello.
|
---|
5718 | * Example, handling Texinfo files: Hello.
|
---|
5719 | * Example, mixed language: Mixing Fortran 77 With C and C++.
|
---|
5720 | * Example, regression test: Hello.
|
---|
5721 | * Executable extension: EXEEXT.
|
---|
5722 | * Exit status 77, special interpretation: Tests.
|
---|
5723 | * Expected test failure: Tests.
|
---|
5724 | * Extending aclocal: Extending aclocal.
|
---|
5725 | * Extending list of installation directories: Uniform.
|
---|
5726 | * Extension, executable: EXEEXT.
|
---|
5727 | * Extra files distributed with Automake: Invoking Automake.
|
---|
5728 | * EXTRA_, prepending: Uniform.
|
---|
5729 | * EXTRA_prog_SOURCES, defined: Conditional Sources.
|
---|
5730 | * EXTRA_PROGRAMS, defined <1>: Conditional Programs.
|
---|
5731 | * EXTRA_PROGRAMS, defined: Uniform.
|
---|
5732 | * false Example: true.
|
---|
5733 | * Files distributed with Automake: Invoking Automake.
|
---|
5734 | * First line of Makefile.am: General Operation.
|
---|
5735 | * FLIBS, defined: Mixing Fortran 77 With C and C++.
|
---|
5736 | * foreign strictness: Strictness.
|
---|
5737 | * Fortran 77 support: Fortran 77 Support.
|
---|
5738 | * Fortran 77, mixing with C and C++: Mixing Fortran 77 With C and C++.
|
---|
5739 | * Fortran 77, Preprocessing: Preprocessing Fortran 77.
|
---|
5740 | * generated files and CVS: CVS.
|
---|
5741 | * generated files, distributed: CVS.
|
---|
5742 | * Gettext support: gettext.
|
---|
5743 | * gnits strictness: Strictness.
|
---|
5744 | * GNU Gettext support: gettext.
|
---|
5745 | * GNU Hello, configure.in: Hello.
|
---|
5746 | * GNU Hello, example: Hello.
|
---|
5747 | * GNU make extensions: General Operation.
|
---|
5748 | * GNU Makefile standards: Introduction.
|
---|
5749 | * gnu strictness: Strictness.
|
---|
5750 | * Header files in _SOURCES: Program Sources.
|
---|
5751 | * HEADERS primary, defined: Headers.
|
---|
5752 | * HEADERS, installation directories: Headers.
|
---|
5753 | * Hello example: Hello.
|
---|
5754 | * Hello, configure.in: Hello.
|
---|
5755 | * hook targets: Extending.
|
---|
5756 | * HP-UX 10, lex problems: Public macros.
|
---|
5757 | * HTML support, example: Uniform.
|
---|
5758 | * id: Tags.
|
---|
5759 | * if: Conditionals.
|
---|
5760 | * include: Include.
|
---|
5761 | * INCLUDES, example usage: Hello.
|
---|
5762 | * Including Makefile fragment: Include.
|
---|
5763 | * info <1>: Extending.
|
---|
5764 | * info: Options.
|
---|
5765 | * info-local: Extending.
|
---|
5766 | * install <1>: Extending.
|
---|
5767 | * install: Install.
|
---|
5768 | * Install hook: Install.
|
---|
5769 | * Install, two parts of: Install.
|
---|
5770 | * install-data: Install.
|
---|
5771 | * install-data-hook: Extending.
|
---|
5772 | * install-data-local <1>: Extending.
|
---|
5773 | * install-data-local: Install.
|
---|
5774 | * install-exec <1>: Extending.
|
---|
5775 | * install-exec: Install.
|
---|
5776 | * install-exec-hook: Extending.
|
---|
5777 | * install-exec-local <1>: Extending.
|
---|
5778 | * install-exec-local: Install.
|
---|
5779 | * install-info <1>: Options.
|
---|
5780 | * install-info: Texinfo.
|
---|
5781 | * install-info target: Texinfo.
|
---|
5782 | * install-man <1>: Options.
|
---|
5783 | * install-man: Man pages.
|
---|
5784 | * install-man target: Man pages.
|
---|
5785 | * install-strip: Install.
|
---|
5786 | * Installation directories, extending list: Uniform.
|
---|
5787 | * Installation support: Install.
|
---|
5788 | * installcheck: Extending.
|
---|
5789 | * installcheck-local: Extending.
|
---|
5790 | * installdirs <1>: Extending.
|
---|
5791 | * installdirs: Install.
|
---|
5792 | * installdirs-local: Extending.
|
---|
5793 | * Installing headers: Headers.
|
---|
5794 | * Installing scripts: Scripts.
|
---|
5795 | * installing versioned binaries: Extending.
|
---|
5796 | * Invoking aclocal: Invoking aclocal.
|
---|
5797 | * Invoking Automake: Invoking Automake.
|
---|
5798 | * JAVA primary, defined: Java.
|
---|
5799 | * JAVA restrictions: Java.
|
---|
5800 | * Java support: Java Support.
|
---|
5801 | * lex problems with HP-UX 10: Public macros.
|
---|
5802 | * lex, multiple lexers: Yacc and Lex.
|
---|
5803 | * LIBADD primary, defined: A Library.
|
---|
5804 | * libltdl, introduction: Libtool Concept.
|
---|
5805 | * LIBOBJS and ansi2knr: ANSI.
|
---|
5806 | * LIBOBJS, special handling: LIBOBJS.
|
---|
5807 | * LIBRARIES primary, defined: A Library.
|
---|
5808 | * libtool convenience libraries: Libtool Convenience Libraries.
|
---|
5809 | * libtool libraries, conditional: Conditional Libtool Libraries.
|
---|
5810 | * libtool library, definition: Libtool Concept.
|
---|
5811 | * libtool modules: Libtool Modules.
|
---|
5812 | * libtool, introduction: Libtool Concept.
|
---|
5813 | * libtoolize and autoreconf: Libtool Issues.
|
---|
5814 | * libtoolize, no longer run by Automake: Libtool Issues.
|
---|
5815 | * Linking Fortran 77 with C and C++: Mixing Fortran 77 With C and C++.
|
---|
5816 | * LISP primary, defined: Emacs Lisp.
|
---|
5817 | * LN_S example: Extending.
|
---|
5818 | * local targets: Extending.
|
---|
5819 | * LTLIBOBJS and ansi2knr: ANSI.
|
---|
5820 | * LTLIBOBJS, special handling: LTLIBOBJ.
|
---|
5821 | * LTLIBRARIES primary, defined: Libtool Libraries.
|
---|
5822 | * ltmain.sh not found: Libtool Issues.
|
---|
5823 | * Macro search path: Macro search path.
|
---|
5824 | * Macros Automake recognizes: Optional.
|
---|
5825 | * make check: Tests.
|
---|
5826 | * make clean support: Clean.
|
---|
5827 | * make dist: Dist.
|
---|
5828 | * make distcheck: Dist.
|
---|
5829 | * make distcleancheck: Dist.
|
---|
5830 | * make distuninstallcheck: Dist.
|
---|
5831 | * make install support: Install.
|
---|
5832 | * make installcheck: Options.
|
---|
5833 | * Make targets, overriding: General Operation.
|
---|
5834 | * Makefile fragment, including: Include.
|
---|
5835 | * Makefile.am, first line: General Operation.
|
---|
5836 | * MANS primary, defined: Man pages.
|
---|
5837 | * mdate-sh: Texinfo.
|
---|
5838 | * missing, purpose: maintainer-mode.
|
---|
5839 | * Mixed language example: Mixing Fortran 77 With C and C++.
|
---|
5840 | * Mixing Fortran 77 with C and C++: Mixing Fortran 77 With C and C++.
|
---|
5841 | * Mixing Fortran 77 with C and/or C++: Mixing Fortran 77 With C and C++.
|
---|
5842 | * modules, libtool: Libtool Modules.
|
---|
5843 | * mostlyclean: Extending.
|
---|
5844 | * mostlyclean-local: Extending.
|
---|
5845 | * Multiple configure.in files: Invoking Automake.
|
---|
5846 | * Multiple lex lexers: Yacc and Lex.
|
---|
5847 | * Multiple yacc parsers: Yacc and Lex.
|
---|
5848 | * no-dependencies: Dependencies.
|
---|
5849 | * no-installinfo: Texinfo.
|
---|
5850 | * no-installman: Man pages.
|
---|
5851 | * no-texinfo.tex: Texinfo.
|
---|
5852 | * nobase_: Alternative.
|
---|
5853 | * nobase_ and dist_ or nodist_: Alternative.
|
---|
5854 | * nodist_ and nobase_: Alternative.
|
---|
5855 | * noinst primary prefix, definition: Uniform.
|
---|
5856 | * noinstall-info target: Texinfo.
|
---|
5857 | * noinstall-man target: Man pages.
|
---|
5858 | * Non-GNU packages: Strictness.
|
---|
5859 | * Non-standard targets: General Operation.
|
---|
5860 | * Objects in subdirectory: Program and Library Variables.
|
---|
5861 | * Option, ansi2knr: Options.
|
---|
5862 | * Option, check-news: Options.
|
---|
5863 | * Option, cygnus: Options.
|
---|
5864 | * Option, dejagnu: Options.
|
---|
5865 | * Option, dist-bzip2: Options.
|
---|
5866 | * Option, dist-shar: Options.
|
---|
5867 | * Option, dist-tarZ: Options.
|
---|
5868 | * Option, dist-zip: Options.
|
---|
5869 | * Option, foreign: Options.
|
---|
5870 | * Option, gnits: Options.
|
---|
5871 | * Option, gnu: Options.
|
---|
5872 | * Option, no-define: Options.
|
---|
5873 | * Option, no-dependencies: Options.
|
---|
5874 | * Option, no-exeext: Options.
|
---|
5875 | * Option, no-installinfo: Options.
|
---|
5876 | * Option, no-installman: Options.
|
---|
5877 | * Option, no-texinfo: Options.
|
---|
5878 | * Option, nostdinc: Options.
|
---|
5879 | * Option, readme-alpha: Options.
|
---|
5880 | * Option, version: Options.
|
---|
5881 | * Option, warnings: Options.
|
---|
5882 | * Options, aclocal: aclocal options.
|
---|
5883 | * Options, Automake: Invoking Automake.
|
---|
5884 | * Options, std-options: Options.
|
---|
5885 | * Overriding make targets: General Operation.
|
---|
5886 | * Overriding make variables: General Operation.
|
---|
5887 | * Path stripping, avoiding: Alternative.
|
---|
5888 | * pdf: Extending.
|
---|
5889 | * pdf-local: Extending.
|
---|
5890 | * per-target compilation flags, defined: Program and Library Variables.
|
---|
5891 | * pkgdatadir, defined: Uniform.
|
---|
5892 | * pkgincludedir, defined: Uniform.
|
---|
5893 | * pkglibdir, defined: Uniform.
|
---|
5894 | * POSIX termios headers: Public macros.
|
---|
5895 | * Preprocessing Fortran 77: Preprocessing Fortran 77.
|
---|
5896 | * Primary variable, DATA: Data.
|
---|
5897 | * Primary variable, defined: Uniform.
|
---|
5898 | * Primary variable, HEADERS: Headers.
|
---|
5899 | * Primary variable, JAVA: Java.
|
---|
5900 | * Primary variable, LIBADD: A Library.
|
---|
5901 | * Primary variable, LIBRARIES: A Library.
|
---|
5902 | * Primary variable, LISP: Emacs Lisp.
|
---|
5903 | * Primary variable, LTLIBRARIES: Libtool Libraries.
|
---|
5904 | * Primary variable, MANS: Man pages.
|
---|
5905 | * Primary variable, PROGRAMS: Uniform.
|
---|
5906 | * Primary variable, PYTHON: Python.
|
---|
5907 | * Primary variable, SCRIPTS: Scripts.
|
---|
5908 | * Primary variable, SOURCES: Program Sources.
|
---|
5909 | * Primary variable, TEXINFOS: Texinfo.
|
---|
5910 | * prog_LDADD, defined: Linking.
|
---|
5911 | * PROGRAMS primary variable: Uniform.
|
---|
5912 | * Programs, auxiliary: Auxiliary Programs.
|
---|
5913 | * PROGRAMS, bindir: Program Sources.
|
---|
5914 | * Programs, conditional: Conditional Programs.
|
---|
5915 | * ps: Extending.
|
---|
5916 | * ps-local: Extending.
|
---|
5917 | * PYTHON primary, defined: Python.
|
---|
5918 | * Ratfor programs: Preprocessing Fortran 77.
|
---|
5919 | * README-alpha: Gnits.
|
---|
5920 | * rebuild rules: CVS.
|
---|
5921 | * Recognized macros by Automake: Optional.
|
---|
5922 | * Recursive operation of Automake: General Operation.
|
---|
5923 | * regex package: Public macros.
|
---|
5924 | * Regression test example: Hello.
|
---|
5925 | * Reporting BUGS: Introduction.
|
---|
5926 | * Requirements of Automake: Requirements.
|
---|
5927 | * Requirements, Automake: Introduction.
|
---|
5928 | * Restrictions for JAVA: Java.
|
---|
5929 | * rx package: Public macros.
|
---|
5930 | * Scanning configure.in: configure.
|
---|
5931 | * SCRIPTS primary, defined: Scripts.
|
---|
5932 | * SCRIPTS, installation directories: Scripts.
|
---|
5933 | * Selecting the linker automatically: How the Linker is Chosen.
|
---|
5934 | * Shared libraries, support for: A Shared Library.
|
---|
5935 | * site.exp: Tests.
|
---|
5936 | * SOURCES primary, defined: Program Sources.
|
---|
5937 | * Special Automake comment: General Operation.
|
---|
5938 | * Strictness, command line: Invoking Automake.
|
---|
5939 | * Strictness, defined: Strictness.
|
---|
5940 | * Strictness, foreign: Strictness.
|
---|
5941 | * Strictness, gnits: Strictness.
|
---|
5942 | * Strictness, gnu: Strictness.
|
---|
5943 | * Subdirectories, building conditionally: Top level.
|
---|
5944 | * Subdirectory, objects in: Program and Library Variables.
|
---|
5945 | * SUBDIRS and AC_SUBST: Top level.
|
---|
5946 | * SUBDIRS and AM_CONDITIONAL: Top level.
|
---|
5947 | * SUBDIRS, conditional: Top level.
|
---|
5948 | * SUBDIRS, explained: Top level.
|
---|
5949 | * suffix .la, defined: Libtool Concept.
|
---|
5950 | * suffix .lo, defined: Libtool Concept.
|
---|
5951 | * SUFFIXES, adding: Suffixes.
|
---|
5952 | * Support for C++: C++ Support.
|
---|
5953 | * Support for Fortran 77: Fortran 77 Support.
|
---|
5954 | * Support for GNU Gettext: gettext.
|
---|
5955 | * Support for Java: Java Support.
|
---|
5956 | * tags: Tags.
|
---|
5957 | * TAGS support: Tags.
|
---|
5958 | * Target, install-info: Texinfo.
|
---|
5959 | * Target, install-man: Man pages.
|
---|
5960 | * Target, noinstall-info: Texinfo.
|
---|
5961 | * Target, noinstall-man: Man pages.
|
---|
5962 | * termios POSIX headers: Public macros.
|
---|
5963 | * Test suites: Tests.
|
---|
5964 | * Tests, expected failure: Tests.
|
---|
5965 | * Texinfo file handling example: Hello.
|
---|
5966 | * Texinfo flag, EDITION: Texinfo.
|
---|
5967 | * Texinfo flag, UPDATED: Texinfo.
|
---|
5968 | * Texinfo flag, UPDATED-MONTH: Texinfo.
|
---|
5969 | * Texinfo flag, VERSION: Texinfo.
|
---|
5970 | * texinfo.tex: Texinfo.
|
---|
5971 | * TEXINFOS primary, defined: Texinfo.
|
---|
5972 | * third-party files and CVS: CVS.
|
---|
5973 | * timestamps and CVS: CVS.
|
---|
5974 | * true Example: true.
|
---|
5975 | * underquoted AC_DEFUN: Extending aclocal.
|
---|
5976 | * Uniform naming scheme: Uniform.
|
---|
5977 | * uninstall <1>: Extending.
|
---|
5978 | * uninstall: Install.
|
---|
5979 | * uninstall-hook: Extending.
|
---|
5980 | * uninstall-local: Extending.
|
---|
5981 | * UPDATED Texinfo flag: Texinfo.
|
---|
5982 | * UPDATED-MONTH Texinfo flag: Texinfo.
|
---|
5983 | * user variables: User Variables.
|
---|
5984 | * Variables, overriding: General Operation.
|
---|
5985 | * variables, reserved for the user: User Variables.
|
---|
5986 | * VERSION Texinfo flag: Texinfo.
|
---|
5987 | * versioned binaries, installing: Extending.
|
---|
5988 | * wildcards: wildcards.
|
---|
5989 | * Windows: EXEEXT.
|
---|
5990 | * yacc, multiple parsers: Yacc and Lex.
|
---|
5991 | * ylwrap: Yacc and Lex.
|
---|
5992 | * zardoz example: Complete.
|
---|
5993 |
|
---|
5994 |
|
---|
5995 |
|
---|
5996 | Tag Table:
|
---|
5997 | Node: Top1157
|
---|
5998 | Node: Introduction3023
|
---|
5999 | Ref: Introduction-Footnote-14486
|
---|
6000 | Ref: Introduction-Footnote-24635
|
---|
6001 | Node: Generalities4836
|
---|
6002 | Node: General Operation5440
|
---|
6003 | Node: Strictness8115
|
---|
6004 | Node: Uniform9851
|
---|
6005 | Node: Canonicalization13666
|
---|
6006 | Node: User Variables14691
|
---|
6007 | Node: Auxiliary Programs15925
|
---|
6008 | Node: Examples18264
|
---|
6009 | Node: Complete18588
|
---|
6010 | Node: Hello20586
|
---|
6011 | Node: true23408
|
---|
6012 | Node: Invoking Automake26155
|
---|
6013 | Node: configure32758
|
---|
6014 | Node: Requirements33802
|
---|
6015 | Node: Optional34730
|
---|
6016 | Node: Invoking aclocal40081
|
---|
6017 | Node: aclocal options41690
|
---|
6018 | Node: Macro search path42662
|
---|
6019 | Node: Macros46829
|
---|
6020 | Node: Public macros47309
|
---|
6021 | Node: Private macros54228
|
---|
6022 | Node: Extending aclocal55620
|
---|
6023 | Node: Top level58550
|
---|
6024 | Ref: Top level-Footnote-163926
|
---|
6025 | Node: Alternative64068
|
---|
6026 | Ref: Alternative-Footnote-165436
|
---|
6027 | Node: Rebuilding65561
|
---|
6028 | Node: Programs66326
|
---|
6029 | Node: A Program67367
|
---|
6030 | Node: Program Sources68097
|
---|
6031 | Node: Linking70063
|
---|
6032 | Node: Conditional Sources72359
|
---|
6033 | Node: Conditional Programs75086
|
---|
6034 | Node: A Library76890
|
---|
6035 | Node: A Shared Library78159
|
---|
6036 | Node: Libtool Concept79120
|
---|
6037 | Node: Libtool Libraries81184
|
---|
6038 | Node: Conditional Libtool Libraries81853
|
---|
6039 | Node: Conditional Libtool Sources84207
|
---|
6040 | Node: Libtool Convenience Libraries85541
|
---|
6041 | Node: Libtool Modules87344
|
---|
6042 | Node: Libtool Flags87902
|
---|
6043 | Node: LTLIBOBJ88403
|
---|
6044 | Node: Libtool Issues88901
|
---|
6045 | Node: Program and Library Variables91738
|
---|
6046 | Ref: Program and Library Variables-Footnote-1100770
|
---|
6047 | Node: LIBOBJS100853
|
---|
6048 | Node: Program variables101512
|
---|
6049 | Node: Yacc and Lex103826
|
---|
6050 | Node: C++ Support108761
|
---|
6051 | Node: Assembly Support109592
|
---|
6052 | Node: Fortran 77 Support110364
|
---|
6053 | Ref: Fortran 77 Support-Footnote-1111943
|
---|
6054 | Node: Preprocessing Fortran 77112146
|
---|
6055 | Node: Compiling Fortran 77 Files112736
|
---|
6056 | Node: Mixing Fortran 77 With C and C++113295
|
---|
6057 | Ref: Mixing Fortran 77 With C and C++-Footnote-1115656
|
---|
6058 | Node: How the Linker is Chosen115959
|
---|
6059 | Node: Fortran 77 and Autoconf118504
|
---|
6060 | Node: Java Support118919
|
---|
6061 | Node: Support for Other Languages120121
|
---|
6062 | Node: ANSI120674
|
---|
6063 | Node: Dependencies123099
|
---|
6064 | Ref: Dependencies-Footnote-1124818
|
---|
6065 | Node: EXEEXT124984
|
---|
6066 | Node: Other objects127177
|
---|
6067 | Node: Scripts127766
|
---|
6068 | Node: Headers128850
|
---|
6069 | Ref: Headers-Footnote-1129551
|
---|
6070 | Node: Data129784
|
---|
6071 | Node: Sources130433
|
---|
6072 | Node: Built sources example133197
|
---|
6073 | Node: Other GNU Tools139623
|
---|
6074 | Node: Emacs Lisp140108
|
---|
6075 | Node: gettext141358
|
---|
6076 | Node: Libtool141855
|
---|
6077 | Node: Java142100
|
---|
6078 | Node: Python143729
|
---|
6079 | Node: Documentation146900
|
---|
6080 | Node: Texinfo147198
|
---|
6081 | Node: Man pages150864
|
---|
6082 | Node: Install153151
|
---|
6083 | Node: Clean157517
|
---|
6084 | Node: Dist158867
|
---|
6085 | Node: Tests166262
|
---|
6086 | Node: Options169865
|
---|
6087 | Node: Miscellaneous176112
|
---|
6088 | Node: Tags176496
|
---|
6089 | Node: Suffixes178505
|
---|
6090 | Node: Multilibs180057
|
---|
6091 | Node: Include180682
|
---|
6092 | Node: Conditionals181570
|
---|
6093 | Node: Gnits184273
|
---|
6094 | Node: Cygnus186132
|
---|
6095 | Node: Extending187951
|
---|
6096 | Node: Distributing190614
|
---|
6097 | Node: API versioning191244
|
---|
6098 | Node: FAQ193875
|
---|
6099 | Node: CVS194489
|
---|
6100 | Node: maintainer-mode201219
|
---|
6101 | Node: wildcards204835
|
---|
6102 | Node: distcleancheck208084
|
---|
6103 | Node: renamed objects212769
|
---|
6104 | Node: Macro and Variable Index214272
|
---|
6105 | Node: General Index224814
|
---|
6106 |
|
---|
6107 | End Tag Table
|
---|