diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-05-26 20:56:32 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2013-05-26 20:56:32 +0200 |
commit | 2b9a79a7c2edefebb4aea3dc08acadb683c9487d (patch) | |
tree | 8bf30b9f031eeaba192abdf4a495384785199ac9 /m4/prog-cc-c-o.m4 | |
parent | 313db7c6a9ad24f059326cc43223056ca3814f23 (diff) | |
parent | 4a4f39cf7b87a9384a1b274263a66577f3387131 (diff) | |
download | automake-2b9a79a7c2edefebb4aea3dc08acadb683c9487d.tar.gz |
Merge branch 'master' into ng/master
* master:
NEWS: document deprecation of 'shar' and 'compress' dist formats
m4: rename minuso.m4 -> prog-cc-c-o.m4
tests: adjust or remove some obsolete comments
tests: remove some useless 'unset' of variables
tests: avoid a couple of extra sleep with GNU make
NEWS: document testsuite work for 1.13.3
lint: remove a couple of obsolete syntax checks
lint: cosmetics: use #-comments, not ##-comments
lint: cosmetics: some reordering
lint: recipes of syntax check require GNU grep; ensure it is used
lint: better name for a syntax check
tests: rename $am_make_rc_got -> $am_make_rc
tests: some tests make no sense if "$CC -c -o" doesn't work
AM_PROG_CC_C_O: don't rely on AC_PROG_CC_C_O, re-implement similar logic
compile: rewrite AC_PROG_CC with AM_PROG_CC_C_O contents
tests: ensure $required is not set too late
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'm4/prog-cc-c-o.m4')
-rw-r--r-- | m4/prog-cc-c-o.m4 | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/m4/prog-cc-c-o.m4 b/m4/prog-cc-c-o.m4 new file mode 100644 index 000000000..3b2a849b0 --- /dev/null +++ b/m4/prog-cc-c-o.m4 @@ -0,0 +1,47 @@ +## -*- Autoconf -*- +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != 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 +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |