Only check for & use -fshort-wchar with CXX as some versions of gcc only support -fshort-wchar for g++.

Bug #139211 r=bryner
This commit is contained in:
seawood%netscape.com 2002-04-25 22:18:43 +00:00
Родитель 065d4ba854
Коммит 8210816284
1 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

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