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 AC_CONFIG_MACRO_DIR([config/m4])
20 AC_CONFIG_SRCDIR([common/unicode/utypes.h])
25 # Use custom echo test for newline option
26 # Current autoconf (2.65) gives incorrect echo newline option
28 # This may be removed later - mow (June 17, 2010)
29 ICU_ECHO_C= ICU_ECHO_N= ICU_ECHO_T=
30 case `/bin/sh -c "echo -n x"` in
32 case `/bin/sh -c "echo 'x\c'"` in
33 *c*) ICU_ECHO_T=' ';; # ECHO_T is single tab character.
43 AC_MSG_CHECKING(for ICU version numbers)
45 # Get the ICU version from uversion.h or other headers
47 [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
50 [sed -n 's/^[ ]*#[ ]*define[ ]*U_UNICODE_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
52 VERSION=`geticuversion $srcdir/common/unicode/uvernum.h`
53 if test x"$VERSION" = x; then
54 as_fn_error $? "Cannot determine ICU version number from uvernum.h header file" "$LINENO" 5
58 #if test "$VERSION" != "$PACKAGE_VERSION"; then
59 # AC_MSG_ERROR([configure was generated for $PACKAGE_VERSION but uvernum.h has $VERSION - please rerun autoconf])
62 UNICODE_VERSION=`getuversion $srcdir/common/unicode/uchar.h`
63 if test x"$UNICODE_VERSION" = x; then
64 AC_MSG_ERROR([Cannot determine Unicode version number from uchar.h header file])
66 # Compute a reasonable library version from the release version. This is
67 # very bad, but that's wanted... We want to make sure that the LIB_VERSION
68 # has at least a dot in it, so we'll add a .0 if needed.
69 #[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
71 LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
74 AC_SUBST(LIB_VERSION_MAJOR)
75 AC_MSG_RESULT([release $VERSION, library $LIB_VERSION, unicode version $UNICODE_VERSION])
77 AC_SUBST(UNICODE_VERSION)
79 # Determine the host system
84 # This variable is needed on z/OS because the C++ compiler only recognizes .C
90 # CONFIG_CPPFLAGS: These are defines that are set for ICU Build time only.
91 # They are only needed for building ICU itself. Example: platform stuff
93 # UCONFIG_CPPFLAGS: These are defines which are set for ICU build time,
94 # and also a notice is output that they need to be set
95 # for end-users of ICU also. uconfig.h.prepend is generated
96 # with, for example, "#define U_DISABLE_RENAMING 1"
97 # Example: ICU configuration stuff
99 # UCONFIG_CFLAGS: contains a copy of anything that needs to be set by end users
103 # Check whether to build debug libraries
104 AC_MSG_CHECKING([whether to build debug libraries])
108 [ --enable-debug build debug libraries and enable the U_DEBUG define [default=no]],
109 [ case "${enableval}" in
110 yes|"") enabled=yes; ENABLE_DEBUG=1; CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEBUG=1" ;;
114 AC_MSG_RESULT($enabled)
115 AC_SUBST(ENABLE_DEBUG)
117 # Check whether to build release libraries
118 AC_MSG_CHECKING([whether to build release libraries])
121 AC_ARG_ENABLE(release,
122 [ --enable-release build release libraries [default=yes]],
123 [ case "${enableval}" in
124 no) enabled=no; ENABLE_RELEASE=0 ;;
128 AC_MSG_RESULT($enabled)
129 AC_SUBST(ENABLE_RELEASE)
131 # Don't use the default C/CXXFLags
135 # Checks for compilers
136 AC_PROG_CC([clang gcc cc c99 c89 xlc_r xlc cl.exe icc])
137 # Make sure that we try clang++ first, which provides C++11 support.
138 # The g++ compiler is less likely to support C++11.
139 AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RCC])
141 # pkg-config is needed for harfbuzz support
142 PKG_PROG_PKG_CONFIG([0.20])
143 PKG_CHECK_MODULES(ICULEHB, icu-le-hb, have_icu_le_hb=true, :)
145 # Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option
146 # The release mode use is the default one for autoconf
147 if test "$GCC" = yes; then
148 if test "$CFLAGS" = ""; then
149 if test "$ENABLE_DEBUG" = 1; then
152 if test "$ENABLE_RELEASE" = 1; then
156 if test "$CXXFLAGS" = ""; then
157 if test "$ENABLE_DEBUG" = 1; then
160 if test "$ENABLE_RELEASE" = 1; then
161 CXXFLAGS="$CXXFLAGS -O2"
170 AC_SUBST(cross_compiling)
172 dnl use the pld hack to get ac_fn_cxx_try_link defined globally and not local
174 AC_LINK_IFELSE([AC_LANG_PROGRAM()])
177 # make sure install is relative to srcdir - if a script
178 if test "$srcdir" = "."; then
179 # If srcdir isn't just ., then (srcdir) is already prepended.
180 if test "${ac_install_sh}" = "${INSTALL}"; then
181 INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
185 #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
186 #AC_CHECK_PROG(STRIP, strip, strip, true)
188 # Check for the platform make
189 AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
193 AC_ARG_WITH(cross-build,
194 [ --with-cross-build=dir specify an absolute path to the build directory of an ICU built for the current platform [default=no cross dir]],
195 [cross_buildroot="${withval}"],
196 [cross_buildroot=""])
198 if test "X$cross_buildroot" = "X"; then
199 if test "$cross_compiling" = "yes"; then
200 AC_MSG_ERROR([Error! Cross compiling but no --with-cross-build option specified - please supply the path to an executable ICU's build root])
204 if test -f "${cross_buildroot}/config/icucross.mk"; then
205 AC_MSG_RESULT([Using cross buildroot: $cross_buildroot])
207 if test -d "${cross_buildroot}"; then
208 AC_MSG_ERROR([${cross_buildroot}/config/icucross.mk not found. Please build ICU in ${cross_buildroot} first.])
210 AC_MSG_ERROR([No such directory ${cross_buildroot} supplied as the argument to --with-cross-build. Use an absolute path.])
214 AC_SUBST(cross_buildroot)
216 # Check for doxygen to generate documentation
217 AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
219 # Check that the linker is usable
222 # Determine the executable suffix
223 # We don't use AC_EXEEXT because some compilers output separate debugging
224 # files, which confuses the AC_EXEEXT macro.
225 AC_MSG_CHECKING(checking for executable suffix)
227 *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;;
231 AC_MSG_RESULT($EXEEXT)
234 # Determine how strict we want to be when compiling
235 AC_CHECK_STRICT_COMPILE
237 # Check if we can build and use 64-bit libraries
240 AC_SUBST(COMPILE_LINK_ENVVAR)
242 # Determine the Makefile fragment
245 # Checks for libraries and other host specific stuff
246 # On HP/UX, don't link to -lm from a shared lib because it isn't
247 # PIC (at least on 10.2)
249 *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
251 *) AC_CHECK_LIB(m, floor)
256 # Check whether to build shared libraries
257 AC_MSG_CHECKING([whether to build shared libraries])
259 AC_ARG_ENABLE(shared,
260 [ --enable-shared build shared libraries [default=yes]],
261 [ case "${enableval}" in
262 yes|"") enabled=yes; ENABLE_SHARED=YES ;;
266 [enabled=yes; ENABLE_SHARED=YES]
268 AC_MSG_RESULT($enabled)
269 AC_SUBST(ENABLE_SHARED)
271 # Check whether to build static libraries
272 AC_MSG_CHECKING([whether to build static libraries])
274 AC_ARG_ENABLE(static,
275 [ --enable-static build static libraries [default=no]],
276 [ case "${enableval}" in
277 yes|"") enabled=yes; ENABLE_STATIC=YES ;;
282 AC_MSG_RESULT($enabled)
283 AC_SUBST(ENABLE_STATIC)
285 # When building release static library, there might be some optimization flags we can use
286 if test "$ENABLE_STATIC" = "YES"; then
287 if test "$ENABLE_SHARED" != "YES"; then
288 if test "$ENABLE_RELEASE" = 1; then
289 AC_MSG_CHECKING([whether we can use static library optimization option])
290 CHECK_STATIC_OPT_FLAG=no
292 OLD_CPPFLAGS="${CPPFLAGS}"
293 OLD_LDFLAGS="${LDFLAGS}"
296 *-linux*|i*86-*-*bsd*|i*86-pc-gnu)
297 if test "$GCC" = yes; then
298 CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections"
299 LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
306 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [CHECK_STATIC_OPT_FLAG=yes], [CHECK_STATIC_OPT_FLAG=no])
307 AC_MSG_RESULT($CHECK_STATIC_OPT_FLAG)
308 if test "$CHECK_STATIC_OPT_FLAG" = no; then
309 CPPFLAGS="${OLD_CPPFLAGS}"
310 LDFLAGS="${OLD_LDFLAGS}"
317 # Check whether to enable auto cleanup of libraries
318 AC_MSG_CHECKING([whether to enable auto cleanup of libraries])
320 UCLN_NO_AUTO_CLEANUP=1
321 AC_ARG_ENABLE(auto-cleanup,
322 [ --enable-auto-cleanup enable auto cleanup of libraries [default=no]],
323 [ case "${enableval}" in
325 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DUCLN_NO_AUTO_CLEANUP=0";
326 UCLN_NO_AUTO_CLEANUP=0
331 AC_MSG_RESULT($enabled)
332 AC_SUBST(UCLN_NO_AUTO_CLEANUP)
334 # MSVC floating-point option
336 if test $enabled = yes
338 if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc
340 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
341 #if defined _MSC_VER && _MSC_VER >= 1400
343 Microsoft Visual C++ < 2005
345 ]], [[]])],[MSVC_RELEASE_FLAG="/fp:precise"],[MSVC_RELEASE_FLAG="/Op"])
347 CFLAGS="${CFLAGS} ${MSVC_RELEASE_FLAG}"
348 CXXFLAGS="${CXXFLAGS} ${MSVC_RELEASE_FLAG}"
352 # Check whether to enabled draft APIs
353 AC_MSG_CHECKING([whether to enable draft APIs])
355 U_DEFAULT_SHOW_DRAFT=1
357 [ --enable-draft enable draft APIs (and internal APIs) [default=yes]],
358 [ case "${enableval}" in
359 no) enabled=no; U_DEFAULT_SHOW_DRAFT=0;
360 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEFAULT_SHOW_DRAFT=0"
365 AC_MSG_RESULT($enabled)
366 # Make sure that we can use draft API in ICU.
367 if test "$U_DEFAULT_SHOW_DRAFT" = 0; then
368 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_SHOW_DRAFT_API -DU_SHOW_INTERNAL_API"
370 AC_SUBST(U_DEFAULT_SHOW_DRAFT)
377 # look for 'ar' the proper way
378 AC_CHECK_TOOL(AR, ar, false)
380 AC_MSG_CHECKING([whether to enable renaming of symbols])
383 AC_ARG_ENABLE(renaming,
384 [ --enable-renaming add a version suffix to symbols [default=yes]],
385 [ case "${enableval}" in
386 yes|"") enabled=yes ;;
387 no) enabled=no; U_DISABLE_RENAMING=1;
388 UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_DISABLE_RENAMING=1"
393 AC_MSG_RESULT($enabled)
394 AC_SUBST(U_DISABLE_RENAMING)
396 AC_MSG_CHECKING([whether to enable function and data tracing])
399 AC_ARG_ENABLE(tracing,
400 [ --enable-tracing enable function and data tracing [default=no]],
401 [ case "${enableval}" in
403 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_TRACING=1";
404 U_ENABLE_TRACING=1 ;;
405 no) enabled=no; U_ENABLE_TRACING=0 ;;
409 AC_MSG_RESULT($enabled)
410 AC_SUBST(U_ENABLE_TRACING)
412 # check if elf.h is present.
413 AC_CHECK_HEADERS([elf.h])
414 if test "x$ac_cv_header_elf_h" = "xyes"; then
415 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1";
418 # Enable/disable plugins
419 AC_ARG_ENABLE(plugins,
420 [ --enable-plugins enable plugins [default=no]],
421 [case "${enableval}" in
424 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugins) ;;
427 ICU_CONDITIONAL(PLUGINS, test "$plugins" = true)
429 if test "x$plugins" = "xtrue"; then
430 UCONFIG_CPPFLAGS="$UCONFIG_CPPFLAGS -DUCONFIG_ENABLE_PLUGINS=1"
436 AC_MSG_CHECKING([whether to enable dynamic loading of plugins. Ignored if plugins disabled.])
437 AC_ARG_ENABLE(dyload,
438 [ --disable-dyload disable dynamic loading [default=no]],
439 [ case "${enableval}" in
447 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_DYLOAD=0";
452 AC_MSG_RESULT($enable)
453 AC_SUBST(U_ENABLE_DYLOAD)
455 if test "$enable" = "yes"; then
456 AC_CHECK_HEADERS([dlfcn.h])
457 #AC_MSG_RESULT($enabled)
458 AC_SEARCH_LIBS([dlopen], [dl])
459 AC_CHECK_FUNCS([dlopen])
461 if test "x$ac_cv_func_dlopen" != xyes; then
462 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DHAVE_DLOPEN=0"
466 # Check for miscellanous functions.
467 # So, use for putil / tools only.
468 # Note that this will generate HAVE_GETTIMEOFDAY, not U_HAVE_GETTIMEOFDAY
469 AC_CHECK_FUNCS([gettimeofday])
472 # Check whether to use the evil rpath or not
474 [ --enable-rpath use rpath when linking [default is only if necessary]],
475 [ case "${enableval}" in
476 yes|"") ENABLE_RPATH=YES ;;
482 AC_SUBST(ENABLE_RPATH)
487 AC_MSG_CHECKING([[if we have a C++ compiler]])
488 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx_okay=yes],[cxx_okay=no])
489 if test $cxx_okay = yes
491 AC_MSG_RESULT([[Good]])
493 AC_MSG_RESULT([[no]])
494 AC_MSG_ERROR([[C++ compiler $CXX does not work or no compiler found]])
497 if [[ "$GXX" = yes ]]; then
498 # if CXXFLAGS does not have a "-std=" setting, set it now to -std=c++11,
499 # and check that the compiler still works.
500 if ! echo "$CXXFLAGS" | grep '\-std=' >/dev/null 2>&1; then
501 OLD_CXXFLAGS="${CXXFLAGS}"
502 CXXFLAGS="$CXXFLAGS -std=c++11"
503 AC_MSG_CHECKING([[if we have a C++11 compiler]])
504 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx11_okay=yes],[cxx11_okay=no])
505 AC_MSG_RESULT($cxx11_okay)
506 if [[ $cxx11_okay = yes ]]; then
507 AC_MSG_NOTICE([Adding CXXFLAGS option -std=c++11])
508 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -std=c++11"
510 CXXFLAGS="$OLD_CXXFLAGS"
514 CXXFLAGS="$OLD_CXXFLAGS"
520 AC_MSG_CHECKING([[if #include <atomic> works]])
521 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no])
522 AC_MSG_RESULT($ac_cv_header_atomic)
523 if test $ac_cv_header_atomic = yes
529 # Make this available via CPPFLAGS
530 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=${U_HAVE_ATOMIC}"
531 AC_SUBST(U_HAVE_ATOMIC)
535 # Always build ICU with multi-threading support.
538 # For Compaq Tru64 (OSF1), we must look for pthread_attr_init
539 # and must do this before seaching for pthread_mutex_destroy, or
540 # we will pick up libpthreads.so not libpthread.so
541 # If this fails, then we must test for HPUX specials, before
542 # moving on to a more generic test
544 AC_CHECK_LIB(pthread, pthread_attr_init)
545 if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
548 # Locate the right library for POSIX threads. We look for the
549 # symbols in the libraries first, because on Solaris libc provides
550 # pthread_create but libpthread has the real code :(
551 # AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread
552 # FreeBSD users may need libpthread if they do not have libc_r.
554 AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r )
556 if test "$ac_cv_search_pthread_mutex_destroy" != no; then
560 AC_CHECK_LIB(pthread, pthread_mutex_init)
561 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
566 AC_CHECK_FUNC(pthread_mutex_lock)
568 if test $ac_cv_func_pthread_mutex_lock = yes; then
572 # Check to see if we are using CygWin with MSVC
574 *-pc-cygwin*|*-pc-mingw*)
575 # For gcc, the thread options are set by mh-mingw/mh-cygwin
576 # For msvc, the thread options are set by runConfigureICU
580 # Add -mt because it does several nice things on newer compilers.
581 case "${icu_cv_host_frag}" in
583 OLD_CXXFLAGS="${CXXFLAGS}"
584 CXXFLAGS="${CXXFLAGS} -mt"
585 if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
586 CXXFLAGS="${OLD_CXXFLAGS}"
588 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -mt"
594 case "${icu_cv_host_frag}" in
602 AC_ARG_ENABLE(weak-threads,
603 [ --enable-weak-threads weakly reference the threading library [default=no]],
604 [case "${enableval}" in
606 LIB_THREAD="${LIBS%${OLD_LIBS}}"
610 *) AC_MSG_ERROR(bad value ${enableval} for --enable-weak-threads) ;;
616 # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
617 # Do this check instead.
619 AC_MSG_CHECKING([for mmap])
620 AC_CACHE_VAL(ac_cv_func_mmap_ok,
621 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
622 #include <sys/mman.h>
623 #include <sys/stat.h>
624 #include <fcntl.h>], [mmap((void *)0, 0, PROT_READ, 0, 0, 0);])],[ac_cv_func_mmap_ok=yes],[ac_cv_func_mmap_ok=no])] )
625 AC_MSG_RESULT($ac_cv_func_mmap_ok)
626 if test $ac_cv_func_mmap_ok = yes
630 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_MMAP=0"
634 AC_MSG_CHECKING([for genccode assembly])
636 # Check to see if genccode can generate simple assembly.
639 *-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu)
640 if test "$GCC" = yes; then
641 # We're using gcc, and the simple -a gcc command line works for genccode
642 GENCCODE_ASSEMBLY="-a gcc"
645 if test "$GCC" = yes; then
646 # When using gcc, look if we're also using GNU as.
647 # When using GNU as, the simple -a gcc command line works for genccode.
648 asv=`"${CC}" -print-prog-name=as 2>/dev/null`
649 asv=`"${asv}" --version 2>/dev/null`
651 X*GNU*) GENCCODE_ASSEMBLY="-a gcc" ;;
652 X*) GENCCODE_ASSEMBLY="-a sun-x86" ;;
656 GENCCODE_ASSEMBLY="-a sun-x86"
659 GENCCODE_ASSEMBLY="-a sun"
662 # There has been some issues with building ICU data on HPUX ia64 aCC
663 # when using the assemble code setting below. For now, build without
664 # assemble code for this platform. This will increase the build time.
665 # GENCCODE_ASSEMBLY="-a aCC-ia64"
668 AC_SUBST(GENCCODE_ASSEMBLY)
670 AC_MSG_RESULT($GENCCODE_ASSEMBLY)
672 # Checks for header files
673 AC_CHECK_HEADERS(inttypes.h)
674 if test $ac_cv_header_inttypes_h = no; then
676 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
680 if test "$CC" = ccc; then
681 AC_MSG_RESULT("C compiler set to CCC ${CC}" )
683 alpha*-*-*) U_HAVE_INTTYPES_H=0;
684 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
688 AC_SUBST(U_HAVE_INTTYPES_H)
690 AC_CHECK_HEADERS(dirent.h)
691 if test $ac_cv_header_dirent_h = no; then
693 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_DIRENT_H=0"
698 AC_SUBST(U_HAVE_DIRENT_H)
700 # Check for endianness
702 if test $ac_cv_c_bigendian = no; then
709 AC_SUBST(U_IS_BIG_ENDIAN)
711 # Do various POSIX related checks
712 U_HAVE_NL_LANGINFO_CODESET=0
713 U_NL_LANGINFO_CODESET=-1
714 AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
715 dnl AC_SUBST(U_HAVE_NL_LANGINFO)
716 if test $U_HAVE_NL_LANGINFO -eq 1; then
717 AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
718 ac_cv_nl_langinfo_codeset,
719 [ac_cv_nl_langinfo_codeset="unknown"
720 for a in CODESET _NL_CTYPE_CODESET_NAME; do
721 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo($a);]])],[ac_cv_nl_langinfo_codeset="$a"; break],[])]
723 if test x$ac_cv_nl_langinfo_codeset != xunknown
725 U_HAVE_NL_LANGINFO_CODESET=1
726 U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
727 if test "x${ac_cv_nl_langinfo_codeset}" != "xCODESET"
729 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DNL_LANGINFO_CODESET=${ac_cv_nl_langinfo_codeset}"
732 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_NL_LANGINFO_CODESET=0"
735 AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
736 AC_SUBST(U_NL_LANGINFO_CODESET)
738 # Namespace support checks
740 AC_MSG_CHECKING([for namespace support])
741 AC_CACHE_VAL(ac_cv_namespace_ok,
742 [AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace x_version {void f(){}}
743 namespace x = x_version;
744 using namespace x_version;
745 ], [f();])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] )
746 AC_MSG_RESULT($ac_cv_namespace_ok)
747 if test $ac_cv_namespace_ok = no
749 AC_MSG_ERROR(Namespace support is required to build ICU.)
752 AC_MSG_CHECKING([for properly overriding new and delete])
753 U_OVERRIDE_CXX_ALLOCATION=0
754 U_HAVE_PLACEMENT_NEW=0
755 AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
756 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
759 void *operator new(size_t size) {return malloc(size);}
760 void *operator new[](size_t size) {return malloc(size);}
761 void operator delete(void *p) {free(p);}
762 void operator delete[](void *p) {free(p);}
764 ]], [])],[ac_cv_override_cxx_allocation_ok=yes],[ac_cv_override_cxx_allocation_ok=no])] )
765 AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
766 if test $ac_cv_override_cxx_allocation_ok = yes
768 U_OVERRIDE_CXX_ALLOCATION=1
769 AC_MSG_CHECKING([for placement new and delete])
770 AC_CACHE_VAL(ac_cv_override_placement_new_ok,
771 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
774 void *operator new(size_t size) {return malloc(size);}
775 void *operator new[](size_t size) {return malloc(size);}
776 void operator delete(void *p) {free(p);}
777 void operator delete[](void *p) {free(p);}
778 void * operator new(size_t, void *ptr) { return ptr; }
779 void operator delete(void *, void *) {}
781 ]], [])],[ac_cv_override_placement_new_ok=yes],[ac_cv_override_placement_new_ok=no])] )
782 AC_MSG_RESULT($ac_cv_override_placement_new_ok)
783 if test $ac_cv_override_placement_new_ok = yes
785 U_HAVE_PLACEMENT_NEW=1
787 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_PLACEMENT_NEW=0"
790 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_OVERRIDE_CXX_ALLOCATION=0"
792 AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
793 AC_SUBST(U_HAVE_PLACEMENT_NEW)
797 if test x$ac_cv_func_popen = xyes
801 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_POPEN=0"
804 AC_SUBST(U_HAVE_POPEN)
808 if test x$ac_cv_func_tzset = xyes
813 AC_CHECK_FUNC(_tzset)
814 if test x$ac_cv_func__tzset = xyes
819 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"
822 AC_SUBST(U_HAVE_TZSET)
826 AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
827 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef _XOPEN_SOURCE
828 #define _XOPEN_SOURCE
832 #ifndef tzname /* For SGI. */
833 extern char *tzname[]; /* RS6000 and others reject char **tzname. */
834 #endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])])
835 if test $ac_cv_var_tzname = yes; then
839 AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
840 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
842 extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])])
843 if test $ac_cv_var__tzname = yes; then
847 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZNAME=0"
850 AC_SUBST(U_HAVE_TZNAME)
853 AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
854 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#ifndef _XOPEN_SOURCE
855 #define _XOPEN_SOURCE
858 ], [[timezone = 1;]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])])
860 if test $ac_cv_var_timezone = yes; then
864 AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
865 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[__timezone = 1;]])],[ac_cv_var___timezone=yes],[ac_cv_var___timezone=no])])
866 if test $ac_cv_var___timezone = yes; then
867 U_TIMEZONE=__timezone
870 AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
871 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[_timezone = 1;]])],[ac_cv_var__timezone=yes],[ac_cv_var__timezone=no])])
872 if test $ac_cv_var__timezone = yes; then
876 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TIMEZONE=0"
880 AC_SUBST(U_HAVE_TIMEZONE)
883 AC_CHECK_FUNC(strtod_l)
884 if test x$ac_cv_func_strtod_l = xyes
887 AC_CHECK_HEADER(xlocale.h)
888 if test "$ac_cv_header_xlocale_h" = yes; then
890 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=1"
893 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=0"
896 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
899 AC_SUBST(U_HAVE_STRTOD_L)
901 # Checks for typedefs
902 AC_CHECK_TYPE(int8_t,signed char)
903 AC_CHECK_TYPE(uint8_t,unsigned char)
904 AC_CHECK_TYPE(int16_t,signed short)
905 AC_CHECK_TYPE(uint16_t,unsigned short)
906 AC_CHECK_TYPE(int32_t,signed long)
907 AC_CHECK_TYPE(uint32_t,unsigned long)
908 AC_CHECK_TYPE(int64_t,signed long long)
909 AC_CHECK_TYPE(uint64_t,unsigned long long)
911 if test $ac_cv_type_int8_t = no; then
912 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT8_T=0"
915 if test $ac_cv_type_uint8_t = no; then
916 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT8_T=0"
919 if test $ac_cv_type_int16_t = no; then
920 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT16_T=0"
923 if test $ac_cv_type_uint16_t = no; then
924 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT16_T=0"
927 if test $ac_cv_type_int32_t = no; then
928 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT32_T=0"
931 if test $ac_cv_type_uint32_t = no; then
932 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT32_T=0"
935 if test $ac_cv_type_int64_t = no; then
936 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT64_T=0"
939 if test $ac_cv_type_uint64_t = no; then
940 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT64_T=0"
943 # Do various wchar_t related checks
944 AC_CHECK_HEADER(wchar.h)
945 if test "$ac_cv_header_wchar_h" = no
949 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCHAR_H=0 -DU_HAVE_WCSCPY=0"
951 AC_DEFINE([HAVE_WCHAR_H], [1], [wchar.h was found.])
953 # Some broken systems have wchar.h but not some of its functions...
954 AC_SEARCH_LIBS(wcscpy, wcs w)
955 if test "$ac_cv_search_wcscpy" != no; then
959 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCSCPY=0"
962 AC_SUBST(U_HAVE_WCHAR_H)
963 AC_SUBST(U_HAVE_WCSCPY)
965 AC_CHECK_SIZEOF([wchar_t], 0, [
974 U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
975 # We do this check to verify that everything is okay.
976 if test $U_SIZEOF_WCHAR_T = 0; then
977 if test $U_HAVE_WCHAR_H=1; then
978 AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
982 AC_MSG_CHECKING([for UTF-16 string literal support])
983 U_CHECK_UTF16_STRING=1
984 CHECK_UTF16_STRING_RESULT="unknown"
987 *-*-aix*|powerpc64-*-linux*)
988 if test "$GCC" = no; then
989 OLD_CFLAGS="${CFLAGS}"
990 OLD_CXXFLAGS="${CXXFLAGS}"
991 CFLAGS="${CFLAGS} -qutf"
992 CXXFLAGS="${CXXFLAGS} -qutf"
993 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = u"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
994 if test "$U_CHECK_UTF16_STRING" = 0; then
995 CFLAGS="${OLD_CFLAGS}"
996 CXXFLAGS="${OLD_CXXFLAGS}"
998 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -qutf"
999 CHECK_UTF16_STRING_RESULT="-qutf"
1004 if test "$GCC" = no; then
1005 OLD_CFLAGS="${CFLAGS}"
1006 OLD_CXXFLAGS="${CXXFLAGS}"
1007 CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
1008 CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort"
1009 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = U"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
1010 if test "$U_CHECK_UTF16_STRING" = 0; then
1011 CFLAGS="${OLD_CFLAGS}"
1012 CXXFLAGS="${OLD_CXXFLAGS}"
1014 CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
1015 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -xustr=ascii_utf16_ushort"
1016 UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -xustr=ascii_utf16_ushort"
1017 # Since we can't detect the availability of this UTF-16 syntax at compile time,
1018 # we depend on configure telling us that we can use it.
1019 # Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
1020 # we only use this macro within ICU.
1021 # If an ICU user uses icu-config, this feature will be enabled.
1022 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_CHECK_UTF16_STRING=1"
1023 U_CHECK_UTF16_STRING=0
1028 if test "$GCC" = no; then
1029 # The option will be detected at compile time without additional compiler options.
1030 CHECK_UTF16_STRING_RESULT="available"
1034 # wchar_t can be used
1035 CHECK_UTF16_STRING_RESULT="available"
1041 # GCC >= 4.4 supports UTF16 string literals. As of ICU 62, both C and C++ files require them.
1042 if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
1043 if test "$GCC" = yes; then
1044 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1045 static const unsigned short test[] = u"This is a UTF16 literal string.";
1046 ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0])
1047 if test "$CC_UTF16_STRING" = 1; then
1048 CHECK_UTF16_STRING_RESULT="C only";
1051 if test "$GXX" = yes; then
1052 # -Wno-return-type-c-linkage is desired so that stable ICU API is not warned about.
1054 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1055 static const char16_t test[] = u"This is a UTF16 literal string.";
1056 ]], [[]])],[CXX_UTF16_STRING=1],[CXX_UTF16_STRING=0])
1058 if test "$CXX_UTF16_STRING" = 1; then
1059 if test "$CC_UTF16_STRING" = 1; then
1060 CHECK_UTF16_STRING_RESULT="available";
1062 CHECK_UTF16_STRING_RESULT="C++ only";
1067 AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT)
1069 # Enable/disable extras
1070 AC_ARG_ENABLE(extras,
1071 [ --enable-extras build ICU extras [default=yes]],
1072 [case "${enableval}" in
1075 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
1078 ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
1079 AC_ARG_ENABLE(icuio,
1080 [ --enable-icuio build ICU's icuio library [default=yes]],
1081 [case "${enableval}" in
1084 *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
1087 ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
1089 # Enable/disable layoutex
1090 AC_ARG_ENABLE(layoutex,
1091 [ --enable-layoutex build ICU's Paragraph Layout library [default=yes].
1092 icu-le-hb must be installed via pkg-config. See http://harfbuzz.org],
1093 [case "${enableval}" in
1094 yes) layoutex=$have_icu_le_hb ;;
1095 no) layoutex=false ;;
1096 *) AC_MSG_ERROR(bad value ${enableval} for --enable-layoutex) ;;
1098 layoutex=$have_icu_le_hb)
1099 ICU_CONDITIONAL(LAYOUTEX, test "$layoutex" = true)
1101 # Enable/disable layout
1102 AC_ARG_ENABLE(layout,
1104 [case "${enableval}" in
1105 yes) AC_MSG_ERROR(The ICU Layout Engine has been removed.) ;;
1111 # Enable/disable tools
1112 AC_ARG_ENABLE(tools,
1113 [ --enable-tools build ICU's tools [default=yes]],
1114 [case "${enableval}" in
1117 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
1120 ICU_CONDITIONAL(TOOLS, test "$tools" = true)
1122 AC_ARG_WITH(data-packaging,
1123 [ --with-data-packaging specify how to package ICU data. Possible values:
1124 files raw files (.res, etc)
1125 archive build a single icudtXX.dat file
1126 library shared library (.dll/.so/etc.)
1127 static static library (.a/.lib/etc.)
1128 auto build shared if possible (default)
1129 See http://userguide.icu-project.org/icudata for more info.],
1130 [case "${withval}" in
1131 files|archive|library) datapackaging=$withval ;;
1132 auto) datapackaging=$withval ;;
1133 common) datapackaging=archive ;;
1134 dll) datapackaging=library ;;
1135 static) datapackaging=static ;;
1136 *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
1140 # Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
1141 # thesysconfdir=`eval echo $sysconfdir`
1142 dnl# AC_SUBST(thesysconfdir)
1143 dnl# thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
1144 dnl# AC_SUBST(thelibdir)
1145 thedatadir=`eval echo $datadir`
1146 dnl# AC_SUBST(thedatadir)
1147 # 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}.
1148 pkgicudatadir=$datadir
1149 thepkgicudatadir=$thedatadir
1150 AC_SUBST(pkgicudatadir)
1151 AC_SUBST(thepkgicudatadir)
1153 dnl# Shouldn't need the AC_SUBST
1155 if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
1156 # default to library
1157 datapackaging=library
1158 if test "$ENABLE_STATIC" = "YES"; then
1159 if test "$ENABLE_SHARED" != "YES"; then
1160 datapackaging=static
1165 datapackaging_dir=`eval echo $thedatadir`"/icu/${VERSION}"
1167 datapackaging_msg="(No explaination for mode $datapackaging.)"
1169 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."
1170 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."
1171 datapackaging_howfound="(unknown)"
1173 case "$datapackaging" in
1175 DATA_PACKAGING_MODE=files
1176 datapackaging_msg="ICU data will be stored in individual files."
1177 datapackaging_howfound="$datapackaging_msg_path"
1180 DATA_PACKAGING_MODE=common
1181 datapackaging_msg="ICU data will be stored in a single .dat file."
1182 datapackaging_howfound="$datapackaging_msg_path"
1185 DATA_PACKAGING_MODE=dll
1186 datapackaging_msg="ICU data will be linked with ICU."
1187 if test "$ENABLE_STATIC" = "YES"; then
1188 datapackaging_msg="$datapackaging_msg A static data library will be built. "
1190 if test "$ENABLE_SHARED" = "YES"; then
1191 datapackaging_msg="$datapackaging_msg A shared data library will be built. "
1193 datapackaging_howfound="$datapackaging_msg_set"
1196 DATA_PACKAGING_MODE=static
1197 datapackaging_msg="ICU data will be stored in a static library."
1198 datapackaging_howfound="$datapackaging_msg_set"
1201 AC_SUBST(DATA_PACKAGING_MODE)
1203 # Sets a library suffix
1204 AC_MSG_CHECKING([for a library suffix to use])
1205 AC_ARG_WITH(library-suffix,
1206 [ --with-library-suffix=suffix tag a suffix to the library names [default=]],
1207 [ICULIBSUFFIX="${withval}"],
1210 if test "$msg" = ""; then
1214 AC_SUBST(ICULIBSUFFIX)
1215 if test "$ICULIBSUFFIX" != ""
1218 ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
1219 UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} "
1223 AC_SUBST(U_HAVE_LIB_SUFFIX)
1224 AC_SUBST(ICULIBSUFFIXCNAME)
1226 # Enable/disable tests
1227 AC_ARG_ENABLE(tests,
1228 [ --enable-tests build ICU tests [default=yes]],
1229 [case "${enableval}" in
1232 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
1235 ICU_CONDITIONAL(TESTS, test "$tests" = true)
1237 # Enable/disable samples
1238 AC_ARG_ENABLE(samples,
1239 [ --enable-samples build ICU samples [default=yes]
1241 Additionally, the variable FORCE_LIBS may be set before calling configure.
1242 If set, it will REPLACE any automatic list of libraries.],
1243 [case "${enableval}" in
1244 yes) samples=true ;;
1245 no) samples=false ;;
1246 *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
1249 ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
1251 ICUDATA_CHAR=$U_ENDIAN_CHAR
1253 # Platform-specific Makefile setup
1254 # set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
1256 *-*-solaris*) platform=U_SOLARIS ;;
1257 *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) platform=U_LINUX ;;
1258 *-*-*bsd*|*-*-dragonfly*) platform=U_BSD ;;
1259 *-*-aix*) platform=U_AIX ;;
1260 *-*-hpux*) platform=U_HPUX ;;
1261 *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
1262 *-*-cygwin*) platform=U_CYGWIN ;;
1263 *-*-mingw*) platform=U_MINGW ;;
1264 *-*ibm-openedition*|*-*-os390*) platform=OS390
1265 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
1268 *-*-os400*) platform=OS400
1269 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
1272 *-*-nto*) platform=U_QNX ;;
1273 *-dec-osf*) platform=U_OSF ;;
1274 *-*-beos) platform=U_BEOS ;;
1275 *-*-irix*) platform=U_IRIX ;;
1276 *-ncr-*) platform=U_MPRAS ;;
1277 *) platform=U_UNKNOWN_PLATFORM ;;
1279 AC_SUBST(ICUDATA_CHAR)
1281 platform_make_fragment_name="$icu_cv_host_frag"
1282 platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
1283 AC_SUBST(platform_make_fragment_name)
1284 AC_SUBST(platform_make_fragment)
1286 if test "${FORCE_LIBS}" != ""; then
1287 echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
1291 # Now that we're done using CPPFLAGS etc. for tests, we can change it
1294 if test "${CC}" == "clang"; then
1295 CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality"
1300 if test "${CXX}" == "clang++"; then
1301 CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality"
1306 CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
1307 CFLAGS="$CFLAGS \$(THREADSCFLAGS) $CLANGCFLAGS"
1308 CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS) $CLANGCXXFLAGS"
1311 AC_SUBST(LIBCXXFLAGS)
1313 # append all config cppflags
1314 CPPFLAGS="$CPPFLAGS $CONFIG_CPPFLAGS $UCONFIG_CPPFLAGS"
1316 echo "CPPFLAGS=$CPPFLAGS"
1317 echo "CFLAGS=$CFLAGS"
1318 echo "CXXFLAGS=$CXXFLAGS"
1321 # output the Makefiles
1322 AC_CONFIG_FILES([icudefs.mk \
1324 data/pkgdataMakefile \
1325 config/Makefile.inc \
1327 config/pkgdataMakefile \
1335 extra/uconv/Makefile \
1336 extra/uconv/pkgdataMakefile \
1337 extra/scrptrun/Makefile \
1339 tools/ctestfw/Makefile \
1340 tools/toolutil/Makefile \
1341 tools/makeconv/Makefile \
1342 tools/genrb/Makefile \
1343 tools/genccode/Makefile \
1344 tools/gencmn/Makefile \
1345 tools/gencnval/Makefile \
1346 tools/gendict/Makefile \
1347 tools/gentest/Makefile \
1348 tools/gennorm2/Makefile \
1349 tools/genbrk/Makefile \
1350 tools/gensprep/Makefile \
1351 tools/icuinfo/Makefile \
1352 tools/icupkg/Makefile \
1353 tools/icuswap/Makefile \
1354 tools/pkgdata/Makefile \
1355 tools/tzcode/Makefile \
1356 tools/gencfu/Makefile \
1357 tools/escapesrc/Makefile \
1359 test/compat/Makefile \
1360 test/testdata/Makefile \
1361 test/testdata/pkgdataMakefile \
1362 test/hdrtst/Makefile \
1363 test/intltest/Makefile \
1364 test/cintltst/Makefile \
1365 test/iotest/Makefile \
1366 test/letest/Makefile \
1367 test/perf/Makefile \
1368 test/perf/collationperf/Makefile \
1369 test/perf/collperf/Makefile \
1370 test/perf/collperf2/Makefile \
1371 test/perf/dicttrieperf/Makefile \
1372 test/perf/ubrkperf/Makefile \
1373 test/perf/charperf/Makefile \
1374 test/perf/convperf/Makefile \
1375 test/perf/normperf/Makefile \
1376 test/perf/DateFmtPerf/Makefile \
1377 test/perf/howExpensiveIs/Makefile \
1378 test/perf/strsrchperf/Makefile \
1379 test/perf/unisetperf/Makefile \
1380 test/perf/usetperf/Makefile \
1381 test/perf/ustrperf/Makefile \
1382 test/perf/utfperf/Makefile \
1383 test/perf/utrie2perf/Makefile \
1384 test/perf/leperf/Makefile \
1385 samples/Makefile samples/date/Makefile \
1386 samples/cal/Makefile samples/layout/Makefile])
1390 echo "ICU for C/C++ $VERSION is ready to be built."
1391 echo "=== Important Notes: ==="
1393 echo "Data Packaging: $datapackaging"
1394 echo " This means: $datapackaging_msg"
1395 echo " To locate data: $datapackaging_howfound"
1397 if test -n "`$U_MAKE -v 2>&1 | grep '^GNU Make'`"; then
1398 echo "Building ICU: Use a GNU make such as $U_MAKE to build ICU."
1400 echo "** WARNING: $U_MAKE may not be GNU make."
1401 echo "This may cause ICU to fail to build. Please make sure that GNU make"
1402 echo "is in your PATH so that the configure script can detect its location."
1404 if test "x$AR" = "xfalse"; then
1405 echo "*** WARNING: Archiver ar not found. Set AR= or fix PATH. Some builds (such as static) may fail."
1408 AC_MSG_CHECKING([the version of "$U_MAKE"])
1409 if "$U_MAKE" -f "$srcdir/config/gmakever.mk" PLATFORM="$platform"; then
1412 AC_MSG_RESULT([too old or test failed - try upgrading GNU Make])
1415 AC_SUBST(UCONFIG_CPPFLAGS)
1416 if test -n "$UCONFIG_CPPFLAGS"; then
1417 HDRFILE="uconfig.h.prepend"
1418 echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:"
1420 echo " ${UCONFIG_CPPFLAGS}"
1422 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.'
1423 echo "Creating the file ${HDRFILE}"
1425 echo '--------------- ' "${HDRFILE}"
1427 echo '/* ICU customizations: put these lines at the top of uconfig.h */' >> "${HDRFILE}"
1428 echo >> "${HDRFILE}"
1429 for flag in ${UCONFIG_CPPFLAGS};
1431 echo " /* $flag */" >> "${HDRFILE}"
1434 [ \echo "${flag}" | sed -n 's%-D\([^=]*\)=%#define \1 %p' >> "${HDRFILE}" ]
1435 \echo >> "${HDRFILE}"
1438 [ \echo "${flag}" | sed -n 's%-D\([^=]*\)%#define \1 %p' >> "${HDRFILE}" ]
1439 \echo >> "${HDRFILE}"
1442 \echo "/* Not sure how to handle this argument: ${flag} */" >> "${HDRFILE}"
1443 \echo >> "${HDRFILE}"
1448 \echo "/* End of ${HDRFILE} ------------ */" >> "${HDRFILE}"
1449 echo >> "${HDRFILE}"
1450 echo '--------------- end ' "${HDRFILE}"
1453 AC_SUBST(UCONFIG_CFLAGS)
1454 if test -n "$UCONFIG_CFLAGS"; then
1455 echo "C apps may want to build with CFLAGS = ${UCONFIG_CFLAGS}"
1457 AC_SUBST(UCONFIG_CXXFLAGS)
1458 if test -n "$UCONFIG_CXXFLAGS"; then
1459 echo "C++ apps may want to build with CXXFLAGS = ${UCONFIG_CXXFLAGS}"
1462 if test "$tools" = false;
1464 echo "## Note: you have disabled ICU's tools. This ICU cannot build its own data or tests."
1465 echo "## Expect build failures in the 'data', 'test', and other directories."
1468 $as_unset _CXX_CXXSUFFIX