From 541df9f424b82b90ec4bd798ab6b8f1c655e3acd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 3 May 2014 09:27:17 -0700 Subject: [PATCH] Get --enable-gcc-warnings to work after touching configure.ac. Preserve ACLOCAL_PATH in later builds, so that by default it has the same value as it did in the first build after initial checkout. * Makefile.in (ACLOCAL_PATH): New macro. ($(srcdir)/aclocal.m4): Use it. * configure.ac (ACLOCAL_PATH): AC_SUBST it. * autogen.sh (env_space): New var. Tell user what variables, if any, to pass to 'configure'. --- ChangeLog | 9 +++++++++ Makefile.in | 3 ++- autogen.sh | 8 +++++--- configure.ac | 3 +++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61df709352..a93a93c8f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2014-05-03 Paul Eggert + Get --enable-gcc-warnings to work after touching configure.ac. + Preserve ACLOCAL_PATH in later builds, so that by default it has + the same value as it did in the first build after initial checkout. + * Makefile.in (ACLOCAL_PATH): New macro. + ($(srcdir)/aclocal.m4): Use it. + * configure.ac (ACLOCAL_PATH): AC_SUBST it. + * autogen.sh (env_space): New var. + Tell user what variables, if any, to pass to 'configure'. + Get --enable-gcc-warnings working again. The recent changes to configure.ac removed the transliteration of -I to -isystem in CFLAGS, which is needed for --enable-gcc-warnings. diff --git a/Makefile.in b/Makefile.in index 2eda8c365d..ffee1ec131 100644 --- a/Makefile.in +++ b/Makefile.in @@ -425,9 +425,10 @@ AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/configure: $(AUTOCONF_INPUTS) cd ${srcdir} && autoconf +ACLOCAL_PATH = @ACLOCAL_PATH@ ACLOCAL_INPUTS = $(srcdir)/configure.ac $(srcdir)/m4/gnulib-comp.m4 $(srcdir)/aclocal.m4: $(ACLOCAL_INPUTS) - cd $(srcdir) && aclocal -I m4 + cd $(srcdir) && ACLOCAL_PATH='$(ACLOCAL_PATH)' aclocal -I m4 AUTOMAKE_INPUTS = $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am \ $(srcdir)/lib/gnulib.mk diff --git a/autogen.sh b/autogen.sh index c2a2c7af04..b7804548ce 100755 --- a/autogen.sh +++ b/autogen.sh @@ -210,6 +210,7 @@ fi # find the pkg.m4 that is installed in the standard location. echo "Checking for pkg.m4..." AUTORECONF_ENV= +env_space= ac_dir=`aclocal --print-ac-dir` && test -r "$ac_dir/pkg.m4" || { oIFS=$IFS IFS=: @@ -225,7 +226,8 @@ ac_dir=`aclocal --print-ac-dir` && test -r "$ac_dir/pkg.m4" || { ?*) ACLOCAL_PATH=$ACLOCAL_PATH:$ac_dir;; esac export ACLOCAL_PATH - AUTORECONF_ENV="ACLOCAL_PATH='$ACLOCAL_PATH' " + AUTORECONF_ENV="ACLOCAL_PATH='$ACLOCAL_PATH'" + env_space=' ' break fi fi @@ -244,7 +246,7 @@ EOF echo ok echo 'Your system has the required tools.' -echo "Running \"${AUTORECONF_ENV}autoreconf -fi -I m4\" ..." +echo "Running \"$AUTORECONF_ENV${env_space}autoreconf -fi -I m4\" ..." ## Let autoreconf figure out what, if anything, needs doing. @@ -255,7 +257,7 @@ autoreconf -fi -I m4 || exit $? ## cause 'make' to needlessly run 'autoheader'. echo timestamp > src/stamp-h.in || exit -echo "You can now run \`./configure'." +echo "You can now run \`./configure$env_space$AUTORECONF_ENV'." exit 0 diff --git a/configure.ac b/configure.ac index 74ea10dd5c..7545e14e15 100644 --- a/configure.ac +++ b/configure.ac @@ -295,6 +295,9 @@ otherwise for the first of `gfile' or `inotify' that is usable.]) dnl http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg01844.html OPTION_DEFAULT_ON([makeinfo],[don't require makeinfo for building manuals]) +## This might be a 'configure' arg, e.g., autogen.sh might set it. +AC_SUBST([ACLOCAL_PATH]) + ## Makefile.in needs the cache file name. AC_SUBST(cache_file) -- 2.20.1