[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])
# 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
#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)
fi
fi
-AC_MSG_CHECKING([[if #include <atomic> works]])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [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.
# 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=""
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: ==="
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