diff --git a/ChangeLog b/ChangeLog index 86d469fe..1b1135da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +1999-09-22 Akim Demaille + + * install.texi: Give emore details on envvar handling. + * acgeneral.m4 (AC_HELP_STRING): Add a third argument to tune the + width of the first column. + (AC_INIT_NOTICE): Initialize ac_arg_enable_help, ac_arg_with_help, + and ac_arg_var_help. + * acgeneral.m4 (AC_INIT_PARSE_ARGS): Remove the handling of + --env-var=. After debate, the solution chosen to specify envvars + to configure is a` la make: ./configure VAR=VAL. + (AC_INIT_PARSE_ARGS, --help): Output ac_arg_enable_help, + ac_arg_with_help, and ac_arg_var_help. + * acgeneral.m4 (AC_ARG_VAR): New macro, to register and document + influent envvars. + * acspecific.m4 (AC_PROG_CC): Document CFLAGS. + This is mainly to test AC_ARG_VAR. Var to document are to be + defined. + 1999-09-22 Akim Demaille * acgeneral.m4 (m4_default): New macro. diff --git a/INSTALL b/INSTALL index 5753aa6e..15e11277 100644 --- a/INSTALL +++ b/INSTALL @@ -55,12 +55,19 @@ Compilers and Options ===================== Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for variables by setting +them in the environment. You can do that on the command line like this: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + Please, note that the former interface: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + or + env CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + is deprecated and should be avoided. + Compiling For Multiple Architectures ==================================== diff --git a/acgeneral.m4 b/acgeneral.m4 index a5aa636d..142bd2e9 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -529,12 +529,14 @@ popdef([ac_width])dnl popdef([ac_cursor])]) -dnl AC_HELP_STRING(LHS, RHS) -dnl ------------------------ +dnl AC_HELP_STRING(LHS, RHS[, COLUMN]) +dnl ---------------------------------- dnl dnl Format an Autoconf macro's help string so that it looks pretty when -dnl the user executes "configure --help". This macro takes two -dnl arguments, a "left hand side" (LHS), and a "right hand side" (RHS). +dnl the user executes "configure --help". This macro takes three +dnl arguments, a "left hand side" (LHS), a "right hand side" (RHS), and +dnl the COLUMN which is a string of wide spaces which leads to the +dnl the RHS column (default: 26 white spaces). dnl dnl The resulting string is suitable for use in other macros that require dnl a help string (e.g. AC_ARG_WITH). @@ -570,23 +572,28 @@ dnl column 0 column 26 dnl dnl This macro is a adhoc version of AC_WRAP. define([AC_HELP_STRING], -[pushdef([ac_prefix], [ ])dnl 26 spaces -pushdef([ac_width], m4_eval(79 - len(ac_prefix)))dnl -pushdef([ac_cursor], 0)dnl -m4_format([ %-23s ], [$1])dnl +[pushdef([AC_Prefix], m4_default([$3], [ ]))dnl +pushdef([AC_Prefix_Len], len(AC_Prefix))dnl Default: 26 +pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s])dnl [ %-23s] +pushdef([AC_Width], m4_eval(79 - AC_Prefix_Len))dnl Width of the RHS column. +pushdef([AC_Cursor], 0)dnl +m4_format(AC_Prefix_Format, [$1])dnl dnl If the option is too wide, leave it alone on the line -ifelse(m4_eval(len(m4_format([ %-23s ], [$1])) > 26), +ifelse(m4_eval(len(m4_format(AC_Prefix_Format, [$1])) > AC_Prefix_Len), 1, [ -]ac_prefix)dnl -AC_FOREACH([ac_word], $2, -[define([ac_cursor], m4_eval(ac_cursor + len(ac_word) + 1))dnl -ifelse(m4_eval(ac_cursor > ac_width), - 1, [define([ac_cursor], m4_eval(len(ac_word) + 1))] -ac_prefix)dnl -ac_word ])dnl -popdef([ac_prefix])dnl -popdef([ac_width])dnl -popdef([ac_cursor])]) +]AC_Prefix)dnl +AC_FOREACH([AC_Word], $2, +[define([AC_Cursor], m4_eval(AC_Cursor + len(AC_Word) + 1))dnl +ifelse(m4_eval(AC_Cursor > AC_Width), + 1, [define([AC_Cursor], m4_eval(len(AC_Word) + 1))] +AC_Prefix)dnl +AC_Word ])dnl +popdef([AC_Cursor])dnl +popdef([AC_Width])dnl +popdef([AC_Prefix_Format])dnl +popdef([AC_Prefix_Len])dnl +popdef([AC_Prefix])dnl +]) @@ -603,7 +610,9 @@ AC_DEFUN(AC_INIT_NOTICE, # gives unlimited permission to copy, distribute and modify it. # Defaults: -ac_help= +ac_arg_with_help= +ac_arg_enable_help= +ac_arg_var_help= ac_default_prefix=/usr/local [#] Any additions from configure.in:]) @@ -738,21 +747,6 @@ changequote([, ])dnl esac eval "enable_${ac_feature}='$ac_optarg'" ;; - -env-* | --env-*) - ac_envvar=`echo $ac_option|sed -e 's/^-*env-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. -changequote(, )dnl - if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then -changequote([, ])dnl - AC_MSG_ERROR($ac_envvar: invalid variable name) - fi - case "$ac_option" in - *=*) ;; - *) AC_MSG_ERROR($ac_envvar: missing value) ;; - esac - eval "${ac_envvar}='$ac_optarg'" - export $ac_envvar ;; - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) @@ -783,7 +777,6 @@ Defaults for the options are specified in brackets. Configuration: --cache-file=FILE cache test results in FILE - [--env-]VAR=VALUE set environment variable VAR to VALUE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages @@ -832,9 +825,19 @@ Features and packages: --x-libraries=DIR X library files are in DIR EOF changequote([, ])dnl - if test -n "$ac_help"; then +dnl It would be great to sort, unfortunately, since each entry maybe +dnl split on several lines, it is not as evident as a simple `| sort'. + if test -n "$ac_arg_enable_help"; then echo " ---enable and --with options recognized:$ac_help" +--enable options recognized:$ac_arg_enable_help" + fi + if test -n "$ac_arg_with_help"; then + echo " +--with options recognized:$ac_arg_with_help" + fi + if test -n "$ac_arg_var_help"; then + echo " +Some of the influent environment variables:$ac_arg_var_help" fi exit 0 ;; @@ -1243,7 +1246,7 @@ dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) dnl ----------------------------------------------------------------------- AC_DEFUN(AC_ARG_ENABLE, [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl -ac_help="$ac_help +ac_arg_enable_help="$ac_arg_enable_help [$2]" AC_DIVERT_POP()dnl [#] Check whether --enable-[$1] or --disable-[$1] was given. @@ -1268,7 +1271,7 @@ dnl ### Working with optional software dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) AC_DEFUN(AC_ARG_WITH, [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl -ac_help="$ac_help +ac_arg_with_help="$ac_arg_with_help [$2]" AC_DIVERT_POP()dnl [#] Check whether --with-[$1] or --without-[$1] was given. @@ -1288,6 +1291,27 @@ AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl +dnl ### Remembering env vars for reconfiguring + +dnl AC_ARG_VAR(VARNAME, DOCUMENTATION) +dnl ---------------------------------- +dnl Register VARNAME as a variable configure should remember, and +dnl document it in --help. +AC_DEFUN(AC_ARG_VAR, +[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl +ac_arg_var_help="$ac_arg_var_help +AC_HELP_STRING([$1], [$2], [ ])" +AC_DIVERT_POP()dnl +dnl Prepend instead of appending, so that envvars set on the cmd line +dnl win over the environment. Don't register envvars not set. +dnl Don't register several times. +case "${$1+set} $ac_configure_args" in + *" $1="* );; + "set "*) ac_configure_args="$1='[$]$1' $ac_configure_args";; +esac]) + + + dnl ### Transforming program names. @@ -2474,8 +2498,8 @@ AC_SHELL_IFELSE(test AC_VAR_GET(ac_var) = yes, AC_VAR_POPDEF([ac_var])dnl ])dnl AC_CHECK_DECL -dnl AC_CHECK_DECL(SYMBOL... , [, INCLUDES, -dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AC_CHECK_DECLS(SYMBOL... , [, INCLUDES, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) AC_DEFUN(AC_CHECK_DECLS, [for ac_sym in $1 do diff --git a/acspecific.m4 b/acspecific.m4 index 7ac816e8..8045651a 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -76,6 +76,7 @@ dnl just gives the user an opportunity to specify an alternative search dnl list for the C compiler. AC_DEFUN(AC_PROG_CC, [AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler]) ifelse([$1], , [ AC_CHECK_PROG(CC, gcc, gcc) diff --git a/autoconf.texi b/autoconf.texi index 9e56720e..2b1655af 100644 --- a/autoconf.texi +++ b/autoconf.texi @@ -376,7 +376,7 @@ systems that lack them. Work is in progress to add those features in the future. Autoconf imposes some restrictions on the names of macros used with -@code{#ifdef} in C programs (@pxref{Preprocessor Symbol Index}). +@code{#if} in C programs (@pxref{Preprocessor Symbol Index}). Autoconf requires GNU @code{m4} in order to generate the scripts. It uses features that some UNIX versions of @code{m4} do not have. It also diff --git a/configure b/configure index 9618d0e3..94cd5037 100755 --- a/configure +++ b/configure @@ -8,7 +8,9 @@ # gives unlimited permission to copy, distribute and modify it. # Defaults: -ac_help= +ac_arg_with_help= +ac_arg_enable_help= +ac_arg_var_help= ac_default_prefix=/usr/local # Any additions from configure.in: @@ -121,19 +123,6 @@ do esac eval "enable_${ac_feature}='$ac_optarg'" ;; - -env-* | --env-*) - ac_envvar=`echo $ac_option|sed -e 's/^-*env-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_envvar: invalid variable name" 1>&2; exit 1; } - fi - case "$ac_option" in - *=*) ;; - *) { echo "configure: error: $ac_envvar: missing value" 1>&2; exit 1; } ;; - esac - eval "${ac_envvar}='$ac_optarg'" - export $ac_envvar ;; - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) @@ -163,7 +152,6 @@ Defaults for the options are specified in brackets. Configuration: --cache-file=FILE cache test results in FILE - [--env-]VAR=VALUE set environment variable VAR to VALUE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages @@ -211,9 +199,17 @@ Features and packages: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF - if test -n "$ac_help"; then + if test -n "$ac_arg_enable_help"; then echo " ---enable and --with options recognized:$ac_help" +--enable options recognized:$ac_arg_enable_help" + fi + if test -n "$ac_arg_with_help"; then + echo " +--with options recognized:$ac_arg_with_help" + fi + if test -n "$ac_arg_var_help"; then + echo " +Some of the influent environment variables:$ac_arg_var_help" fi exit 0 ;; @@ -587,7 +583,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:591: checking for $ac_word" 1>&5 +echo "configure:587: checking for $ac_word" 1>&5 if test "${ac_cv_path_M4+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -628,7 +624,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:632: checking for $ac_word" 1>&5 +echo "configure:628: checking for $ac_word" 1>&5 if test "${ac_cv_prog_AWK+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -661,7 +657,7 @@ done # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:665: checking for $ac_word" 1>&5 +echo "configure:661: checking for $ac_word" 1>&5 if test "${ac_cv_path_PERL+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -731,7 +727,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install... $ac_c" 1>&6 -echo "configure:735: checking for a BSD compatible install" 1>&5 +echo "configure:731: checking for a BSD compatible install" 1>&5 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 9e56720e..2b1655af 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -376,7 +376,7 @@ systems that lack them. Work is in progress to add those features in the future. Autoconf imposes some restrictions on the names of macros used with -@code{#ifdef} in C programs (@pxref{Preprocessor Symbol Index}). +@code{#if} in C programs (@pxref{Preprocessor Symbol Index}). Autoconf requires GNU @code{m4} in order to generate the scripts. It uses features that some UNIX versions of @code{m4} do not have. It also diff --git a/doc/install.texi b/doc/install.texi index a9432a9e..b40df89e 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -67,15 +67,26 @@ other programs in order to regenerate files that came with the distribution. @node Compilers and Options @section Compilers and Options -Some systems require unusual options for compilation or linking that -the @code{configure} script does not know about. You can give -@code{configure} initial values for variables by setting them in the -environment. Using a Bourne-compatible shell, you can do that on the -command line like this: +Some systems require unusual options for compilation or linking that the +@code{configure} script does not know about. Run @samp{./configure +--help} for details on some of the pertinent environment variables. + +You can give @code{configure} initial values for variables by setting +them in the environment. You can do that on the command line like this: @example ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix @end example +Please, note that the former interface: +@example +CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +@end example +or +@example +env CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +@end example +is deprecated and should be avoided. + @node Multiple Architectures @section Compiling For Multiple Architectures diff --git a/install.texi b/install.texi index a9432a9e..b40df89e 100644 --- a/install.texi +++ b/install.texi @@ -67,15 +67,26 @@ other programs in order to regenerate files that came with the distribution. @node Compilers and Options @section Compilers and Options -Some systems require unusual options for compilation or linking that -the @code{configure} script does not know about. You can give -@code{configure} initial values for variables by setting them in the -environment. Using a Bourne-compatible shell, you can do that on the -command line like this: +Some systems require unusual options for compilation or linking that the +@code{configure} script does not know about. Run @samp{./configure +--help} for details on some of the pertinent environment variables. + +You can give @code{configure} initial values for variables by setting +them in the environment. You can do that on the command line like this: @example ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix @end example +Please, note that the former interface: +@example +CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +@end example +or +@example +env CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +@end example +is deprecated and should be avoided. + @node Multiple Architectures @section Compiling For Multiple Architectures diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index a5aa636d..142bd2e9 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -529,12 +529,14 @@ popdef([ac_width])dnl popdef([ac_cursor])]) -dnl AC_HELP_STRING(LHS, RHS) -dnl ------------------------ +dnl AC_HELP_STRING(LHS, RHS[, COLUMN]) +dnl ---------------------------------- dnl dnl Format an Autoconf macro's help string so that it looks pretty when -dnl the user executes "configure --help". This macro takes two -dnl arguments, a "left hand side" (LHS), and a "right hand side" (RHS). +dnl the user executes "configure --help". This macro takes three +dnl arguments, a "left hand side" (LHS), a "right hand side" (RHS), and +dnl the COLUMN which is a string of wide spaces which leads to the +dnl the RHS column (default: 26 white spaces). dnl dnl The resulting string is suitable for use in other macros that require dnl a help string (e.g. AC_ARG_WITH). @@ -570,23 +572,28 @@ dnl column 0 column 26 dnl dnl This macro is a adhoc version of AC_WRAP. define([AC_HELP_STRING], -[pushdef([ac_prefix], [ ])dnl 26 spaces -pushdef([ac_width], m4_eval(79 - len(ac_prefix)))dnl -pushdef([ac_cursor], 0)dnl -m4_format([ %-23s ], [$1])dnl +[pushdef([AC_Prefix], m4_default([$3], [ ]))dnl +pushdef([AC_Prefix_Len], len(AC_Prefix))dnl Default: 26 +pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s])dnl [ %-23s] +pushdef([AC_Width], m4_eval(79 - AC_Prefix_Len))dnl Width of the RHS column. +pushdef([AC_Cursor], 0)dnl +m4_format(AC_Prefix_Format, [$1])dnl dnl If the option is too wide, leave it alone on the line -ifelse(m4_eval(len(m4_format([ %-23s ], [$1])) > 26), +ifelse(m4_eval(len(m4_format(AC_Prefix_Format, [$1])) > AC_Prefix_Len), 1, [ -]ac_prefix)dnl -AC_FOREACH([ac_word], $2, -[define([ac_cursor], m4_eval(ac_cursor + len(ac_word) + 1))dnl -ifelse(m4_eval(ac_cursor > ac_width), - 1, [define([ac_cursor], m4_eval(len(ac_word) + 1))] -ac_prefix)dnl -ac_word ])dnl -popdef([ac_prefix])dnl -popdef([ac_width])dnl -popdef([ac_cursor])]) +]AC_Prefix)dnl +AC_FOREACH([AC_Word], $2, +[define([AC_Cursor], m4_eval(AC_Cursor + len(AC_Word) + 1))dnl +ifelse(m4_eval(AC_Cursor > AC_Width), + 1, [define([AC_Cursor], m4_eval(len(AC_Word) + 1))] +AC_Prefix)dnl +AC_Word ])dnl +popdef([AC_Cursor])dnl +popdef([AC_Width])dnl +popdef([AC_Prefix_Format])dnl +popdef([AC_Prefix_Len])dnl +popdef([AC_Prefix])dnl +]) @@ -603,7 +610,9 @@ AC_DEFUN(AC_INIT_NOTICE, # gives unlimited permission to copy, distribute and modify it. # Defaults: -ac_help= +ac_arg_with_help= +ac_arg_enable_help= +ac_arg_var_help= ac_default_prefix=/usr/local [#] Any additions from configure.in:]) @@ -738,21 +747,6 @@ changequote([, ])dnl esac eval "enable_${ac_feature}='$ac_optarg'" ;; - -env-* | --env-*) - ac_envvar=`echo $ac_option|sed -e 's/^-*env-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. -changequote(, )dnl - if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then -changequote([, ])dnl - AC_MSG_ERROR($ac_envvar: invalid variable name) - fi - case "$ac_option" in - *=*) ;; - *) AC_MSG_ERROR($ac_envvar: missing value) ;; - esac - eval "${ac_envvar}='$ac_optarg'" - export $ac_envvar ;; - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) @@ -783,7 +777,6 @@ Defaults for the options are specified in brackets. Configuration: --cache-file=FILE cache test results in FILE - [--env-]VAR=VALUE set environment variable VAR to VALUE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages @@ -832,9 +825,19 @@ Features and packages: --x-libraries=DIR X library files are in DIR EOF changequote([, ])dnl - if test -n "$ac_help"; then +dnl It would be great to sort, unfortunately, since each entry maybe +dnl split on several lines, it is not as evident as a simple `| sort'. + if test -n "$ac_arg_enable_help"; then echo " ---enable and --with options recognized:$ac_help" +--enable options recognized:$ac_arg_enable_help" + fi + if test -n "$ac_arg_with_help"; then + echo " +--with options recognized:$ac_arg_with_help" + fi + if test -n "$ac_arg_var_help"; then + echo " +Some of the influent environment variables:$ac_arg_var_help" fi exit 0 ;; @@ -1243,7 +1246,7 @@ dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) dnl ----------------------------------------------------------------------- AC_DEFUN(AC_ARG_ENABLE, [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl -ac_help="$ac_help +ac_arg_enable_help="$ac_arg_enable_help [$2]" AC_DIVERT_POP()dnl [#] Check whether --enable-[$1] or --disable-[$1] was given. @@ -1268,7 +1271,7 @@ dnl ### Working with optional software dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) AC_DEFUN(AC_ARG_WITH, [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl -ac_help="$ac_help +ac_arg_with_help="$ac_arg_with_help [$2]" AC_DIVERT_POP()dnl [#] Check whether --with-[$1] or --without-[$1] was given. @@ -1288,6 +1291,27 @@ AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl +dnl ### Remembering env vars for reconfiguring + +dnl AC_ARG_VAR(VARNAME, DOCUMENTATION) +dnl ---------------------------------- +dnl Register VARNAME as a variable configure should remember, and +dnl document it in --help. +AC_DEFUN(AC_ARG_VAR, +[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl +ac_arg_var_help="$ac_arg_var_help +AC_HELP_STRING([$1], [$2], [ ])" +AC_DIVERT_POP()dnl +dnl Prepend instead of appending, so that envvars set on the cmd line +dnl win over the environment. Don't register envvars not set. +dnl Don't register several times. +case "${$1+set} $ac_configure_args" in + *" $1="* );; + "set "*) ac_configure_args="$1='[$]$1' $ac_configure_args";; +esac]) + + + dnl ### Transforming program names. @@ -2474,8 +2498,8 @@ AC_SHELL_IFELSE(test AC_VAR_GET(ac_var) = yes, AC_VAR_POPDEF([ac_var])dnl ])dnl AC_CHECK_DECL -dnl AC_CHECK_DECL(SYMBOL... , [, INCLUDES, -dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl AC_CHECK_DECLS(SYMBOL... , [, INCLUDES, +dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) AC_DEFUN(AC_CHECK_DECLS, [for ac_sym in $1 do diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 7ac816e8..8045651a 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -76,6 +76,7 @@ dnl just gives the user an opportunity to specify an alternative search dnl list for the C compiler. AC_DEFUN(AC_PROG_CC, [AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler]) ifelse([$1], , [ AC_CHECK_PROG(CC, gcc, gcc)