mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
More robust check for Windows ICU
Also ensure that we don't include both unicode/*.h and icu.h.
This commit is contained in:
parent
5120069a88
commit
b41953d274
8 changed files with 35 additions and 52 deletions
|
@ -55,8 +55,7 @@
|
|||
#endif
|
||||
#if defined(HAVE_UNICODE_UCNV_H)
|
||||
#include <unicode/ucnv.h>
|
||||
#endif
|
||||
#if defined(HAVE_ICU_H)
|
||||
#elif defined(HAVE_ICU_H)
|
||||
#include <icu.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
#if defined(HAVE_UNICODE_UTEXT_H)
|
||||
#include <unicode/utext.h>
|
||||
#endif
|
||||
#if defined(HAVE_ICU_H)
|
||||
#elif defined(HAVE_ICU_H)
|
||||
#include <icu.h>
|
||||
// icu.h in Windows 10 is missing a declaration of UTEXT_MAGIC
|
||||
#ifndef UTEXT_MAGIC
|
||||
|
|
|
@ -46,15 +46,12 @@
|
|||
#import "Foundation/NSDateFormatter.h"
|
||||
#import "Foundation/NSCoder.h"
|
||||
|
||||
#if defined(HAVE_UNICODE_UDAT_H)
|
||||
#if defined(HAVE_UNICODE_UDAT_H) && defined(HAVE_UNICODE_UDATPG_H)
|
||||
#define id id_ucal
|
||||
#include <unicode/udat.h>
|
||||
#undef id
|
||||
#endif
|
||||
#if defined(HAVE_UNICODE_UDATPG_H)
|
||||
#include <unicode/udatpg.h>
|
||||
#endif
|
||||
#if defined(HAVE_ICU_H)
|
||||
#elif defined(HAVE_ICU_H)
|
||||
#include <icu.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -54,8 +54,7 @@
|
|||
|
||||
#if defined(HAVE_UNICODE_UREGEX_H)
|
||||
#include <unicode/uregex.h>
|
||||
#endif
|
||||
#if defined(HAVE_ICU_H)
|
||||
#elif defined(HAVE_ICU_H)
|
||||
#include <icu.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
#if GS_USE_ICU == 1
|
||||
#if defined(HAVE_UNICODE_UREGEX_H)
|
||||
#include <unicode/uregex.h>
|
||||
#endif
|
||||
#if defined(HAVE_ICU_H)
|
||||
#elif defined(HAVE_ICU_H)
|
||||
#include <icu.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -120,8 +120,7 @@
|
|||
#define id id_ucal
|
||||
#include <unicode/ucal.h>
|
||||
#undef id
|
||||
#endif
|
||||
#if defined(HAVE_ICU_H)
|
||||
#elif defined(HAVE_ICU_H)
|
||||
#include <icu.h>
|
||||
#endif
|
||||
|
||||
|
|
54
configure
vendored
54
configure
vendored
|
@ -13242,6 +13242,8 @@ if test "x$enable_icu" = "xyes"; then :
|
|||
case "$target_os" in
|
||||
mingw*|windows)
|
||||
# check for ICU bundled with Windows 10
|
||||
old_LIBS="$LIBS"
|
||||
LIBS="-licu $LIBS"
|
||||
for ac_header in icu.h
|
||||
do :
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "icu.h" "ac_cv_header_icu_h" "$ac_includes_default"
|
||||
|
@ -13249,54 +13251,36 @@ if test "x$ac_cv_header_icu_h" = xyes; then :
|
|||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_ICU_H 1
|
||||
_ACEOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for udat_open in -licu" >&5
|
||||
$as_echo_n "checking for udat_open in -licu... " >&6; }
|
||||
if ${ac_cv_lib_icu_udat_open+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
if test "$cross_compiling" = yes; then :
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error $? "cannot run test program while cross compiling
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-licu $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char udat_open ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return udat_open ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#include <icu.h>
|
||||
int main () {
|
||||
return udat_countAvailable() > 0 ? 0 : 1;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_icu_udat_open=yes
|
||||
else
|
||||
ac_cv_lib_icu_udat_open=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_icu_udat_open" >&5
|
||||
$as_echo "$ac_cv_lib_icu_udat_open" >&6; }
|
||||
if test "x$ac_cv_lib_icu_udat_open" = xyes; then :
|
||||
if ac_fn_c_try_run "$LINENO"; then :
|
||||
HAVE_ICU=1
|
||||
fi
|
||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
LIBS="$old_LIBS"
|
||||
if test $HAVE_ICU = 1; then
|
||||
ICU_LIBS=-licu
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Using ICU DLL from Windows 10 (requires version 1903 or later)" >&5
|
||||
$as_echo "$as_me: Using ICU DLL from Windows 10 (requires version 1903 or later)" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Using system-provided ICU DLL (requires Windows 10 version 1903 or later)" >&5
|
||||
$as_echo "$as_me: Using system-provided ICU DLL (requires Windows 10 version 1903 or later)" >&6;}
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
11
configure.ac
11
configure.ac
|
@ -3496,11 +3496,18 @@ AS_IF([test "x$enable_icu" = "xyes"], [
|
|||
case "$target_os" in
|
||||
mingw*|windows)
|
||||
# check for ICU bundled with Windows 10
|
||||
old_LIBS="$LIBS"
|
||||
LIBS="-licu $LIBS"
|
||||
AC_CHECK_HEADERS([icu.h],
|
||||
AC_CHECK_LIB(icu, udat_open, HAVE_ICU=1))
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([
|
||||
#include <icu.h>
|
||||
int main () {
|
||||
return udat_countAvailable() > 0 ? 0 : 1;
|
||||
}])], HAVE_ICU=1))
|
||||
LIBS="$old_LIBS"
|
||||
if test $HAVE_ICU = 1; then
|
||||
ICU_LIBS=-licu
|
||||
AC_MSG_NOTICE([Using ICU DLL from Windows 10 (requires version 1903 or later)])
|
||||
AC_MSG_NOTICE([Using system-provided ICU DLL (requires Windows 10 version 1903 or later)])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue