X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/0f5d89e82340278ed3d7d50029f37cab2c41a57e..a01113dcd0f39d5da295ef82785beff9ed86fe38:/icuSources/configure.ac diff --git a/icuSources/configure.ac b/icuSources/configure.ac index 7078d491..8cd270b0 100644 --- a/icuSources/configure.ac +++ b/icuSources/configure.ac @@ -16,6 +16,10 @@ AC_INIT([ICU], [International Components for Unicode], [http://icu-project.org]) +# Instruct Python to never write any byte code to the ICU source tree. +PYTHONDONTWRITEBYTECODE=1 +export PYTHONDONTWRITEBYTECODE + AC_CONFIG_MACRO_DIR([config/m4]) AC_CONFIG_SRCDIR([common/unicode/utypes.h]) @@ -100,6 +104,16 @@ UCONFIG_CPPFLAGS="" # such as -std UCONFIG_CFLAGS="" +# Check whether to install icu-config +AC_ARG_ENABLE([icu-config], + AS_HELP_STRING([--enable-icu-config], [install icu-config]), + [case "${enableval}" in + yes) enable_icu_config=true ;; + no) enable_icu_config=false ;; + *) AC_MSG_ERROR([bad value '${enableval}' for --enable-icu-config]) ;; + esac], [enable_icu_config=true]) +AC_SUBST(INSTALL_ICU_CONFIG, [$enable_icu_config]) + # Check whether to build debug libraries AC_MSG_CHECKING([whether to build debug libraries]) enabled=no @@ -185,6 +199,10 @@ fi #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true) #AC_CHECK_PROG(STRIP, strip, strip, true) +# TODO(ICU-20301): Remove fallback to Python 2. +AC_CHECK_PROGS(PYTHON, python3 "py -3" python "py") +AC_SUBST(PYTHON) + # Check for the platform make AC_PATH_PROGS(U_MAKE, gmake gnumake, make) AC_SUBST(U_MAKE) @@ -517,19 +535,6 @@ if [[ "$GXX" = yes ]]; then fi fi -AC_MSG_CHECKING([[if #include works]]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no]) -AC_MSG_RESULT($ac_cv_header_atomic) -if test $ac_cv_header_atomic = yes -then - U_HAVE_ATOMIC=1 -else - U_HAVE_ATOMIC=0 -fi -# Make this available via CPPFLAGS -CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=${U_HAVE_ATOMIC}" -AC_SUBST(U_HAVE_ATOMIC) - AC_LANG_POP([C++]) # Always build ICU with multi-threading support. @@ -1291,13 +1296,13 @@ fi # Now that we're done using CPPFLAGS etc. for tests, we can change it # for build. -if test "${CC}" == "clang"; then +if test "${CC}" = "clang"; then CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality" else CLANGCFLAGS="" fi -if test "${CXX}" == "clang++"; then +if test "${CXX}" = "clang++"; then CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality" else CLANGCXXFLAGS="" @@ -1386,6 +1391,39 @@ AC_CONFIG_FILES([icudefs.mk \ samples/cal/Makefile samples/layout/Makefile]) AC_OUTPUT +if test -z "$PYTHON"; +then + echo "" > data/rules.mk + echo "" > test/testdata/rules.mk +else + if test -f "$srcdir/data/locales/root.txt"; + then + echo "Spawning Python to generate data/rules.mk..." + PYTHONPATH="$srcdir/data" $PYTHON -m buildtool \ + --mode gnumake \ + --seqmode parallel \ + --src_dir "$srcdir/data" \ + --filter_file "$ICU_DATA_FILTER_FILE" \ + $ICU_DATA_BUILDTOOL_OPTS \ + > data/rules.mk + if test "$?" != "0"; then + AC_MSG_ERROR(Python failed to run; see above error.) + fi + else + echo "Not rebuilding data/rules.mk, assuming prebuilt data in data/in" + touch data/rules.mk + fi + echo "Spawning Python to generate test/testdata/rules.mk..." + PYTHONPATH="$srcdir/test/testdata:$srcdir/data" $PYTHON -m buildtool \ + --mode gnumake \ + --seqmode parallel \ + --src_dir "$srcdir/test/testdata" \ + > test/testdata/rules.mk + if test "$?" != "0"; then + AC_MSG_ERROR(Python failed to run; see above error.) + fi +fi + echo echo "ICU for C/C++ $VERSION is ready to be built." echo "=== Important Notes: ===" @@ -1465,4 +1503,9 @@ then echo "## Expect build failures in the 'data', 'test', and other directories." fi +if test -z "$PYTHON"; +then + echo "** Note: Python not found. You will not be able to build data from source or run tests." +fi + $as_unset _CXX_CXXSUFFIX