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
+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
+Library, need major changes because they relied on undocumented
+internals of version 1. Future releases of those packages will have
+updated configure.in files.
+
Major changes in release 2.0:
** New macros:
[define($1, [AC_PRO([$1])$2[]AC_EPI()])])
-dnl ### Controlling Autoconf operation
+dnl ### Initialization
dnl AC_INIT_NOTICE()
# Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this script; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# The copying terms for this script do not affect the copying terms
+# for software that it configures.
ac_help=])
AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])dnl
])
+
+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_SUBST(build_os)dnl
])
-dnl Link each of the existing files SOURCE... to the corresponding
-dnl link name in DEST...
-dnl Not actually done until AC_OUTPUT_LINKS.
-dnl AC_LINK_FILES(SOURCE..., DEST...)
-AC_DEFUN(AC_LINK_FILES,
-[define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
-
dnl ### Caching test results
])
-dnl ### Setting variables
+dnl ### Defining symbols
dnl Set VARIABLE to VALUE, verbatim, or 1.
EOF
])
+
+dnl ### Setting output variables
+
+
dnl This macro protects VARIABLE from being diverted twice
dnl if this macro is called twice for it.
dnl AC_SUBST(VARIABLE)
[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])
-dnl ### Enforcing ordering constraints
+dnl ### Dependencies between macros
dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
)])
-dnl ### Checking for files (caching)
+dnl ### Checking for programs
dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
undefine([AC_VAR_NAME])dnl
])
+
+dnl ### Checking for libraries
+
+
dnl AC_CHECK_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
AC_DEFUN(AC_CHECK_LIB,
])
-dnl ### Checking C system output (no caching)
+dnl ### Examining declarations
+
+dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
+AC_DEFUN(AC_TRY_CPP,
+[AC_REQUIRE_CPP()dnl
+cat > conftest.$ac_ext <<EOF
+[#]line __oline__ "configure"
+#include "confdefs.h"
+[$1]
+EOF
+dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
+dnl We used to copy stderr to stdout and capture it in a variable, but
+dnl that breaks under sh -x, which writes compile commands starting
+dnl with ` +' to stderr in eval and subshells.
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ ifelse([$2], , :, [rm -rf conftest*
+ $2])
+else
+ echo "$ac_err" >&AC_FD_CC
+ifelse([$3], , , [ rm -rf conftest*
+ $3
+])dnl
+fi
+rm -f conftest*])
dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
dnl ACTION-IF-NOT-FOUND])
rm -f conftest*
])
+
+dnl ### Examining libraries
+
+
dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
AC_DEFUN(AC_COMPILE_CHECK,
rm -f conftest*]
)
+
+dnl ### Checking for run-time features
+
+
dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
dnl [, ACTION-IF-CROSS-COMPILING]])
AC_DEFUN(AC_TRY_RUN,
fi
rm -fr conftest*])
-dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_TRY_CPP,
-[AC_REQUIRE_CPP()dnl
-cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-#include "confdefs.h"
-[$1]
-EOF
-dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
-dnl We used to copy stderr to stdout and capture it in a variable, but
-dnl that breaks under sh -x, which writes compile commands starting
-dnl with ` +' to stderr in eval and subshells.
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- ifelse([$2], , :, [rm -rf conftest*
- $2])
-else
- echo "$ac_err" >&AC_FD_CC
-ifelse([$3], , , [ rm -rf conftest*
- $3
-])dnl
-fi
-rm -f conftest*])
-
-dnl ### Checking for C features (caching)
+dnl ### Checking for header files
dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
done
])
+
+dnl ### Checking for library functions
+
+
dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
AC_DEFUN(AC_CHECK_FUNC,
[AC_MSG_CHECKING([for $1])
AC_SUBST(LIBOBJS)dnl
])
+
+dnl ### Checking compiler characteristics
+
+
dnl AC_CHECK_SIZEOF(TYPE)
AC_DEFUN(AC_CHECK_SIZEOF,
[changequote(<<, >>)dnl
undefine([AC_CV_NAME])dnl
])
+
+dnl ### Checking for typedefs
+
+
dnl AC_CHECK_TYPE(TYPE, DEFAULT)
AC_DEFUN(AC_CHECK_TYPE,
[AC_REQUIRE([AC_HEADER_STDC])dnl
])
-dnl ### Controlling Autoconf output
+dnl ### Creating output files
dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
AC_DEFUN(AC_CONFIG_HEADER,
[define(AC_LIST_HEADER, $1)])
+dnl Link each of the existing files SOURCE... to the corresponding
+dnl link name in DEST...
+dnl AC_LINK_FILES(SOURCE..., DEST...)
+AC_DEFUN(AC_LINK_FILES,
+[define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
+
dnl AC_CONFIG_SUBDIRS(DIR ...)
AC_DEFUN(AC_CONFIG_SUBDIRS,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_DEFUN(AC_PROG_LEX,
[AC_CHECK_PROG(LEX, flex, flex, lex)
-AC_MSG_CHECKING(for $LEX library)
if test -z "$LEXLIB"
then
case "$LEX" in
*) LEXLIB="-ll" ;;
esac
fi
-AC_MSG_RESULT($LEXLIB)
AC_SUBST(LEXLIB)])
AC_DEFUN(AC_DECL_YYTEXT,
[define($1, [AC_PRO([$1])$2[]AC_EPI()])])
-dnl ### Controlling Autoconf operation
+dnl ### Initialization
dnl AC_INIT_NOTICE()
# Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this script; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# The copying terms for this script do not affect the copying terms
+# for software that it configures.
ac_help=])
AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])dnl
])
+
+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_SUBST(build_os)dnl
])
-dnl Link each of the existing files SOURCE... to the corresponding
-dnl link name in DEST...
-dnl Not actually done until AC_OUTPUT_LINKS.
-dnl AC_LINK_FILES(SOURCE..., DEST...)
-AC_DEFUN(AC_LINK_FILES,
-[define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
-
dnl ### Caching test results
])
-dnl ### Setting variables
+dnl ### Defining symbols
dnl Set VARIABLE to VALUE, verbatim, or 1.
EOF
])
+
+dnl ### Setting output variables
+
+
dnl This macro protects VARIABLE from being diverted twice
dnl if this macro is called twice for it.
dnl AC_SUBST(VARIABLE)
[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])
-dnl ### Enforcing ordering constraints
+dnl ### Dependencies between macros
dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
)])
-dnl ### Checking for files (caching)
+dnl ### Checking for programs
dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
undefine([AC_VAR_NAME])dnl
])
+
+dnl ### Checking for libraries
+
+
dnl AC_CHECK_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, OTHER-LIBRARIES]]])
AC_DEFUN(AC_CHECK_LIB,
])
-dnl ### Checking C system output (no caching)
+dnl ### Examining declarations
+
+dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
+AC_DEFUN(AC_TRY_CPP,
+[AC_REQUIRE_CPP()dnl
+cat > conftest.$ac_ext <<EOF
+[#]line __oline__ "configure"
+#include "confdefs.h"
+[$1]
+EOF
+dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
+dnl We used to copy stderr to stdout and capture it in a variable, but
+dnl that breaks under sh -x, which writes compile commands starting
+dnl with ` +' to stderr in eval and subshells.
+eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ ifelse([$2], , :, [rm -rf conftest*
+ $2])
+else
+ echo "$ac_err" >&AC_FD_CC
+ifelse([$3], , , [ rm -rf conftest*
+ $3
+])dnl
+fi
+rm -f conftest*])
dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
dnl ACTION-IF-NOT-FOUND])
rm -f conftest*
])
+
+dnl ### Examining libraries
+
+
dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
AC_DEFUN(AC_COMPILE_CHECK,
rm -f conftest*]
)
+
+dnl ### Checking for run-time features
+
+
dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
dnl [, ACTION-IF-CROSS-COMPILING]])
AC_DEFUN(AC_TRY_RUN,
fi
rm -fr conftest*])
-dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_TRY_CPP,
-[AC_REQUIRE_CPP()dnl
-cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-#include "confdefs.h"
-[$1]
-EOF
-dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
-dnl We used to copy stderr to stdout and capture it in a variable, but
-dnl that breaks under sh -x, which writes compile commands starting
-dnl with ` +' to stderr in eval and subshells.
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- ifelse([$2], , :, [rm -rf conftest*
- $2])
-else
- echo "$ac_err" >&AC_FD_CC
-ifelse([$3], , , [ rm -rf conftest*
- $3
-])dnl
-fi
-rm -f conftest*])
-
-dnl ### Checking for C features (caching)
+dnl ### Checking for header files
dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
done
])
+
+dnl ### Checking for library functions
+
+
dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
AC_DEFUN(AC_CHECK_FUNC,
[AC_MSG_CHECKING([for $1])
AC_SUBST(LIBOBJS)dnl
])
+
+dnl ### Checking compiler characteristics
+
+
dnl AC_CHECK_SIZEOF(TYPE)
AC_DEFUN(AC_CHECK_SIZEOF,
[changequote(<<, >>)dnl
undefine([AC_CV_NAME])dnl
])
+
+dnl ### Checking for typedefs
+
+
dnl AC_CHECK_TYPE(TYPE, DEFAULT)
AC_DEFUN(AC_CHECK_TYPE,
[AC_REQUIRE([AC_HEADER_STDC])dnl
])
-dnl ### Controlling Autoconf output
+dnl ### Creating output files
dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
AC_DEFUN(AC_CONFIG_HEADER,
[define(AC_LIST_HEADER, $1)])
+dnl Link each of the existing files SOURCE... to the corresponding
+dnl link name in DEST...
+dnl AC_LINK_FILES(SOURCE..., DEST...)
+AC_DEFUN(AC_LINK_FILES,
+[define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
+
dnl AC_CONFIG_SUBDIRS(DIR ...)
AC_DEFUN(AC_CONFIG_SUBDIRS,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_DEFUN(AC_PROG_LEX,
[AC_CHECK_PROG(LEX, flex, flex, lex)
-AC_MSG_CHECKING(for $LEX library)
if test -z "$LEXLIB"
then
case "$LEX" in
*) LEXLIB="-ll" ;;
esac
fi
-AC_MSG_RESULT($LEXLIB)
AC_SUBST(LEXLIB)])
AC_DEFUN(AC_DECL_YYTEXT,