]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Don't AC_SUBST too much, as it makes Automake include those
authorAkim Demaille <akim@epita.fr>
Wed, 24 Jan 2001 07:50:55 +0000 (07:50 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 24 Jan 2001 07:50:55 +0000 (07:50 +0000)
variables in Makefiles, and drives autoscan to require unneeded
programs.
* acgeneral.m4 (_AC_INIT_PREPARE): Don't AC_SUBST CFLAGS,
CPPFLAGS, CXXFLAGS and LDFLAGS.
(AC_ARG_VAR): AC_SUBST the var.
Document it only once, even if there are several different docs.
* aclang.m4 (AC_PROG_CPP): Declare CPP and CPPFLAGS to AC_ARG_VAR.
(AC_PROG_CXXCPP): Declare CXXCPP and CPPFLAGS.

ChangeLog
acgeneral.m4
acheaders.m4
aclang.m4
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/general.m4
lib/autoconf/headers.m4
lib/autoconf/lang.m4

index 43faf280ee2165f73102a377d3e3a98aa7a66dd8..e4a32c5b198281272911938c5f319f33c354d802 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-01-24  Akim Demaille  <akim@epita.fr>
+
+       Don't AC_SUBST too much, as it makes Automake include those
+       variables in Makefiles, and drives autoscan to require unneeded
+       programs.
+
+       * acgeneral.m4 (_AC_INIT_PREPARE): Don't AC_SUBST CFLAGS,
+       CPPFLAGS, CXXFLAGS and LDFLAGS.
+       (AC_ARG_VAR): AC_SUBST the var.
+       Document it only once, even if there are several different docs.
+       * aclang.m4 (AC_PROG_CPP): Declare CPP and CPPFLAGS to AC_ARG_VAR.
+       (AC_PROG_CXXCPP): Declare CXXCPP and CPPFLAGS.
+
 2001-01-24  Akim Demaille  <akim@epita.fr>
 
        * m4sugar.m4 (m4_expand_once): Accept a witness.
index 5bba8a2fc55fe6f6dfd60696bd3da911c8843b5d..59356200ecc1c4f38b9a13d222980a0d0c7e9369 100644 (file)
@@ -1479,12 +1479,7 @@ AC_LANG_PUSH(C)
 
 _AC_PROG_ECHO()dnl
 dnl Substitute for predefined variables.
-AC_SUBST(CFLAGS)dnl
-AC_SUBST(CPPFLAGS)dnl
-AC_SUBST(CXXFLAGS)dnl
-AC_SUBST(FFLAGS)dnl
 AC_SUBST(DEFS)dnl
-AC_SUBST(LDFLAGS)dnl
 AC_SUBST(LIBS)dnl
 m4_divert_pop([INIT_PREPARE])dnl
 ])# _AC_INIT_PREPARE
@@ -1673,11 +1668,14 @@ fi
 AC_DEFUN([AC_ARG_VAR],
 [m4_divert_once([HELP_VAR], [[
 Some influential environment variables:]])dnl
-m4_divert_once([HELP_VAR_END], [
+m4_divert_once([HELP_VAR_END], [[
 Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.])dnl
-m4_divert_once([HELP_VAR], [AC_HELP_STRING([$1], [$2], [              ])])dnl
+it to find libraries and programs with nonstandard names/locations.]])dnl
+m4_expand_once([m4_divert_once([HELP_VAR],
+                               [AC_HELP_STRING([$1], [$2], [              ])])],
+               [$0($1)])dnl
 _AC_ARG_VAR_PRECIOUS([$1])dnl
+AC_SUBST([$1])dnl
 ])# AC_ARG_VAR
 
 
@@ -2618,7 +2616,9 @@ AS_IF([test "$ac_cv_search_$1" != no],
 AC_DEFUN([AC_CHECK_LIB],
 [m4_ifval([$3], , [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<lib dir> if you have libraries in a nonstandard directory <lib dir>])
+AC_ARG_VAR([LDFLAGS],
+           [linker flags, e.g. -L<lib dir> if you have libraries in a
+            nonstandard directory <lib dir>])
 AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
 [ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$1 $5 $LIBS"
index f41650a7edc59b5e475e612f17ee0918ba5cc9b1..a2f0eaa9b594052a966f8ef1b6bfdd2c7b246052 100644 (file)
@@ -64,8 +64,6 @@
 # ----------------------------------------------------------------------
 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<include dir> if you have headers in a nonstandard directory <include dir>])
 AC_CACHE_CHECK([for $1], ac_Header,
                [AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include <$1>])],
                                   [AC_VAR_SET(ac_Header, yes)],
index 1fa961f72e5a6583af513f253d8a8f821bd3c590..5226734bbd56c0a3ddb4f042dcac8d5aabe3a546 100644 (file)
--- a/aclang.m4
+++ b/aclang.m4
@@ -813,6 +813,10 @@ fi])])# _AC_PROG_PREPROC_WORKS
 # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
 AC_DEFUN([AC_PROG_CPP],
 [AC_REQUIRE([AC_PROG_CC])dnl
+AC_ARG_VAR([CPP],      [C preprocessor])
+AC_ARG_VAR([CPPFLAGS],
+           [C/C++ preprocessor flags, e.g. -I<include dir> if you have
+            headers in a nonstandard directory <include dir>])
 AC_LANG_PUSH(C)dnl
 AC_MSG_CHECKING([how to run the C preprocessor])
 # On Suns, sometimes $CPP names a directory.
@@ -867,7 +871,7 @@ AU_DEFUN([ac_cv_prog_gcc],
 # search list for the C compiler.
 AC_DEFUN([AC_PROG_CC],
 [AC_LANG_PUSH(C)dnl
-AC_ARG_VAR([CC], [C compiler command])
+AC_ARG_VAR([CC],     [C compiler command])
 AC_ARG_VAR([CFLAGS], [C compiler flags])
 m4_ifval([$1],
       [AC_CHECK_TOOLS(CC, [$1])],
@@ -1026,6 +1030,10 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
 AC_DEFUN([AC_PROG_CXXCPP],
 [AC_REQUIRE([AC_PROG_CXX])dnl
+AC_ARG_VAR([CXXCPP],   [C++ preprocessor])
+AC_ARG_VAR([CPPFLAGS],
+           [C/C++ preprocessor flags, e.g. -I<include dir> if you have
+            headers in a nonstandard directory <include dir>])
 AC_LANG_PUSH(C++)dnl
 AC_MSG_CHECKING([how to run the C++ preprocessor])
 if test -z "$CXXCPP"; then
@@ -1082,7 +1090,7 @@ AU_DEFUN([ac_cv_prog_gxx],
 # xlC  AIX C Set++
 AC_DEFUN([AC_PROG_CXX],
 [AC_LANG_PUSH(C++)dnl
-AC_ARG_VAR([CXX], [C++ compiler command])
+AC_ARG_VAR([CXX],      [C++ compiler command])
 AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])
 AC_CHECK_TOOLS(CXX,
                [$CCC m4_default([$1],
@@ -1205,7 +1213,7 @@ AU_DEFUN([ac_cv_prog_g77],
 # lf95 is the Lahey-Fujitsu compiler.
 AC_DEFUN([AC_PROG_F77],
 [AC_LANG_PUSH(Fortran 77)dnl
-AC_ARG_VAR([F77], [Fortran 77 compiler command])
+AC_ARG_VAR([F77],    [Fortran 77 compiler command])
 AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags])
 AC_CHECK_TOOLS(F77,
       [m4_default([$1],
index 1fa961f72e5a6583af513f253d8a8f821bd3c590..5226734bbd56c0a3ddb4f042dcac8d5aabe3a546 100644 (file)
@@ -813,6 +813,10 @@ fi])])# _AC_PROG_PREPROC_WORKS
 # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
 AC_DEFUN([AC_PROG_CPP],
 [AC_REQUIRE([AC_PROG_CC])dnl
+AC_ARG_VAR([CPP],      [C preprocessor])
+AC_ARG_VAR([CPPFLAGS],
+           [C/C++ preprocessor flags, e.g. -I<include dir> if you have
+            headers in a nonstandard directory <include dir>])
 AC_LANG_PUSH(C)dnl
 AC_MSG_CHECKING([how to run the C preprocessor])
 # On Suns, sometimes $CPP names a directory.
@@ -867,7 +871,7 @@ AU_DEFUN([ac_cv_prog_gcc],
 # search list for the C compiler.
 AC_DEFUN([AC_PROG_CC],
 [AC_LANG_PUSH(C)dnl
-AC_ARG_VAR([CC], [C compiler command])
+AC_ARG_VAR([CC],     [C compiler command])
 AC_ARG_VAR([CFLAGS], [C compiler flags])
 m4_ifval([$1],
       [AC_CHECK_TOOLS(CC, [$1])],
@@ -1026,6 +1030,10 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
 AC_DEFUN([AC_PROG_CXXCPP],
 [AC_REQUIRE([AC_PROG_CXX])dnl
+AC_ARG_VAR([CXXCPP],   [C++ preprocessor])
+AC_ARG_VAR([CPPFLAGS],
+           [C/C++ preprocessor flags, e.g. -I<include dir> if you have
+            headers in a nonstandard directory <include dir>])
 AC_LANG_PUSH(C++)dnl
 AC_MSG_CHECKING([how to run the C++ preprocessor])
 if test -z "$CXXCPP"; then
@@ -1082,7 +1090,7 @@ AU_DEFUN([ac_cv_prog_gxx],
 # xlC  AIX C Set++
 AC_DEFUN([AC_PROG_CXX],
 [AC_LANG_PUSH(C++)dnl
-AC_ARG_VAR([CXX], [C++ compiler command])
+AC_ARG_VAR([CXX],      [C++ compiler command])
 AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])
 AC_CHECK_TOOLS(CXX,
                [$CCC m4_default([$1],
@@ -1205,7 +1213,7 @@ AU_DEFUN([ac_cv_prog_g77],
 # lf95 is the Lahey-Fujitsu compiler.
 AC_DEFUN([AC_PROG_F77],
 [AC_LANG_PUSH(Fortran 77)dnl
-AC_ARG_VAR([F77], [Fortran 77 compiler command])
+AC_ARG_VAR([F77],    [Fortran 77 compiler command])
 AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags])
 AC_CHECK_TOOLS(F77,
       [m4_default([$1],
index 1fa961f72e5a6583af513f253d8a8f821bd3c590..5226734bbd56c0a3ddb4f042dcac8d5aabe3a546 100644 (file)
@@ -813,6 +813,10 @@ fi])])# _AC_PROG_PREPROC_WORKS
 # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
 AC_DEFUN([AC_PROG_CPP],
 [AC_REQUIRE([AC_PROG_CC])dnl
+AC_ARG_VAR([CPP],      [C preprocessor])
+AC_ARG_VAR([CPPFLAGS],
+           [C/C++ preprocessor flags, e.g. -I<include dir> if you have
+            headers in a nonstandard directory <include dir>])
 AC_LANG_PUSH(C)dnl
 AC_MSG_CHECKING([how to run the C preprocessor])
 # On Suns, sometimes $CPP names a directory.
@@ -867,7 +871,7 @@ AU_DEFUN([ac_cv_prog_gcc],
 # search list for the C compiler.
 AC_DEFUN([AC_PROG_CC],
 [AC_LANG_PUSH(C)dnl
-AC_ARG_VAR([CC], [C compiler command])
+AC_ARG_VAR([CC],     [C compiler command])
 AC_ARG_VAR([CFLAGS], [C compiler flags])
 m4_ifval([$1],
       [AC_CHECK_TOOLS(CC, [$1])],
@@ -1026,6 +1030,10 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
 AC_DEFUN([AC_PROG_CXXCPP],
 [AC_REQUIRE([AC_PROG_CXX])dnl
+AC_ARG_VAR([CXXCPP],   [C++ preprocessor])
+AC_ARG_VAR([CPPFLAGS],
+           [C/C++ preprocessor flags, e.g. -I<include dir> if you have
+            headers in a nonstandard directory <include dir>])
 AC_LANG_PUSH(C++)dnl
 AC_MSG_CHECKING([how to run the C++ preprocessor])
 if test -z "$CXXCPP"; then
@@ -1082,7 +1090,7 @@ AU_DEFUN([ac_cv_prog_gxx],
 # xlC  AIX C Set++
 AC_DEFUN([AC_PROG_CXX],
 [AC_LANG_PUSH(C++)dnl
-AC_ARG_VAR([CXX], [C++ compiler command])
+AC_ARG_VAR([CXX],      [C++ compiler command])
 AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])
 AC_CHECK_TOOLS(CXX,
                [$CCC m4_default([$1],
@@ -1205,7 +1213,7 @@ AU_DEFUN([ac_cv_prog_g77],
 # lf95 is the Lahey-Fujitsu compiler.
 AC_DEFUN([AC_PROG_F77],
 [AC_LANG_PUSH(Fortran 77)dnl
-AC_ARG_VAR([F77], [Fortran 77 compiler command])
+AC_ARG_VAR([F77],    [Fortran 77 compiler command])
 AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags])
 AC_CHECK_TOOLS(F77,
       [m4_default([$1],
index 5bba8a2fc55fe6f6dfd60696bd3da911c8843b5d..59356200ecc1c4f38b9a13d222980a0d0c7e9369 100644 (file)
@@ -1479,12 +1479,7 @@ AC_LANG_PUSH(C)
 
 _AC_PROG_ECHO()dnl
 dnl Substitute for predefined variables.
-AC_SUBST(CFLAGS)dnl
-AC_SUBST(CPPFLAGS)dnl
-AC_SUBST(CXXFLAGS)dnl
-AC_SUBST(FFLAGS)dnl
 AC_SUBST(DEFS)dnl
-AC_SUBST(LDFLAGS)dnl
 AC_SUBST(LIBS)dnl
 m4_divert_pop([INIT_PREPARE])dnl
 ])# _AC_INIT_PREPARE
@@ -1673,11 +1668,14 @@ fi
 AC_DEFUN([AC_ARG_VAR],
 [m4_divert_once([HELP_VAR], [[
 Some influential environment variables:]])dnl
-m4_divert_once([HELP_VAR_END], [
+m4_divert_once([HELP_VAR_END], [[
 Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.])dnl
-m4_divert_once([HELP_VAR], [AC_HELP_STRING([$1], [$2], [              ])])dnl
+it to find libraries and programs with nonstandard names/locations.]])dnl
+m4_expand_once([m4_divert_once([HELP_VAR],
+                               [AC_HELP_STRING([$1], [$2], [              ])])],
+               [$0($1)])dnl
 _AC_ARG_VAR_PRECIOUS([$1])dnl
+AC_SUBST([$1])dnl
 ])# AC_ARG_VAR
 
 
@@ -2618,7 +2616,9 @@ AS_IF([test "$ac_cv_search_$1" != no],
 AC_DEFUN([AC_CHECK_LIB],
 [m4_ifval([$3], , [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<lib dir> if you have libraries in a nonstandard directory <lib dir>])
+AC_ARG_VAR([LDFLAGS],
+           [linker flags, e.g. -L<lib dir> if you have libraries in a
+            nonstandard directory <lib dir>])
 AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
 [ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$1 $5 $LIBS"
index f41650a7edc59b5e475e612f17ee0918ba5cc9b1..a2f0eaa9b594052a966f8ef1b6bfdd2c7b246052 100644 (file)
@@ -64,8 +64,6 @@
 # ----------------------------------------------------------------------
 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<include dir> if you have headers in a nonstandard directory <include dir>])
 AC_CACHE_CHECK([for $1], ac_Header,
                [AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include <$1>])],
                                   [AC_VAR_SET(ac_Header, yes)],
index 1fa961f72e5a6583af513f253d8a8f821bd3c590..5226734bbd56c0a3ddb4f042dcac8d5aabe3a546 100644 (file)
@@ -813,6 +813,10 @@ fi])])# _AC_PROG_PREPROC_WORKS
 # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC.
 AC_DEFUN([AC_PROG_CPP],
 [AC_REQUIRE([AC_PROG_CC])dnl
+AC_ARG_VAR([CPP],      [C preprocessor])
+AC_ARG_VAR([CPPFLAGS],
+           [C/C++ preprocessor flags, e.g. -I<include dir> if you have
+            headers in a nonstandard directory <include dir>])
 AC_LANG_PUSH(C)dnl
 AC_MSG_CHECKING([how to run the C preprocessor])
 # On Suns, sometimes $CPP names a directory.
@@ -867,7 +871,7 @@ AU_DEFUN([ac_cv_prog_gcc],
 # search list for the C compiler.
 AC_DEFUN([AC_PROG_CC],
 [AC_LANG_PUSH(C)dnl
-AC_ARG_VAR([CC], [C compiler command])
+AC_ARG_VAR([CC],     [C compiler command])
 AC_ARG_VAR([CFLAGS], [C compiler flags])
 m4_ifval([$1],
       [AC_CHECK_TOOLS(CC, [$1])],
@@ -1026,6 +1030,10 @@ AC_DEFUN([AC_LANG_PREPROC(C++)],
 # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX.
 AC_DEFUN([AC_PROG_CXXCPP],
 [AC_REQUIRE([AC_PROG_CXX])dnl
+AC_ARG_VAR([CXXCPP],   [C++ preprocessor])
+AC_ARG_VAR([CPPFLAGS],
+           [C/C++ preprocessor flags, e.g. -I<include dir> if you have
+            headers in a nonstandard directory <include dir>])
 AC_LANG_PUSH(C++)dnl
 AC_MSG_CHECKING([how to run the C++ preprocessor])
 if test -z "$CXXCPP"; then
@@ -1082,7 +1090,7 @@ AU_DEFUN([ac_cv_prog_gxx],
 # xlC  AIX C Set++
 AC_DEFUN([AC_PROG_CXX],
 [AC_LANG_PUSH(C++)dnl
-AC_ARG_VAR([CXX], [C++ compiler command])
+AC_ARG_VAR([CXX],      [C++ compiler command])
 AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])
 AC_CHECK_TOOLS(CXX,
                [$CCC m4_default([$1],
@@ -1205,7 +1213,7 @@ AU_DEFUN([ac_cv_prog_g77],
 # lf95 is the Lahey-Fujitsu compiler.
 AC_DEFUN([AC_PROG_F77],
 [AC_LANG_PUSH(Fortran 77)dnl
-AC_ARG_VAR([F77], [Fortran 77 compiler command])
+AC_ARG_VAR([F77],    [Fortran 77 compiler command])
 AC_ARG_VAR([FFLAGS], [Fortran 77 compiler flags])
 AC_CHECK_TOOLS(F77,
       [m4_default([$1],