зеркало из https://github.com/mozilla/gecko-dev.git
Bug 946687 - Move ICU detection from configure.in and js/src/configure.in into build/autoconf/icu.m4. r=gps
This commit is contained in:
Родитель
80e79be833
Коммит
740c20d702
|
@ -8,6 +8,57 @@ dnl linking against a shared library of ICU, either one that we build from
|
||||||
dnl our copy of ICU or the system provided library.
|
dnl our copy of ICU or the system provided library.
|
||||||
|
|
||||||
AC_DEFUN([MOZ_CONFIG_ICU], [
|
AC_DEFUN([MOZ_CONFIG_ICU], [
|
||||||
|
|
||||||
|
ICU_LIB_NAMES=
|
||||||
|
MOZ_NATIVE_ICU=
|
||||||
|
MOZ_ARG_WITH_BOOL(system-icu,
|
||||||
|
[ --with-system-icu
|
||||||
|
Use system ICU (located with pkgconfig)],
|
||||||
|
MOZ_NATIVE_ICU=1)
|
||||||
|
|
||||||
|
if test -n "$MOZ_NATIVE_ICU"; then
|
||||||
|
PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
|
||||||
|
MOZ_SHARED_ICU=1
|
||||||
|
else
|
||||||
|
MOZ_ICU_CFLAGS='-I$(topsrcdir)/intl/icu/source/common -I$(topsrcdir)/intl/icu/source/i18n'
|
||||||
|
AC_SUBST(MOZ_ICU_CFLAGS)
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(MOZ_NATIVE_ICU)
|
||||||
|
|
||||||
|
MOZ_ARG_WITH_STRING(intl-api,
|
||||||
|
[ --with-intl-api, --with-intl-api=build, --without-intl-api
|
||||||
|
Determine the status of the ECMAScript Internationalization API. The first
|
||||||
|
(or lack of any of these) builds and exposes the API. The second builds it
|
||||||
|
but doesn't use ICU or expose the API to script. The third doesn't build
|
||||||
|
ICU at all.],
|
||||||
|
_INTL_API=$withval)
|
||||||
|
|
||||||
|
ENABLE_INTL_API=
|
||||||
|
EXPOSE_INTL_API=
|
||||||
|
case "$_INTL_API" in
|
||||||
|
no)
|
||||||
|
;;
|
||||||
|
build)
|
||||||
|
ENABLE_INTL_API=1
|
||||||
|
;;
|
||||||
|
yes)
|
||||||
|
ENABLE_INTL_API=1
|
||||||
|
EXPOSE_INTL_API=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Invalid value passed to --with-intl-api: $_INTL_API])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -n "$EXPOSE_INTL_API"; then
|
||||||
|
AC_DEFINE(EXPOSE_INTL_API)
|
||||||
|
fi
|
||||||
|
|
||||||
|
dnl Settings for the implementation of the ECMAScript Internationalization API
|
||||||
|
if test -n "$ENABLE_INTL_API"; then
|
||||||
|
AC_DEFINE(ENABLE_INTL_API)
|
||||||
|
|
||||||
icudir="$_topsrcdir/intl/icu/source"
|
icudir="$_topsrcdir/intl/icu/source"
|
||||||
if test ! -d "$icudir"; then
|
if test ! -d "$icudir"; then
|
||||||
icudir="$_topsrcdir/../../intl/icu/source"
|
icudir="$_topsrcdir/../../intl/icu/source"
|
||||||
|
@ -28,4 +79,56 @@ AC_DEFUN([MOZ_CONFIG_ICU], [
|
||||||
|
|
||||||
AC_SUBST(MOZ_ICU_VERSION)
|
AC_SUBST(MOZ_ICU_VERSION)
|
||||||
AC_SUBST(MOZ_SHARED_ICU)
|
AC_SUBST(MOZ_SHARED_ICU)
|
||||||
|
|
||||||
|
if test -z "$MOZ_NATIVE_ICU"; then
|
||||||
|
case "$OS_TARGET" in
|
||||||
|
WINNT)
|
||||||
|
ICU_LIB_NAMES="icuin icuuc icudt"
|
||||||
|
if test -n "$MOZ_SHARED_ICU"; then
|
||||||
|
DBG_SUFFIX=
|
||||||
|
if test -n "$MOZ_DEBUG"; then
|
||||||
|
DBG_SUFFIX=d
|
||||||
|
fi
|
||||||
|
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)$1/intl/icu/target/lib/$(LIB_PREFIX)$(lib)$(DBG_SUFFIX).$(LIB_SUFFIX))'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
Darwin)
|
||||||
|
ICU_LIB_NAMES="icui18n icuuc icudata"
|
||||||
|
if test -n "$MOZ_SHARED_ICU"; then
|
||||||
|
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)$1/intl/icu/target/lib/$(DLL_PREFIX)$(lib).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
|
||||||
|
ICU_LIB_NAMES="icui18n icuuc icudata"
|
||||||
|
if test -n "$MOZ_SHARED_ICU"; then
|
||||||
|
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)$1/intl/icu/target/lib/$(DLL_PREFIX)$(lib)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
|
||||||
|
esac
|
||||||
|
if test -z "$MOZ_SHARED_ICU"; then
|
||||||
|
MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)$1/intl/icu/target/lib)'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(DBG_SUFFIX)
|
||||||
|
AC_SUBST(ENABLE_INTL_API)
|
||||||
|
AC_SUBST(ICU_LIB_NAMES)
|
||||||
|
AC_SUBST(MOZ_ICU_LIBS)
|
||||||
|
|
||||||
|
if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
|
||||||
|
dnl We build ICU as a static library for non-shared js builds and as a shared library for shared js builds.
|
||||||
|
if test -z "$MOZ_SHARED_ICU"; then
|
||||||
|
AC_DEFINE(U_STATIC_IMPLEMENTATION)
|
||||||
|
else
|
||||||
|
AC_DEFINE(U_COMBINED_IMPLEMENTATION)
|
||||||
|
fi
|
||||||
|
dnl Source files that use ICU should have control over which parts of the ICU
|
||||||
|
dnl namespace they want to use.
|
||||||
|
AC_DEFINE(U_USING_ICU_NAMESPACE,0)
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
94
configure.in
94
configure.in
|
@ -3823,26 +3823,6 @@ MOZ_ARG_ENABLE_BOOL(shared-js,
|
||||||
JS_SHARED_LIBRARY=1,
|
JS_SHARED_LIBRARY=1,
|
||||||
JS_SHARED_LIBRARY=)
|
JS_SHARED_LIBRARY=)
|
||||||
|
|
||||||
dnl ========================================================
|
|
||||||
dnl System ICU Support
|
|
||||||
dnl ========================================================
|
|
||||||
MOZ_NATIVE_ICU=
|
|
||||||
MOZ_ARG_WITH_BOOL(system-icu,
|
|
||||||
[ --with-system-icu
|
|
||||||
Use system ICU (located with pkgconfig)],
|
|
||||||
MOZ_NATIVE_ICU=1)
|
|
||||||
|
|
||||||
if test -n "$MOZ_NATIVE_ICU"; then
|
|
||||||
PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
|
|
||||||
MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS"
|
|
||||||
MOZ_SHARED_ICU=1
|
|
||||||
else
|
|
||||||
MOZ_ICU_CFLAGS='-I$(topsrcdir)/intl/icu/source/common -I$(topsrcdir)/intl/icu/source/i18n'
|
|
||||||
AC_SUBST(MOZ_ICU_CFLAGS)
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_SUBST(MOZ_NATIVE_ICU)
|
|
||||||
|
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
dnl Java SDK support
|
dnl Java SDK support
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
|
@ -8721,81 +8701,27 @@ HAVE_SYS_MOUNT_H
|
||||||
|
|
||||||
AC_SUBST(STLPORT_LIBS)
|
AC_SUBST(STLPORT_LIBS)
|
||||||
|
|
||||||
MOZ_ARG_WITH_STRING(intl-api,
|
dnl ========================================================
|
||||||
[ --with-intl-api, --with-intl-api=build, --without-intl-api
|
dnl ICU Support
|
||||||
Determine the status of the ECMAScript Internationalization API. The first
|
dnl ========================================================
|
||||||
(or lack of any of these) builds and exposes the API. The second builds it
|
|
||||||
but doesn't use ICU or expose the API to script. The third doesn't build
|
|
||||||
ICU at all.],
|
|
||||||
_INTL_API=$withval,
|
|
||||||
_INTL_API=yes)
|
|
||||||
|
|
||||||
WITH_INTL="--with-intl-api=$_INTL_API"
|
|
||||||
ENABLE_INTL_API=
|
|
||||||
case "$_INTL_API" in
|
|
||||||
no)
|
|
||||||
;;
|
|
||||||
build)
|
|
||||||
ENABLE_INTL_API=1
|
|
||||||
;;
|
|
||||||
yes)
|
|
||||||
ENABLE_INTL_API=1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([Invalid value passed to --with-intl-api: $_INTL_API])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test -n "$ENABLE_INTL_API"; then
|
|
||||||
if test "$MOZ_BUILD_APP" = "browser"; then
|
if test "$MOZ_BUILD_APP" = "browser"; then
|
||||||
WITH_INTL="--with-intl-api"
|
_INTL_API=yes
|
||||||
else
|
else
|
||||||
# Internationalization isn't built or exposed by default in non-desktop
|
# Internationalization isn't built or exposed by default in non-desktop
|
||||||
# builds. Bugs to enable:
|
# builds. Bugs to enable:
|
||||||
#
|
#
|
||||||
# Android: bug 864843
|
# Android: bug 864843
|
||||||
# B2G: bug 866301
|
# B2G: bug 866301
|
||||||
WITH_INTL="--without-intl-api"
|
_INTL_API=no
|
||||||
ENABLE_INTL_API=
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl Settings for the implementation of the ECMAScript Internationalization API
|
MOZ_CONFIG_ICU(/js/src)
|
||||||
if test -n "$ENABLE_INTL_API"; then
|
|
||||||
AC_DEFINE(ENABLE_INTL_API)
|
|
||||||
|
|
||||||
MOZ_CONFIG_ICU()
|
if test -n "$MOZ_NATIVE_ICU"; then
|
||||||
|
MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS"
|
||||||
dnl Build ICU as a shared library for shared js builds.
|
|
||||||
if test -z "$MOZ_NATIVE_ICU" -a -n "$JS_SHARED_LIBRARY"; then
|
|
||||||
case "$OS_TARGET" in
|
|
||||||
WINNT)
|
|
||||||
ICU_LIB_NAMES="icuin icuuc icudt"
|
|
||||||
DBG_SUFFIX=
|
|
||||||
if test -n "$MOZ_DEBUG"; then
|
|
||||||
DBG_SUFFIX=d
|
|
||||||
fi
|
|
||||||
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/js/src/intl/icu/target/lib/$(LIB_PREFIX)$(lib)$(DBG_SUFFIX).$(LIB_SUFFIX))'
|
|
||||||
;;
|
|
||||||
Darwin)
|
|
||||||
ICU_LIB_NAMES="icui18n icuuc icudata"
|
|
||||||
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/js/src/intl/icu/target/lib/$(DLL_PREFIX)$(lib).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))'
|
|
||||||
;;
|
|
||||||
Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
|
|
||||||
ICU_LIB_NAMES="icui18n icuuc icudata"
|
|
||||||
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/js/src/intl/icu/target/lib/$(DLL_PREFIX)$(lib)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))'
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST(DBG_SUFFIX)
|
|
||||||
AC_SUBST(ENABLE_INTL_API)
|
|
||||||
AC_SUBST(ICU_LIB_NAMES)
|
|
||||||
AC_SUBST(MOZ_ICU_LIBS)
|
|
||||||
|
|
||||||
export WRITE_MOZINFO=1
|
export WRITE_MOZINFO=1
|
||||||
AC_OUTPUT()
|
AC_OUTPUT()
|
||||||
unset WRITE_MOZINFO
|
unset WRITE_MOZINFO
|
||||||
|
@ -9011,7 +8937,9 @@ dist=$MOZ_BUILD_ROOT/dist
|
||||||
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
|
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
|
||||||
ac_configure_args="$ac_configure_args --enable-threadsafe"
|
ac_configure_args="$ac_configure_args --enable-threadsafe"
|
||||||
|
|
||||||
ac_configure_args="$ac_configure_args $WITH_INTL"
|
if test "$_INTL_API" = no; then
|
||||||
|
ac_configure_args="$ac_configure_args --without-intl-api"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$BUILD_CTYPES"; then
|
if test "$BUILD_CTYPES"; then
|
||||||
# Build js-ctypes on the platforms we can.
|
# Build js-ctypes on the platforms we can.
|
||||||
|
|
|
@ -4106,109 +4106,14 @@ fi
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
dnl ECMAScript Internationalization API Support (uses ICU)
|
dnl ECMAScript Internationalization API Support (uses ICU)
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
ICU_LIB_NAMES=
|
|
||||||
MOZ_NATIVE_ICU=
|
|
||||||
MOZ_ARG_WITH_BOOL(system-icu,
|
|
||||||
[ --with-system-icu
|
|
||||||
Use system ICU (located with pkgconfig)],
|
|
||||||
MOZ_NATIVE_ICU=1)
|
|
||||||
|
|
||||||
if test -n "$MOZ_NATIVE_ICU"; then
|
dnl top-level configure may override this with --without-intl-api
|
||||||
PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
|
_INTL_API=yes
|
||||||
MOZ_SHARED_ICU=1
|
|
||||||
else
|
|
||||||
MOZ_ICU_CFLAGS='-I$(topsrcdir)/intl/icu/source/common -I$(topsrcdir)/intl/icu/source/i18n'
|
|
||||||
AC_SUBST(MOZ_ICU_CFLAGS)
|
|
||||||
fi
|
|
||||||
|
|
||||||
MOZ_ARG_WITH_STRING(intl-api,
|
MOZ_CONFIG_ICU()
|
||||||
[ --with-intl-api, --with-intl-api=build, --without-intl-api
|
|
||||||
Determine the status of the ECMAScript Internationalization API. The first
|
|
||||||
(or lack of any of these) builds and exposes the API. The second builds it
|
|
||||||
but doesn't use ICU or expose the API to script. The third doesn't build
|
|
||||||
ICU at all.],
|
|
||||||
_INTL_API=$withval,
|
|
||||||
_INTL_API=yes)
|
|
||||||
|
|
||||||
ENABLE_INTL_API=
|
|
||||||
EXPOSE_INTL_API=
|
|
||||||
case "$_INTL_API" in
|
|
||||||
no)
|
|
||||||
;;
|
|
||||||
build)
|
|
||||||
ENABLE_INTL_API=1
|
|
||||||
;;
|
|
||||||
yes)
|
|
||||||
ENABLE_INTL_API=1
|
|
||||||
EXPOSE_INTL_API=1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([Invalid value passed to --with-intl-api: $_INTL_API])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test -n "$EXPOSE_INTL_API"; then
|
|
||||||
AC_DEFINE(EXPOSE_INTL_API)
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Settings for the implementation of the ECMAScript Internationalization API
|
|
||||||
if test -n "$ENABLE_INTL_API"; then
|
|
||||||
AC_DEFINE(ENABLE_INTL_API)
|
|
||||||
|
|
||||||
MOZ_CONFIG_ICU()
|
|
||||||
|
|
||||||
if test -z "$MOZ_NATIVE_ICU"; then
|
|
||||||
case "$OS_TARGET" in
|
|
||||||
WINNT)
|
|
||||||
ICU_LIB_NAMES="icuin icuuc icudt"
|
|
||||||
if test -n "$MOZ_SHARED_ICU"; then
|
|
||||||
DBG_SUFFIX=
|
|
||||||
if test -n "$MOZ_DEBUG"; then
|
|
||||||
DBG_SUFFIX=d
|
|
||||||
fi
|
|
||||||
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(LIB_PREFIX)$(lib)$(DBG_SUFFIX).$(LIB_SUFFIX))'
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
Darwin)
|
|
||||||
ICU_LIB_NAMES="icui18n icuuc icudata"
|
|
||||||
if test -n "$MOZ_SHARED_ICU"; then
|
|
||||||
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))'
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
|
|
||||||
ICU_LIB_NAMES="icui18n icuuc icudata"
|
|
||||||
if test -n "$MOZ_SHARED_ICU"; then
|
|
||||||
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))'
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
|
|
||||||
esac
|
|
||||||
if test -z "$MOZ_SHARED_ICU"; then
|
|
||||||
MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib)'
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_SUBST(DBG_SUFFIX)
|
|
||||||
AC_SUBST(ENABLE_INTL_API)
|
|
||||||
AC_SUBST(ICU_LIB_NAMES)
|
|
||||||
AC_SUBST(MOZ_ICU_LIBS)
|
|
||||||
AC_SUBST(MOZ_NATIVE_ICU)
|
|
||||||
|
|
||||||
dnl Settings for ICU
|
dnl Settings for ICU
|
||||||
if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
|
if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
|
||||||
dnl We build ICU as a static library for non-shared js builds and as a shared library for shared js builds.
|
|
||||||
if test -z "$MOZ_SHARED_ICU"; then
|
|
||||||
AC_DEFINE(U_STATIC_IMPLEMENTATION)
|
|
||||||
else
|
|
||||||
AC_DEFINE(U_COMBINED_IMPLEMENTATION)
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Source files that use ICU should have control over which parts of the ICU
|
|
||||||
dnl namespace they want to use.
|
|
||||||
AC_DEFINE(U_USING_ICU_NAMESPACE,0)
|
|
||||||
|
|
||||||
# Set ICU compile options
|
# Set ICU compile options
|
||||||
ICU_CPPFLAGS=""
|
ICU_CPPFLAGS=""
|
||||||
# don't use icu namespace automatically in client code
|
# don't use icu namespace automatically in client code
|
||||||
|
|
Загрузка…
Ссылка в новой задаче