summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-05-16 00:00:13 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-05-16 00:00:13 +0200
commit05f889a017a262a40459d94c6e20e6c2b4579f5d (patch)
tree5cc5e0945fda80a6afaad2cdaab39807190e9d24 /m4
parent722f25b9875d55c0bb89d69e1916dfcaafde5b8a (diff)
parentc91f24a5a72e0eced917507ff092e7845448b27d (diff)
downloadautomake-05f889a017a262a40459d94c6e20e6c2b4579f5d.tar.gz
Merge branch 'master' into ng/master
* master: post-release: micro version bump (1.13.2a) release: stable micro release 1.13.2 vala tests: skip in a cross compiler setup HACKING: miscellaneous fixes, updates and enhancements NEWS: minor improvements to wording (about new versioning scheme) THANKS: update Akim's e-mail address tests: less uses of "make -e"; avoid spurious failures in 'check-cc-no-c-o' build: be more respectful of user-specified verbosity check-cc-no-c-o: unify initializations in a single place check-cc-no-c-o: avoid a spurious failure build: fixup for building in a VPATH setup Use AC_DEFUN_ONCE to define AM_PROG_CC_C_O compile: avoid AC_PROG_CC messy rewrite options: tiny simplification in dealing with incompatible versions Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/init.m452
-rw-r--r--m4/minuso.m429
2 files changed, 24 insertions, 57 deletions
diff --git a/m4/init.m4 b/m4/init.m4
index 8a01b8cad..a2f301c5c 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -101,6 +101,12 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
+dnl Automatically invoke AM_PROG_CC_C_O as necessary. Since AC_PROG_CC is
+dnl usually called after AM_INIT_AUTOMAKE, we arrange for the test to be
+dnl done later by AC_CONFIG_COMMANDS_PRE.
+AC_CONFIG_COMMANDS_PRE([AC_PROVIDE_IFELSE(
+ [AC_PROG_CC],
+ [AC_LANG_PUSH([C]) AM_PROG_CC_C_O AC_LANG_POP([C])])])dnl
AC_REQUIRE([AM_SILENT_RULES])dnl
# POSIX will say in a future version that running "rm -f" with no argument
@@ -145,52 +151,6 @@ END
fi
fi])
-dnl We have to redefine AC_PROG_CC to allow our compile rules to use
-dnl "-c -o" together also with losing compilers.
-dnl FIXME: Add references to the original discussion and bug report.
-dnl FIXME: Shameless copy & paste from Autoconf internals, since trying to
-dnl play smart among tangles of AC_REQUIRE, m4_defn, m4_provide and
-dnl other tricks was proving too difficult, and in the end, likely
-dnl more brittle too. And this should anyway be just a temporary
-dnl band-aid, until Autoconf provides the semantics and/or hooks we
-dnl need (hint hint, nudge nudge) ...
-AC_DEFUN([AC_PROG_CC],
-m4_defn([AC_PROG_CC])
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-dnl FIXME The following abomination is expected to disappear in
-dnl Automake 1.14.
-AC_MSG_CHECKING([whether $CC understands -c and -o together])
-set dummy $CC; am__cc=`AS_ECHO(["$[2]"]) | \
- sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'`
-AC_CACHE_VAL([am_cv_prog_cc_${am__cc}_c_o],
-[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&AS_MESSAGE_LOG_FD'
-rm -f conftest2.*
-if _AC_DO_VAR(ac_try) && test -f conftest2.$ac_objext
-then
- eval am_cv_prog_cc_${am__cc}_c_o=yes
-else
- eval am_cv_prog_cc_${am__cc}_c_o=no
-fi
-rm -f core conftest*
-])dnl
-if eval test \"\$am_cv_prog_cc_${am__cc}_c_o\" = yes; then
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
- # Losing compiler, so wrap it with the 'compile' script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-])
-
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
diff --git a/m4/minuso.m4 b/m4/minuso.m4
index 17fa8c92a..06f74c906 100644
--- a/m4/minuso.m4
+++ b/m4/minuso.m4
@@ -7,19 +7,26 @@
# AM_PROG_CC_C_O
# --------------
-# Basically a no-op now, completely superseded by the AC_PROG_CC
-# adjusted by Automake. Kept for backward-compatibility.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC])dnl
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
dnl Make sure AC_PROG_CC is never called again, or it will override our
dnl setting of CC.
m4_define([AC_PROG_CC],
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-# For better backward-compatibility. Users are advised to stop
-# relying on this cache variable and C preprocessor symbol ASAP.
-eval ac_cv_prog_cc_${am__cc}_c_o=\$am_cv_prog_cc_${am__cc}_c_o
-if eval test \"\$ac_cv_prog_cc_${am__cc}_c_o\" != yes; then
- AC_DEFINE([NO_MINUS_C_MINUS_O], [1],
- [Define to 1 if your C compiler doesn't accept -c and -o together.])
-fi
])