diff --git a/configure.in b/configure.in index 1a3757a2240..b622562e514 100644 --- a/configure.in +++ b/configure.in @@ -1889,40 +1889,39 @@ fi dnl Check for short-wchar dnl ======================================================== -if test "$MOZ_ENABLE_SHORTWCHAR" -then - -AC_MSG_CHECKING(for size of wchar_t == 2) -AC_TRY_RUN([ int main () { - if (sizeof(wchar_t) == 2) { return 0; } return 1; } ], - result="yes", result="no", result="maybe" ) -AC_MSG_RESULT("$result") -if test "$result" = "yes"; then +AC_CACHE_CHECK(for size of wchar_t == 2, + ac_cv_have_short_wchar_t, + [AC_TRY_RUN([#include + int main () { return (sizeof(wchar_t) != 2); } ], + ac_cv_have_short_wchar_t="yes", + ac_cv_have_short_wchar_t="no", + ac_cv_have_short_wchar_t="maybe")]) +if test "$ac_cv_have_short_wchar_t" = "yes"; then AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T) HAVE_CPP_2BYTE_WCHAR_T=1 -fi - -if test ! "$HAVE_CPP_2BYTE_WCHAR_T" -then +else +dnl This is really gcc-only _SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -fshort-wchar" AC_CACHE_CHECK(for compiler short-wchar option, - ac_cv_have_short_wchar, - [AC_TRY_COMPILE(char *x;, - char y, - ac_cv_have_short_wchar=yes, - ac_cv_have_short_wchar=no)]) + ac_cv_have_short_wchar_t_option, + [AC_TRY_RUN([#include + int main () { return (sizeof(wchar_t) != 2); } ], + ac_cv_have_short_wchar_t_option="yes", + ac_cv_have_short_wchar_t_option="no", + ac_cv_have_short_wchar_t_option="maybe")]) - if test "$ac_cv_have_short_wchar" = "yes"; then + if test "$ac_cv_have_short_wchar_t_option" = "yes"; then AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T) HAVE_CPP_2BYTE_WCHAR_T=1 +dnl Is it OK to assume CXX and CC take the same arguments? + CXXFLAGS="$CXXFLAGS -fshort-wchar" else CFLAGS=$_SAVE_CFLAGS fi fi -fi dnl Checks for header files. dnl ======================================================== AC_HEADER_DIRENT