diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/configure.in b/configure.in index 28fb1ffc..6439edc2 100644 --- a/configure.in +++ b/configure.in @@ -107,31 +107,48 @@ AC_STDC_HEADERS AM_PROG_LIBTOOL +AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h) + dnl dnl Detect supported locale dnl XSLT_LOCALE_XLOCALE=0 -XSLT_LOCALE_MSVCRT=0 +XSLT_LOCALE_WINAPI=0 -AC_CHECK_HEADERS([xlocale.h]) +AC_CHECK_HEADERS([locale.h xlocale.h]) if test $ac_cv_header_xlocale_h = yes; then -AC_MSG_CHECKING([for working xlocale]) -AC_RUN_IFELSE(AC_LANG_PROGRAM([[ +dnl +dnl Check for generic locale_t declaration +dnl +AC_MSG_CHECKING([if xlocale program link]) +AC_LINK_IFELSE(AC_LANG_PROGRAM([[ +#ifdef HAVE_LOCALE_H #include <locale.h> +#endif +#ifdef HAVE_XLOCALE_H #include <xlocale.h> +#endif +#ifdef HAVE_STRING_H #include <string.h> +#endif +#ifdef HAVE_STDLIB_H #include <stdlib.h> +#endif +#ifdef __GLIBC__ +typedef __locale_t xsltLocale; +#else +typedef locale_t xsltLocale; +#endif #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 2 -#define locale_t __locale_t #define newlocale __newlocale #define freelocale __freelocale #define strxfrm_l __strxfrm_l #define LC_COLLATE_MASK (1 << LC_COLLATE) #endif ]],[[ - locale_t locale; + xsltLocale locale; const char *src[[2]] = { "\xc3\x84rger", "Zeppelin" }; char *dst[[2]]; size_t len, r; @@ -152,24 +169,23 @@ AC_RUN_IFELSE(AC_LANG_PROGRAM([[ return(0); ]]), [AC_MSG_RESULT(yes); XSLT_LOCALE_XLOCALE=1], - [AC_MSG_RESULT(no)], - [AC_MSG_WARN([cross compiling: assuming no])] + [AC_MSG_RESULT(no)] ) else - dnl defined in msvcrt - AC_CHECK_FUNC(_create_locale, - [XSLT_LOCALE_MSVCRT=1] - ) + case "$host" in + *-*-mingw*) + AC_MSG_NOTICE([using winapi locale]) + XSLT_LOCALE_WINAPI=1;; + esac fi AC_SUBST(XSLT_LOCALE_XLOCALE) -AC_SUBST(XSLT_LOCALE_MSVCRT) +AC_SUBST(XSLT_LOCALE_WINAPI) dnl dnl Math detection dnl -AC_CHECK_HEADERS(sys/types.h sys/time.h stdlib.h unistd.h string.h) AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h) AC_CHECK_HEADERS(sys/timeb.h time.h sys/stat.h sys/select.h stdarg.h) AC_CHECK_FUNCS(stat _stat) |