From adfbd796b92e365b9e70cb21492898f9fabe7a69 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 18 May 2010 12:52:47 -0700 Subject: [PATCH] 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. --- aclocal.m4 | 4 ++-- configure.in | 28 ++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 1e563501b..239b5f720 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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 diff --git a/configure.in b/configure.in index 3f38afb14..08abf8b5b 100644 --- a/configure.in +++ b/configure.in @@ -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)