summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorAkim Demaille <akim@epita.fr>2001-01-25 15:50:36 +0000
committerAkim Demaille <akim@epita.fr>2001-01-25 15:50:36 +0000
commitb37ff24ab19a17e9ca166be09fcf6dfe6cb9162c (patch)
treed91ee2f4020c07317242366c9ed8c99ad0b885af /aclocal.m4
parente36d38fdd5f29b7599b1faaf33399265558dc1ce (diff)
downloadautomake-b37ff24ab19a17e9ca166be09fcf6dfe6cb9162c.tar.gz
* m4/depend.m4 (AM_DEPENDENCIES): Don't leave `AC_PROG_CC' etc. in
clear. * m4/init.m4: Likewise. * m4/sanity.m4: s/conftestfile/conftest.file/.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m4157
1 files changed, 95 insertions, 62 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 48e36cfc9..ee128bac7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -15,8 +15,16 @@
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
-# serial 3
+# serial 6
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it see a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+# 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)
@@ -36,8 +44,7 @@ ifdef([AC_PROVIDE_IFELSE],
# 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
@@ -69,38 +76,42 @@ AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CC],
+AC_PROVIDE_IFELSE([AC_PROG_][CC],
[AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [define([AC_PROG_][CC],
+ defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_][CXX],
[AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])])dnl
+ [define([AC_PROG_][CXX],
+ defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
])
#
# Check to make sure that the build environment is sane.
#
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
- if test "[$]*" = "X"; then
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "[$]*" != "X $srcdir/configure conftestfile" \
- && test "[$]*" != "X conftestfile $srcdir/configure"; then
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $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
@@ -110,7 +121,7 @@ if (
alias in your environment])
fi
- test "[$]2" = conftestfile
+ test "$[2]" = conftest.file
)
then
# Ok.
@@ -122,31 +133,42 @@ fi
rm -f conftest*
AC_MSG_RESULT(yes)])
+
+# 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
@@ -158,37 +180,44 @@ else
fi
])
-# See how the compiler implements dependency checking.
-# Usage:
+# serial 3
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it see a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
# 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_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
-ifelse([$1],CC,[
-AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AC_PROG_CPP])
+AC_DEFUN([AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+ifelse([$1], CC,
+ [AC_REQUIRE([AC_PROG_][CC])dnl
+AC_REQUIRE([AC_PROG_][CPP])
depcc="$CC"
-depcpp="$CPP"],[$1],CXX,[
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PROG_CXXCPP])
+depcpp="$CPP"],
+ [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
+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])dnl
+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
@@ -209,26 +238,27 @@ if test -z "$AMDEP"; then
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])
])
+
+# AM_SET_DEPDIR
+# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in AM_DEPENDENCIES
-
-AC_DEFUN([AM_SET_DEPDIR],[
-if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+AC_DEFUN([AM_SET_DEPDIR],
+[if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
DEPDIR=.deps
# We redirect because .deps might already exist and be populated.
# In this situation we don't want to see an error.
@@ -239,8 +269,11 @@ fi
AC_SUBST(DEPDIR)
])
-AC_DEFUN([AM_DEP_TRACK],[
-AC_ARG_ENABLE(dependency-tracking,
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" = xno; then