From: David MacKenzie Date: Mon, 6 Feb 1995 23:31:34 +0000 (+0000) Subject: various bug fixes X-Git-Tag: fsf-origin~328 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5cee524913165f3ef1a6b5700f0d485c2852cdc;p=thirdparty%2Fautoconf.git various bug fixes --- diff --git a/NEWS b/NEWS index cb226556c..d5d135ee1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +Major changes in release 2.2: + + Major changes in release 2.1: * Fix C++ problems. @@ -12,7 +15,7 @@ Thanks to everybody who's submitted changes and additions to Autoconf! I've incorporated many of them, and am still considering others for future releases -- but I didn't want to postpone this release indefinitely. -Caution: don't indiscriminantly rebuild configure scripts with +Caution: don't indiscriminately rebuild configure scripts with Autoconf version 2. Some configure.in files need minor adjustments to work with it; the documentation has a chapter on upgrading. A few configure.in files, including those for GNU Emacs and the GNU C diff --git a/TODO b/TODO index 89c32295d..3a8453a26 100644 --- a/TODO +++ b/TODO @@ -66,7 +66,7 @@ Things it might be nice to do someday: * Mike Haertel's suggestions: -** Provide files containing decls for alloca, strings, etc. +** Provide header files containing decls for alloca, strings, etc. ** Cross compiling: @@ -94,6 +94,148 @@ shared libraries, various other things. ------------------------------------------------------------------------------ +For AC_TYPE_SIGNAL signal handlers, provide a way for code to know +whether to do "return 0" or "return" (int vs void) to avoid compiler +warnings. (Roland McGrath) + +------------------------------------------------------------------------------ + +It would be very useful if autoconf allowed checking for multiple libraries +that are required together. For example: + +AC_HAVE_LIBRARY([-lsocket -lnsl], [LIBS="$LIBS -lsocket -lnsl"]) + +I have been informed that SVR4 requires both -lnsl to be used with -lsocket, +so a test just for -lsocket fails, as that will not compile. +From: markd@grizzly.COM (Mark Diekhans) + +------------------------------------------------------------------------------ + +In config.status comment, put the host/target/build types, if used. + +------------------------------------------------------------------------------ + +Support a way of including makefile fragments that then have @var@ +substitutions done on them. + +------------------------------------------------------------------------------ + +Have AC_CANONICAL_HOST cache the host/build/target types. + +------------------------------------------------------------------------------ + + AC_OUTPUT(Makefile.out:Makefile.in) +generates + trap 'rm -f Makefile.out:Makefile.in; exit 1' 1 2 15 + +------------------------------------------------------------------------------ + +Look at contributions: + ac_include (Karl Berry) + tool_prefix (Roland McGrath) + aclocal.h tom@basil.icce.rug.NL (Tom R.Hageman) + inline rewrite (Jim Avera) + getpgrp and stringize (Arnold Robbins) + caching AC_DECL_YYTEXT (Karl Berry, John something) + +------------------------------------------------------------------------------ + + The argument HELP-STRING is a description of the option which + ... + Avoid tabs in the help string. You'll need to enclose it in `[' + and `]' in order to produce the leading spaces. + +Except that [...] is the convention for telling the user the default, +So I guess a changequote(`,') or something would be in order in some cases. +From: "K. Berry" + +------------------------------------------------------------------------------ + +I would find it a wonderful boon if config.log contained not just the +output from the compilers, but also the invocation. Almost all +the errors I've found are due to the wrong options getting passed for +one reason or another. + +Saving the input test file(s) that failed would be useful, too. +From: "K. Berry" + +------------------------------------------------------------------------------ + +The default of unlimited permission is fine, but there should be some easy +way for configure to have copyright terms passed through from configure.in. +Maybe AC_LICENSE([...]). +From: roland@gnu.ai.mit.edu (Roland McGrath) + +------------------------------------------------------------------------------ + +autoconf-2.1 AC_EGREP_HEADER does not work if [square brackets] +are used in the egrep pattern. This makes egrep fairly useless to +find, for example, a space or tab followed by something. + +Putting changequotes around the PATTERN parameter makes no difference. +-Jim Avera (jima@netcom.com) + +------------------------------------------------------------------------------ + +AC_MSG_CHECKING([checking for ANSI #stringize]) +AC_REVISION([ #(@) revision 2.1 ]) + +causes bogus code to be generated for whatever immediately follows. The +problem goes away if the '#' is removed. Probably the macros are not +disabling the m4 "comment" feature when processing user-supplied strings. +-Jim Avera jima@netcom.com + +------------------------------------------------------------------------------ + +- I would like the default behavior of the library command to change +so that the newly tested library is tried in front of $LIBS instead of +after it. This makes it possible to test for more complicated sets of +dependencies. For instance: on some SVR4 systems (e.g. Sequent), +-lsocket requires -linet and -lnsl. The link order must be +"-lsocket -linet -lnsl". On some other SVR4 systems either -linet or +-lnsl does not exist. Now if I test for -lnsl first, the test for +-linet fails because it tries "-lnsl -linet"; but if I test for +-linet it fails because it only works if -lnsl is also specified. +--Guido van Rossum, CWI, Amsterdam + +------------------------------------------------------------------------------ + +on hal.gnu.ai.mit.edu, configure is getting the wrong answer for +AC_CHECK_FUNCS(select). + +The problem here is that there's severe namespace pollution: when +conftest.c includes to pick up any __stub macro definitions, +it's getting a prototype declaration for select(), which collides +with the dummy declaration in conftest.c. (The chain of includes +is conftest.c -> -> -> +-> -> .) + + #define $ac_func __dummy_$ac_func + #include + #undef $ac_func +From: kwzh@gnu.ai.mit.edu (Karl Heuer) + +------------------------------------------------------------------------------ + +put all the config.* stuff somewhere like config/? +All these extrainious file sure clutter up a toplevel directory. +From: "Randall S. Winchester" + +------------------------------------------------------------------------------ + +It would be nice if I could (in the Makefile.in files) set +the path to config.h. You have config.h ../config.h ../../config.h's all +over the place, in the findutils-4.1 directory. +From: "Randall S. Winchester" + +------------------------------------------------------------------------------ + + define([AC_DEFUN], + [define($1, [AC_PRO([$1])[$2][]AC_EPI()])]) +to fix a quoting bug (Noah Friedman). + +------------------------------------------------------------------------------ + * Test suite: more things to test: ** That the shell scripts produce correct output on some simple data. ** Configuration header files. That autoheader does the right thing, diff --git a/acconfig.h b/acconfig.h index 801a8ac8b..a97b10803 100644 --- a/acconfig.h +++ b/acconfig.h @@ -25,7 +25,9 @@ #undef C_ALLOCA /* Define if type char is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ #undef __CHAR_UNSIGNED__ +#endif /* Define if the closedir function returns void instead of int. */ #undef CLOSEDIR_VOID diff --git a/acgeneral.m4 b/acgeneral.m4 index 215e9e72c..b6d33d12d 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -73,7 +73,7 @@ dnl ### Defining macros dnl m4 output diversions. We let m4 output them all in order at the end, dnl except that we explicitly undivert AC_DIVERSION_SED. -dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #!/bin/sh line +dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings define(AC_DIVERSION_INIT, 2)dnl initialization code define(AC_DIVERSION_SED, 3)dnl variable substitutions in config.status @@ -448,7 +448,7 @@ dnl Try to have only one #! line, so the script doesn't look funny dnl for users of AC_REVISION. dnl AC_INIT_BINSH() AC_DEFUN(AC_INIT_BINSH, -[#!/bin/sh +[#! /bin/sh ]) dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) @@ -466,14 +466,15 @@ AC_DIVERT_POP()dnl to NORMAL dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR) AC_DEFUN(AC_INIT_PREPARE, -[trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 +[trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: -# 0 unused; standard input +# 0 standard input # 1 file creation # 2 errors and warnings -# 3 unused; some systems may open it to /dev/tty -define(AC_FD_MSG, 4)dnl +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +define(AC_FD_MSG, 6)dnl [#] AC_FD_MSG checking for... messages and results define(AC_FD_CC, 5)dnl [#] AC_FD_CC compiler messages saved in config.log @@ -581,8 +582,8 @@ AC_DEFUN(AC_ARG_ENABLE, ac_help="$ac_help [$2]" AC_DIVERT_POP()dnl -[#] Check whether --enable-$1 or --disable-$1 was given. -enableval="[$enable_]patsubst($1, -, _)" +[#] Check whether --enable-[$1] or --disable-[$1] was given. +enableval="[$enable_]patsubst([$1], -, _)" if test -n "$enableval"; then ifelse([$3], , :, [$3]) ifelse([$4], , , [else @@ -606,8 +607,8 @@ AC_DEFUN(AC_ARG_WITH, ac_help="$ac_help [$2]" AC_DIVERT_POP()dnl -[#] Check whether --with-$1 or --without-$1 was given. -withval="[$with_]patsubst($1, -, _)" +[#] Check whether --with-[$1] or --without-[$1] was given. +withval="[$with_]patsubst([$1], -, _)" if test -n "$withval"; then ifelse([$3], , :, [$3]) ifelse([$4], , , [else @@ -901,9 +902,10 @@ cat > $cache_file <<\EOF EOF changequote(, )dnl dnl Allow a site initialization script to override cache values. -# Ultrix sh set writes to stderr and can't be redirected directly. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \ + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ >> $cache_file changequote([, ])dnl else @@ -1504,7 +1506,7 @@ main() if (!f) exit(1); fprintf(f, "%d\n", sizeof($1)); exit(0); -}], AC_CV_NAME=`cat conftestval`)])dnl +}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0)])dnl AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) undefine([AC_TYPE_NAME])dnl @@ -1558,7 +1560,7 @@ dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS]) define(AC_OUTPUT, [trap '' 1 2 15 AC_CACHE_SAVE -trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. @@ -1583,7 +1585,7 @@ ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()]) echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS <>$LEX_OUTPUT_ROOT.c +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" -AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, ac_cv_prog_lex_yytext_pointer=yes) +AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, , ac_cv_prog_lex_yytext_pointer=yes) LIBS="$ac_save_LIBS" rm -f "${LEX_OUTPUT_ROOT}.c"])dnl AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer) @@ -973,10 +973,11 @@ main() { /* Use a field that we can force nonzero -- voluntary context switches. For systems like NeXT and OSF/1 that don't set it, - also use the system CPU time. */ + also use the system CPU time. And page faults (I/O) for Linux. */ r.ru_nvcsw = 0; r.ru_stime.tv_sec = 0; r.ru_stime.tv_usec = 0; + r.ru_majflt = r.ru_minflt = 0; switch (fork()) { case 0: /* Child. */ sleep(1); /* Give up the CPU. */ @@ -985,7 +986,7 @@ main() { default: /* Parent. */ wait3(&i, 0, &r); sleep(1); /* Avoid "text file busy" from rm on fast HP-UX machines. */ - exit(r.ru_nvcsw == 0 + exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); } }], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl @@ -1196,7 +1197,7 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 && t.st_mtime - s.st_mtime < 120)); }], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no, ac_cv_func_utime_null=no) -rm -f core])dnl +rm -f core core.* *.core])dnl AC_MSG_RESULT($ac_cv_func_utime_null) if test $ac_cv_func_utime_null = yes; then AC_DEFINE(HAVE_UTIME_NULL) @@ -1233,7 +1234,7 @@ main () { putc('\r', stdout); exit(0); /* Non-reversed systems segv here. */ }], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no) -rm -f core])dnl +rm -f core core.* *.core])dnl AC_MSG_RESULT($ac_cv_func_setvbuf_reversed) if test $ac_cv_func_setvbuf_reversed = yes; then AC_DEFINE(SETVBUF_REVERSED) @@ -1372,7 +1373,7 @@ AC_DEFUN(AC_C_CROSS, AC_MSG_CHECKING(whether cross-compiling) AC_CACHE_VAL(ac_cv_c_cross, [AC_TRY_RUN([main(){return(0);}], - ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_cross=yes)])dnl + ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes)])dnl cross_compiling=$ac_cv_c_cross AC_MSG_RESULT($ac_cv_c_cross) ]) @@ -1542,7 +1543,7 @@ AC_DEFUN(AC_SYS_INTERPRETER, ac_msg="whether #! works in shell scripts" AC_MSG_CHECKING($ac_msg) AC_CACHE_VAL(ac_cv_sys_interpreter, -[echo '#!/bin/cat +[echo '#! /bin/cat exit 69 ' > conftest chmod u+x conftest @@ -1829,7 +1830,7 @@ else # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. - AC_CHECK_LIB(ICE, IceConnectionNumbers, + AC_CHECK_LIB(ICE, IceConnectionNumber, [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"]) LDFLAGS="$ac_save_LDFLAGS" diff --git a/autoconf.in b/autoconf.in index 5ae95c710..e8263481e 100644 --- a/autoconf.in +++ b/autoconf.in @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoconf -- create `configure' using m4 macros # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. @@ -31,8 +31,8 @@ Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi -test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ -test -z "${M4}" && M4=@M4@ +: ${AC_MACRODIR=@datadir@} +: ${M4=@M4@} case "${M4}" in /*) # Handle the case that m4 has moved since we were configured. # It may have been found originally in a build directory. diff --git a/autoconf.sh b/autoconf.sh index 5ae95c710..e8263481e 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoconf -- create `configure' using m4 macros # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. @@ -31,8 +31,8 @@ Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi -test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ -test -z "${M4}" && M4=@M4@ +: ${AC_MACRODIR=@datadir@} +: ${M4=@M4@} case "${M4}" in /*) # Handle the case that m4 has moved since we were configured. # It may have been found originally in a build directory. diff --git a/autoconf.texi b/autoconf.texi index 3ec9655cb..5198325d7 100644 --- a/autoconf.texi +++ b/autoconf.texi @@ -141,7 +141,7 @@ Initialization and Output Files Substitutions in Makefiles * Preset Output Variables:: Output variables that are always set. -* Build Directories:: Compiling in a different directory. +* Build Directories:: Supporting multiple concurrent compiles. * Automatic Remaking:: Makefile rules for configuring. Configuration Header Files @@ -248,7 +248,7 @@ Running @code{configure} Scripts * Basic Installation:: Instructions for typical cases. * Compilers and Options:: Selecting compilers and optimization. -* Build Directory:: Configuring in a different directory. +* Multiple Architectures:: Compiling for multiple architectures at once. * Installation Names:: Installing in different directories. * Optional Features:: Selecting optional features. * System Type:: Specifying the system type. @@ -753,7 +753,9 @@ Process any command-line arguments and find the source code directory. @var{unique-file-in-source-dir} is some file that is in the package's source directory; @code{configure} checks for this file's existence to make sure that the directory that it is told contains the source code in -fact does (@pxref{Invoking configure}, for more information). +fact does. Occasionally people accidentally specify the wrong directory +with @samp{--srcdir}; this is a safety check. @xref{Invoking configure}, +for more information. @end defmac Packages that do manual configuration or use the @code{install} program @@ -873,7 +875,7 @@ GNU Coding Standards}, for more information on what to put in @menu * Preset Output Variables:: Output variables that are always set. -* Build Directories:: Compiling in a different directory. +* Build Directories:: Supporting multiple concurrent compiles. * Automatic Remaking:: Makefile rules for configuring. @end menu @@ -896,7 +898,7 @@ reference this variable in a comment at the top of each input file. For example, an input shell script should begin like this: @example -#!/bin/sh +#! /bin/sh # @@configure_input@@ @end example @@ -978,11 +980,9 @@ linking programs to test for C features. @node Build Directories, Automatic Remaking, Preset Output Variables, Makefile Substitutions @subsection Build Directories -You might want to compile a software package in a different directory -from the one that contains the source code. Doing this allows you to -compile the package for several architectures simultaneously from the -same copy of the source code and keep multiple sets of object files on -disk. +You can support compiling a software package for several architectures +simultaneously from the same copy of the source code. The object files +for each architecture are kept in their own directory. To support doing this, @code{make} uses the @code{VPATH} variable to find the files that are in the source directory. GNU @code{make} and @@ -1003,7 +1003,7 @@ Do not set @code{VPATH} to the value of another variable, for example variable substitutions on the value of @code{VPATH}. @code{configure} substitutes in the correct value for @code{srcdir} when -it produces @file{Makefile.in}. +it produces @file{Makefile}. Do not use the @code{make} variable @code{$<}, which expands to the pathname of the file in the source directory (found with @code{VPATH}), @@ -1335,7 +1335,7 @@ particular @code{configure} corresponds to. It is a good idea to call this macro before @code{AC_INIT} so that the revision number is near the top of both @file{configure.in} and @code{configure}. To support doing that, the @code{AC_REVISION} output -begins with @samp{#!/bin/sh}, like the normal start of a +begins with @samp{#! /bin/sh}, like the normal start of a @code{configure} script does. For example, this line in @file{configure.in}: @@ -1349,7 +1349,7 @@ AC_REVISION($@asis{Revision: 1.30 }$)dnl produces this in @code{configure}: @example -#!/bin/sh +#! /bin/sh # From configure.in Revision: 1.30 @end example @end defmac @@ -1633,8 +1633,8 @@ add @samp{-l@var{library}} to @code{LIBS} and define If linking with @var{library} results in unresolved symbols, which would be resolved by linking with additional libraries, give those libraries -as the @var{other-libraries} argument, separated by spaces: @samp{-lX11 --lXt}. Otherwise this macro will fail to detect that @var{library} is +as the @var{other-libraries} argument, separated by spaces: @samp{-lXt +-lX11}. Otherwise this macro will fail to detect that @var{library} is present, because linking the test program will always fail with unresolved symbols. @end defmac @@ -2454,7 +2454,7 @@ The following macros check for operating system services or capabilities. @defmac AC_SYS_INTERPRETER @maindex SYS_INTERPRETER Check whether the system supports starting scripts with a line of the -form @samp{#!/bin/csh} to select the interpreter to use for the script. +form @samp{#! /bin/csh} to select the interpreter to use for the script. After running this macro, shell code in @code{configure.in} can check the variable @code{ac_cv_sys_interpreter}; it will be set to @samp{yes} if the system supports @samp{#!}, @samp{no} if not. @@ -2601,6 +2601,10 @@ any messages, for the same reason. The checks for particular kinds of C features call these macros and do cache their results and print messages about what they're checking for. +When you write a feature test that could be applicable to more than one +software package, the best thing to do is encapsulate it in a new macro. +@xref{Writing Macros}, for how to do that. + @menu * Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. @@ -2712,7 +2716,9 @@ there are unresolved functions in the link. This bug makes the configuration scripts produced by Autoconf unusable on those systems. However, some of them can be given options that make the exit status correct. This is a problem that Autoconf does not currently handle -automatically. +automatically. If users encounter this problem, they might be able to +solve it by setting @code{LDFLAGS} in the environment to pass whatever +options the linker needs (for example, @samp{-Wl,-dn} on MIPS RISC/OS). @code{AC_TRY_LINK} is used to compile test programs to test for functions and global variables. It is also used (by @@ -2895,7 +2901,14 @@ advantage of features that were added after UNIX version 7, circa 1977. You should not use shell functions, aliases, negated character classes, or other features that are not found in all Bourne-compatible shells; restrict yourself to the lowest common denominator. Even @code{unset} -is not supported by all shells! +is not supported by all shells! Also, include a space after the +exclamation point in interpreter specifications, like this: +@example +#! /usr/bin/perl +@end example +If you omit the space before the path, then 4.2BSD based systems (such +as Sequent DYNIX) will ignore the line, because they interpret @samp{#! /} +as a 4-byte magic number. The set of external programs you should run in a @code{configure} script is fairly small. @xref{Utilities in Makefiles, , Utilities in @@ -3347,7 +3360,7 @@ This macro prints nothing if @code{configure} is run with the @maindex MSG_ERROR Notify the user of an error that prevents @code{configure} from completing. This macro prints an error message on the standard error -stream and exits @code{configure} with a nonzero status. +output and exits @code{configure} with a nonzero status. @var{error-description} should be something like @samp{invalid value $HOME for \$HOME}. @end defmac @@ -3355,7 +3368,7 @@ $HOME for \$HOME}. @defmac AC_MSG_WARN (@var{problem-description}) @maindex MSG_WARN Notify the @code{configure} user of a possible problem. This macro -prints the message on the standard error stream; @code{configure} +prints the message on the standard error output; @code{configure} continues running afterward, so macros that call @code{AC_MSG_WARN} should provide a default (back-up) behavior for the situations they warn about. @var{problem-description} should be something like @samp{ln -s seems to @@ -3870,17 +3883,17 @@ should call @code{AC_ARG_WITH} to detect whether the @code{configure} user asked to use it. Whether each package is used or not by default, and which arguments are valid, is up to you. -@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]}) @maindex ARG_WITH If the user gave @code{configure} the option @samp{--with-@var{package}} or @samp{--without-@var{package}}, run shell commands -@var{action-if-true}. Otherwise run shell commands -@var{action-if-false}. The name @var{package} indicates another +@var{action-if-given}. Otherwise run shell commands +@var{action-if-not-given}. The name @var{package} indicates another software package that this program should work with. It should consist only of alphanumeric characters and dashes. The option's argument is available to the shell commands -@var{action-if-true} in the shell variable @code{withval}. +@var{action-if-given} in the shell variable @code{withval}. The argument @var{help-string} is a description of the option which looks like this: @@ -3894,7 +3907,7 @@ Avoid tabs in the help string. You'll need to enclose it in @samp{[} and @samp{]} in order to produce the leading spaces. @end defmac -@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@defmac AC_WITH (@var{package}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]}) @maindex WITH This is an obsolete version of @code{AC_ARG_WITH} that does not support providing a help string. @@ -3930,22 +3943,22 @@ For each optional feature, @file{configure.in} should call to include it. Whether each feature is included or not by default, and which arguments are valid, is up to you. -@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]}) @maindex ARG_ENABLE If the user gave @code{configure} the option @samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run -shell commands @var{action-if-true}. Otherwise run shell commands -@var{action-if-false}. The name @var{feature} indicates an optional +shell commands @var{action-if-given}. Otherwise run shell commands +@var{action-if-not-given}. The name @var{feature} indicates an optional user-level facility. It should consist only of alphanumeric characters and dashes. The option's argument is available to the shell commands -@var{action-if-true} in the shell variable @code{enableval}. +@var{action-if-given} in the shell variable @code{enableval}. The @var{help-string} argument is like that of @code{AC_ARG_WITH} (@pxref{External Software}). @end defmac -@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@defmac AC_ENABLE (@var{feature}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]}) @maindex ENABLE This is an obsolete version of @code{AC_ARG_ENABLE} that does not support providing a help string. @@ -3966,11 +3979,11 @@ edited @emph{only by users}, not by programs. The location of the file can either be based on the @code{prefix} variable, or be a standard location such as the user's home directory. It could even be specified by an environment variable. The programs should examine that file at -run time, rather than at compile time. That approach is more convenient -for users and makes the configuration process simpler than getting the -information while configuring. @xref{Directory Variables, , Variables -for Installation Directories, standards, GNU Coding Standards}, for more -information on where to put data files. +run time, rather than at compile time. Run time configuration is more +convenient for users and makes the configuration process simpler than +getting the information while configuring. @xref{Directory Variables, , +Variables for Installation Directories, standards, GNU Coding +Standards}, for more information on where to put data files. @node Transforming Names, Site Defaults, Site Details, Site Configuration @section Transforming Program Names When Installing @@ -4169,7 +4182,7 @@ may use comes with Autoconf. @menu * Basic Installation:: Instructions for typical cases. * Compilers and Options:: Selecting compilers and optimization. -* Build Directory:: Configuring in a different directory. +* Multiple Architectures:: Compiling for multiple architectures at once. * Installation Names:: Installing in different directories. * Optional Features:: Selecting optional features. * System Type:: Specifying the system type. @@ -4421,7 +4434,7 @@ standard way. Finally, Mark Eichin notes: Imake isn't all that extensible, either. In order to add new features to -Imake, you need to provide you own project template, and duplicate most +Imake, you need to provide your own project template, and duplicate most of the features of the existing one. This means that for a sophisticated project, using the vendor-provided Imake templates fails to provide any leverage---since they don't cover anything that your own project needs @@ -4490,7 +4503,8 @@ your @file{Makefile.in} files, so they can take advantage of the values of those variables in the environment when @code{configure} is run. Doing this isn't necessary, but it's a convenience for users. -Also add @samp{@@configure_input@@} in a comment to each input file for +Also add @samp{@@configure_input@@} in a comment to each non-@file{Makefile} +input file for @code{AC_OUTPUT}, so that the output files will contain a comment saying they were produced by @code{configure}. Automatically selecting the right comment syntax for all the kinds of files that people call @@ -4515,7 +4529,7 @@ exec_prefix = @@exec_prefix@@ @end example @noindent -The old feature of replacing those variables without @samp{@@} +The old behavior of replacing those variables without @samp{@@} characters around them has been removed. @node Changed Macros, Invoking autoupdate, Changed Makefiles, Upgrading diff --git a/autoheader.in b/autoheader.in index 354d4d09d..655dd4d6f 100644 --- a/autoheader.in +++ b/autoheader.in @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoheader -- create `config.h.in' from `configure.in' # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. diff --git a/autoheader.sh b/autoheader.sh index 354d4d09d..655dd4d6f 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoheader -- create `config.h.in' from `configure.in' # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. diff --git a/autoreconf.in b/autoreconf.in index 4b83f8042..538a754c2 100644 --- a/autoreconf.in +++ b/autoreconf.in @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoreconf - remake all Autoconf configure scripts in a directory tree # Copyright (C) 1994 Free Software Foundation, Inc. diff --git a/autoreconf.sh b/autoreconf.sh index 4b83f8042..538a754c2 100644 --- a/autoreconf.sh +++ b/autoreconf.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoreconf - remake all Autoconf configure scripts in a directory tree # Copyright (C) 1994 Free Software Foundation, Inc. diff --git a/autoscan.in b/autoscan.in index 9f26bfb2d..7b272ed46 100644 --- a/autoscan.in +++ b/autoscan.in @@ -1,4 +1,4 @@ -#!@PERL@ +#! @PERL@ # autoscan - Create configure.scan (a preliminary configure.in) for a package. # Copyright (C) 1994 Free Software Foundation, Inc. diff --git a/autoscan.pl b/autoscan.pl index 9f26bfb2d..7b272ed46 100644 --- a/autoscan.pl +++ b/autoscan.pl @@ -1,4 +1,4 @@ -#!@PERL@ +#! @PERL@ # autoscan - Create configure.scan (a preliminary configure.in) for a package. # Copyright (C) 1994 Free Software Foundation, Inc. diff --git a/bin/autoconf.in b/bin/autoconf.in index 5ae95c710..e8263481e 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoconf -- create `configure' using m4 macros # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. @@ -31,8 +31,8 @@ Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LANG+set}" = set; then LANG=C; export LANG; fi -test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@ -test -z "${M4}" && M4=@M4@ +: ${AC_MACRODIR=@datadir@} +: ${M4=@M4@} case "${M4}" in /*) # Handle the case that m4 has moved since we were configured. # It may have been found originally in a build directory. diff --git a/bin/autoheader.in b/bin/autoheader.in index 354d4d09d..655dd4d6f 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoheader -- create `config.h.in' from `configure.in' # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 4b83f8042..538a754c2 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -1,4 +1,4 @@ -#!/bin/sh +#! /bin/sh # autoreconf - remake all Autoconf configure scripts in a directory tree # Copyright (C) 1994 Free Software Foundation, Inc. diff --git a/bin/autoscan.in b/bin/autoscan.in index 9f26bfb2d..7b272ed46 100644 --- a/bin/autoscan.in +++ b/bin/autoscan.in @@ -1,4 +1,4 @@ -#!@PERL@ +#! @PERL@ # autoscan - Create configure.scan (a preliminary configure.in) for a package. # Copyright (C) 1994 Free Software Foundation, Inc. diff --git a/bin/ifnames.in b/bin/ifnames.in index cd95da844..72620d45b 100644 --- a/bin/ifnames.in +++ b/bin/ifnames.in @@ -1,6 +1,6 @@ -#!/bin/sh +#! /bin/sh # ifnames - print the identifiers used in C preprocessor conditionals -# Copyright (C) 1994 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,12 +20,13 @@ # Writes to stdout. # Written by David MacKenzie +# and Paul Eggert . usage="\ Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]" show_version=no -test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ +test -z "$AC_MACRODIR" && AC_MACRODIR=/usr/local/gnu/share/autoconf while test $# -gt 0; do case "$1" in @@ -55,39 +56,45 @@ if test $show_version = yes; then exit 0 fi -if test $# -eq 0; then - cat > stdin - set stdin - trap 'rm -f stdin' 0 - trap 'rm -f stdin; exit 1' 1 3 15 -fi +mawk ' + # Record that sym was found in FILENAME. + function file_sym(sym, i, fs) { + if (sym ~ /^[A-Za-z_]/) { + if (!found[sym,FILENAME]) { + found[sym,FILENAME] = 1 + + # Insert FILENAME into files[sym], keeping the list sorted. + i = 1 + fs = files[sym] + while (match(substr(fs, i), /^ [^ ]*/) \ + && substr(fs, i + 1, RLENGTH - 1) < FILENAME) { + i += RLENGTH + } + files[sym] = substr(fs, 1, i - 1) " " FILENAME substr(fs, i) + } + } + } + + /^[\t ]*#/ { + if (sub(/^[\t ]*#[\t ]*ifn?def[\t ]+/, "", $0)) { + sub(/[^A-Za-z_0-9].*/, "", $0) + file_sym($0) + } + if (sub(/^[\t ]*#[\t ]*(el)?if[\t ]+/, "", $0)) { + # Remove comments. Not perfect, but close enough. + gsub(/\/\*[^\/]*(\*\/)?/, "", $0) + + for (i = split($0, field, /[^A-Za-z_0-9]+/); 1 <= i; i--) { + if (field[i] != "defined") { + file_sym(field[i]) + } + } + } + } -for arg -do -# The first two substitutions remove comments. Not perfect, but close enough. -# The second is for comments that end on a later line. The others do: -# Enclose identifiers in @ and a space. -# Handle "#if 0" -- there are no @s to trigger removal. -# Remove non-identifiers. -# Remove any spaces at the end. -# Translate any other spaces to newlines. -sed -n ' -s%/\*[^/]*\*/%%g -s%/\*[^/]*%%g -/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p -/^[ ]*#[ ]*e*l*if[ ]/{ - s/// - s/@//g - s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g - s/$/@ / - s/@defined //g - s/[^@]*@\([^ ]* \)[^@]*/\1/g - s/ *$// - s/ /\ -/g - p -} -' $arg | sort -u | sed 's%$% '$arg'%' -done | awk ' -{ files[$1] = files[$1] " " $2 } -END { for (sym in files) print sym files[sym] }' | sort + END { + for (sym in files) { + print sym files[sym] + } + } +' ${1+"$@"} | sort diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 3ec9655cb..5198325d7 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -141,7 +141,7 @@ Initialization and Output Files Substitutions in Makefiles * Preset Output Variables:: Output variables that are always set. -* Build Directories:: Compiling in a different directory. +* Build Directories:: Supporting multiple concurrent compiles. * Automatic Remaking:: Makefile rules for configuring. Configuration Header Files @@ -248,7 +248,7 @@ Running @code{configure} Scripts * Basic Installation:: Instructions for typical cases. * Compilers and Options:: Selecting compilers and optimization. -* Build Directory:: Configuring in a different directory. +* Multiple Architectures:: Compiling for multiple architectures at once. * Installation Names:: Installing in different directories. * Optional Features:: Selecting optional features. * System Type:: Specifying the system type. @@ -753,7 +753,9 @@ Process any command-line arguments and find the source code directory. @var{unique-file-in-source-dir} is some file that is in the package's source directory; @code{configure} checks for this file's existence to make sure that the directory that it is told contains the source code in -fact does (@pxref{Invoking configure}, for more information). +fact does. Occasionally people accidentally specify the wrong directory +with @samp{--srcdir}; this is a safety check. @xref{Invoking configure}, +for more information. @end defmac Packages that do manual configuration or use the @code{install} program @@ -873,7 +875,7 @@ GNU Coding Standards}, for more information on what to put in @menu * Preset Output Variables:: Output variables that are always set. -* Build Directories:: Compiling in a different directory. +* Build Directories:: Supporting multiple concurrent compiles. * Automatic Remaking:: Makefile rules for configuring. @end menu @@ -896,7 +898,7 @@ reference this variable in a comment at the top of each input file. For example, an input shell script should begin like this: @example -#!/bin/sh +#! /bin/sh # @@configure_input@@ @end example @@ -978,11 +980,9 @@ linking programs to test for C features. @node Build Directories, Automatic Remaking, Preset Output Variables, Makefile Substitutions @subsection Build Directories -You might want to compile a software package in a different directory -from the one that contains the source code. Doing this allows you to -compile the package for several architectures simultaneously from the -same copy of the source code and keep multiple sets of object files on -disk. +You can support compiling a software package for several architectures +simultaneously from the same copy of the source code. The object files +for each architecture are kept in their own directory. To support doing this, @code{make} uses the @code{VPATH} variable to find the files that are in the source directory. GNU @code{make} and @@ -1003,7 +1003,7 @@ Do not set @code{VPATH} to the value of another variable, for example variable substitutions on the value of @code{VPATH}. @code{configure} substitutes in the correct value for @code{srcdir} when -it produces @file{Makefile.in}. +it produces @file{Makefile}. Do not use the @code{make} variable @code{$<}, which expands to the pathname of the file in the source directory (found with @code{VPATH}), @@ -1335,7 +1335,7 @@ particular @code{configure} corresponds to. It is a good idea to call this macro before @code{AC_INIT} so that the revision number is near the top of both @file{configure.in} and @code{configure}. To support doing that, the @code{AC_REVISION} output -begins with @samp{#!/bin/sh}, like the normal start of a +begins with @samp{#! /bin/sh}, like the normal start of a @code{configure} script does. For example, this line in @file{configure.in}: @@ -1349,7 +1349,7 @@ AC_REVISION($@asis{Revision: 1.30 }$)dnl produces this in @code{configure}: @example -#!/bin/sh +#! /bin/sh # From configure.in Revision: 1.30 @end example @end defmac @@ -1633,8 +1633,8 @@ add @samp{-l@var{library}} to @code{LIBS} and define If linking with @var{library} results in unresolved symbols, which would be resolved by linking with additional libraries, give those libraries -as the @var{other-libraries} argument, separated by spaces: @samp{-lX11 --lXt}. Otherwise this macro will fail to detect that @var{library} is +as the @var{other-libraries} argument, separated by spaces: @samp{-lXt +-lX11}. Otherwise this macro will fail to detect that @var{library} is present, because linking the test program will always fail with unresolved symbols. @end defmac @@ -2454,7 +2454,7 @@ The following macros check for operating system services or capabilities. @defmac AC_SYS_INTERPRETER @maindex SYS_INTERPRETER Check whether the system supports starting scripts with a line of the -form @samp{#!/bin/csh} to select the interpreter to use for the script. +form @samp{#! /bin/csh} to select the interpreter to use for the script. After running this macro, shell code in @code{configure.in} can check the variable @code{ac_cv_sys_interpreter}; it will be set to @samp{yes} if the system supports @samp{#!}, @samp{no} if not. @@ -2601,6 +2601,10 @@ any messages, for the same reason. The checks for particular kinds of C features call these macros and do cache their results and print messages about what they're checking for. +When you write a feature test that could be applicable to more than one +software package, the best thing to do is encapsulate it in a new macro. +@xref{Writing Macros}, for how to do that. + @menu * Examining Declarations:: Detecting header files and declarations. * Examining Syntax:: Detecting language syntax features. @@ -2712,7 +2716,9 @@ there are unresolved functions in the link. This bug makes the configuration scripts produced by Autoconf unusable on those systems. However, some of them can be given options that make the exit status correct. This is a problem that Autoconf does not currently handle -automatically. +automatically. If users encounter this problem, they might be able to +solve it by setting @code{LDFLAGS} in the environment to pass whatever +options the linker needs (for example, @samp{-Wl,-dn} on MIPS RISC/OS). @code{AC_TRY_LINK} is used to compile test programs to test for functions and global variables. It is also used (by @@ -2895,7 +2901,14 @@ advantage of features that were added after UNIX version 7, circa 1977. You should not use shell functions, aliases, negated character classes, or other features that are not found in all Bourne-compatible shells; restrict yourself to the lowest common denominator. Even @code{unset} -is not supported by all shells! +is not supported by all shells! Also, include a space after the +exclamation point in interpreter specifications, like this: +@example +#! /usr/bin/perl +@end example +If you omit the space before the path, then 4.2BSD based systems (such +as Sequent DYNIX) will ignore the line, because they interpret @samp{#! /} +as a 4-byte magic number. The set of external programs you should run in a @code{configure} script is fairly small. @xref{Utilities in Makefiles, , Utilities in @@ -3347,7 +3360,7 @@ This macro prints nothing if @code{configure} is run with the @maindex MSG_ERROR Notify the user of an error that prevents @code{configure} from completing. This macro prints an error message on the standard error -stream and exits @code{configure} with a nonzero status. +output and exits @code{configure} with a nonzero status. @var{error-description} should be something like @samp{invalid value $HOME for \$HOME}. @end defmac @@ -3355,7 +3368,7 @@ $HOME for \$HOME}. @defmac AC_MSG_WARN (@var{problem-description}) @maindex MSG_WARN Notify the @code{configure} user of a possible problem. This macro -prints the message on the standard error stream; @code{configure} +prints the message on the standard error output; @code{configure} continues running afterward, so macros that call @code{AC_MSG_WARN} should provide a default (back-up) behavior for the situations they warn about. @var{problem-description} should be something like @samp{ln -s seems to @@ -3870,17 +3883,17 @@ should call @code{AC_ARG_WITH} to detect whether the @code{configure} user asked to use it. Whether each package is used or not by default, and which arguments are valid, is up to you. -@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]}) @maindex ARG_WITH If the user gave @code{configure} the option @samp{--with-@var{package}} or @samp{--without-@var{package}}, run shell commands -@var{action-if-true}. Otherwise run shell commands -@var{action-if-false}. The name @var{package} indicates another +@var{action-if-given}. Otherwise run shell commands +@var{action-if-not-given}. The name @var{package} indicates another software package that this program should work with. It should consist only of alphanumeric characters and dashes. The option's argument is available to the shell commands -@var{action-if-true} in the shell variable @code{withval}. +@var{action-if-given} in the shell variable @code{withval}. The argument @var{help-string} is a description of the option which looks like this: @@ -3894,7 +3907,7 @@ Avoid tabs in the help string. You'll need to enclose it in @samp{[} and @samp{]} in order to produce the leading spaces. @end defmac -@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@defmac AC_WITH (@var{package}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]}) @maindex WITH This is an obsolete version of @code{AC_ARG_WITH} that does not support providing a help string. @@ -3930,22 +3943,22 @@ For each optional feature, @file{configure.in} should call to include it. Whether each feature is included or not by default, and which arguments are valid, is up to you. -@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]}) @maindex ARG_ENABLE If the user gave @code{configure} the option @samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run -shell commands @var{action-if-true}. Otherwise run shell commands -@var{action-if-false}. The name @var{feature} indicates an optional +shell commands @var{action-if-given}. Otherwise run shell commands +@var{action-if-not-given}. The name @var{feature} indicates an optional user-level facility. It should consist only of alphanumeric characters and dashes. The option's argument is available to the shell commands -@var{action-if-true} in the shell variable @code{enableval}. +@var{action-if-given} in the shell variable @code{enableval}. The @var{help-string} argument is like that of @code{AC_ARG_WITH} (@pxref{External Software}). @end defmac -@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]}) +@defmac AC_ENABLE (@var{feature}, @var{action-if-given} @r{[}, @var{action-if-not-given}@r{]}) @maindex ENABLE This is an obsolete version of @code{AC_ARG_ENABLE} that does not support providing a help string. @@ -3966,11 +3979,11 @@ edited @emph{only by users}, not by programs. The location of the file can either be based on the @code{prefix} variable, or be a standard location such as the user's home directory. It could even be specified by an environment variable. The programs should examine that file at -run time, rather than at compile time. That approach is more convenient -for users and makes the configuration process simpler than getting the -information while configuring. @xref{Directory Variables, , Variables -for Installation Directories, standards, GNU Coding Standards}, for more -information on where to put data files. +run time, rather than at compile time. Run time configuration is more +convenient for users and makes the configuration process simpler than +getting the information while configuring. @xref{Directory Variables, , +Variables for Installation Directories, standards, GNU Coding +Standards}, for more information on where to put data files. @node Transforming Names, Site Defaults, Site Details, Site Configuration @section Transforming Program Names When Installing @@ -4169,7 +4182,7 @@ may use comes with Autoconf. @menu * Basic Installation:: Instructions for typical cases. * Compilers and Options:: Selecting compilers and optimization. -* Build Directory:: Configuring in a different directory. +* Multiple Architectures:: Compiling for multiple architectures at once. * Installation Names:: Installing in different directories. * Optional Features:: Selecting optional features. * System Type:: Specifying the system type. @@ -4421,7 +4434,7 @@ standard way. Finally, Mark Eichin notes: Imake isn't all that extensible, either. In order to add new features to -Imake, you need to provide you own project template, and duplicate most +Imake, you need to provide your own project template, and duplicate most of the features of the existing one. This means that for a sophisticated project, using the vendor-provided Imake templates fails to provide any leverage---since they don't cover anything that your own project needs @@ -4490,7 +4503,8 @@ your @file{Makefile.in} files, so they can take advantage of the values of those variables in the environment when @code{configure} is run. Doing this isn't necessary, but it's a convenience for users. -Also add @samp{@@configure_input@@} in a comment to each input file for +Also add @samp{@@configure_input@@} in a comment to each non-@file{Makefile} +input file for @code{AC_OUTPUT}, so that the output files will contain a comment saying they were produced by @code{configure}. Automatically selecting the right comment syntax for all the kinds of files that people call @@ -4515,7 +4529,7 @@ exec_prefix = @@exec_prefix@@ @end example @noindent -The old feature of replacing those variables without @samp{@@} +The old behavior of replacing those variables without @samp{@@} characters around them has been removed. @node Changed Macros, Invoking autoupdate, Changed Makefiles, Upgrading diff --git a/doc/install.texi b/doc/install.texi index bff0738b8..3cfb52f64 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -55,10 +55,13 @@ Type @samp{make install} to install the programs and any data files and documentation. @item -You can remove the program binaries and object files from the source +You can remove the program binaries and object files from the source code directory by typing @samp{make clean}. To also remove the files that @code{configure} created (so you can compile the package for a different -kind of computer), type @samp{make distclean}. +kind of computer), type @samp{make distclean}. There is also a +@samp{make realclean} target, but that is intended mainly for the +package's developers. If you use it, you may have to get all sorts of +other programs in order to regenerate files that came with the distribution. @end enumerate @node Compilers and Options @@ -79,17 +82,23 @@ Or on systems that have the @code{env} program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure @end example -@node Build Directory -@section Using a Different Build Directory +@node Multiple Architectures +@section Compiling For Multiple Architectures -You can compile the package in a different directory from the one -containing the source code. Doing so allows you to compile it on more -than one kind of computer at the same time. To do this, you must use a -version of @code{make} that supports the @code{VPATH} variable, such as -GNU @code{make}. @code{cd} to the directory where you want the object -files and executables to go and run the @code{configure} script. -@code{configure} automatically checks for the source code in the -directory that @code{configure} is in and in @file{..}. +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of @code{make} that +supports the @code{VPATH} variable, such as GNU @code{make}. @code{cd} +to the directory where you want the object files and executables to go +and run the @code{configure} script. @code{configure} automatically +checks for the source code in the directory that @code{configure} is in +and in @file{..}. + +If you have to use a @code{make} that does not supports the @code{VPATH} +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use @samp{make distclean} before reconfiguring for +another architecture. @node Installation Names @section Installation Names @@ -168,8 +177,8 @@ operates. @table @code @item --cache-file=@var{file} -Save the results of the tests in @var{file} instead of -@file{config.cache}. Set @var{file} to @file{/dev/null} to disable +Use and save the results of the tests in @var{file} instead of +@file{./config.cache}. Set @var{file} to @file{/dev/null} to disable caching, for debugging @code{configure}. @item --help diff --git a/ifnames.in b/ifnames.in index cd95da844..72620d45b 100644 --- a/ifnames.in +++ b/ifnames.in @@ -1,6 +1,6 @@ -#!/bin/sh +#! /bin/sh # ifnames - print the identifiers used in C preprocessor conditionals -# Copyright (C) 1994 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,12 +20,13 @@ # Writes to stdout. # Written by David MacKenzie +# and Paul Eggert . usage="\ Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]" show_version=no -test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ +test -z "$AC_MACRODIR" && AC_MACRODIR=/usr/local/gnu/share/autoconf while test $# -gt 0; do case "$1" in @@ -55,39 +56,45 @@ if test $show_version = yes; then exit 0 fi -if test $# -eq 0; then - cat > stdin - set stdin - trap 'rm -f stdin' 0 - trap 'rm -f stdin; exit 1' 1 3 15 -fi +mawk ' + # Record that sym was found in FILENAME. + function file_sym(sym, i, fs) { + if (sym ~ /^[A-Za-z_]/) { + if (!found[sym,FILENAME]) { + found[sym,FILENAME] = 1 + + # Insert FILENAME into files[sym], keeping the list sorted. + i = 1 + fs = files[sym] + while (match(substr(fs, i), /^ [^ ]*/) \ + && substr(fs, i + 1, RLENGTH - 1) < FILENAME) { + i += RLENGTH + } + files[sym] = substr(fs, 1, i - 1) " " FILENAME substr(fs, i) + } + } + } + + /^[\t ]*#/ { + if (sub(/^[\t ]*#[\t ]*ifn?def[\t ]+/, "", $0)) { + sub(/[^A-Za-z_0-9].*/, "", $0) + file_sym($0) + } + if (sub(/^[\t ]*#[\t ]*(el)?if[\t ]+/, "", $0)) { + # Remove comments. Not perfect, but close enough. + gsub(/\/\*[^\/]*(\*\/)?/, "", $0) + + for (i = split($0, field, /[^A-Za-z_0-9]+/); 1 <= i; i--) { + if (field[i] != "defined") { + file_sym(field[i]) + } + } + } + } -for arg -do -# The first two substitutions remove comments. Not perfect, but close enough. -# The second is for comments that end on a later line. The others do: -# Enclose identifiers in @ and a space. -# Handle "#if 0" -- there are no @s to trigger removal. -# Remove non-identifiers. -# Remove any spaces at the end. -# Translate any other spaces to newlines. -sed -n ' -s%/\*[^/]*\*/%%g -s%/\*[^/]*%%g -/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p -/^[ ]*#[ ]*e*l*if[ ]/{ - s/// - s/@//g - s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g - s/$/@ / - s/@defined //g - s/[^@]*@\([^ ]* \)[^@]*/\1/g - s/ *$// - s/ /\ -/g - p -} -' $arg | sort -u | sed 's%$% '$arg'%' -done | awk ' -{ files[$1] = files[$1] " " $2 } -END { for (sym in files) print sym files[sym] }' | sort + END { + for (sym in files) { + print sym files[sym] + } + } +' ${1+"$@"} | sort diff --git a/ifnames.sh b/ifnames.sh index cd95da844..72620d45b 100644 --- a/ifnames.sh +++ b/ifnames.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#! /bin/sh # ifnames - print the identifiers used in C preprocessor conditionals -# Copyright (C) 1994 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,12 +20,13 @@ # Writes to stdout. # Written by David MacKenzie +# and Paul Eggert . usage="\ Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]" show_version=no -test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@ +test -z "$AC_MACRODIR" && AC_MACRODIR=/usr/local/gnu/share/autoconf while test $# -gt 0; do case "$1" in @@ -55,39 +56,45 @@ if test $show_version = yes; then exit 0 fi -if test $# -eq 0; then - cat > stdin - set stdin - trap 'rm -f stdin' 0 - trap 'rm -f stdin; exit 1' 1 3 15 -fi +mawk ' + # Record that sym was found in FILENAME. + function file_sym(sym, i, fs) { + if (sym ~ /^[A-Za-z_]/) { + if (!found[sym,FILENAME]) { + found[sym,FILENAME] = 1 + + # Insert FILENAME into files[sym], keeping the list sorted. + i = 1 + fs = files[sym] + while (match(substr(fs, i), /^ [^ ]*/) \ + && substr(fs, i + 1, RLENGTH - 1) < FILENAME) { + i += RLENGTH + } + files[sym] = substr(fs, 1, i - 1) " " FILENAME substr(fs, i) + } + } + } + + /^[\t ]*#/ { + if (sub(/^[\t ]*#[\t ]*ifn?def[\t ]+/, "", $0)) { + sub(/[^A-Za-z_0-9].*/, "", $0) + file_sym($0) + } + if (sub(/^[\t ]*#[\t ]*(el)?if[\t ]+/, "", $0)) { + # Remove comments. Not perfect, but close enough. + gsub(/\/\*[^\/]*(\*\/)?/, "", $0) + + for (i = split($0, field, /[^A-Za-z_0-9]+/); 1 <= i; i--) { + if (field[i] != "defined") { + file_sym(field[i]) + } + } + } + } -for arg -do -# The first two substitutions remove comments. Not perfect, but close enough. -# The second is for comments that end on a later line. The others do: -# Enclose identifiers in @ and a space. -# Handle "#if 0" -- there are no @s to trigger removal. -# Remove non-identifiers. -# Remove any spaces at the end. -# Translate any other spaces to newlines. -sed -n ' -s%/\*[^/]*\*/%%g -s%/\*[^/]*%%g -/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p -/^[ ]*#[ ]*e*l*if[ ]/{ - s/// - s/@//g - s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g - s/$/@ / - s/@defined //g - s/[^@]*@\([^ ]* \)[^@]*/\1/g - s/ *$// - s/ /\ -/g - p -} -' $arg | sort -u | sed 's%$% '$arg'%' -done | awk ' -{ files[$1] = files[$1] " " $2 } -END { for (sym in files) print sym files[sym] }' | sort + END { + for (sym in files) { + print sym files[sym] + } + } +' ${1+"$@"} | sort diff --git a/install.texi b/install.texi index bff0738b8..3cfb52f64 100644 --- a/install.texi +++ b/install.texi @@ -55,10 +55,13 @@ Type @samp{make install} to install the programs and any data files and documentation. @item -You can remove the program binaries and object files from the source +You can remove the program binaries and object files from the source code directory by typing @samp{make clean}. To also remove the files that @code{configure} created (so you can compile the package for a different -kind of computer), type @samp{make distclean}. +kind of computer), type @samp{make distclean}. There is also a +@samp{make realclean} target, but that is intended mainly for the +package's developers. If you use it, you may have to get all sorts of +other programs in order to regenerate files that came with the distribution. @end enumerate @node Compilers and Options @@ -79,17 +82,23 @@ Or on systems that have the @code{env} program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure @end example -@node Build Directory -@section Using a Different Build Directory +@node Multiple Architectures +@section Compiling For Multiple Architectures -You can compile the package in a different directory from the one -containing the source code. Doing so allows you to compile it on more -than one kind of computer at the same time. To do this, you must use a -version of @code{make} that supports the @code{VPATH} variable, such as -GNU @code{make}. @code{cd} to the directory where you want the object -files and executables to go and run the @code{configure} script. -@code{configure} automatically checks for the source code in the -directory that @code{configure} is in and in @file{..}. +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of @code{make} that +supports the @code{VPATH} variable, such as GNU @code{make}. @code{cd} +to the directory where you want the object files and executables to go +and run the @code{configure} script. @code{configure} automatically +checks for the source code in the directory that @code{configure} is in +and in @file{..}. + +If you have to use a @code{make} that does not supports the @code{VPATH} +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use @samp{make distclean} before reconfiguring for +another architecture. @node Installation Names @section Installation Names @@ -168,8 +177,8 @@ operates. @table @code @item --cache-file=@var{file} -Save the results of the tests in @var{file} instead of -@file{config.cache}. Set @var{file} to @file{/dev/null} to disable +Use and save the results of the tests in @var{file} instead of +@file{./config.cache}. Set @var{file} to @file{/dev/null} to disable caching, for debugging @code{configure}. @item --help diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 215e9e72c..b6d33d12d 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -73,7 +73,7 @@ dnl ### Defining macros dnl m4 output diversions. We let m4 output them all in order at the end, dnl except that we explicitly undivert AC_DIVERSION_SED. -dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #!/bin/sh line +dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings define(AC_DIVERSION_INIT, 2)dnl initialization code define(AC_DIVERSION_SED, 3)dnl variable substitutions in config.status @@ -448,7 +448,7 @@ dnl Try to have only one #! line, so the script doesn't look funny dnl for users of AC_REVISION. dnl AC_INIT_BINSH() AC_DEFUN(AC_INIT_BINSH, -[#!/bin/sh +[#! /bin/sh ]) dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) @@ -466,14 +466,15 @@ AC_DIVERT_POP()dnl to NORMAL dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR) AC_DEFUN(AC_INIT_PREPARE, -[trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 +[trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: -# 0 unused; standard input +# 0 standard input # 1 file creation # 2 errors and warnings -# 3 unused; some systems may open it to /dev/tty -define(AC_FD_MSG, 4)dnl +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +define(AC_FD_MSG, 6)dnl [#] AC_FD_MSG checking for... messages and results define(AC_FD_CC, 5)dnl [#] AC_FD_CC compiler messages saved in config.log @@ -581,8 +582,8 @@ AC_DEFUN(AC_ARG_ENABLE, ac_help="$ac_help [$2]" AC_DIVERT_POP()dnl -[#] Check whether --enable-$1 or --disable-$1 was given. -enableval="[$enable_]patsubst($1, -, _)" +[#] Check whether --enable-[$1] or --disable-[$1] was given. +enableval="[$enable_]patsubst([$1], -, _)" if test -n "$enableval"; then ifelse([$3], , :, [$3]) ifelse([$4], , , [else @@ -606,8 +607,8 @@ AC_DEFUN(AC_ARG_WITH, ac_help="$ac_help [$2]" AC_DIVERT_POP()dnl -[#] Check whether --with-$1 or --without-$1 was given. -withval="[$with_]patsubst($1, -, _)" +[#] Check whether --with-[$1] or --without-[$1] was given. +withval="[$with_]patsubst([$1], -, _)" if test -n "$withval"; then ifelse([$3], , :, [$3]) ifelse([$4], , , [else @@ -901,9 +902,10 @@ cat > $cache_file <<\EOF EOF changequote(, )dnl dnl Allow a site initialization script to override cache values. -# Ultrix sh set writes to stderr and can't be redirected directly. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \ + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ >> $cache_file changequote([, ])dnl else @@ -1504,7 +1506,7 @@ main() if (!f) exit(1); fprintf(f, "%d\n", sizeof($1)); exit(0); -}], AC_CV_NAME=`cat conftestval`)])dnl +}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0)])dnl AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) undefine([AC_TYPE_NAME])dnl @@ -1558,7 +1560,7 @@ dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS]) define(AC_OUTPUT, [trap '' 1 2 15 AC_CACHE_SAVE -trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. @@ -1583,7 +1585,7 @@ ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()]) echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS <>$LEX_OUTPUT_ROOT.c +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS="$LIBS" LIBS="$LIBS $LEXLIB" -AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, ac_cv_prog_lex_yytext_pointer=yes) +AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, , ac_cv_prog_lex_yytext_pointer=yes) LIBS="$ac_save_LIBS" rm -f "${LEX_OUTPUT_ROOT}.c"])dnl AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer) @@ -973,10 +973,11 @@ main() { /* Use a field that we can force nonzero -- voluntary context switches. For systems like NeXT and OSF/1 that don't set it, - also use the system CPU time. */ + also use the system CPU time. And page faults (I/O) for Linux. */ r.ru_nvcsw = 0; r.ru_stime.tv_sec = 0; r.ru_stime.tv_usec = 0; + r.ru_majflt = r.ru_minflt = 0; switch (fork()) { case 0: /* Child. */ sleep(1); /* Give up the CPU. */ @@ -985,7 +986,7 @@ main() { default: /* Parent. */ wait3(&i, 0, &r); sleep(1); /* Avoid "text file busy" from rm on fast HP-UX machines. */ - exit(r.ru_nvcsw == 0 + exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); } }], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl @@ -1196,7 +1197,7 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 && t.st_mtime - s.st_mtime < 120)); }], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no, ac_cv_func_utime_null=no) -rm -f core])dnl +rm -f core core.* *.core])dnl AC_MSG_RESULT($ac_cv_func_utime_null) if test $ac_cv_func_utime_null = yes; then AC_DEFINE(HAVE_UTIME_NULL) @@ -1233,7 +1234,7 @@ main () { putc('\r', stdout); exit(0); /* Non-reversed systems segv here. */ }], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no) -rm -f core])dnl +rm -f core core.* *.core])dnl AC_MSG_RESULT($ac_cv_func_setvbuf_reversed) if test $ac_cv_func_setvbuf_reversed = yes; then AC_DEFINE(SETVBUF_REVERSED) @@ -1372,7 +1373,7 @@ AC_DEFUN(AC_C_CROSS, AC_MSG_CHECKING(whether cross-compiling) AC_CACHE_VAL(ac_cv_c_cross, [AC_TRY_RUN([main(){return(0);}], - ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_cross=yes)])dnl + ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes)])dnl cross_compiling=$ac_cv_c_cross AC_MSG_RESULT($ac_cv_c_cross) ]) @@ -1542,7 +1543,7 @@ AC_DEFUN(AC_SYS_INTERPRETER, ac_msg="whether #! works in shell scripts" AC_MSG_CHECKING($ac_msg) AC_CACHE_VAL(ac_cv_sys_interpreter, -[echo '#!/bin/cat +[echo '#! /bin/cat exit 69 ' > conftest chmod u+x conftest @@ -1829,7 +1830,7 @@ else # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. - AC_CHECK_LIB(ICE, IceConnectionNumbers, + AC_CHECK_LIB(ICE, IceConnectionNumber, [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"]) LDFLAGS="$ac_save_LDFLAGS"