if test "$wxUSE_MAC" = 1; then
if test "$wxUSE_PRECOMP" = "yes"; then
CPPFLAGS="$CPPFLAGS -cpp-precomp"
+ else
+ CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
fi
CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon -I\${top_srcdir}/src/mac/morefile"
CFLAGS="$CFLAGS -fpascal-strings"
dnl defines uid_t and gid_t if not already defined
AC_TYPE_UID_T
-dnl check for wchar_t
-dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
-dnl on Cygwin wchar.h needs stddef.h to be #included by hand
-AC_CACHE_CHECK([for wchar_t], wx_cv_type_wchar_t,
-[
- AC_TRY_COMPILE(
- [
- #ifdef HAVE_WCHAR_H
- # ifdef __CYGWIN__
- # include <stddef.h>
- # endif
- # include <wchar.h>
- #endif
- #ifdef HAVE_STDLIB_H
- # include <stdlib.h>
- #endif
- ],
- [
- wchar_t wc, *ws;
- wc = L'a';
- ws = L"Hello, world!";
- ],
- wx_cv_type_wchar_t=yes,
- wx_cv_type_wchar_t=no
- )
-])
-
-if test "$wx_cv_type_wchar_t" = "yes"; then
- AC_DEFINE(wxUSE_WCHAR_T)
-fi
-
dnl check what exactly size_t is on this machine - this is necessary to avoid
dnl ambiguos overloads in several places, notably wx/string.h and wx/array.h
AC_LANG_SAVE
dnl Check for functions
dnl ---------------------------------------------------------------------------
-dnl check for wcslen
-AC_CHECK_LIB(c, wcslen, [
- AC_DEFINE(HAVE_WCSLEN)
- WCHAR_LINK=
- ], [
- AC_CHECK_LIB(w, wcslen, [
- AC_DEFINE(HAVE_WCSLEN)
- WCHAR_LINK=" -lw"
- ], [
- AC_CHECK_LIB(msvcrt, wcslen, [
+dnl don't check for wchar_t functions if we haven't got wchar_t itself
+WCHAR_OK=0
+if test "$wx_cv_sizeof_wchar_t" != "0"; then
+ dnl check for wcslen
+ WCHAR_LINK=
+ AC_CHECK_FUNCS(wcslen, [
AC_DEFINE(HAVE_WCSLEN)
- WCHAR_LINK=
- ])
+ WCHAR_OK=1
+ ])
+
+ if test "$WCHAR_OK" = 0; then
+ if test "$TOOLKIT" = "MSW"; then
+ AC_CHECK_LIB(msvcrt, wcslen, [
+ AC_DEFINE(HAVE_WCSLEN)
+ WCHAR_OK=1
])
- ])
+ else
+ AC_CHECK_LIB(w, wcslen, [
+ AC_DEFINE(HAVE_WCSLEN)
+ WCHAR_LINK=" -lw"
+ WCHAR_OK=1
+ ])
+ fi
+ fi
+fi
-dnl use wcsrtombs instead of wcstombs which is buggy in old GNU libc versions
-dnl if possible
-AC_CHECK_FUNCS(wcsrtombs)
+dnl we need at least the definition of wchar_t itself and wcslen() to compile
+dnl with wchar_t support -- turn it off if we don't have this
+if test "$WCHAR_OK" = 1; then
+ AC_DEFINE(wxUSE_WCHAR_T)
+
+ dnl also try to use wcsrtombs instead of wcstombs which is buggy in old GNU
+ dnl libc versions if possible
+ AC_CHECK_FUNCS(wcsrtombs)
+else
+ AC_MSG_WARN([Wide character support is unavailable])
+fi
dnl check for vprintf/vsprintf() which are GNU extensions
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strptime)
dnl check for timezone variable
+ dnl doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead
AC_CACHE_CHECK(for timezone variable in <time.h>,
wx_cv_var_timezone,
[
],
[
if test "$USE_DOS" = 0 ; then
- AC_MSG_ERROR(no timezone variable)
+ AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead)
fi
]
)