From: Tom Tromey Date: Sun, 8 Sep 1996 20:15:14 +0000 (+0000) Subject: Doc updates. Bug fixes. Removed old files. Check versions X-Git-Tag: Release-1-1d~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=642c65331aab458ddcb54703d8ff01e1bf920310;p=thirdparty%2Fautomake.git Doc updates. Bug fixes. Removed old files. Check versions --- diff --git a/ChangeLog b/ChangeLog index 80d0c3102..9a10b01f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,25 @@ Sun Sep 8 09:00:37 1996 Tom Tromey + * m4/AM_PROG_CC_STDC.m4: Applied patch from Jim Meyering. + + * automake.in (scan_configure): Handle AM_WITH_REGEX. + (handle_lib_objects): Require .h files in %libsources but don't + generate dependencies for them. + (scan_configure): Also require rx.h and regex.h. + + * m4/Makefile.am (m4data_DATA): Don't include AM_PROG_LIBTOOL, + AM_FEATURE_CTYPE, AM_FEATURE_ERRNO, AM_FEATURE_EXIT, + AM_SYSTEM_HEADER. + + * texi-version.am: Use "cp; rm" and not "mv", to work around + broken mvs. + * automake.in ($package_version): New global. (scan_configure): Set it. (check_gnits_standards): Verify version string; require README-alpha if alpha version. + (scan_configure): Recognize AM_FUNC_FNMATCH, + AM_REPLACE_GNU_GETOPT. * Makefile.am (installcheck-local): Check all scripts. diff --git a/THANKS b/THANKS index d41d300b6..9c58c3c5f 100644 --- a/THANKS +++ b/THANKS @@ -6,6 +6,7 @@ Andreas Schwab David A. Swierczek Dieter Baron François Pinard +Fred Fish Glenn Amerine Gord Matzigkeit Greg A. Woods diff --git a/TODO b/TODO index ba6c4c29f..d18e09bcf 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,16 @@ Priorities for release: [ none ] +* actually use acinstall program + !! Must fix require_file stuff. It is really gross, and I don't understand it any more. * error messages should print ``[info blah blah]'' command when a certain part of the standards apply. +* patch from Joel Weber about fixing yacc; in particular generating .h file + !! remove autosystem-specific macros !! should write autoconf-style doc entries for each m4 macro @@ -310,14 +314,12 @@ AM_ macros. should write more complete explanation of implicit copying semantics -finish yacc, lex, c++ nodes +finish yacc, lex Document customary ordering of Makefile.am. From François. must document that @ALLOCA@ works in _LDADD -Must document BUILT_SOURCES variable. See depend.am. - Should include extended version of diagram from Autoconf (suggested by Greg Woods) @@ -334,8 +336,6 @@ document rebuilding configure. CONFIGURE_DEPENDENCIES document new variables introduced when AC_CANONICAL_* used -document canonicalization for texinfos - automake must be run in each directory with a configure.in This is insufficiently clear @@ -346,18 +346,11 @@ document actual uses of PACKAGE and VERSION Must document aclocal program -djm says: -David> A list of autoconf macros that can be required for use with -David> automake, all in one place, would be helpful. - document *not* putting config.h into _SOURCES document variable scanning: $() and ${} interpolation -document --build-dir - -document the fact that you can re-run automake (s/ args) to get back -into a "maintainer" mode (auto-dependencies) +mention libit when talking about LIBOBJS ================================================================ diff --git a/acinstall b/acinstall index e77fdf5a4..7f9e9091a 100755 --- a/acinstall +++ b/acinstall @@ -20,7 +20,7 @@ fi # Maybe if the installed file has no serial number we should just # assume it is ancient. -instserial="`grep '^# serial' $dir/$file | sed -e 's/^# serial //g'`" +instserial="`grep '^# serial ' $dir/$file | sed -e 's/^# serial //g'`" if test -z "$instserial"; then echo "acinstall: no serial number in $dir/$file" 1>&2 exit 1 diff --git a/aclocal.m4 b/aclocal.m4 index 884c25a27..8a40624e4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,9 +1,11 @@ -dnl aclocal.m4 generated automatically by aclocal 1.1c +dnl aclocal.m4 generated automatically by aclocal 1.1d # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. +# serial 1 + dnl Usage: dnl AM_INIT_AUTOMAKE(package,version) @@ -11,8 +13,10 @@ AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AM_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") VERSION=[$2] AC_SUBST(VERSION) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_ARG_PROGRAM AC_PROG_MAKE_SET]) @@ -22,9 +26,11 @@ AC_PROG_MAKE_SET]) ## From Franc,ois Pinard ## ## --------------------------------------------------------- ## +# serial 1 + AC_DEFUN(AM_PROG_INSTALL, [AC_REQUIRE([AC_PROG_INSTALL]) -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' AC_SUBST(INSTALL_SCRIPT)dnl ]) diff --git a/automake.in b/automake.in index 5c3f67ca9..a594d7f50 100755 --- a/automake.in +++ b/automake.in @@ -902,7 +902,11 @@ sub handle_lib_objects local ($iter, $rewrite); foreach $iter (keys %libsources) { - if ($iter ne 'alloca.c') + if ($iter =~ /\.h$/) + { + &require_file_with_line ($var, $FOREIGN, $iter); + } + elsif ($iter ne 'alloca.c') { ($rewrite = $iter) =~ s/\.c$/.P/; $dep_files{'.deps/' . $rewrite} = 1; @@ -2622,9 +2626,8 @@ sub scan_configure { $libsources{'fileblocks.c'} = 1; } - elsif (/(AC|fp)_FUNC_FNMATCH/) + elsif (/AM_FUNC_FNMATCH/) { - # AC_FUNC_FNMATCH is just wishful thinking at this point. $libsources{'fnmatch.c'} = 1; } elsif (/AC_REPLACE_FUNCS\s*\((.*)\)/) @@ -2634,7 +2637,7 @@ sub scan_configure $libsources{$_ . '.c'} = 1; } } - elsif (/AC_REPLACE_GNU_GETOPT/) + elsif (/A[CM]_REPLACE_GNU_GETOPT/) { $libsources{'getopt.c'} = 1; $libsources{'getopt1.c'} = 1; @@ -2643,6 +2646,13 @@ sub scan_configure { $libsources{'strtod.c'} = 1; } + elsif (/AM_WITH_REGEX/) + { + $libsources{'rx.c'} = 1; + $libsources{'rx.h'} = 1; + $libsources{'regex.c'} = 1; + $libsources{'regex.h'} = 1; + } elsif (/LIBOBJS="(.*)\s+\$LIBOBJS"/ || /LIBOBJS="\$LIBOBJS\s+(.*)"/) { @@ -2655,7 +2665,7 @@ sub scan_configure } } - if (/(fp_PROG_INSTALL|fp_C_PROTOTYPES|jm_MAINTAINER_MODE)/) + if (/(fp_FUNC_FNMATCH|fp_PROG_INSTALL|fp_C_PROTOTYPES|jm_MAINTAINER_MODE)/) { &am_conf_line_error ($., "\`$1' is obsolete; use corresponding \`AM_' macro"); } @@ -3214,6 +3224,7 @@ sub initialize_global_constants ); $USAGE = "\ + -a, --add-missing add missing standard files to package --amdir=DIR directory storing config files --build-dir=DIR directory where build being done (for dependencies) --foreign same as --strictness=foreign @@ -3221,13 +3232,12 @@ sub initialize_global_constants --gnu same as --strictness=gnu --help print this help, then exit -i, --include-deps include generated dependencies in Makefile.in - -a, --add-missing add missing standard files to package --no-force only update Makefile.in's that are out of date -o DIR, --output-dir=DIR put generated Makefile.in's into DIR + --srcdir-name=DIR name used for srcdir (for dependencies) -s LEVEL, --strictness=LEVEL set strictness level. LEVEL is foreign, gnu, gnits - --srcdir-name=DIR name used for srcdir (for dependencies) -v, --verbose verbosely list files processed --version print version number, then exit\n"; diff --git a/automake.texi b/automake.texi index 0c03b345f..d7cd63b1c 100644 --- a/automake.texi +++ b/automake.texi @@ -155,7 +155,8 @@ and enforces certain restrictions on the @file{configure.in} contents. fully GNU standards-compliant, and do not require @code{perl} in order to be built. -Mail suggestions and bug reports for Automake to tromey@@cygnus.com. +Mail suggestions and bug reports for Automake to +bug-gnu-utils@@prep.ai.mit.edu. @node Invoking Automake @@ -180,10 +181,24 @@ in a subdirectory to change its behavior in some cases. @code{automake} accepts the following options: @table @code +@item -a +@item --add-missing +Automake requires certain common files to exist in certain situations; +for instance @file{config.guess} is required if @file{configure.in} runs +@code{AC_CANONICAL_HOST}. Automake is distributed with several of these +files; this option will cause the missing ones to be automatically added +to the package, whenever possible. In general if Automake tells you a +file is missing, try using this option. + @item --amdir=@var{dir} Look for Automake data files in directory @var{dir} instead of in the installation directory. This is typically used for debugging. +@item --build-dir=@var{dir} +Tell Automake where the build directory is. This option is used when +including dependencies into a @file{Makefile.in} generated by @code{make +dist}; it should not be used otherwise. + @item --foreign An alias for @samp{--strictness=foreign}. @@ -196,30 +211,33 @@ An alias for @samp{--strictness=gnu}. @item --help Print a summary of the command line options and exit. +@item -i @item --include-deps Include all automatically generated dependency information (@pxref{Dependencies}) in the generated @file{Makefile.in}. This is generally done when making a distribution; see @ref{Dist}. -@item --add-missing -Automake requires certain common files to exist in certain situations; -for instance @file{config.guess} is required if @file{configure.in} runs -@code{AC_CANONICAL_HOST}. Automake is distributed with several of these -files; this option will cause the missing ones to be automatically added -to the package, whenever possible. - +@item -o @var{dir} @item --output-dir=@var{dir} Put the generated @file{Makefile.in} in the directory @var{dir}. Ordinarily each @file{Makefile.in} is created in the directory of the corresponding @file{Makefile.am}. This option is used when making distributions. +@item --srcdir-name=@var{dir} +Tell Automake the name of the source directory used in the current +build. This option is used when including dependencies into a +@file{Makefile.in} generated by @code{make dist}; it should not be used +otherwise. + +@item -s @var{level} @item --strictness=@var{level} Set the global strictness to @var{level}; this can be overridden in each @file{Makefile.am} if required. @xref{Generalities} for more information. +@item -v @item --verbose Cause Automake to print information about which files are being read or created. @@ -232,6 +250,50 @@ Print the version number of Automake and exit. @node Generalities @chapter General ideas +There are a few basic ideas that will help understand how Automake +works. + +@menu +* General Operation:: General operation of Automake +* Depth:: The kinds of packages +* Strictness:: Standards conformance checking +* Uniform:: The Uniform Naming Scheme +* Canonicalization:: How derived variables are named +@end menu + +@node General Operation +@section General Operation +Automake essentially works by reading a @file{Makefile.am} and +generating a @file{Makefile.in}. The macro definitions and targets in +the @file{Makefile.am} are copied into the generated file. + +Automake tries to group comments with adjoining targets (or variable +definitions) in an intelligent way. + +A target defined in @file{Makefile.am} generally overrides any such +target of a similar name that would be automatically generated by +@code{automake}. Although this is a supported feature, it is generally +best to avoid making use of it, as sometimes the generated rules are +very particular. + +Automake also allows a form of comment which is @emph{not} copied into +the output; all lines beginning with @samp{##} are completely ignored by +Automake. + +It is customary to make the first line of @file{Makefile.am} read: + +@example +## Process this file with automake to produce Makefile.in +@end example + +@c FIXME discuss putting a copyright into Makefile.am here? I would but +@c I don't know quite what to say. + +@c FIXME document customary ordering of Makefile.am here! + + + +@node Depth @section Depth @code{automake} supports three kinds of directory hierarchy: ``flat'', ``shallow'', and ``deep''. @@ -255,6 +317,7 @@ reside in subdirectories. @code{automake} is one such package (as is GNU @code{make}, which does not currently use @code{automake}). +@node Strictness @section Strictness While Automake is intended to be used by maintainers of GNU packages, it does make some effort to accommodate those who wish to use it, but do @@ -288,6 +351,7 @@ standard is actually published. @end table +@node Uniform @section The Uniform Naming Scheme Automake variables generally follow a uniform naming scheme that makes it easy to decide how programs (and other derived objects) are built, @@ -361,54 +425,61 @@ The special prefix @samp{check} indicates that the objects in question should not be built until the @code{make check} command is run. Possible primary names are @samp{PROGRAMS}, @samp{LIBRARIES}, -@samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS}, @samp{MANS}, and -@samp{TEXINFOS}. +@samp{LISP}, @samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS}, @samp{MANS}, +and @samp{TEXINFOS}. @vindex PROGRAMS @vindex LIBRARIES +@vindex LISP @vindex SCRIPTS @vindex DATA @vindex HEADERS @vindex MANS @vindex TEXINFOS -@section General Operation -Automake essentially works by reading a @file{Makefile.am} and -generating a @file{Makefile.in}. The macro definitions and targets in -the @file{Makefile.am} are copied into the generated file. -Automake tries to group comments with adjoining targets (or variable -definitions) in an intelligent way. - -A target defined in @file{Makefile.am} generally overrides any such -target of a similar name that would be automatically generated by -@code{automake}. Although this is a supported feature, it is generally -best to avoid making use of it, as sometimes the generated rules are -very particular. +@node Canonicalization +@section How derived variables are named -Automake also allows a form of comment which is @emph{not} copied into -the output; all lines beginning with @samp{##} are completely ignored by -Automake. +Sometimes a Makefile variable name is derived from some text the user +supplies. For instance program names are rewritten into Makefile macro +names. Automake canonicalizes this text, so that it does not have to +follow Makefile variable naming rules. All characters in the name +except for letters, numbers, and the underscore are turned into +underscores when making macro references. Eg, if your program is named +@code{sniff-glue}, the derived variable name would be +@code{sniff_glue_SOURCES}, not @code{sniff-glue_SOURCES}. -It is customary to make the first line of @file{Makefile.am} read: -@example -## Process this file with automake to produce Makefile.in -@end example +@node configure +@chapter Scanning @file{configure.in} -@c FIXME discuss putting a copyright into Makefile.am here? I would but -@c I don't know quite what to say. +Automake scans the package's @file{configure.in} to determine certain +information about the package. Some @code{autoconf} macros are required +and some variables must be defined in @file{configure.in}. Automake +will also use information from @file{configure.in} to further tailor its +output. -@c FIXME document customary ordering of Makefile.am here! +@menu +* Requirements:: Configuration requirements +* Optional:: Other things Automake recognizes +* Invoking aclocal:: Auto-generating aclocal.m4 +* Macros:: Autoconf macros supplied with Automake +* Extending aclocal:: Writing your own aclocal macros +@end menu -@node configure -@chapter Scanning @file{configure.in} +@node Requirements +@section Configuration requirements -Automake requires certain variables to be defined and certain macros to -be used in the package @file{configure.in}. +The simplest way to meet the basic Automake requirements is to use the +macro @code{AM_INIT_AUTOMAKE} (FIXME: xref). But if you prefer, you can +do the required steps by hand: +@cvindex AM_INIT_AUTOMAKE -One such requirement is that @file{configure.in} must define the -variables @code{PACKAGE} and @code{VERSION} with @code{AC_SUBST}. +@itemize @bullet +@item +Define the variables @code{PACKAGE} and @code{VERSION} with +@code{AC_SUBST}. @cvindex PACKAGE @cvindex VERSION @code{PACKAGE} should be the name of the package as it appears when @@ -418,14 +489,42 @@ the release that is being developed. We recommend that you make @file{configure.in} the only place in your package where the version number is defined; this makes releases simpler. -Automake requires the use of the macro @code{AC_ARG_PROGRAM} if a -program or script is installed. +Automake doesn't do any interpretation of @code{PACKAGE} or +@code{VERSION}, except in @samp{Gnits} mode (FIXME xref). + +@item +Use the macro @code{AC_ARG_PROGRAM} if a program or script is installed. @cvindex AC_ARG_PROGRAM -If your package is not a flat distribution, Automake requires the use of -@code{AC_PROG_MAKE_SET}. +@item +Use @code{AC_PROG_MAKE_SET} if the package is not flat. @cvindex AC_PROG_MAKE_SET +@item +Use @code{AM_PROG_INSTALL} if any scripts (@pxref{Scripts}) are +installed by the package. Otherwise, use @code{AC_PROG_INSTALL}. +@cvindex AC_PROG_INSTALL +@cvindex AM_PROG_INSTALL +@end itemize + + +Here are the other macros which Automake requires but which are not run +by @code{AM_INIT_AUTOMAKE}: + +@table @code +@item AC_OUTPUT +Automake uses this to determine which files to create. Listed files +named @code{Makefile} are treated as @file{Makefile}s. Other listed +files are treated differently. Currently the only difference is that a +@file{Makefile} is removed by @code{make distclean}, while other files +are removed by @code{make clean}. +@c FIXME: this is in violation of standards! +@cvindex AC_OUTPUT +@end table + +@node Optional +@section Other things Automake recognizes + Automake will also recognize the use of certain macros and tailor the generated @file{Makefile.in} appropriately. Currently recognized macros and their effects are: @@ -434,13 +533,17 @@ and their effects are: @item AC_CONFIG_HEADER Automake will generate rules to automatically regenerate the config header. If you do use this macro, you must create the file -@file{stamp-h.in}. It can be empty. Also, the @code{AC_OUTPUT} command -in @file{configure.in} must create @file{stamp-h}, eg: +@file{stamp-h.in} in your source directory. It can be empty. Also, the +@code{AC_OUTPUT} command in @file{configure.in} must create +@file{stamp-h}, eg: @example AC_OUTPUT(Makefile, [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h]) @end example @cvindex AC_CONFIG_HEADER +Note that Automake does not currently currently check to make sure the +@code{AC_OUTPUT} command is correct. Hopefully a future version of +@code{autoconf} will let Automake handle this automatically. @item AC_CONFIG_AUX_DIR Automake will look for various helper scripts, such as @@ -450,10 +553,7 @@ If not seen, the scripts are looked for in their ``standard'' locations corresponding to the current @file{Makefile.am}, whichever is appropriate). @cvindex AC_CONFIG_AUX_DIR - -@item AC_OUTPUT -Automake uses this to determine which files to create. -@cvindex AC_OUTPUT +FIXME: give complete list of things looked for in this directory @item AC_PATH_XTRA Automake will insert definitions for the variables defined by @@ -475,10 +575,10 @@ exist. @item AC_FUNC_MEMCMP @item AC_STRUCT_ST_BLOCKS @item AM_FUNC_FNMATCH -@item AC_FUNC_FNMATCH @item AM_FUNC_STRTOD @item AC_REPLACE_FUNCS @item AC_REPLACE_GNU_GETOPT +@item AM_WITH_REGEX Automake will ensure that the appropriate source files are part of the distribution, and will ensure that the appropriate dependencies are generated for these objects. @xref{A Library} for more @@ -492,9 +592,12 @@ information. @cvindex AC_REPLACE_FUNCS @cvindex AC_REPLACE_GNU_GETOPT @cvindex AM_FUNC_STRTOD +@cvindex AM_WITH_REGEX -Automake will also detect statements which put @samp{.o} files into -@code{LIBOBJS}, and will treat these additional files in a similar way. +@item LIBOBJS +Automake will detect statements which put @samp{.o} files into +@code{LIBOBJS}, and will treat these additional files as if they were +discovered via @code{AC_REPLACE_FUNCS}. @cvindex LIBOBJS @item AC_PROG_RANLIB @@ -505,21 +608,11 @@ This is required if any libraries are built in the package. This is required if any C++ source is included. @cvindex AC_PROG_CXX -@item AC_PROG_INSTALL -@item AM_PROG_INSTALL -@code{AM_PROG_INSTALL} is required if any scripts (@pxref{Scripts}) are -installed by the package. Otherwise, @code{AC_PROG_INSTALL} is -required. @code{AM_INIT_AUTOMAKE} automatically calls -@code{AM_PROG_INSTALL}. -@cvindex AC_PROG_INSTALL -@cvindex AM_PROG_INSTALL -@cvindex AM_INIT_AUTOMAKE - -@item AM_PROG_LIBTOOL -Automake will turn on processing for @code{libtool} (@pxref{Top, , The -Libtool Manual, libtool.info, The Libtool Manual}). This work is -still preliminary. -@cvindex AM_PROG_LIBTOOL +@c @item AM_PROG_LIBTOOL +@c Automake will turn on processing for @code{libtool} (@pxref{Top, , The +@c Libtool Manual, libtool.info, The Libtool Manual}). This work is +@c still preliminary. +@c @cvindex AM_PROG_LIBTOOL @item AC_PROG_YACC If a Yacc source file is seen, then you must either use this macro or @@ -553,15 +646,84 @@ It is distributed with gettext. Automake uses this macro to ensure that the package meets some of gettext's requirements. @cvindex ud_GNU_GETTEXT -@item jm_MAINTAINER_MODE +@item AM_MAINTAINER_MODE This macro adds a @samp{--enable-maintainer-mode} option to @code{configure}. If this is used, @code{automake} will cause ``maintainer-only'' rules to be turned off by default in the generated -@file{Makefile.in}s. +@file{Makefile.in}s. This macro is disallowed in @samp{Gnits} mode. +FIXME xref. @cvindex jm_MAINTAINER_MODE @end table +@node Invoking aclocal +@section Auto-generating aclocal.m4 + +The @code{aclocal} program will automatically generate @file{aclocal.m4} +files based on the contents of @file{configure.in}. + +... explain why on earth you'd want to do this + +@code{aclocal} accepts the following options: + +@table @code +@item --acdir=@var{dir} +Look for the macro files in @var{dir} instead of the installation +directory. This is typically used for debugging. + +@item --help +Print a summary of the command line options and exit. + +@item --output=@var{file} +Cause the output to be put into @var{file} instead of @file{aclocal.m4}. + +@item --verbose +Print the names of the files it examines. + +@item --version +Print the version number of Automake and exit. +@end table + + +@node Macros +@section Autoconf macros supplied with Automake + +@c consider generating this node automatically from m4 files. + +@table @code +@item AM_FUNC_FNMATCH +If the @code{fnmatch} function is not available, or does not work +correctly (like the one on SunOS 5.4), add @samp{fnmatch.o} to output +variable @code{LIBOBJS}. + +@item AM_FUNC_STRTOD +If the @code{strtod} function is not available, or does not work +correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output +variable @code{LIBOBJS}. + +@item AM_C_PROTOTYPES +@item AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL +@item AM_INIT_AUTOMAKE +@item AM_MAINTAINER_MODE +@item AM_PATH_LISPDIR +@item AM_PROG_CC_STDC +@item AM_PROG_INSTALL +@item AM_SANITY_CHECK_CC +@item AM_SYS_POSIX_TERMIOS +@item AM_TYPE_PTRDIFF_T +@item AM_WITH_DMALLOC +@item AM_WITH_REGEX +@end table + + +@node Extending aclocal +@section Writing your own aclocal macros + +... explain format of macro files +... explain how to get your own macros installed (using acinstall) +... explain situations where this is actually useful (eg gettext) + + @node Top level @chapter The top-level @file{Makefile.am} @@ -593,6 +755,10 @@ Automake itself does not actually examine the contents of this variable. If @code{SUBDIRS} is defined, then your @file{configure.in} must include @code{AC_PROG_MAKE_SET}. +The use of @code{SUBDIRS} is not restricted to just the top-level +@file{Makefile.am}. Automake can be used to construct packages of +arbitrary depth. + @node Programs @chapter Building Programs and Libraries @@ -647,7 +813,8 @@ Multiple programs can be built in a single directory. Multiple programs can share a single source file. The source file must be listed in each @samp{_SOURCES} definition. -Header files listed in a @samp{_SOURCES} definition will be ignored. +Header files listed in a @samp{_SOURCES} definition will be included in +the distribution but otherwise ignored. Lex (@samp{.l}) and yacc (@samp{.y}) files can also be listed; support for these should work but is still preliminary. @c lex & yacc should have a separate section @@ -703,15 +870,6 @@ target which is not actually part of that program. This can be done using the @samp{prog_DEPENDENCIES} variable. Each program depends on the contents of such a variable, but no further interpretation is done. -Since program names are rewritten into Makefile macro names, program -names must follow Makefile macro syntax. Sometimes it is useful to have -a program whose name does not follow such rules. In these cases, -Automake canonicalizes the program name. All characters in the name -except for letters, numbers, and the underscore are turned into -underscores when making macro references. Eg, if your program is named -@code{sniff-glue}, you would use @code{sniff_glue_SOURCES}, not -@code{sniff-glue_SOURCES}. - @node A Library @section Building a library @@ -759,8 +917,8 @@ Automake uses for compilations; for instance you might need to do your own compilation in some special cases. Some variables are inherited from Autoconf; these are @code{CC}, -@code{CFLAGS}, @code{CPPFLAGS}, @code{CXX}, @code{CXXFLAGS}, -@code{DEFS}, @code{LDFLAGS}, and @code{LIBS}. +@code{CFLAGS}, @code{CPPFLAGS}, @code{DEFS}, @code{LDFLAGS}, and +@code{LIBS}. There are some additional variables which Automake itself defines: @@ -783,8 +941,7 @@ This is the command used to actually link a C program. @section Yacc and Lex support Automake has somewhat idiosyncratic support for Yacc and Lex. - - +FIXME: describe it here. @node C++ @@ -797,8 +954,22 @@ demand. Any package including C++ code must use @code{AC_PROG_CXX} in its @file{configure.in}. +A few additional variables are defined when a C++ source file is seen: + +@table @code +@item CXX +The name of the C++ compiler. + +@item CXXFLAGS +Any flags to pass to the C++ compiler. + +@item CXXCOMPILE +The command used to actually compile a C++ source file. The file name +is appended to form the complete command line. -A few additional variables are defined when a C++ source file is seen. +@item CXXLINK +The command used to actually link a C++ program. +@end table @node ANSI @@ -822,8 +993,24 @@ This support requires the source files @file{ansi2knr.c} and @file{ansi2knr.1} to be in the same directory as the ANSI C source; these files are distributed with Automake. Also, the package @file{configure.in} must call the macro -@code{fp_C_PROTOTYPES}. -@cvindex fp_C_PROTOTYPES +@code{AM_C_PROTOTYPES}. +@cvindex AM_C_PROTOTYPES + +Automake also handles finding the @code{ansi2knr} support files in some +other directory in the current package. This is done by prepending the +relative path to the appropriate directory to the @code{ansi2knr} +option. For instance, suppose the package has ANSI C code in the +@file{src} and @file{lib} subdirs. The files @file{ansi2knr.c} and +@file{ansi2knr.1} appear in @file{lib}. Then this could appear in +@file{src/Makefile.am}: + +@example +AUTOMAKE_OPTIONS = ../lib/ansi2knr +@end example + +Note that the directory holding the @code{ansi2knr} support files must +be built before all other directories using these files. Automake does +not currently check that this is the case. @node Dependencies @@ -856,6 +1043,10 @@ variable @code{AUTOMAKE_OPTIONS}. @vindex AUTOMAKE_OPTIONS @opindex no-dependencies +If you unpack a distribution made by @code{make dist}, and you want to +turn on the dependency-tracking code again, simply run @code{automake} +with no arguments. + @node Other objects @chapter Other Derived Objects @@ -883,8 +1074,7 @@ programs are listed using the @samp{SCRIPTS} primary name. @vindex SCRIPTS @code{automake} does not assume that scripts are derived objects; such -objects are must be deleted by hand; see @ref{Clean} for more -information. +objects must be deleted by hand; see @ref{Clean} for more information. @code{automake} itself is a script that is generated at configure time from @file{automake.in}. Here is how this is handled: @@ -893,8 +1083,8 @@ from @file{automake.in}. Here is how this is handled: bin_SCRIPTS = automake @end example -Since @code{automake} appears in the @code{AC_OUTPUT} macro, -dependencies for it are automatically generated. +Since @code{automake} appears in the @code{AC_OUTPUT} macro, a target +for it is automatically generated. Script objects can be installed in @code{bindir}, @code{sbindir}, @code{libexecdir}, or @code{pkgdatadir}. @@ -909,9 +1099,9 @@ variable will be the most used. @vindex HEADERS All header files must be listed somewhere; missing ones will not appear -in the distribution. Often it is most convenient to list uninstalled -headers with the rest of the sources for a program. @xref{A Program}. -Headers listed in a @samp{_SOURCES} variable need not be listed in any +in the distribution. Often it is clearest to list uninstalled headers +with the rest of the sources for a program. @xref{A Program}. Headers +listed in a @samp{_SOURCES} variable need not be listed in any @samp{_HEADERS} variable. Headers can be installed in @code{includedir}, @code{oldincludedir}, or @@ -991,8 +1181,8 @@ Currently Automake provides support for Texinfo and man pages. If the current directory contains Texinfo source, you must declare it with the @samp{TEXINFOS} primary. Generally Texinfo files are converted into info, and thus the @code{info_TEXINFOS} macro is most commonly used -here. Note that any Texinfo source file must end in the @samp{.texi} -extension (@samp{.texinfo} won't work). +here. Note that any Texinfo source file must end in the @samp{.texi} or +@samp{.texinfo} extension. @vindex TEXINFOS @vindex info_TEXINFOS @@ -1018,9 +1208,10 @@ info_TEXINFOS = kpathsea.texi kpathsea_TEXINFOS = install.texi copying.texi freedom.texi @end example -Automake will warn if a directory containing Texinfo source does not -also contain the file @file{texinfo.tex}. This file is supplied with -Automake. +By default, Automake requires the file @file{texinfo.tex} to appear in +the same directory as the Texinfo source. However, if you used +@code{AC_CONFIG_AUX_DIR} in @file{configure.in}, then @file{texinfo.tex} +is looked for there. Automake supplies @file{texinfo.tex}. Automake generates an @code{install-info} target; some people apparently use this. By default, info pages are installed by @samp{make install}. @@ -1066,8 +1257,8 @@ for the purposes of making a distribution. Naturally, Automake handles the details of actually installing your program once it has been built. All @code{PROGRAMS}, @code{SCRIPTS}, -@code{LIBRARIES}, @code{DATA} and @code{HEADERS} are automatically -installed in the appropriate places. +@code{LIBRARIES}, @code{LISP}, @code{DATA} and @code{HEADERS} are +automatically installed in the appropriate places. Automake also handles installing any specified info and man pages. @@ -1107,14 +1298,6 @@ be defined to specify additional files to clean. These variables are @vindex DISTCLEANFILES @vindex MAINTAINERCLEANFILES -In Automake, the @code{automake} program is not automatically removed, -because it is an executable script. So this code in @file{Makefile.am} -causes it to be removed by @samp{make clean}: - -@example -CLEANFILES = automake -@end example - @node Dist @chapter What Goes in a Distribution @@ -1222,13 +1405,13 @@ targets will still be available. This option is disallowed at @item @code{ansi2knr} @item @code{path/ansi2knr} -Turn on automatic de-ANSI-fication. If preceeded by a path, the -generated @file{Makefile.in} will look in the specified directory to -find the @file{ansi2knr} program. Generally the path should be a -relative path to another directory in the same distribution (though -Automake currently does not check this). It is up to you to make sure -that the specified directory is built before the current directory; if -@file{ansi2knr} does not exist then the build will fail. +Turn on automatic de-ANSI-fication. @xref{ANSI}. If preceeded by a +path, the generated @file{Makefile.in} will look in the specified +directory to find the @file{ansi2knr} program. Generally the path +should be a relative path to another directory in the same distribution +(though Automake currently does not check this). It is up to you to +make sure that the specified directory is built before the current +directory; if @file{ansi2knr} does not exist then the build will fail. @item @code{dejagnu} Cause @code{dejagnu}-specific rules to be generated. @xref{Tests}. @@ -1383,7 +1566,7 @@ For instance, here is how to create a hard link to an installed program: @example install-exec-hook: - $(LN) $(bindir)/program $(bindir)/proglink + ln $(bindir)/program $(bindir)/proglink @end example @c FIXME should include discussion of variables you can use in these @@ -1444,10 +1627,7 @@ Of course, Automake also requires some minor changes to @example dnl Process this file with autoconf to produce a configure script. AC_INIT(hello.c) -VERSION=1.3 -AC_SUBST(VERSION) -PACKAGE=hello -AC_SUBST(PACKAGE) +AM_INIT_AUTOMAKE(hello, 1.3) AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL @@ -1530,8 +1710,6 @@ aclocal.m4 ## These must all be executable when installed. pkgdata_SCRIPTS = config.guess config.sub install-sh mdate-sh mkinstalldirs -CLEANFILES = automake - # The following requires a fixed version of the Emacs 19.30 etags. ETAGS_ARGS = automake.in --lang=none \ --regex='/^@@node[ \t]+\([^,]+\)/\1/' automake.texi diff --git a/configure b/configure index 9cce49bf2..33ac5d0b7 100755 --- a/configure +++ b/configure @@ -592,13 +592,21 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' PACKAGE=automake +cat >> confdefs.h <> confdefs.h <&2 exit 1 diff --git a/m4/AM_FEATURE_CTYPE.m4 b/m4/AM_FEATURE_CTYPE.m4 deleted file mode 100644 index 9ca09ff55..000000000 --- a/m4/AM_FEATURE_CTYPE.m4 +++ /dev/null @@ -1,11 +0,0 @@ -## -------------------------- ## -## Use in conjunction with ## -## autosystem to get working ## -## ctype-style macros ## -## Tom Tromey ## -## -------------------------- ## - -# serial 1 - -AC_DEFUN([AM_FEATURE_CTYPE], -AC_REQUIRE([AC_HEADER_STDC])) diff --git a/m4/AM_FEATURE_ERRNO.m4 b/m4/AM_FEATURE_ERRNO.m4 deleted file mode 100644 index 47158375f..000000000 --- a/m4/AM_FEATURE_ERRNO.m4 +++ /dev/null @@ -1,7 +0,0 @@ -dnl Use this in conjunction with autosystem to get `errno'. -dnl Doesn't actually require any definition; it just assumes that -dnl exists. - -# serial 1 - -AC_DEFUN([AM_FEATURE_ERRNO]) diff --git a/m4/AM_FEATURE_EXIT.m4 b/m4/AM_FEATURE_EXIT.m4 deleted file mode 100644 index 3bd37a903..000000000 --- a/m4/AM_FEATURE_EXIT.m4 +++ /dev/null @@ -1,8 +0,0 @@ -dnl Use this in conjunction with autosystem to get `exit', -dnl EXIT_SUCCESS, and EXIT_FAILURE. -dnl Doesn't actually require any definition; it just assumes that -dnl exists. - -# serial 1 - -AC_DEFUN([AM_FEATURE_EXIT]) diff --git a/m4/AM_FUNC_STRTOD.m4 b/m4/AM_FUNC_STRTOD.m4 index 681ac39e0..cb6e08873 100644 --- a/m4/AM_FUNC_STRTOD.m4 +++ b/m4/AM_FUNC_STRTOD.m4 @@ -2,6 +2,14 @@ dnl From Jim Meyering. # serial 1 +# @defmac AC_FUNC_STRTOD +# @maindex FUNC_STRTOD +# @ovindex LIBOBJS +# If the @code{strtod} function is not available, or does not work +# correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output +# variable @code{LIBOBJS}. +# @end defmac + AC_DEFUN(AM_FUNC_STRTOD, [AC_CACHE_CHECK(for working strtod, am_cv_func_strtod, [AC_TRY_RUN([ diff --git a/m4/AM_PROG_CC_STDC.m4 b/m4/AM_PROG_CC_STDC.m4 index 70c769129..563d4ccd9 100644 --- a/m4/AM_PROG_CC_STDC.m4 +++ b/m4/AM_PROG_CC_STDC.m4 @@ -41,8 +41,10 @@ do choke me #endif ], [/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */ -#include -#include +#ifdef _SEQUENT_ +# include +# include +#endif int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);};], diff --git a/m4/AM_PROG_LIBTOOL.m4 b/m4/AM_PROG_LIBTOOL.m4 deleted file mode 100644 index 92146415a..000000000 --- a/m4/AM_PROG_LIBTOOL.m4 +++ /dev/null @@ -1,92 +0,0 @@ -## --------------------------------------------------------- ## -## Configure the libtool script for this package ## -## From Gord Matzigkeit ## -## --------------------------------------------------------- ## - -# serial 1 - -AC_DEFUN(AM_PROG_LIBTOOL, -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_PROG_RANLIB]) - -AC_MSG_CHECKING([libtool object types]) - -# Default to static linking. -AC_ARG_ENABLE(linktype, -[ --enable-linktype=TYPE link programs against TYPE libraries [default=static]], -[libtool_linktype="$enableval"], -libtool_linktype=static) - -AC_ARG_ENABLE(profile, -[ --enable-profile build profiled libraries [default=no]], -libtool_enable_profile="$enableval", -libtool_enable_profile=no) - -AC_ARG_ENABLE(shared, -[ --enable-shared build shared libraries [default=no]], -libtool_enable_shared="$enableval", -libtool_enable_shared=no) - -AC_ARG_ENABLE(static, -[ --enable-static build static libraries [default=yes]], -libtool_enable_static="$enableval", -libtool_enable_static=yes) - -libtool_objtypes= -case "$libtool_linktype" in - profile) libtool_objtypes=doP ;; - shared) libtool_objtypes=dos ;; - static) libtool_objtypes=do ;; - *) AC_MSG_ERROR([invalid option to --enable-linktype]) ;; -esac - -case "$libtool_enable_profile" in - yes) test "$libtool_linktype" != "profile" && - libtool_objtypes="$libtool_objtypes:doP" ;; - no) ;; - *) AC_MSG_ERROR([invalid option to --enable-profile]) ;; -esac -case "$libtool_enable_shared" in - yes) test "$libtool_linktype" != "shared" && - libtool_objtypes="$libtool_objtypes:dos" ;; # Yuck! It spells "DOS"! - no) ;; - *) AC_MSG_ERROR([invalid option to --enable-shared]) ;; -esac -case "$libtool_enable_static" in - yes) test "$libtool_linktype" != "static" && - libtool_objtypes="$libtool_objtypes:do" ;; - no) ;; - *) AC_MSG_ERROR([invalid option to --enable-static]) ;; -esac - -test -n "$OBJTYPES" || OBJTYPES="$libtool_objtypes" - -AC_MSG_RESULT([$OBJTYPES]) - -# Propagate silent flags -am_prog_libtool_flags= -test "$silent" = yes && am_prog_libtool_flags="--silent" - -# Get the real value of libdir: -am_prog_libtool_libdir=`eval echo $libdir` -case "$am_prog_libtool_libdir" in - NONE/lib) - if test "$exec_prefix" = "NONE"; then - if test "$prefix" = NONE; then - am_prog_libtool_libdir="$ac_default_prefix/lib" - else - am_prog_libtool_libdir="$prefix/lib" - fi - else - am_prog_libtool_libdir="$exec_prefix/lib" - fi ;; -esac - -# Actually configure libtool. -# Holy mackerel, what a command line! -CC="$CC" LD="$LD" RANLIB="$RANLIB" OBJTYPES="$OBJTYPES" \ -$srcdir/libtool --host="$host" --libdir="$am_prog_libtool_libdir" --no-validate-host \ ---with-gcc="$am_cv_prog_gcc" $am_prog_libtool_flags \ -configure || AC_MSG_ERROR([libtool configure failed]) -]) diff --git a/m4/AM_SYSTEM_HEADER.m4 b/m4/AM_SYSTEM_HEADER.m4 deleted file mode 100644 index 3f6d584d3..000000000 --- a/m4/AM_SYSTEM_HEADER.m4 +++ /dev/null @@ -1,3 +0,0 @@ -# serial 1 - -AC_DEFUN([AM_SYSTEM_HEADER]) diff --git a/m4/Makefile.am b/m4/Makefile.am index 829f81f68..924f64884 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -4,11 +4,8 @@ AUTOMAKE_OPTIONS = gnits MAINT_CHARSET = latin1 m4datadir = $(datadir)/aclocal -m4data_DATA = AM_C_PROTOTYPES.m4 AM_FEATURE_CTYPE.m4 \ -AM_FEATURE_ERRNO.m4 AM_FEATURE_EXIT.m4 AM_FUNC_FNMATCH.m4 \ +m4data_DATA = AM_C_PROTOTYPES.m4 AM_FUNC_FNMATCH.m4 AM_FUNC_STRTOD.m4 \ +AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL.m4 AM_INIT_AUTOMAKE.m4 \ AM_MAINTAINER_MODE.m4 AM_PATH_LISPDIR.m4 AM_PROG_CC_STDC.m4 \ -AM_PROG_INSTALL.m4 AM_PROG_LIBTOOL.m4 AM_SYSTEM_HEADER.m4 \ -AM_TYPE_PTRDIFF_T.m4 AM_WITH_DMALLOC.m4 AM_WITH_REGEX.m4 \ -AM_FUNC_STRTOD.m4 AM_INIT_AUTOMAKE.m4 \ -AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL.m4 \ -AM_SYS_POSIX_TERMIOS.m4 AM_SANITY_CHECK_CC.m4 +AM_PROG_INSTALL.m4 AM_SANITY_CHECK_CC.m4 AM_SYS_POSIX_TERMIOS.m4 \ +AM_TYPE_PTRDIFF_T.m4 AM_WITH_DMALLOC.m4 AM_WITH_REGEX.m4 diff --git a/m4/Makefile.in b/m4/Makefile.in index 7ec9d5ba7..80f558732 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -42,14 +42,11 @@ AUTOMAKE_OPTIONS = gnits MAINT_CHARSET = latin1 m4datadir = $(datadir)/aclocal -m4data_DATA = AM_C_PROTOTYPES.m4 AM_FEATURE_CTYPE.m4 \ -AM_FEATURE_ERRNO.m4 AM_FEATURE_EXIT.m4 AM_FUNC_FNMATCH.m4 \ +m4data_DATA = AM_C_PROTOTYPES.m4 AM_FUNC_FNMATCH.m4 AM_FUNC_STRTOD.m4 \ +AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL.m4 AM_INIT_AUTOMAKE.m4 \ AM_MAINTAINER_MODE.m4 AM_PATH_LISPDIR.m4 AM_PROG_CC_STDC.m4 \ -AM_PROG_INSTALL.m4 AM_PROG_LIBTOOL.m4 AM_SYSTEM_HEADER.m4 \ -AM_TYPE_PTRDIFF_T.m4 AM_WITH_DMALLOC.m4 AM_WITH_REGEX.m4 \ -AM_FUNC_STRTOD.m4 AM_INIT_AUTOMAKE.m4 \ -AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL.m4 \ -AM_SYS_POSIX_TERMIOS.m4 AM_SANITY_CHECK_CC.m4 +AM_PROG_INSTALL.m4 AM_SANITY_CHECK_CC.m4 AM_SYS_POSIX_TERMIOS.m4 \ +AM_TYPE_PTRDIFF_T.m4 AM_WITH_DMALLOC.m4 AM_WITH_REGEX.m4 mkinstalldirs = $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DATA = $(m4data_DATA) diff --git a/texi-version.am b/texi-version.am index 781766414..3c6f3c897 100644 --- a/texi-version.am +++ b/texi-version.am @@ -24,11 +24,11 @@ stamp-@VTI@: @TEXI@ $(top_srcdir)/configure.in && $(SHELL) @MDDIR@/mdate-sh @TEXI@`" > @VTI@.tmp echo "@set EDITION $(VERSION)" >> @VTI@.tmp echo "@set VERSION $(VERSION)" >> @VTI@.tmp - if cmp -s @VTI@.tmp $(srcdir)/@VTEXI@; then \ - rm @VTI@.tmp; \ - else \ - mv @VTI@.tmp $(srcdir)/@VTEXI@; \ - fi +## Use cp and rm here because some older "mv"s can't move across +## filesystems. Furthermore, GNU "mv" in the AmigaDOS environment +## can't handle this. + cmp -s @VTI@.tmp $(srcdir)/@VTEXI@ || cp @VTI@.tmp $(srcdir)/@VTEXI@ + rm @VTI@.tmp echo timestamp > $(srcdir)/stamp-@VTI@ mostlyclean-@VTI@: diff --git a/version.texi b/version.texi index 8204d9296..3c0be126e 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 24 August 1996 +@set UPDATED 8 September 1996 @set EDITION 1.1d @set VERSION 1.1d