Check that the C and C++ compilers match.

Since we have not tested and some of the flags are not configured to
support mixed compiler compilation do not allow it for now.
This commit is contained in:
Cary R 2010-05-18 12:52:47 -07:00 committed by Stephen Williams
parent 420519193d
commit adfbd796b9
2 changed files with 26 additions and 6 deletions

4
aclocal.m4 vendored
View File

@ -129,7 +129,7 @@ case "${host}" in
;;
*-*-solaris*)
if test ${using_sunpro} = 1
if test ${using_sunpro_c} = 1
then
shared="-G"
fi
@ -161,7 +161,7 @@ case "${host}" in
;;
*-*-solaris*)
if test ${using_sunpro} = 1
if test ${using_sunpro_c} = 1
then
PICFLAG=-G
fi

View File

@ -58,12 +58,12 @@ AC_SUBST(EXEEXT)
# Combined check for Microsoft-related bogosities; sets WIN32 if found
AX_WIN32
# Check to see if we are using the SUN compiler. If so then configure
# some of the flags to match the SUN compiler syntax. This is also used
# Check to see if we are using the Sun compiler. If so then configure
# some of the flags to match the Sun compiler syntax. This is also used
# in the aclocal.m4 file to configure the flags used to build and link
# dynamic libraries
AC_CHECK_DECL(__SUNPRO_C, using_sunpro=1, using_sunpro=0)
if test ${using_sunpro} = 1
AC_CHECK_DECL(__SUNPRO_C, using_sunpro_c=1, using_sunpro_c=0)
if test ${using_sunpro_c} = 1
then
AC_SUBST(DEPENDENCY_FLAG, [-xMMD])
AC_SUBST(WARNING_FLAGS, [""])
@ -74,6 +74,26 @@ fi
AC_LANG(C++)
# Check that we are using either the GNU compilers or the Sun compilers
# but not a mixture of the two (not currently supported).
AC_CHECK_DECL(__SUNPRO_CC, using_sunpro_cc=1, using_sunpro_cc=0)
if test ${using_sunpro_c} = 1
then
if test ${using_sunpro_cc} = 0
then
echo "*** Error: No support for mixing GNU and Sun compilers. ***"
echo " Using Sun C compiler and GNU C++ compiler.."
exit 1
fi
else
if test ${using_sunpro_cc} = 1
then
echo "*** Error: No support for mixing GNU and Sun compilers. ***"
echo " Using GNU C compiler and Sun C++ compiler.."
exit 1
fi
fi
AC_CHECK_HEADERS(getopt.h malloc.h inttypes.h libiberty.h iosfwd sys/wait.h)
AC_CHECK_SIZEOF(unsigned long long)