From: Akim Demaille Date: Tue, 23 Jan 2001 17:04:35 +0000 (+0000) Subject: * acgeneral.m4 (AC_EXPAND_ONCE): Remove, use m4_expand_once. X-Git-Tag: autoconf-2.50~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bddc73937184075e4529545d2f2ca01e6d5abe73;p=thirdparty%2Fautoconf.git * acgeneral.m4 (AC_EXPAND_ONCE): Remove, use m4_expand_once. (AC_DIVERT_ONCE): Move to... * m4sugar.m4 (m4_expand_once): here. --- diff --git a/ChangeLog b/ChangeLog index 748ccf4e1..f13ed7110 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-01-23 Akim Demaille + + * acgeneral.m4 (AC_EXPAND_ONCE): Remove, use m4_expand_once. + (AC_DIVERT_ONCE): Move to... + * m4sugar.m4 (m4_expand_once): here. + 2001-01-23 Akim Demaille * aclang.m4 (_AC_LANG_SET): Turn off optimizations. diff --git a/acgeneral.m4 b/acgeneral.m4 index 4019089c2..5bba8a2fc 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -134,14 +134,6 @@ m4_define([_m4_divert(PREPARE)], 100) -# AC_DIVERT_ONCE(DIVERSION-NAME, CONTENT) -# --------------------------------------- -# Output once CONTENT into DIVERSION-NAME (which may be a number -# actually). An end of line is appended for free to CONTENT. -m4_define([AC_DIVERT_ONCE], -[AC_EXPAND_ONCE([m4_divert_text([$1], [$2])])]) - - # AC_DIVERT_PUSH(DIVERSION-NAME) # AC_DIVERT_POP # ------------------------------ @@ -201,15 +193,6 @@ m4_define([AC_BEFORE], m4_copy([m4_require], [AC_REQUIRE]) -# AC_EXPAND_ONCE(TEXT) -# -------------------- -# If TEXT has never been expanded, expand it *here*. -m4_define([AC_EXPAND_ONCE], -[m4_expand_once([$1], - [], - [AC_PROVIDE([$1])[]$1])]) - - # AC_PROVIDE(MACRO-NAME) # ---------------------- # Ideally we should just use `m4_provide($1)', but unfortunately many @@ -1572,11 +1555,11 @@ m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # ------------------------------------------------------------------------ AC_DEFUN([AC_ARG_ENABLE], -[AC_DIVERT_ONCE([HELP_ENABLE], [[ +[m4_divert_once([HELP_ENABLE], [[ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnl -AC_DIVERT_ONCE([HELP_ENABLE], [$2])dnl +m4_divert_once([HELP_ENABLE], [$2])dnl # Check whether --enable-$1 or --disable-$1 was given. if test "[${enable_]m4_patsubst([$1], -, _)+set}" = set; then enableval="[$enable_]m4_patsubst([$1], -, _)" @@ -1600,11 +1583,11 @@ AU_DEFUN([AC_ENABLE], # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE]) # -------------------------------------------------------------------- AC_DEFUN([AC_ARG_WITH], -[AC_DIVERT_ONCE([HELP_WITH], [[ +[m4_divert_once([HELP_WITH], [[ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]]) -AC_DIVERT_ONCE([HELP_WITH], [$2])dnl +m4_divert_once([HELP_WITH], [$2])dnl # Check whether --with-$1 or --without-$1 was given. if test "[${with_]m4_patsubst([$1], -, _)+set}" = set; then withval="[$with_]m4_patsubst([$1], -, _)" @@ -1639,7 +1622,7 @@ AU_DEFUN([AC_WITH], # In subsequent runs, after having loaded the cache, compare # ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE. m4_define([_AC_ARG_VAR_PRECIOUS], -[AC_DIVERT_ONCE([PARSE_ARGS], +[m4_divert_once([PARSE_ARGS], [ac_env_$1_set=${$1+set} ac_env_$1_value=$$1 ac_cv_env_$1_set=${$1+set} @@ -1688,12 +1671,12 @@ fi # Register VARNAME as a precious variable, and document it in # `configure --help' (but only once). AC_DEFUN([AC_ARG_VAR], -[AC_DIVERT_ONCE([HELP_VAR], [ -Some influential environment variables:])dnl -AC_DIVERT_ONCE([HELP_VAR_END], [ +[m4_divert_once([HELP_VAR], [[ +Some influential environment variables:]])dnl +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 -AC_DIVERT_ONCE([HELP_VAR], [AC_HELP_STRING([$1], [$2], [ ])])dnl +m4_divert_once([HELP_VAR], [AC_HELP_STRING([$1], [$2], [ ])])dnl _AC_ARG_VAR_PRECIOUS([$1])dnl ])# AC_ARG_VAR @@ -2104,7 +2087,7 @@ EOF # If VARIABLE has not already been AC_SUBST'ed, append the sed PROGRAM # to `_AC_SUBST_SED_PROGRAM'. m4_define([_AC_SUBST], -[AC_EXPAND_ONCE([m4_append([_AC_SUBST_SED_PROGRAM], +[m4_expand_once([m4_append([_AC_SUBST_SED_PROGRAM], [$2 ])])dnl ]) diff --git a/aclang.m4 b/aclang.m4 index 0a5075e6f..1fa961f72 100644 --- a/aclang.m4 +++ b/aclang.m4 @@ -885,8 +885,8 @@ fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS _AC_LANG_COMPILER_GNU GCC=`test $ac_compiler_gnu = yes && echo yes` @@ -1089,8 +1089,8 @@ AC_CHECK_TOOLS(CXX, [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])], g++) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS _AC_LANG_COMPILER_GNU GXX=`test $ac_compiler_gnu = yes && echo yes` @@ -1211,8 +1211,8 @@ AC_CHECK_TOOLS(F77, [m4_default([$1], [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 pgf90 fc])]) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS # If we don't use `.F' as extension, the preprocessor is not run on the # input file. diff --git a/acspecific.m4 b/acspecific.m4 index d4194f7b8..6fc7d401f 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -733,7 +733,7 @@ fi])dnl # --without-x overrides everything else, but does not touch the cache. AC_DEFUN([AC_PATH_X], [dnl Document the X abnormal options inherited from history. -AC_DIVERT_ONCE([HELP_BEGIN], [ +m4_divert_once([HELP_BEGIN], [ X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR])dnl diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 0a5075e6f..1fa961f72 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -885,8 +885,8 @@ fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS _AC_LANG_COMPILER_GNU GCC=`test $ac_compiler_gnu = yes && echo yes` @@ -1089,8 +1089,8 @@ AC_CHECK_TOOLS(CXX, [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])], g++) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS _AC_LANG_COMPILER_GNU GXX=`test $ac_compiler_gnu = yes && echo yes` @@ -1211,8 +1211,8 @@ AC_CHECK_TOOLS(F77, [m4_default([$1], [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 pgf90 fc])]) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS # If we don't use `.F' as extension, the preprocessor is not run on the # input file. diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 0a5075e6f..1fa961f72 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -885,8 +885,8 @@ fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS _AC_LANG_COMPILER_GNU GCC=`test $ac_compiler_gnu = yes && echo yes` @@ -1089,8 +1089,8 @@ AC_CHECK_TOOLS(CXX, [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])], g++) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS _AC_LANG_COMPILER_GNU GXX=`test $ac_compiler_gnu = yes && echo yes` @@ -1211,8 +1211,8 @@ AC_CHECK_TOOLS(F77, [m4_default([$1], [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 pgf90 fc])]) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS # If we don't use `.F' as extension, the preprocessor is not run on the # input file. diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 4019089c2..5bba8a2fc 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -134,14 +134,6 @@ m4_define([_m4_divert(PREPARE)], 100) -# AC_DIVERT_ONCE(DIVERSION-NAME, CONTENT) -# --------------------------------------- -# Output once CONTENT into DIVERSION-NAME (which may be a number -# actually). An end of line is appended for free to CONTENT. -m4_define([AC_DIVERT_ONCE], -[AC_EXPAND_ONCE([m4_divert_text([$1], [$2])])]) - - # AC_DIVERT_PUSH(DIVERSION-NAME) # AC_DIVERT_POP # ------------------------------ @@ -201,15 +193,6 @@ m4_define([AC_BEFORE], m4_copy([m4_require], [AC_REQUIRE]) -# AC_EXPAND_ONCE(TEXT) -# -------------------- -# If TEXT has never been expanded, expand it *here*. -m4_define([AC_EXPAND_ONCE], -[m4_expand_once([$1], - [], - [AC_PROVIDE([$1])[]$1])]) - - # AC_PROVIDE(MACRO-NAME) # ---------------------- # Ideally we should just use `m4_provide($1)', but unfortunately many @@ -1572,11 +1555,11 @@ m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # ------------------------------------------------------------------------ AC_DEFUN([AC_ARG_ENABLE], -[AC_DIVERT_ONCE([HELP_ENABLE], [[ +[m4_divert_once([HELP_ENABLE], [[ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnl -AC_DIVERT_ONCE([HELP_ENABLE], [$2])dnl +m4_divert_once([HELP_ENABLE], [$2])dnl # Check whether --enable-$1 or --disable-$1 was given. if test "[${enable_]m4_patsubst([$1], -, _)+set}" = set; then enableval="[$enable_]m4_patsubst([$1], -, _)" @@ -1600,11 +1583,11 @@ AU_DEFUN([AC_ENABLE], # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE]) # -------------------------------------------------------------------- AC_DEFUN([AC_ARG_WITH], -[AC_DIVERT_ONCE([HELP_WITH], [[ +[m4_divert_once([HELP_WITH], [[ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]]) -AC_DIVERT_ONCE([HELP_WITH], [$2])dnl +m4_divert_once([HELP_WITH], [$2])dnl # Check whether --with-$1 or --without-$1 was given. if test "[${with_]m4_patsubst([$1], -, _)+set}" = set; then withval="[$with_]m4_patsubst([$1], -, _)" @@ -1639,7 +1622,7 @@ AU_DEFUN([AC_WITH], # In subsequent runs, after having loaded the cache, compare # ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE. m4_define([_AC_ARG_VAR_PRECIOUS], -[AC_DIVERT_ONCE([PARSE_ARGS], +[m4_divert_once([PARSE_ARGS], [ac_env_$1_set=${$1+set} ac_env_$1_value=$$1 ac_cv_env_$1_set=${$1+set} @@ -1688,12 +1671,12 @@ fi # Register VARNAME as a precious variable, and document it in # `configure --help' (but only once). AC_DEFUN([AC_ARG_VAR], -[AC_DIVERT_ONCE([HELP_VAR], [ -Some influential environment variables:])dnl -AC_DIVERT_ONCE([HELP_VAR_END], [ +[m4_divert_once([HELP_VAR], [[ +Some influential environment variables:]])dnl +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 -AC_DIVERT_ONCE([HELP_VAR], [AC_HELP_STRING([$1], [$2], [ ])])dnl +m4_divert_once([HELP_VAR], [AC_HELP_STRING([$1], [$2], [ ])])dnl _AC_ARG_VAR_PRECIOUS([$1])dnl ])# AC_ARG_VAR @@ -2104,7 +2087,7 @@ EOF # If VARIABLE has not already been AC_SUBST'ed, append the sed PROGRAM # to `_AC_SUBST_SED_PROGRAM'. m4_define([_AC_SUBST], -[AC_EXPAND_ONCE([m4_append([_AC_SUBST_SED_PROGRAM], +[m4_expand_once([m4_append([_AC_SUBST_SED_PROGRAM], [$2 ])])dnl ]) diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index 0a5075e6f..1fa961f72 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -885,8 +885,8 @@ fi test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS _AC_LANG_COMPILER_GNU GCC=`test $ac_compiler_gnu = yes && echo yes` @@ -1089,8 +1089,8 @@ AC_CHECK_TOOLS(CXX, [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC])], g++) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS _AC_LANG_COMPILER_GNU GXX=`test $ac_compiler_gnu = yes && echo yes` @@ -1211,8 +1211,8 @@ AC_CHECK_TOOLS(F77, [m4_default([$1], [g77 f77 xlf cf77 pgf77 fl32 fort77 f90 xlf90 f95 lf95 pgf90 fc])]) -AC_EXPAND_ONCE([_AC_COMPILER_OBJEXT])[]dnl -AC_EXPAND_ONCE([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl _AC_LANG_COMPILER_WORKS # If we don't use `.F' as extension, the preprocessor is not run on the # input file. diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index d4194f7b8..6fc7d401f 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -733,7 +733,7 @@ fi])dnl # --without-x overrides everything else, but does not touch the cache. AC_DEFUN([AC_PATH_X], [dnl Document the X abnormal options inherited from history. -AC_DIVERT_ONCE([HELP_BEGIN], [ +m4_divert_once([HELP_BEGIN], [ X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR])dnl diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4 index b9a770c79..57ce03645 100644 --- a/lib/m4sugar/m4sugar.m4 +++ b/lib/m4sugar/m4sugar.m4 @@ -750,6 +750,14 @@ m4_divert_pop([$1])dnl ]) +# m4_divert_once(DIVERSION-NAME, CONTENT) +# --------------------------------------- +# Output once CONTENT into DIVERSION-NAME (which may be a number +# actually). An end of line is appended for free to CONTENT. +m4_define([m4_divert_once], +[m4_expand_once([m4_divert_text([$1], [$2])])]) + + # m4_undivert(DIVERSION-NAME) # --------------------------- # Undivert DIVERSION-NAME. diff --git a/m4sugar.m4 b/m4sugar.m4 index b9a770c79..57ce03645 100644 --- a/m4sugar.m4 +++ b/m4sugar.m4 @@ -750,6 +750,14 @@ m4_divert_pop([$1])dnl ]) +# m4_divert_once(DIVERSION-NAME, CONTENT) +# --------------------------------------- +# Output once CONTENT into DIVERSION-NAME (which may be a number +# actually). An end of line is appended for free to CONTENT. +m4_define([m4_divert_once], +[m4_expand_once([m4_divert_text([$1], [$2])])]) + + # m4_undivert(DIVERSION-NAME) # --------------------------- # Undivert DIVERSION-NAME.