From 8210816284b35eba618c1c12424c51e27f318b06 Mon Sep 17 00:00:00 2001 From: "seawood%netscape.com" Date: Thu, 25 Apr 2002 22:18:43 +0000 Subject: [PATCH] Only check for & use -fshort-wchar with CXX as some versions of gcc only support -fshort-wchar for g++. Bug #139211 r=bryner --- configure.in | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index a23c52d46c1..6045ee26aaa 100644 --- a/configure.in +++ b/configure.in @@ -1519,13 +1519,15 @@ if test "$ac_cv_have_usable_wchar" = "yes"; then HAVE_CPP_2BYTE_WCHAR_T=1 else dnl This is really gcc-only -dnl Do this test using CXX instead of CC since some versions of gcc -dnl 2.96-2.97 have a signed wchar_t in c++ only. +dnl Do this test using CXX only since some versions of gcc +dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions +dnl only have short-wchar support for c++. +dnl Note that we assume that mac & win32 have short wchar (see nscore.h) - _SAVE_CFLAGS=$CFLAGS - _SAVE_CC=$CC - CC=$CXX - CFLAGS="$CFLAGS -fshort-wchar" + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + _SAVE_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS -fshort-wchar" AC_CACHE_CHECK(for compiler -fshort-wchar option, ac_cv_have_usable_wchar_option, @@ -1540,12 +1542,10 @@ dnl 2.96-2.97 have a signed wchar_t in c++ only. if test "$ac_cv_have_usable_wchar_option" = "yes"; then AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T) HAVE_CPP_2BYTE_WCHAR_T=1 -dnl Since this is gcc-only, CC and CXX should take the same arguments. - CXXFLAGS="$CXXFLAGS -fshort-wchar" else - CFLAGS=$_SAVE_CFLAGS + CXXFLAGS=$_SAVE_CXXFLAGS fi - CC=$_SAVE_CC + AC_LANG_RESTORE fi dnl Checks for header files.