* 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.
This commit is contained in:
Ralf Wildenhues 2006-05-20 05:39:03 +00:00
parent 4b2a883785
commit 621112ccfb
5 changed files with 48 additions and 1 deletions

View File

@ -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

3
NEWS
View File

@ -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.

View 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

View 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. #
# ------------------------------ #

View 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],