From: Akim Demaille Date: Mon, 10 Jul 2000 10:37:19 +0000 (+0000) Subject: Improve --help documentation of important environment variables. X-Git-Tag: autoconf-2.50~738 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb30dd84845ff6b4cda1430b756f3583c7702145;p=thirdparty%2Fautoconf.git Improve --help documentation of important environment variables. * acgeneral.m4 (_AC_INIT_HELP): Direct reader to descriptions of useful variables at the end of the --help. (AC_ARG_VAR): Emphasize use of environment variables to override and/or help the configure script. Ensure that a given variable is only documented once in the --help. (AC_CHECK_LIB): Call AC_ARG_VAR to document and register the LDFLAGS variable, and... (AC_CHECK_HEADER): do the same for the CPPFLAGS variable. * aclang.m4 (AC_PROG_CC): Call AC_ARG_VAR to document and register the CC and CFLAGS variables, and do the same for... (AC_PROG_CXX): CXX and CXXFLAGS, and... (AC_PROG_F77): F77 and FFLAGS. --- diff --git a/ChangeLog b/ChangeLog index 95c5698f3..d384cfdc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2000-07-10 Steven G. Johnson + + Improve --help documentation of important environment variables. + + * acgeneral.m4 (_AC_INIT_HELP): Direct reader to descriptions + of useful variables at the end of the --help. + (AC_ARG_VAR): Emphasize use of environment variables to override + and/or help the configure script. Ensure that a given variable + is only documented once in the --help. + (AC_CHECK_LIB): Call AC_ARG_VAR to document and register the + LDFLAGS variable, and... + (AC_CHECK_HEADER): do the same for the CPPFLAGS variable. + * aclang.m4 (AC_PROG_CC): Call AC_ARG_VAR to document and register + the CC and CFLAGS variables, and do the same for... + (AC_PROG_CXX): CXX and CXXFLAGS, and... + (AC_PROG_F77): F77 and FFLAGS. + 2000-07-10 Akim Demaille * Makefile.am (wget-update): New target. diff --git a/acgeneral.m4 b/acgeneral.m4 index ef1def442..b0b928d5c 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -1642,7 +1642,7 @@ if test "$ac_init_help" = "long"; then Usage: $[0] [[OPTION]]... [[VAR=VALUE]]... [To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. +VAR=VALUE. See below for descriptions of useful variables. Defaults for the options are specified in brackets. @@ -2040,13 +2040,16 @@ AU_DEFUN([AC_WITH], # AC_ARG_VAR(VARNAME, DOCUMENTATION) # ---------------------------------- # Register VARNAME as a variable configure should remember, and -# document it in `configure --help'. +# document it in `configure --help' (but only once). AC_DEFUN([AC_ARG_VAR], [AC_DIVERT_PUSH([HELP_VAR])dnl AC_EXPAND_ONCE([ -Some influent environment variables: +Some relevant environment variables, which you can use to override the +choices made by the configure script or to help it to find libraries and +programs with nonstandard names/locations: ])[]dnl -AC_HELP_STRING([$1], [$2], [ ]) +ifdef([AC_ARG_VAR_$1],,[AC_HELP_STRING([$1], [$2], [ ]) +define([AC_ARG_VAR_$1])])dnl AC_DIVERT_POP()dnl dnl Register if set and not yet registered. dnl If there are envvars given as arguments, they are already set, @@ -3098,6 +3101,7 @@ AC_SHELL_IFELSE([test "$ac_cv_search_$1" != no], AC_DEFUN([AC_CHECK_LIB], [AH_CHECK_LIB([$1])dnl AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl +AC_ARG_VAR([LDFLAGS], [linker flags, e.g. -L if you have libraries in a nonstandard directory ]) AC_CACHE_CHECK([for $2 in -l$1], ac_Lib, [ac_check_lib_save_LIBS=$LIBS LIBS="-l$1 $5 $LIBS" @@ -3346,6 +3350,7 @@ fi # ---------------------------------------------------------------------- AC_DEFUN([AC_CHECK_HEADER], [AC_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl +AC_ARG_VAR([CPPFLAGS], [C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory ]) AC_CACHE_CHECK([for $1], ac_Header, [AC_TRY_CPP([#include <$1> ], diff --git a/aclang.m4 b/aclang.m4 index 46183f289..ac0d8c21d 100644 --- a/aclang.m4 +++ b/aclang.m4 @@ -544,7 +544,8 @@ AC_SUBST(CPP)dnl AC_DEFUN([AC_PROG_CC], [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_LANG_PUSH(C) -AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler]) +AC_ARG_VAR([CC], [C compiler command]) +AC_ARG_VAR([CFLAGS], [C compiler flags]) ifval([$1], [AC_CHECK_TOOLS(CC, [$1])], [ @@ -743,6 +744,8 @@ AC_SUBST(CXXCPP)dnl AC_DEFUN([AC_PROG_CXX], [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl AC_LANG_PUSH(C++) +AC_ARG_VAR([CXX], [C++ compiler command]) +AC_ARG_VAR([CXXFLAGS], [C++ compiler flags]) AC_CHECK_TOOLS(CXX, [$CCC m4_default([$1], [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])], @@ -842,6 +845,8 @@ fi[]dnl AC_DEFUN([AC_PROG_F77], [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_LANG_PUSH(Fortran 77) +AC_ARG_VAR([F77], [Fortran 77 compiler command]) +AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags]) AC_CHECK_TOOLS(F77, [m4_default([$1], [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])]) diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 46183f289..ac0d8c21d 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -544,7 +544,8 @@ AC_SUBST(CPP)dnl AC_DEFUN([AC_PROG_CC], [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_LANG_PUSH(C) -AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler]) +AC_ARG_VAR([CC], [C compiler command]) +AC_ARG_VAR([CFLAGS], [C compiler flags]) ifval([$1], [AC_CHECK_TOOLS(CC, [$1])], [ @@ -743,6 +744,8 @@ AC_SUBST(CXXCPP)dnl AC_DEFUN([AC_PROG_CXX], [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl AC_LANG_PUSH(C++) +AC_ARG_VAR([CXX], [C++ compiler command]) +AC_ARG_VAR([CXXFLAGS], [C++ compiler flags]) AC_CHECK_TOOLS(CXX, [$CCC m4_default([$1], [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])], @@ -842,6 +845,8 @@ fi[]dnl AC_DEFUN([AC_PROG_F77], [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_LANG_PUSH(Fortran 77) +AC_ARG_VAR([F77], [Fortran 77 compiler command]) +AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags]) AC_CHECK_TOOLS(F77, [m4_default([$1], [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])]) diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 46183f289..ac0d8c21d 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -544,7 +544,8 @@ AC_SUBST(CPP)dnl AC_DEFUN([AC_PROG_CC], [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_LANG_PUSH(C) -AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler]) +AC_ARG_VAR([CC], [C compiler command]) +AC_ARG_VAR([CFLAGS], [C compiler flags]) ifval([$1], [AC_CHECK_TOOLS(CC, [$1])], [ @@ -743,6 +744,8 @@ AC_SUBST(CXXCPP)dnl AC_DEFUN([AC_PROG_CXX], [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl AC_LANG_PUSH(C++) +AC_ARG_VAR([CXX], [C++ compiler command]) +AC_ARG_VAR([CXXFLAGS], [C++ compiler flags]) AC_CHECK_TOOLS(CXX, [$CCC m4_default([$1], [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])], @@ -842,6 +845,8 @@ fi[]dnl AC_DEFUN([AC_PROG_F77], [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_LANG_PUSH(Fortran 77) +AC_ARG_VAR([F77], [Fortran 77 compiler command]) +AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags]) AC_CHECK_TOOLS(F77, [m4_default([$1], [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])]) diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index ef1def442..b0b928d5c 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1642,7 +1642,7 @@ if test "$ac_init_help" = "long"; then Usage: $[0] [[OPTION]]... [[VAR=VALUE]]... [To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. +VAR=VALUE. See below for descriptions of useful variables. Defaults for the options are specified in brackets. @@ -2040,13 +2040,16 @@ AU_DEFUN([AC_WITH], # AC_ARG_VAR(VARNAME, DOCUMENTATION) # ---------------------------------- # Register VARNAME as a variable configure should remember, and -# document it in `configure --help'. +# document it in `configure --help' (but only once). AC_DEFUN([AC_ARG_VAR], [AC_DIVERT_PUSH([HELP_VAR])dnl AC_EXPAND_ONCE([ -Some influent environment variables: +Some relevant environment variables, which you can use to override the +choices made by the configure script or to help it to find libraries and +programs with nonstandard names/locations: ])[]dnl -AC_HELP_STRING([$1], [$2], [ ]) +ifdef([AC_ARG_VAR_$1],,[AC_HELP_STRING([$1], [$2], [ ]) +define([AC_ARG_VAR_$1])])dnl AC_DIVERT_POP()dnl dnl Register if set and not yet registered. dnl If there are envvars given as arguments, they are already set, @@ -3098,6 +3101,7 @@ AC_SHELL_IFELSE([test "$ac_cv_search_$1" != no], AC_DEFUN([AC_CHECK_LIB], [AH_CHECK_LIB([$1])dnl AC_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl +AC_ARG_VAR([LDFLAGS], [linker flags, e.g. -L if you have libraries in a nonstandard directory ]) AC_CACHE_CHECK([for $2 in -l$1], ac_Lib, [ac_check_lib_save_LIBS=$LIBS LIBS="-l$1 $5 $LIBS" @@ -3346,6 +3350,7 @@ fi # ---------------------------------------------------------------------- AC_DEFUN([AC_CHECK_HEADER], [AC_VAR_PUSHDEF([ac_Header], [ac_cv_header_$1])dnl +AC_ARG_VAR([CPPFLAGS], [C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory ]) AC_CACHE_CHECK([for $1], ac_Header, [AC_TRY_CPP([#include <$1> ], diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index 46183f289..ac0d8c21d 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -544,7 +544,8 @@ AC_SUBST(CPP)dnl AC_DEFUN([AC_PROG_CC], [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_LANG_PUSH(C) -AC_ARG_VAR([CFLAGS], [Extra flags for the C compiler]) +AC_ARG_VAR([CC], [C compiler command]) +AC_ARG_VAR([CFLAGS], [C compiler flags]) ifval([$1], [AC_CHECK_TOOLS(CC, [$1])], [ @@ -743,6 +744,8 @@ AC_SUBST(CXXCPP)dnl AC_DEFUN([AC_PROG_CXX], [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl AC_LANG_PUSH(C++) +AC_ARG_VAR([CXX], [C++ compiler command]) +AC_ARG_VAR([CXXFLAGS], [C++ compiler flags]) AC_CHECK_TOOLS(CXX, [$CCC m4_default([$1], [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])], @@ -842,6 +845,8 @@ fi[]dnl AC_DEFUN([AC_PROG_F77], [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_LANG_PUSH(Fortran 77) +AC_ARG_VAR([F77], [Fortran 77 compiler command]) +AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags]) AC_CHECK_TOOLS(F77, [m4_default([$1], [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 fc])])