Index: ChangeLog from Akim Demaille * m4/multi.m4: Remove the hairy useless quotation of `$'. Simplify `ifelse([$2],,,[$2])' into... `$2'! * m4/minuso.m4: Don't use changequote! * m4/cond.m4: Fix quotation. * m4/sanity.m4: Follow the Autoconf coding style. * m4/missing.m4 (AM_MISSING_INSTALL_SH): Use a for loop. * m4/depend.m4 (AM_DEPENDENCIES): Fix quotation issues. Use AC_CACHE_CHECK. Index: m4/sanity.m4 --- m4/sanity.m4 Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/9_sanity.m4 1.1 644) +++ m4/sanity.m4 Mon, 15 Jan 2001 00:07:24 +0100 akim (am/f/9_sanity.m4 1.1 644) @@ -2,6 +2,8 @@ # Check to make sure that the build environment is sane. # +# serial 2 + AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case @@ -14,12 +16,12 @@ AC_DEFUN([AM_SANITY_CHECK], # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then + if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then + if test "$[*]" != "X $srcdir/configure conftestfile" \ + && test "$[*]" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a @@ -29,7 +31,7 @@ AC_DEFUN([AM_SANITY_CHECK], alias in your environment]) fi - test "[$]2" = conftestfile + test "$[2]" = conftestfile ) then # Ok. Index: m4/multi.m4 --- m4/multi.m4 Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/15_multi.m4 1.1 644) +++ m4/multi.m4 Mon, 15 Jan 2001 00:18:35 +0100 akim (am/f/15_multi.m4 1.1 644) @@ -1,34 +1,40 @@ -# Add --enable-multilib to configure. -# Usage: AM_ENABLE_MULTILIB([makefile, [rel-to-top-srcdir]]) +# serial 2 -AC_DEFUN([AM_ENABLE_MULTILIB], [ -# Default to --enable-multilib +# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) +# --------------------------------------------------- +# Add --enable-multilib to configure. +AC_DEFUN([AM_ENABLE_MULTILIB], +[# Default to --enable-multilib AC_ARG_ENABLE(multilib, [ --enable-multilib build many library versions (default)], -[case "${enableval}" in +[case "$enableval" in yes) multilib=yes ;; no) multilib=no ;; - *) AC_MSG_ERROR([bad value ${enableval} for multilib option]) ;; - esac], [multilib=yes]) + *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;; + esac], + [multilib=yes]) # We may get other options which we are undocumented: # --with-target-subdir, --with-multisrctop, --with-multisubdir -if test "[$]{srcdir}" = "."; then - if test "[$]{with_target_subdir}" != "."; then - multi_basedir="[$]{srcdir}/[$]{with_multisrctop}../ifelse([$2],,,[$2])" +if test "$srcdir" = "."; then + if test "$with_target_subdir" != "."; then + multi_basedir="$srcdir/$with_multisrctop../$2" else - multi_basedir="[$]{srcdir}/[$]{with_multisrctop}ifelse([$2],,,[$2])" + multi_basedir="$srcdir/$with_multisrctop$2" fi else - multi_basedir="[$]{srcdir}/ifelse([$2],,,[$2])" + multi_basedir="$srcdir/$2" fi AC_SUBST(multi_basedir) -AC_OUTPUT_COMMANDS( +AC_OUTPUT_COMMANDS([ if test -n "$CONFIG_FILES"; then - ac_file=[]ifelse([$1],,Makefile,[$1]) . ${multi_basedir}/config-ml.in -fi, [ + # FIXME: Something is really fishy here, the dot looks like Perl + # code. What was meant? Clearly, this code has never been exercised. + ac_file=ifelse([$1],,Makefile,[$1]) . ${multi_basedir}/config-ml.in +fi], + [ srcdir="$srcdir" host="$host" target="$target" Index: m4/missing.m4 --- m4/missing.m4 Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/16_missing.m4 1.1 644) +++ m4/missing.m4 Mon, 15 Jan 2001 00:04:31 +0100 akim (am/f/16_missing.m4 1.1 644) @@ -1,31 +1,42 @@ ## --------------------------------------------------------- ## ## Fake the existence of programs that GNU maintainers use. ## ## --------------------------------------------------------- ## + +# serial 2 + # AM_MISSING_PROG(NAME, PROGRAM) -AC_DEFUN([AM_MISSING_PROG], [ -AC_REQUIRE([AM_MISSING_HAS_RUN]) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) + +# AM_MISSING_INSTALL_SH +# --------------------- # Like AM_MISSING_PROG, but only looks for install-sh. -# AM_MISSING_INSTALL_SH() -AC_DEFUN([AM_MISSING_INSTALL_SH], [ -AC_REQUIRE([AM_MISSING_HAS_RUN]) +AC_DEFUN([AM_MISSING_INSTALL_SH], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) if test -z "$install_sh"; then - install_sh="$ac_aux_dir/install-sh" - test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh" - test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh" - dnl FIXME: an evil hack: we remove the SHELL invocation from - dnl install_sh because automake adds it back in. Sigh. - install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`" + for install_sh in "$ac_aux_dir/install-sh" \ + "$ac_aux_dir/install.sh" \ + "${am_missing_run}${ac_auxdir}/install-sh"; + do + test -f "$install_sh" && break + done + # FIXME: an evil hack: we remove the SHELL invocation from + # install_sh because automake adds it back in. Sigh. + install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'` fi AC_SUBST(install_sh)]) -# AM_MISSING_HAS_RUN. + +# AM_MISSING_HAS_RUN +# ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], [ -test x"${MISSING+set}" = xset || \ +AC_DEFUN([AM_MISSING_HAS_RUN], +[test x"${MISSING+set}" = xset || MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing" # Use eval to expand $SHELL if eval "$MISSING --run :"; then Index: m4/minuso.m4 --- m4/minuso.m4 Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/17_minuso.m4 1.1 644) +++ m4/minuso.m4 Mon, 15 Jan 2001 00:12:01 +0100 akim (am/f/17_minuso.m4 1.1 644) @@ -1,13 +1,14 @@ -# Like AC_PROG_CC_C_O, but changed for automake. +# serial 2 -AC_DEFUN([AM_PROG_CC_C_O],[ -AC_REQUIRE([AC_PROG_CC_C_O]) +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl # FIXME: we rely on the cache variable name because # there is no other way. -set dummy $CC; ac_cc="`echo [$]2 | -changequote(, )dnl - sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" -changequote([, ])dnl +set dummy $CC +ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. CC="\$(top_srcdir)/compile $CC" Index: m4/init.m4 --- m4/init.m4 Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/21_init.m4 1.1 644) +++ m4/init.m4 Mon, 15 Jan 2001 00:09:14 +0100 akim (am/f/21_init.m4 1.1 644) @@ -2,8 +2,9 @@ # some checks are only needed if your package does certain things. # But this isn't really a big deal. -# serial 3 +# serial 4 +# We require 2.13 because we rely on SHELL being computed by configure. AC_PREREQ([2.13]) # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) @@ -23,8 +24,7 @@ # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) # ---------------------------------------------- AC_DEFUN([AM_INIT_AUTOMAKE], -[dnl We require 2.13 because we rely on SHELL being computed by configure. -AC_REQUIRE([AC_PROG_INSTALL])dnl +[AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then Index: m4/depend.m4 --- m4/depend.m4 Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/27_depend.m4 1.1 644) +++ m4/depend.m4 Mon, 15 Jan 2001 00:05:32 +0100 akim (am/f/27_depend.m4 1.1 644) @@ -1,34 +1,35 @@ -# See how the compiler implements dependency checking. -# Usage: +# serial 2 + # AM_DEPENDENCIES(NAME) +# --------------------- +# See how the compiler implements dependency checking. # NAME is "CC", "CXX" or "OBJC". - # We try a few techniques and use that to set a single cache variable. - -AC_DEFUN([AM_DEPENDENCIES],[ -AC_REQUIRE([AM_SET_DEPDIR]) +AC_DEFUN([AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR]) AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS]) -ifelse([$1],CC,[ -AC_REQUIRE([AC_PROG_CC]) +ifelse([$1], CC, + [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CPP]) depcc="$CC" -depcpp="$CPP"],[$1],CXX,[ -AC_REQUIRE([AC_PROG_CXX]) +depcpp="$CPP"], + [$1], CXX, [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) depcc="$CXX" -depcpp="$CXXCPP"],[$1],OBJC,[ -am_cv_OBJC_dependencies_compiler_type=gcc],[ -AC_REQUIRE([AC_PROG_][$1]) -depcc="$[$1]" +depcpp="$CXXCPP"], + [$1], OBJC, [am_cv_OBJC_dependencies_compiler_type=gcc], + [AC_REQUIRE([AC_PROG_$1]) +depcc="$$1" depcpp=""]) -AC_MSG_CHECKING([dependency style of $depcc]) -AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[ -if test -z "$AMDEP"; then + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP"; then echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h - am_cv_[$1]_dependencies_compiler_type=none - for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do + am_cv_$1_dependencies_compiler_type=none + for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "$am_depcomp"`; do case "$depmode" in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll @@ -49,19 +50,18 @@ AC_DEFUN([AM_DEPENDENCIES],[ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL $am_depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1; then - am_cv_[$1]_dependencies_compiler_type="$depmode" + am_cv_$1_dependencies_compiler_type="$depmode" break fi done rm -f conftest.* else - am_cv_[$1]_dependencies_compiler_type=none + am_cv_$1_dependencies_compiler_type=none fi ]) -AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type) -[$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type" -AC_SUBST([$1]DEPMODE) +$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type" +AC_SUBST([$1DEPMODE]) ]) # Choose a directory name for dependency files. Index: m4/cond.m4 --- m4/cond.m4 Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/28_cond.m4 1.1 644) +++ m4/cond.m4 Mon, 15 Jan 2001 00:10:08 +0100 akim (am/f/28_cond.m4 1.1 644) @@ -1,8 +1,11 @@ -# Define a conditional. +# serial 2 +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) +[AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#'