]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/c.m4 (AC_PROG_CXX_C_O): New macro.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 20 May 2006 05:39:03 +0000 (05:39 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 20 May 2006 05:39:03 +0000 (05:39 +0000)
* doc/autoconf.texi (C++ Compiler): Document it.
* lib/autoconf/fortran.m4 (_AC_PROG_FC_C_O): Adjust comment.
* NEWS: Update.

ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/c.m4
lib/autoconf/fortran.m4

index 5ac2cccd901d67840b66c77e4da69e47324c1005..780afcba11b1d03036dabb9b00c03416da7cae5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-20  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * lib/autoconf/c.m4 (AC_PROG_CXX_C_O): New macro.
+       * doc/autoconf.texi (C++ Compiler): Document it.
+       * lib/autoconf/fortran.m4 (_AC_PROG_FC_C_O): Adjust comment.
+       * NEWS: Update.
+
 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
 
        * lib/autoconf/status.m4 (_AC_OUTPUT_HEADER): Fix off-by-one bug
diff --git a/NEWS b/NEWS
index 809fcc987045fe9e325acb9f139ef86e037e665b..ad6037017a2cf1bdf8bc7eb3483d0b51c0554e84 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@
   and ac_cv_prog_cc_c89 to 'no' as well, for backward compatibility with
   obsolete K&R tests in the Automake test suite.
 
+** AC_PROG_CXX_C_O
+  New macro.
+
 ** AC_PROG_MKDIR_P
   New macro.
 
index d4fcd9e2be5162da40a9deb28f40758f74cd96c8..a7b450a729e88404cd26140b05bbc22e5ad4f29e 100644 (file)
@@ -6409,6 +6409,14 @@ consider the test failed if any warnings have been reported.  However,
 it is not known whether such broken preprocessors exist for C++.
 @end defmac
 
+@defmac AC_PROG_CXX_C_O
+@acindex{PROG_CXX_C_O}
+@cvindex CXX_NO_MINUS_C_MINUS_O
+Test whether the C++ compiler accepts the options @option{-c} and
+@option{-o} simultaneously, and define @code{CXX_NO_MINUS_C_MINUS_O},
+if it does not.
+@end defmac
+
 
 @node Objective C Compiler
 @subsection Objective C Compiler Characteristics
index 7dcaf6d0d8fa7331bdb307ab4539fdb853f73d43..58c915a599fb6addf9e247cbb7aede1317c569ea 100644 (file)
@@ -824,6 +824,35 @@ fi[]dnl
 ])# _AC_PROG_CXX_G
 
 
+# AC_PROG_CXX_C_O
+# ---------------
+# Test if the C++ compiler accepts the options `-c' and `-o'
+# simultaneously, and define `CXX_NO_MINUS_C_MINUS_O' if it does not.
+AC_DEFUN([AC_PROG_CXX_C_O],
+[AC_LANG_ASSERT([C++])dnl
+AC_CACHE_CHECK([whether $CXX understands -c and -o together],
+               [ac_cv_prog_cxx_c_o],
+[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+# We test twice because some compilers refuse to overwrite an existing
+# `.o' file with `-o', although they will create one.
+ac_try='$CXX $CXXFLAGS -c conftest.$ac_ext -o conftest2.$ac_objext >&AS_MESSAGE_LOG_FD'
+rm -f conftest2.*
+if AC_TRY_EVAL(ac_try) &&
+     test -f conftest2.$ac_objext &&
+     AC_TRY_EVAL(ac_try); then
+  ac_cv_prog_cxx_c_o=yes
+else
+  ac_cv_prog_cxx_c_o=no
+fi
+rm -f conftest*])
+if test $ac_cv_prog_cxx_c_o = no; then
+  AC_DEFINE(CXX_NO_MINUS_C_MINUS_O, 1,
+            [Define to 1 if your C++ compiler doesn't accept
+             -c and -o together.])
+fi
+])# AC_PROG_CXX_C_O
+
+
 # ------------------------------ #
 # 3d. The Objective C compiler.  #
 # ------------------------------ #
index 9dc089eb7a547380991dc6887a4b9870125f26af..9b9aee785568142e1d47e70f7a8831de6f1a9fa9 100644 (file)
@@ -452,7 +452,7 @@ fi[]dnl
 # why anyone would use it.  The only reason I include it is for
 # completeness, since a similar test exists for the C compiler.
 #
-# FIXME: it seems like we could merge the C/Fortran versions of this.
+# FIXME: it seems like we could merge the C/C++/Fortran versions of this.
 AC_DEFUN([_AC_PROG_FC_C_O],
 [_AC_FORTRAN_ASSERT()dnl
 AC_CACHE_CHECK([whether $[]_AC_FC[] understands -c and -o together],