Fix and enable the autoconf test to allow the faster version of NS_LITERAL_STRING on compilers where sizeof(wchar_t) == 2 or compilers (such as gcc 2.96+) that accept -fshort-wchar to force this. r=waterson@netscape.com sr=cls@seawood.org b=54564
This commit is contained in:
Родитель
6af210070c
Коммит
2ff6dea99f
39
configure.in
39
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 <wchar.h>
|
||||
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 <wchar.h>
|
||||
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче