- dnl check if <string> declares std::wstring
- AC_MSG_CHECKING([for $std_string in <string>])
- AC_TRY_COMPILE([#include <string>],
- [$std_string foo;],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_STD_WSTRING)],
- [AC_MSG_RESULT(no)
- AC_MSG_CHECKING([if std::basic_string<$char_type> works])
- 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
- #include <stdio.h>
- #include <string>
- ],
- [std::basic_string<$char_type> foo;
- const $char_type* dummy = foo.c_str();],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT([no])
- if test "$wxUSE_STL" = "yes"; then
- AC_MSG_ERROR([Can't use --enable-stl without $std_string or std::basic_string<$char_type>])
- elif grep wxUSE_STD_STRING $wx_arg_cache_file >/dev/null; then
- AC_MSG_ERROR([Can't use --enable-std_string without $std_string or std::basic_string<$char_type>])
- else
- AC_MSG_WARN([No $std_string or std::basic_string<$char_type>, switching to --disable-std_string])
- wxUSE_STD_STRING=no
- fi
- ]
- )
- ])
+ dnl check if <string> declares std::[w]string
+ AC_CACHE_CHECK([for $std_string in <string>],
+ wx_cv_class_stdstring,
+ [
+ AC_TRY_COMPILE([#include <string>],
+ [$std_string foo;],
+ wx_cv_class_stdstring=yes,
+ wx_cv_class_stdstring=no
+ )
+ ]
+ )
+
+ if test "$wx_cv_class_stdstring" = yes; then
+ if test "$wxUSE_UNICODE" = "yes"; then
+ AC_DEFINE(HAVE_STD_WSTRING)
+ fi
+ dnl we don't need HAVE_STD_STRING, we just suppose it's available if
+ dnl wxUSE_STD_STRING==yes
+ else
+ AC_CACHE_CHECK([if std::basic_string<$char_type> works],
+ wx_cv_class_stdbasicstring,
+ [
+ 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
+ #include <stdio.h>
+ #include <string>
+ ],
+ [std::basic_string<$char_type> foo;
+ const $char_type* dummy = foo.c_str();],
+ wx_cv_class_stdbasicstring=yes,
+ wx_cv_class_stdbasicstring=no
+ )
+ ]
+ )
+
+ if test "$wx_cv_class_stdbasicstring" != yes; then
+ if test "$wxUSE_STL" = "yes"; then
+ AC_MSG_ERROR([Can't use --enable-stl without $std_string or std::basic_string<$char_type>])
+ elif grep wxUSE_STD_STRING $wx_arg_cache_file >/dev/null; then
+ AC_MSG_ERROR([Can't use --enable-std_string without $std_string or std::basic_string<$char_type>])
+ else
+ AC_MSG_WARN([No $std_string or std::basic_string<$char_type>, switching to --disable-std_string])
+ wxUSE_STD_STRING=no
+ fi
+ fi
+ fi