2 AC_COPYRIGHT([ Copyright (C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html ])
3 # AC_COPYRIGHT([ Copyright (c) 1999-2015, International Business Machines Corporation and others. All Rights Reserved. ])
5 # Stephen F. Booth, heavily modified by Yves and others
7 # NOTE: please use 'autoreconf' to rebuild, otherwise 'aclocal && autoconf'.
9 # Check for autoconf version
12 # Process this file with autoreconf to produce a configure script
14 m4_esyscmd_s([sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "./common/unicode/uvernum.h]"),
15 [http://icu-project.org/bugs],
16 [International Components for Unicode],
17 [http://icu-project.org])
19 # Instruct Python to never write any byte code to the ICU source tree.
20 PYTHONDONTWRITEBYTECODE=1
21 export PYTHONDONTWRITEBYTECODE
23 AC_CONFIG_MACRO_DIR([config/m4])
24 AC_CONFIG_SRCDIR([common/unicode/utypes.h])
29 # Use custom echo test for newline option
30 # Current autoconf (2.65) gives incorrect echo newline option
32 # This may be removed later - mow (June 17, 2010)
33 ICU_ECHO_C= ICU_ECHO_N= ICU_ECHO_T=
34 case `/bin/sh -c "echo -n x"` in
36 case `/bin/sh -c "echo 'x\c'"` in
37 *c*) ICU_ECHO_T=' ';; # ECHO_T is single tab character.
47 AC_MSG_CHECKING(for ICU version numbers)
49 # Get the ICU version from uversion.h or other headers
51 [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
54 [sed -n 's/^[ ]*#[ ]*define[ ]*U_UNICODE_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
56 VERSION=`geticuversion $srcdir/common/unicode/uvernum.h`
57 if test x"$VERSION" = x; then
58 as_fn_error $? "Cannot determine ICU version number from uvernum.h header file" "$LINENO" 5
62 #if test "$VERSION" != "$PACKAGE_VERSION"; then
63 # AC_MSG_ERROR([configure was generated for $PACKAGE_VERSION but uvernum.h has $VERSION - please rerun autoconf])
66 UNICODE_VERSION=`getuversion $srcdir/common/unicode/uchar.h`
67 if test x"$UNICODE_VERSION" = x; then
68 AC_MSG_ERROR([Cannot determine Unicode version number from uchar.h header file])
70 # Compute a reasonable library version from the release version. This is
71 # very bad, but that's wanted... We want to make sure that the LIB_VERSION
72 # has at least a dot in it, so we'll add a .0 if needed.
73 #[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
75 LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
78 AC_SUBST(LIB_VERSION_MAJOR)
79 AC_MSG_RESULT([release $VERSION, library $LIB_VERSION, unicode version $UNICODE_VERSION])
81 AC_SUBST(UNICODE_VERSION)
83 # Determine the host system
88 # This variable is needed on z/OS because the C++ compiler only recognizes .C
94 # CONFIG_CPPFLAGS: These are defines that are set for ICU Build time only.
95 # They are only needed for building ICU itself. Example: platform stuff
97 # UCONFIG_CPPFLAGS: These are defines which are set for ICU build time,
98 # and also a notice is output that they need to be set
99 # for end-users of ICU also. uconfig.h.prepend is generated
100 # with, for example, "#define U_DISABLE_RENAMING 1"
101 # Example: ICU configuration stuff
103 # UCONFIG_CFLAGS: contains a copy of anything that needs to be set by end users
107 # Check whether to install icu-config
108 AC_ARG_ENABLE([icu-config],
109 AS_HELP_STRING([--enable-icu-config], [install icu-config]),
110 [case "${enableval}" in
111 yes) enable_icu_config=true ;;
112 no) enable_icu_config=false ;;
113 *) AC_MSG_ERROR([bad value '${enableval}' for --enable-icu-config]) ;;
114 esac], [enable_icu_config=true])
115 AC_SUBST(INSTALL_ICU_CONFIG, [$enable_icu_config])
117 # Check whether to build debug libraries
118 AC_MSG_CHECKING([whether to build debug libraries])
122 [ --enable-debug build debug libraries and enable the U_DEBUG define [default=no]],
123 [ case "${enableval}" in
124 yes|"") enabled=yes; ENABLE_DEBUG=1; CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEBUG=1" ;;
128 AC_MSG_RESULT($enabled)
129 AC_SUBST(ENABLE_DEBUG)
131 # Check whether to build release libraries
132 AC_MSG_CHECKING([whether to build release libraries])
135 AC_ARG_ENABLE(release,
136 [ --enable-release build release libraries [default=yes]],
137 [ case "${enableval}" in
138 no) enabled=no; ENABLE_RELEASE=0 ;;
142 AC_MSG_RESULT($enabled)
143 AC_SUBST(ENABLE_RELEASE)
145 # Don't use the default C/CXXFLags
149 # Checks for compilers
150 AC_PROG_CC([clang gcc cc c99 c89 xlc_r xlc cl.exe icc])
151 # Make sure that we try clang++ first, which provides C++11 support.
152 # The g++ compiler is less likely to support C++11.
153 AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RCC])
155 # pkg-config is needed for harfbuzz support
156 PKG_PROG_PKG_CONFIG([0.20])
157 PKG_CHECK_MODULES(ICULEHB, icu-le-hb, have_icu_le_hb=true, :)
159 # Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option
160 # The release mode use is the default one for autoconf
161 if test "$GCC" = yes; then
162 if test "$CFLAGS" = ""; then
163 if test "$ENABLE_DEBUG" = 1; then
166 if test "$ENABLE_RELEASE" = 1; then
170 if test "$CXXFLAGS" = ""; then
171 if test "$ENABLE_DEBUG" = 1; then
174 if test "$ENABLE_RELEASE" = 1; then
175 CXXFLAGS="$CXXFLAGS -O2"
184 AC_SUBST(cross_compiling)
186 dnl use the pld hack to get ac_fn_cxx_try_link defined globally and not local
188 AC_LINK_IFELSE([AC_LANG_PROGRAM()])
191 # make sure install is relative to srcdir - if a script
192 if test "$srcdir" = "."; then
193 # If srcdir isn't just ., then (srcdir) is already prepended.
194 if test "${ac_install_sh}" = "${INSTALL}"; then
195 INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
199 #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
200 #AC_CHECK_PROG(STRIP, strip, strip, true)
202 # TODO(ICU-20301): Remove fallback to Python 2.
203 AC_CHECK_PROGS(PYTHON, python3 "py -3" python "py")
206 # Check for the platform make
207 AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
211 AC_ARG_WITH(cross-build,
212 [ --with-cross-build=dir specify an absolute path to the build directory of an ICU built for the current platform [default=no cross dir]],
213 [cross_buildroot="${withval}"],
214 [cross_buildroot=""])
216 if test "X$cross_buildroot" = "X"; then
217 if test "$cross_compiling" = "yes"; then
218 AC_MSG_ERROR([Error! Cross compiling but no --with-cross-build option specified - please supply the path to an executable ICU's build root])
222 if test -f "${cross_buildroot}/config/icucross.mk"; then
223 AC_MSG_RESULT([Using cross buildroot: $cross_buildroot])
225 if test -d "${cross_buildroot}"; then
226 AC_MSG_ERROR([${cross_buildroot}/config/icucross.mk not found. Please build ICU in ${cross_buildroot} first.])
228 AC_MSG_ERROR([No such directory ${cross_buildroot} supplied as the argument to --with-cross-build. Use an absolute path.])
232 AC_SUBST(cross_buildroot)
234 # Check for doxygen to generate documentation
235 AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
237 # Check that the linker is usable
240 # Determine the executable suffix
241 # We don't use AC_EXEEXT because some compilers output separate debugging
242 # files, which confuses the AC_EXEEXT macro.
243 AC_MSG_CHECKING(checking for executable suffix)
245 *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;;
249 AC_MSG_RESULT($EXEEXT)
252 # Determine how strict we want to be when compiling
253 AC_CHECK_STRICT_COMPILE
255 # Check if we can build and use 64-bit libraries
258 AC_SUBST(COMPILE_LINK_ENVVAR)
260 # Determine the Makefile fragment
263 # Checks for libraries and other host specific stuff
264 # On HP/UX, don't link to -lm from a shared lib because it isn't
265 # PIC (at least on 10.2)
267 *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
269 *) AC_CHECK_LIB(m, floor)
274 # Check whether to build shared libraries
275 AC_MSG_CHECKING([whether to build shared libraries])
277 AC_ARG_ENABLE(shared,
278 [ --enable-shared build shared libraries [default=yes]],
279 [ case "${enableval}" in
280 yes|"") enabled=yes; ENABLE_SHARED=YES ;;
284 [enabled=yes; ENABLE_SHARED=YES]
286 AC_MSG_RESULT($enabled)
287 AC_SUBST(ENABLE_SHARED)
289 # Check whether to build static libraries
290 AC_MSG_CHECKING([whether to build static libraries])
292 AC_ARG_ENABLE(static,
293 [ --enable-static build static libraries [default=no]],
294 [ case "${enableval}" in
295 yes|"") enabled=yes; ENABLE_STATIC=YES ;;
300 AC_MSG_RESULT($enabled)
301 AC_SUBST(ENABLE_STATIC)
303 # When building release static library, there might be some optimization flags we can use
304 if test "$ENABLE_STATIC" = "YES"; then
305 if test "$ENABLE_SHARED" != "YES"; then
306 if test "$ENABLE_RELEASE" = 1; then
307 AC_MSG_CHECKING([whether we can use static library optimization option])
308 CHECK_STATIC_OPT_FLAG=no
310 OLD_CPPFLAGS="${CPPFLAGS}"
311 OLD_LDFLAGS="${LDFLAGS}"
314 *-linux*|i*86-*-*bsd*|i*86-pc-gnu)
315 if test "$GCC" = yes; then
316 CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections"
317 LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
324 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [CHECK_STATIC_OPT_FLAG=yes], [CHECK_STATIC_OPT_FLAG=no])
325 AC_MSG_RESULT($CHECK_STATIC_OPT_FLAG)
326 if test "$CHECK_STATIC_OPT_FLAG" = no; then
327 CPPFLAGS="${OLD_CPPFLAGS}"
328 LDFLAGS="${OLD_LDFLAGS}"
335 # Check whether to enable auto cleanup of libraries
336 AC_MSG_CHECKING([whether to enable auto cleanup of libraries])
338 UCLN_NO_AUTO_CLEANUP=1
339 AC_ARG_ENABLE(auto-cleanup,
340 [ --enable-auto-cleanup enable auto cleanup of libraries [default=no]],
341 [ case "${enableval}" in
343 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DUCLN_NO_AUTO_CLEANUP=0";
344 UCLN_NO_AUTO_CLEANUP=0
349 AC_MSG_RESULT($enabled)
350 AC_SUBST(UCLN_NO_AUTO_CLEANUP)
352 # MSVC floating-point option
354 if test $enabled = yes
356 if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc
358 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
359 #if defined _MSC_VER && _MSC_VER >= 1400
361 Microsoft Visual C++ < 2005
363 ]], [[]])],[MSVC_RELEASE_FLAG="/fp:precise"],[MSVC_RELEASE_FLAG="/Op"])
365 CFLAGS="${CFLAGS} ${MSVC_RELEASE_FLAG}"
366 CXXFLAGS="${CXXFLAGS} ${MSVC_RELEASE_FLAG}"
370 # Check whether to enabled draft APIs
371 AC_MSG_CHECKING([whether to enable draft APIs])
373 U_DEFAULT_SHOW_DRAFT=1
375 [ --enable-draft enable draft APIs (and internal APIs) [default=yes]],
376 [ case "${enableval}" in
377 no) enabled=no; U_DEFAULT_SHOW_DRAFT=0;
378 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEFAULT_SHOW_DRAFT=0"
383 AC_MSG_RESULT($enabled)
384 # Make sure that we can use draft API in ICU.
385 if test "$U_DEFAULT_SHOW_DRAFT" = 0; then
386 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_SHOW_DRAFT_API -DU_SHOW_INTERNAL_API"
388 AC_SUBST(U_DEFAULT_SHOW_DRAFT)
395 # look for 'ar' the proper way
396 AC_CHECK_TOOL(AR, ar, false)
398 AC_MSG_CHECKING([whether to enable renaming of symbols])
401 AC_ARG_ENABLE(renaming,
402 [ --enable-renaming add a version suffix to symbols [default=yes]],
403 [ case "${enableval}" in
404 yes|"") enabled=yes ;;
405 no) enabled=no; U_DISABLE_RENAMING=1;
406 UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_DISABLE_RENAMING=1"
411 AC_MSG_RESULT($enabled)
412 AC_SUBST(U_DISABLE_RENAMING)
414 AC_MSG_CHECKING([whether to enable function and data tracing])
417 AC_ARG_ENABLE(tracing,
418 [ --enable-tracing enable function and data tracing [default=no]],
419 [ case "${enableval}" in
421 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_TRACING=1";
422 U_ENABLE_TRACING=1 ;;
423 no) enabled=no; U_ENABLE_TRACING=0 ;;
427 AC_MSG_RESULT($enabled)
428 AC_SUBST(U_ENABLE_TRACING)
430 # check if elf.h is present.
431 AC_CHECK_HEADERS([elf.h])
432 if test "x$ac_cv_header_elf_h" = "xyes"; then
433 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1";
436 # Enable/disable plugins
437 AC_ARG_ENABLE(plugins,
438 [ --enable-plugins enable plugins [default=no]],
439 [case "${enableval}" in
442 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugins) ;;
445 ICU_CONDITIONAL(PLUGINS, test "$plugins" = true)
447 if test "x$plugins" = "xtrue"; then
448 UCONFIG_CPPFLAGS="$UCONFIG_CPPFLAGS -DUCONFIG_ENABLE_PLUGINS=1"
454 AC_MSG_CHECKING([whether to enable dynamic loading of plugins. Ignored if plugins disabled.])
455 AC_ARG_ENABLE(dyload,
456 [ --disable-dyload disable dynamic loading [default=no]],
457 [ case "${enableval}" in
465 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_DYLOAD=0";
470 AC_MSG_RESULT($enable)
471 AC_SUBST(U_ENABLE_DYLOAD)
473 if test "$enable" = "yes"; then
474 AC_CHECK_HEADERS([dlfcn.h])
475 #AC_MSG_RESULT($enabled)
476 AC_SEARCH_LIBS([dlopen], [dl])
477 AC_CHECK_FUNCS([dlopen])
479 if test "x$ac_cv_func_dlopen" != xyes; then
480 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DHAVE_DLOPEN=0"
484 # Check for miscellanous functions.
485 # So, use for putil / tools only.
486 # Note that this will generate HAVE_GETTIMEOFDAY, not U_HAVE_GETTIMEOFDAY
487 AC_CHECK_FUNCS([gettimeofday])
490 # Check whether to use the evil rpath or not
492 [ --enable-rpath use rpath when linking [default is only if necessary]],
493 [ case "${enableval}" in
494 yes|"") ENABLE_RPATH=YES ;;
500 AC_SUBST(ENABLE_RPATH)
505 AC_MSG_CHECKING([[if we have a C++ compiler]])
506 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx_okay=yes],[cxx_okay=no])
507 if test $cxx_okay = yes
509 AC_MSG_RESULT([[Good]])
511 AC_MSG_RESULT([[no]])
512 AC_MSG_ERROR([[C++ compiler $CXX does not work or no compiler found]])
515 if [[ "$GXX" = yes ]]; then
516 # if CXXFLAGS does not have a "-std=" setting, set it now to -std=c++11,
517 # and check that the compiler still works.
518 if ! echo "$CXXFLAGS" | grep '\-std=' >/dev/null 2>&1; then
519 OLD_CXXFLAGS="${CXXFLAGS}"
520 CXXFLAGS="$CXXFLAGS -std=c++11"
521 AC_MSG_CHECKING([[if we have a C++11 compiler]])
522 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx11_okay=yes],[cxx11_okay=no])
523 AC_MSG_RESULT($cxx11_okay)
524 if [[ $cxx11_okay = yes ]]; then
525 AC_MSG_NOTICE([Adding CXXFLAGS option -std=c++11])
526 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -std=c++11"
528 CXXFLAGS="$OLD_CXXFLAGS"
532 CXXFLAGS="$OLD_CXXFLAGS"
540 # Always build ICU with multi-threading support.
543 # For Compaq Tru64 (OSF1), we must look for pthread_attr_init
544 # and must do this before seaching for pthread_mutex_destroy, or
545 # we will pick up libpthreads.so not libpthread.so
546 # If this fails, then we must test for HPUX specials, before
547 # moving on to a more generic test
549 AC_CHECK_LIB(pthread, pthread_attr_init)
550 if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
553 # Locate the right library for POSIX threads. We look for the
554 # symbols in the libraries first, because on Solaris libc provides
555 # pthread_create but libpthread has the real code :(
556 # AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread
557 # FreeBSD users may need libpthread if they do not have libc_r.
559 AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r )
561 if test "$ac_cv_search_pthread_mutex_destroy" != no; then
565 AC_CHECK_LIB(pthread, pthread_mutex_init)
566 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
571 AC_CHECK_FUNC(pthread_mutex_lock)
573 if test $ac_cv_func_pthread_mutex_lock = yes; then
577 # Check to see if we are using CygWin with MSVC
579 *-pc-cygwin*|*-pc-mingw*)
580 # For gcc, the thread options are set by mh-mingw/mh-cygwin
581 # For msvc, the thread options are set by runConfigureICU
585 # Add -mt because it does several nice things on newer compilers.
586 case "${icu_cv_host_frag}" in
588 OLD_CXXFLAGS="${CXXFLAGS}"
589 CXXFLAGS="${CXXFLAGS} -mt"
590 if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
591 CXXFLAGS="${OLD_CXXFLAGS}"
593 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -mt"
599 case "${icu_cv_host_frag}" in
607 AC_ARG_ENABLE(weak-threads,
608 [ --enable-weak-threads weakly reference the threading library [default=no]],
609 [case "${enableval}" in
611 LIB_THREAD="${LIBS%${OLD_LIBS}}"
615 *) AC_MSG_ERROR(bad value ${enableval} for --enable-weak-threads) ;;
621 # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
622 # Do this check instead.
624 AC_MSG_CHECKING([for mmap])
625 AC_CACHE_VAL(ac_cv_func_mmap_ok,
626 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
627 #include <sys/mman.h>
628 #include <sys/stat.h>
629 #include <fcntl.h>], [mmap((void *)0, 0, PROT_READ, 0, 0, 0);])],[ac_cv_func_mmap_ok=yes],[ac_cv_func_mmap_ok=no])] )
630 AC_MSG_RESULT($ac_cv_func_mmap_ok)
631 if test $ac_cv_func_mmap_ok = yes
635 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_MMAP=0"
639 AC_MSG_CHECKING([for genccode assembly])
641 # Check to see if genccode can generate simple assembly.
644 *-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu)
645 if test "$GCC" = yes; then
646 # We're using gcc, and the simple -a gcc command line works for genccode
647 GENCCODE_ASSEMBLY="-a gcc"
650 if test "$GCC" = yes; then
651 # When using gcc, look if we're also using GNU as.
652 # When using GNU as, the simple -a gcc command line works for genccode.
653 asv=`"${CC}" -print-prog-name=as 2>/dev/null`
654 asv=`"${asv}" --version 2>/dev/null`
656 X*GNU*) GENCCODE_ASSEMBLY="-a gcc" ;;
657 X*) GENCCODE_ASSEMBLY="-a sun-x86" ;;
661 GENCCODE_ASSEMBLY="-a sun-x86"
664 GENCCODE_ASSEMBLY="-a sun"
667 # There has been some issues with building ICU data on HPUX ia64 aCC
668 # when using the assemble code setting below. For now, build without
669 # assemble code for this platform. This will increase the build time.
670 # GENCCODE_ASSEMBLY="-a aCC-ia64"
673 AC_SUBST(GENCCODE_ASSEMBLY)
675 AC_MSG_RESULT($GENCCODE_ASSEMBLY)
677 # Checks for header files
678 AC_CHECK_HEADERS(inttypes.h)
679 if test $ac_cv_header_inttypes_h = no; then
681 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
685 if test "$CC" = ccc; then
686 AC_MSG_RESULT("C compiler set to CCC ${CC}" )
688 alpha*-*-*) U_HAVE_INTTYPES_H=0;
689 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
693 AC_SUBST(U_HAVE_INTTYPES_H)
695 AC_CHECK_HEADERS(dirent.h)
696 if test $ac_cv_header_dirent_h = no; then
698 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_DIRENT_H=0"
703 AC_SUBST(U_HAVE_DIRENT_H)
705 # Check for endianness
707 if test $ac_cv_c_bigendian = no; then
714 AC_SUBST(U_IS_BIG_ENDIAN)
716 # Do various POSIX related checks
717 U_HAVE_NL_LANGINFO_CODESET=0
718 U_NL_LANGINFO_CODESET=-1
719 AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
720 dnl AC_SUBST(U_HAVE_NL_LANGINFO)
721 if test $U_HAVE_NL_LANGINFO -eq 1; then
722 AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
723 ac_cv_nl_langinfo_codeset,
724 [ac_cv_nl_langinfo_codeset="unknown"
725 for a in CODESET _NL_CTYPE_CODESET_NAME; do
726 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo($a);]])],[ac_cv_nl_langinfo_codeset="$a"; break],[])]
728 if test x$ac_cv_nl_langinfo_codeset != xunknown
730 U_HAVE_NL_LANGINFO_CODESET=1
731 U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
732 if test "x${ac_cv_nl_langinfo_codeset}" != "xCODESET"
734 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DNL_LANGINFO_CODESET=${ac_cv_nl_langinfo_codeset}"
737 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_NL_LANGINFO_CODESET=0"
740 AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
741 AC_SUBST(U_NL_LANGINFO_CODESET)
743 # Namespace support checks
745 AC_MSG_CHECKING([for namespace support])
746 AC_CACHE_VAL(ac_cv_namespace_ok,
747 [AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace x_version {void f(){}}
748 namespace x = x_version;
749 using namespace x_version;
750 ], [f();])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] )
751 AC_MSG_RESULT($ac_cv_namespace_ok)
752 if test $ac_cv_namespace_ok = no
754 AC_MSG_ERROR(Namespace support is required to build ICU.)
757 AC_MSG_CHECKING([for properly overriding new and delete])
758 U_OVERRIDE_CXX_ALLOCATION=0
759 U_HAVE_PLACEMENT_NEW=0
760 AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
761 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
764 void *operator new(size_t size) {return malloc(size);}
765 void *operator new[](size_t size) {return malloc(size);}
766 void operator delete(void *p) {free(p);}
767 void operator delete[](void *p) {free(p);}
769 ]], [])],[ac_cv_override_cxx_allocation_ok=yes],[ac_cv_override_cxx_allocation_ok=no])] )
770 AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
771 if test $ac_cv_override_cxx_allocation_ok = yes
773 U_OVERRIDE_CXX_ALLOCATION=1
774 AC_MSG_CHECKING([for placement new and delete])
775 AC_CACHE_VAL(ac_cv_override_placement_new_ok,
776 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
779 void *operator new(size_t size) {return malloc(size);}
780 void *operator new[](size_t size) {return malloc(size);}
781 void operator delete(void *p) {free(p);}
782 void operator delete[](void *p) {free(p);}
783 void * operator new(size_t, void *ptr) { return ptr; }
784 void operator delete(void *, void *) {}
786 ]], [])],[ac_cv_override_placement_new_ok=yes],[ac_cv_override_placement_new_ok=no])] )
787 AC_MSG_RESULT($ac_cv_override_placement_new_ok)
788 if test $ac_cv_override_placement_new_ok = yes
790 U_HAVE_PLACEMENT_NEW=1
792 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_PLACEMENT_NEW=0"
795 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_OVERRIDE_CXX_ALLOCATION=0"
797 AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
798 AC_SUBST(U_HAVE_PLACEMENT_NEW)
802 if test x$ac_cv_func_popen = xyes
806 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_POPEN=0"
809 AC_SUBST(U_HAVE_POPEN)
813 if test x$ac_cv_func_tzset = xyes
818 AC_CHECK_FUNC(_tzset)
819 if test x$ac_cv_func__tzset = xyes
824 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"
827 AC_SUBST(U_HAVE_TZSET)
831 AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
832 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef _XOPEN_SOURCE
833 #define _XOPEN_SOURCE
837 #ifndef tzname /* For SGI. */
838 extern char *tzname[]; /* RS6000 and others reject char **tzname. */
839 #endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])])
840 if test $ac_cv_var_tzname = yes; then
844 AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
845 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
847 extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])])
848 if test $ac_cv_var__tzname = yes; then
852 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZNAME=0"
855 AC_SUBST(U_HAVE_TZNAME)
858 AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
859 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#ifndef _XOPEN_SOURCE
860 #define _XOPEN_SOURCE
863 ], [[timezone = 1;]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])])
865 if test $ac_cv_var_timezone = yes; then
869 AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
870 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[__timezone = 1;]])],[ac_cv_var___timezone=yes],[ac_cv_var___timezone=no])])
871 if test $ac_cv_var___timezone = yes; then
872 U_TIMEZONE=__timezone
875 AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
876 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[_timezone = 1;]])],[ac_cv_var__timezone=yes],[ac_cv_var__timezone=no])])
877 if test $ac_cv_var__timezone = yes; then
881 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TIMEZONE=0"
885 AC_SUBST(U_HAVE_TIMEZONE)
888 AC_CHECK_FUNC(strtod_l)
889 if test x$ac_cv_func_strtod_l = xyes
892 AC_CHECK_HEADER(xlocale.h)
893 if test "$ac_cv_header_xlocale_h" = yes; then
895 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1"
898 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=0"
901 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
904 AC_SUBST(U_HAVE_STRTOD_L)
906 # Checks for typedefs
907 AC_CHECK_TYPE(int8_t,signed char)
908 AC_CHECK_TYPE(uint8_t,unsigned char)
909 AC_CHECK_TYPE(int16_t,signed short)
910 AC_CHECK_TYPE(uint16_t,unsigned short)
911 AC_CHECK_TYPE(int32_t,signed long)
912 AC_CHECK_TYPE(uint32_t,unsigned long)
913 AC_CHECK_TYPE(int64_t,signed long long)
914 AC_CHECK_TYPE(uint64_t,unsigned long long)
916 if test $ac_cv_type_int8_t = no; then
917 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT8_T=0"
920 if test $ac_cv_type_uint8_t = no; then
921 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT8_T=0"
924 if test $ac_cv_type_int16_t = no; then
925 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT16_T=0"
928 if test $ac_cv_type_uint16_t = no; then
929 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT16_T=0"
932 if test $ac_cv_type_int32_t = no; then
933 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT32_T=0"
936 if test $ac_cv_type_uint32_t = no; then
937 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT32_T=0"
940 if test $ac_cv_type_int64_t = no; then
941 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT64_T=0"
944 if test $ac_cv_type_uint64_t = no; then
945 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT64_T=0"
948 # Do various wchar_t related checks
949 AC_CHECK_HEADER(wchar.h)
950 if test "$ac_cv_header_wchar_h" = no
954 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCHAR_H=0 -DU_HAVE_WCSCPY=0"
956 AC_DEFINE([HAVE_WCHAR_H], [1], [wchar.h was found.])
958 # Some broken systems have wchar.h but not some of its functions...
959 AC_SEARCH_LIBS(wcscpy, wcs w)
960 if test "$ac_cv_search_wcscpy" != no; then
964 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCSCPY=0"
967 AC_SUBST(U_HAVE_WCHAR_H)
968 AC_SUBST(U_HAVE_WCSCPY)
970 AC_CHECK_SIZEOF([wchar_t], 0, [
979 U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
980 # We do this check to verify that everything is okay.
981 if test $U_SIZEOF_WCHAR_T = 0; then
982 if test $U_HAVE_WCHAR_H=1; then
983 AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
987 AC_MSG_CHECKING([for UTF-16 string literal support])
988 U_CHECK_UTF16_STRING=1
989 CHECK_UTF16_STRING_RESULT="unknown"
992 *-*-aix*|powerpc64-*-linux*)
993 if test "$GCC" = no; then
994 OLD_CFLAGS="${CFLAGS}"
995 OLD_CXXFLAGS="${CXXFLAGS}"
996 CFLAGS="${CFLAGS} -qutf"
997 CXXFLAGS="${CXXFLAGS} -qutf"
998 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = u"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
999 if test "$U_CHECK_UTF16_STRING" = 0; then
1000 CFLAGS="${OLD_CFLAGS}"
1001 CXXFLAGS="${OLD_CXXFLAGS}"
1003 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -qutf"
1004 CHECK_UTF16_STRING_RESULT="-qutf"
1009 if test "$GCC" = no; then
1010 OLD_CFLAGS="${CFLAGS}"
1011 OLD_CXXFLAGS="${CXXFLAGS}"
1012 CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
1013 CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort"
1014 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = U"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
1015 if test "$U_CHECK_UTF16_STRING" = 0; then
1016 CFLAGS="${OLD_CFLAGS}"
1017 CXXFLAGS="${OLD_CXXFLAGS}"
1019 CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
1020 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -xustr=ascii_utf16_ushort"
1021 UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -xustr=ascii_utf16_ushort"
1022 # Since we can't detect the availability of this UTF-16 syntax at compile time,
1023 # we depend on configure telling us that we can use it.
1024 # Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
1025 # we only use this macro within ICU.
1026 # If an ICU user uses icu-config, this feature will be enabled.
1027 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_CHECK_UTF16_STRING=1"
1028 U_CHECK_UTF16_STRING=0
1033 if test "$GCC" = no; then
1034 # The option will be detected at compile time without additional compiler options.
1035 CHECK_UTF16_STRING_RESULT="available"
1039 # wchar_t can be used
1040 CHECK_UTF16_STRING_RESULT="available"
1046 # GCC >= 4.4 supports UTF16 string literals. As of ICU 62, both C and C++ files require them.
1047 if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
1048 if test "$GCC" = yes; then
1049 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1050 static const unsigned short test[] = u"This is a UTF16 literal string.";
1051 ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0])
1052 if test "$CC_UTF16_STRING" = 1; then
1053 CHECK_UTF16_STRING_RESULT="C only";
1056 if test "$GXX" = yes; then
1057 # -Wno-return-type-c-linkage is desired so that stable ICU API is not warned about.
1059 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1060 static const char16_t test[] = u"This is a UTF16 literal string.";
1061 ]], [[]])],[CXX_UTF16_STRING=1],[CXX_UTF16_STRING=0])
1063 if test "$CXX_UTF16_STRING" = 1; then
1064 if test "$CC_UTF16_STRING" = 1; then
1065 CHECK_UTF16_STRING_RESULT="available";
1067 CHECK_UTF16_STRING_RESULT="C++ only";
1072 AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT)
1074 # Enable/disable extras
1075 AC_ARG_ENABLE(extras,
1076 [ --enable-extras build ICU extras [default=yes]],
1077 [case "${enableval}" in
1080 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
1083 ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
1084 AC_ARG_ENABLE(icuio,
1085 [ --enable-icuio build ICU's icuio library [default=yes]],
1086 [case "${enableval}" in
1089 *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
1092 ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
1094 # Enable/disable layoutex
1095 AC_ARG_ENABLE(layoutex,
1096 [ --enable-layoutex build ICU's Paragraph Layout library [default=yes].
1097 icu-le-hb must be installed via pkg-config. See http://harfbuzz.org],
1098 [case "${enableval}" in
1099 yes) layoutex=$have_icu_le_hb ;;
1100 no) layoutex=false ;;
1101 *) AC_MSG_ERROR(bad value ${enableval} for --enable-layoutex) ;;
1103 layoutex=$have_icu_le_hb)
1104 ICU_CONDITIONAL(LAYOUTEX, test "$layoutex" = true)
1106 # Enable/disable layout
1107 AC_ARG_ENABLE(layout,
1109 [case "${enableval}" in
1110 yes) AC_MSG_ERROR(The ICU Layout Engine has been removed.) ;;
1116 # Enable/disable tools
1117 AC_ARG_ENABLE(tools,
1118 [ --enable-tools build ICU's tools [default=yes]],
1119 [case "${enableval}" in
1122 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
1125 ICU_CONDITIONAL(TOOLS, test "$tools" = true)
1127 AC_ARG_WITH(data-packaging,
1128 [ --with-data-packaging specify how to package ICU data. Possible values:
1129 files raw files (.res, etc)
1130 archive build a single icudtXX.dat file
1131 library shared library (.dll/.so/etc.)
1132 static static library (.a/.lib/etc.)
1133 auto build shared if possible (default)
1134 See http://userguide.icu-project.org/icudata for more info.],
1135 [case "${withval}" in
1136 files|archive|library) datapackaging=$withval ;;
1137 auto) datapackaging=$withval ;;
1138 common) datapackaging=archive ;;
1139 dll) datapackaging=library ;;
1140 static) datapackaging=static ;;
1141 *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
1145 # Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
1146 # thesysconfdir=`eval echo $sysconfdir`
1147 dnl# AC_SUBST(thesysconfdir)
1148 dnl# thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
1149 dnl# AC_SUBST(thelibdir)
1150 thedatadir=`eval echo $datadir`
1151 dnl# AC_SUBST(thedatadir)
1152 # Always put raw data files in share/icu/{version}, etc. Never use lib/icu/{version} for data files.. Actual shared libraries will go in {libdir}.
1153 pkgicudatadir=$datadir
1154 thepkgicudatadir=$thedatadir
1155 AC_SUBST(pkgicudatadir)
1156 AC_SUBST(thepkgicudatadir)
1158 dnl# Shouldn't need the AC_SUBST
1160 if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
1161 # default to library
1162 datapackaging=library
1163 if test "$ENABLE_STATIC" = "YES"; then
1164 if test "$ENABLE_SHARED" != "YES"; then
1165 datapackaging=static
1170 datapackaging_dir=`eval echo $thedatadir`"/icu/${VERSION}"
1172 datapackaging_msg="(No explaination for mode $datapackaging.)"
1174 datapackaging_msg_path="ICU will look in $datapackaging_dir which is the installation location. Call u_setDataDirectory() or use the ICU_DATA environment variable to override."
1175 datapackaging_msg_set="ICU will use the linked data library. If linked with the stub library located in stubdata/, the application can use udata_setCommonData() or set a data path to override."
1176 datapackaging_howfound="(unknown)"
1178 case "$datapackaging" in
1180 DATA_PACKAGING_MODE=files
1181 datapackaging_msg="ICU data will be stored in individual files."
1182 datapackaging_howfound="$datapackaging_msg_path"
1185 DATA_PACKAGING_MODE=common
1186 datapackaging_msg="ICU data will be stored in a single .dat file."
1187 datapackaging_howfound="$datapackaging_msg_path"
1190 DATA_PACKAGING_MODE=dll
1191 datapackaging_msg="ICU data will be linked with ICU."
1192 if test "$ENABLE_STATIC" = "YES"; then
1193 datapackaging_msg="$datapackaging_msg A static data library will be built. "
1195 if test "$ENABLE_SHARED" = "YES"; then
1196 datapackaging_msg="$datapackaging_msg A shared data library will be built. "
1198 datapackaging_howfound="$datapackaging_msg_set"
1201 DATA_PACKAGING_MODE=static
1202 datapackaging_msg="ICU data will be stored in a static library."
1203 datapackaging_howfound="$datapackaging_msg_set"
1206 AC_SUBST(DATA_PACKAGING_MODE)
1208 # Sets a library suffix
1209 AC_MSG_CHECKING([for a library suffix to use])
1210 AC_ARG_WITH(library-suffix,
1211 [ --with-library-suffix=suffix tag a suffix to the library names [default=]],
1212 [ICULIBSUFFIX="${withval}"],
1215 if test "$msg" = ""; then
1219 AC_SUBST(ICULIBSUFFIX)
1220 if test "$ICULIBSUFFIX" != ""
1223 ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
1224 UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} "
1228 AC_SUBST(U_HAVE_LIB_SUFFIX)
1229 AC_SUBST(ICULIBSUFFIXCNAME)
1231 # Enable/disable tests
1232 AC_ARG_ENABLE(tests,
1233 [ --enable-tests build ICU tests [default=yes]],
1234 [case "${enableval}" in
1237 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
1240 ICU_CONDITIONAL(TESTS, test "$tests" = true)
1242 # Enable/disable samples
1243 AC_ARG_ENABLE(samples,
1244 [ --enable-samples build ICU samples [default=yes]
1246 Additionally, the variable FORCE_LIBS may be set before calling configure.
1247 If set, it will REPLACE any automatic list of libraries.],
1248 [case "${enableval}" in
1249 yes) samples=true ;;
1250 no) samples=false ;;
1251 *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
1254 ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
1256 ICUDATA_CHAR=$U_ENDIAN_CHAR
1258 # Platform-specific Makefile setup
1259 # set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
1261 *-*-solaris*) platform=U_SOLARIS ;;
1262 *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) platform=U_LINUX ;;
1263 *-*-*bsd*|*-*-dragonfly*) platform=U_BSD ;;
1264 *-*-aix*) platform=U_AIX ;;
1265 *-*-hpux*) platform=U_HPUX ;;
1266 *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
1267 *-*-cygwin*) platform=U_CYGWIN ;;
1268 *-*-mingw*) platform=U_MINGW ;;
1269 *-*ibm-openedition*|*-*-os390*) platform=OS390
1270 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
1273 *-*-os400*) platform=OS400
1274 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
1277 *-*-nto*) platform=U_QNX ;;
1278 *-dec-osf*) platform=U_OSF ;;
1279 *-*-beos) platform=U_BEOS ;;
1280 *-*-irix*) platform=U_IRIX ;;
1281 *-ncr-*) platform=U_MPRAS ;;
1282 *) platform=U_UNKNOWN_PLATFORM ;;
1284 AC_SUBST(ICUDATA_CHAR)
1286 platform_make_fragment_name="$icu_cv_host_frag"
1287 platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
1288 AC_SUBST(platform_make_fragment_name)
1289 AC_SUBST(platform_make_fragment)
1291 if test "${FORCE_LIBS}" != ""; then
1292 echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
1296 # Now that we're done using CPPFLAGS etc. for tests, we can change it
1299 if test "${CC}" = "clang"; then
1300 CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality"
1305 if test "${CXX}" = "clang++"; then
1306 CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality"
1311 CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
1312 CFLAGS="$CFLAGS \$(THREADSCFLAGS) $CLANGCFLAGS"
1313 CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS) $CLANGCXXFLAGS"
1316 AC_SUBST(LIBCXXFLAGS)
1318 # append all config cppflags
1319 CPPFLAGS="$CPPFLAGS $CONFIG_CPPFLAGS $UCONFIG_CPPFLAGS"
1321 echo "CPPFLAGS=$CPPFLAGS"
1322 echo "CFLAGS=$CFLAGS"
1323 echo "CXXFLAGS=$CXXFLAGS"
1326 # output the Makefiles
1327 AC_CONFIG_FILES([icudefs.mk \
1329 data/pkgdataMakefile \
1330 config/Makefile.inc \
1332 config/pkgdataMakefile \
1340 extra/uconv/Makefile \
1341 extra/uconv/pkgdataMakefile \
1342 extra/scrptrun/Makefile \
1344 tools/ctestfw/Makefile \
1345 tools/toolutil/Makefile \
1346 tools/makeconv/Makefile \
1347 tools/genrb/Makefile \
1348 tools/genccode/Makefile \
1349 tools/gencmn/Makefile \
1350 tools/gencnval/Makefile \
1351 tools/gendict/Makefile \
1352 tools/gentest/Makefile \
1353 tools/gennorm2/Makefile \
1354 tools/genbrk/Makefile \
1355 tools/gensprep/Makefile \
1356 tools/icuinfo/Makefile \
1357 tools/icupkg/Makefile \
1358 tools/icuswap/Makefile \
1359 tools/pkgdata/Makefile \
1360 tools/tzcode/Makefile \
1361 tools/gencfu/Makefile \
1362 tools/escapesrc/Makefile \
1364 test/compat/Makefile \
1365 test/testdata/Makefile \
1366 test/testdata/pkgdataMakefile \
1367 test/hdrtst/Makefile \
1368 test/intltest/Makefile \
1369 test/cintltst/Makefile \
1370 test/iotest/Makefile \
1371 test/letest/Makefile \
1372 test/perf/Makefile \
1373 test/perf/collationperf/Makefile \
1374 test/perf/collperf/Makefile \
1375 test/perf/collperf2/Makefile \
1376 test/perf/dicttrieperf/Makefile \
1377 test/perf/ubrkperf/Makefile \
1378 test/perf/charperf/Makefile \
1379 test/perf/convperf/Makefile \
1380 test/perf/normperf/Makefile \
1381 test/perf/DateFmtPerf/Makefile \
1382 test/perf/howExpensiveIs/Makefile \
1383 test/perf/strsrchperf/Makefile \
1384 test/perf/unisetperf/Makefile \
1385 test/perf/usetperf/Makefile \
1386 test/perf/ustrperf/Makefile \
1387 test/perf/utfperf/Makefile \
1388 test/perf/utrie2perf/Makefile \
1389 test/perf/leperf/Makefile \
1390 samples/Makefile samples/date/Makefile \
1391 samples/cal/Makefile samples/layout/Makefile])
1394 if test -z "$PYTHON";
1396 echo "" > data/rules.mk
1397 echo "" > test/testdata/rules.mk
1399 if test -f "$srcdir/data/locales/root.txt";
1401 echo "Spawning Python to generate data/rules.mk..."
1402 PYTHONPATH="$srcdir/data" $PYTHON -m buildtool \
1404 --seqmode parallel \
1405 --src_dir "$srcdir/data" \
1406 --filter_file "$ICU_DATA_FILTER_FILE" \
1407 $ICU_DATA_BUILDTOOL_OPTS \
1409 if test "$?" != "0"; then
1410 AC_MSG_ERROR(Python failed to run; see above error.)
1413 echo "Not rebuilding data/rules.mk, assuming prebuilt data in data/in"
1416 echo "Spawning Python to generate test/testdata/rules.mk..."
1417 PYTHONPATH="$srcdir/test/testdata:$srcdir/data" $PYTHON -m buildtool \
1419 --seqmode parallel \
1420 --src_dir "$srcdir/test/testdata" \
1421 > test/testdata/rules.mk
1422 if test "$?" != "0"; then
1423 AC_MSG_ERROR(Python failed to run; see above error.)
1428 echo "ICU for C/C++ $VERSION is ready to be built."
1429 echo "=== Important Notes: ==="
1431 echo "Data Packaging: $datapackaging"
1432 echo " This means: $datapackaging_msg"
1433 echo " To locate data: $datapackaging_howfound"
1435 if test -n "`$U_MAKE -v 2>&1 | grep '^GNU Make'`"; then
1436 echo "Building ICU: Use a GNU make such as $U_MAKE to build ICU."
1438 echo "** WARNING: $U_MAKE may not be GNU make."
1439 echo "This may cause ICU to fail to build. Please make sure that GNU make"
1440 echo "is in your PATH so that the configure script can detect its location."
1442 if test "x$AR" = "xfalse"; then
1443 echo "*** WARNING: Archiver ar not found. Set AR= or fix PATH. Some builds (such as static) may fail."
1446 AC_MSG_CHECKING([the version of "$U_MAKE"])
1447 if "$U_MAKE" -f "$srcdir/config/gmakever.mk" PLATFORM="$platform"; then
1450 AC_MSG_RESULT([too old or test failed - try upgrading GNU Make])
1453 AC_SUBST(UCONFIG_CPPFLAGS)
1454 if test -n "$UCONFIG_CPPFLAGS"; then
1455 HDRFILE="uconfig.h.prepend"
1456 echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:"
1458 echo " ${UCONFIG_CPPFLAGS}"
1460 echo 'The recommended way to do this is to prepend the following lines to source/common/unicode/uconfig.h or #include them near the top of that file.'
1461 echo "Creating the file ${HDRFILE}"
1463 echo '--------------- ' "${HDRFILE}"
1465 echo '/* ICU customizations: put these lines at the top of uconfig.h */' >> "${HDRFILE}"
1466 echo >> "${HDRFILE}"
1467 for flag in ${UCONFIG_CPPFLAGS};
1469 echo " /* $flag */" >> "${HDRFILE}"
1472 [ \echo "${flag}" | sed -n 's%-D\([^=]*\)=%#define \1 %p' >> "${HDRFILE}" ]
1473 \echo >> "${HDRFILE}"
1476 [ \echo "${flag}" | sed -n 's%-D\([^=]*\)%#define \1 %p' >> "${HDRFILE}" ]
1477 \echo >> "${HDRFILE}"
1480 \echo "/* Not sure how to handle this argument: ${flag} */" >> "${HDRFILE}"
1481 \echo >> "${HDRFILE}"
1486 \echo "/* End of ${HDRFILE} ------------ */" >> "${HDRFILE}"
1487 echo >> "${HDRFILE}"
1488 echo '--------------- end ' "${HDRFILE}"
1491 AC_SUBST(UCONFIG_CFLAGS)
1492 if test -n "$UCONFIG_CFLAGS"; then
1493 echo "C apps may want to build with CFLAGS = ${UCONFIG_CFLAGS}"
1495 AC_SUBST(UCONFIG_CXXFLAGS)
1496 if test -n "$UCONFIG_CXXFLAGS"; then
1497 echo "C++ apps may want to build with CXXFLAGS = ${UCONFIG_CXXFLAGS}"
1500 if test "$tools" = false;
1502 echo "## Note: you have disabled ICU's tools. This ICU cannot build its own data or tests."
1503 echo "## Expect build failures in the 'data', 'test', and other directories."
1506 if test -z "$PYTHON";
1508 echo "** Note: Python not found. You will not be able to build data from source or run tests."
1511 $as_unset _CXX_CXXSUFFIX