2 AC_COPYRIGHT([ Copyright (c) 1999-2014, International Business Machines Corporation and others. All Rights Reserved. ])
4 # Stephen F. Booth, heavily modified by Yves and others
6 # Check for autoconf version
9 # Process this file with autoconf to produce a configure script
11 m4_esyscmd_s([sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "./common/unicode/uvernum.h]"),
12 [http://icu-project.org/bugs],
13 [International Components for Unicode],
14 [http://icu-project.org])
16 AC_CONFIG_MACRO_DIR([config/m4])
17 AC_CONFIG_SRCDIR([common/unicode/utypes.h])
22 # Use custom echo test for newline option
23 # Current autoconf (2.65) gives incorrect echo newline option
25 # This may be removed later - mow (June 17, 2010)
26 ICU_ECHO_C= ICU_ECHO_N= ICU_ECHO_T=
27 case `/bin/sh -c "echo -n x"` in
29 case `/bin/sh -c "echo 'x\c'"` in
30 *c*) ICU_ECHO_T=' ';; # ECHO_T is single tab character.
40 AC_MSG_CHECKING(for ICU version numbers)
42 # Get the ICU version from uversion.h or other headers
44 [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
47 [sed -n 's/^[ ]*#[ ]*define[ ]*U_UNICODE_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
49 VERSION=`geticuversion $srcdir/common/unicode/uvernum.h`
50 if test x"$VERSION" = x; then
51 as_fn_error $? "Cannot determine ICU version number from uvernum.h header file" "$LINENO" 5
55 #if test "$VERSION" != "$PACKAGE_VERSION"; then
56 # AC_MSG_ERROR([configure was generated for $PACKAGE_VERSION but uvernum.h has $VERSION - please rerun autoconf])
59 UNICODE_VERSION=`getuversion $srcdir/common/unicode/uchar.h`
60 if test x"$UNICODE_VERSION" = x; then
61 AC_MSG_ERROR([Cannot determine Unicode version number from uchar.h header file])
63 # Compute a reasonable library version from the release version. This is
64 # very bad, but that's wanted... We want to make sure that the LIB_VERSION
65 # has at least a dot in it, so we'll add a .0 if needed.
66 #[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
68 LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
71 AC_SUBST(LIB_VERSION_MAJOR)
72 AC_MSG_RESULT([release $VERSION, library $LIB_VERSION, unicode version $UNICODE_VERSION])
74 AC_SUBST(UNICODE_VERSION)
76 # Determine the host system
81 # This variable is needed on z/OS because the C++ compiler only recognizes .C
87 # CONFIG_CPPFLAGS: These are defines that are set for ICU Build time only.
88 # They are only needed for building ICU itself. Example: platform stuff
90 # UCONFIG_CPPFLAGS: These are defines which are set for ICU build time,
91 # and also a notice is output that they need to be set
92 # for end-users of ICU also. uconfig.h.prepend is generated
93 # with, for example, "#define U_DISABLE_RENAMING 1"
94 # Example: ICU configuration stuff
96 # UCONFIG_CFLAGS: contains a copy of anything that needs to be set by end users
100 # Check whether to build debug libraries
101 AC_MSG_CHECKING([whether to build debug libraries])
105 [ --enable-debug build debug libraries and enable the U_DEBUG define [default=no]],
106 [ case "${enableval}" in
107 yes|"") enabled=yes; ENABLE_DEBUG=1; CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEBUG=1" ;;
111 AC_MSG_RESULT($enabled)
112 AC_SUBST(ENABLE_DEBUG)
114 # Check whether to build release libraries
115 AC_MSG_CHECKING([whether to build release libraries])
118 AC_ARG_ENABLE(release,
119 [ --enable-release build release libraries [default=yes]],
120 [ case "${enableval}" in
121 no) enabled=no; ENABLE_RELEASE=0 ;;
125 AC_MSG_RESULT($enabled)
126 AC_SUBST(ENABLE_RELEASE)
128 # Don't use the default C/CXXFLags
132 # Checks for compilers
133 AC_PROG_CC([clang gcc cc c99 c89 xlc_r xlc cl.exe icc])
134 # Make sure that we try clang++ first, which provides C++11 support.
135 # The g++ compiler is less likely to support C++11.
136 AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RCC])
138 # pkg-config is needed for harfbuzz support
139 PKG_PROG_PKG_CONFIG([0.20])
140 PKG_CHECK_MODULES(ICULEHB, icu-le-hb, have_icu_le_hb=true, :)
142 # Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option
143 # The release mode use is the default one for autoconf
144 if test "$GCC" = yes; then
145 if test "$CFLAGS" = ""; then
146 if test "$ENABLE_DEBUG" = 1; then
149 if test "$ENABLE_RELEASE" = 1; then
153 if test "$CXXFLAGS" = ""; then
154 if test "$ENABLE_DEBUG" = 1; then
157 if test "$ENABLE_RELEASE" = 1; then
158 CXXFLAGS="$CXXFLAGS -O2"
167 AC_SUBST(cross_compiling)
169 dnl use the pld hack to get ac_fn_cxx_try_link defined globally and not local
171 AC_LINK_IFELSE([AC_LANG_PROGRAM()])
174 # make sure install is relative to srcdir - if a script
175 if test "$srcdir" = "."; then
176 # If srcdir isn't just ., then (srcdir) is already prepended.
177 if test "${ac_install_sh}" = "${INSTALL}"; then
178 INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
182 #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
183 #AC_CHECK_PROG(STRIP, strip, strip, true)
185 # Check for the platform make
186 AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
190 AC_ARG_WITH(cross-build,
191 [ --with-cross-build=dir specify an absolute path to the build directory of an ICU built for the current platform [default=no cross dir]],
192 [cross_buildroot="${withval}"],
193 [cross_buildroot=""])
195 if test "X$cross_buildroot" = "X"; then
196 if test "$cross_compiling" = "yes"; then
197 AC_MSG_ERROR([Error! Cross compiling but no --with-cross-build option specified - please supply the path to an executable ICU's build root])
201 if test -f "${cross_buildroot}/config/icucross.mk"; then
202 AC_MSG_RESULT([Using cross buildroot: $cross_buildroot])
204 if test -d "${cross_buildroot}"; then
205 AC_MSG_ERROR([${cross_buildroot}/config/icucross.mk not found. Please build ICU in ${cross_buildroot} first.])
207 AC_MSG_ERROR([No such directory ${cross_buildroot} supplied as the argument to --with-cross-build. Use an absolute path.])
211 AC_SUBST(cross_buildroot)
213 # Check for doxygen to generate documentation
214 AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
216 # Check that the linker is usable
219 # Determine the executable suffix
220 # We don't use AC_EXEEXT because some compilers output separate debugging
221 # files, which confuses the AC_EXEEXT macro.
222 AC_MSG_CHECKING(checking for executable suffix)
224 *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;;
228 AC_MSG_RESULT($EXEEXT)
231 # Determine how strict we want to be when compiling
232 AC_CHECK_STRICT_COMPILE
234 # Check if we can build and use 64-bit libraries
237 AC_SUBST(COMPILE_LINK_ENVVAR)
239 # Determine the Makefile fragment
242 # Checks for libraries and other host specific stuff
243 # On HP/UX, don't link to -lm from a shared lib because it isn't
244 # PIC (at least on 10.2)
246 *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
248 *) AC_CHECK_LIB(m, floor)
253 # Check whether to build shared libraries
254 AC_MSG_CHECKING([whether to build shared libraries])
256 AC_ARG_ENABLE(shared,
257 [ --enable-shared build shared libraries [default=yes]],
258 [ case "${enableval}" in
259 yes|"") enabled=yes; ENABLE_SHARED=YES ;;
263 [enabled=yes; ENABLE_SHARED=YES]
265 AC_MSG_RESULT($enabled)
266 AC_SUBST(ENABLE_SHARED)
268 # Check whether to build static libraries
269 AC_MSG_CHECKING([whether to build static libraries])
271 AC_ARG_ENABLE(static,
272 [ --enable-static build static libraries [default=no]],
273 [ case "${enableval}" in
274 yes|"") enabled=yes; ENABLE_STATIC=YES ;;
279 AC_MSG_RESULT($enabled)
280 AC_SUBST(ENABLE_STATIC)
282 # When building release static library, there might be some optimization flags we can use
283 if test "$ENABLE_STATIC" = "YES"; then
284 if test "$ENABLE_SHARED" != "YES"; then
285 if test "$ENABLE_RELEASE" = 1; then
286 AC_MSG_CHECKING([whether we can use static library optimization option])
287 CHECK_STATIC_OPT_FLAG=no
289 OLD_CPPFLAGS="${CPPFLAGS}"
290 OLD_LDFLAGS="${LDFLAGS}"
293 *-linux*|i*86-*-*bsd*|i*86-pc-gnu)
294 if test "$GCC" = yes; then
295 CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections"
296 LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
303 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [CHECK_STATIC_OPT_FLAG=yes], [CHECK_STATIC_OPT_FLAG=no])
304 AC_MSG_RESULT($CHECK_STATIC_OPT_FLAG)
305 if test "$CHECK_STATIC_OPT_FLAG" = no; then
306 CPPFLAGS="${OLD_CPPFLAGS}"
307 LDFLAGS="${OLD_LDFLAGS}"
314 # Check whether to enable auto cleanup of libraries
315 AC_MSG_CHECKING([whether to enable auto cleanup of libraries])
317 UCLN_NO_AUTO_CLEANUP=1
318 AC_ARG_ENABLE(auto-cleanup,
319 [ --enable-auto-cleanup enable auto cleanup of libraries [default=no]],
320 [ case "${enableval}" in
322 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DUCLN_NO_AUTO_CLEANUP=0";
323 UCLN_NO_AUTO_CLEANUP=0
328 AC_MSG_RESULT($enabled)
329 AC_SUBST(UCLN_NO_AUTO_CLEANUP)
331 # MSVC floating-point option
333 if test $enabled = yes
335 if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc
337 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
338 #if defined _MSC_VER && _MSC_VER >= 1400
340 Microsoft Visual C++ < 2005
342 ]], [[]])],[MSVC_RELEASE_FLAG="/fp:precise"],[MSVC_RELEASE_FLAG="/Op"])
344 CFLAGS="${CFLAGS} ${MSVC_RELEASE_FLAG}"
345 CXXFLAGS="${CXXFLAGS} ${MSVC_RELEASE_FLAG}"
349 # Check whether to enabled draft APIs
350 AC_MSG_CHECKING([whether to enable draft APIs])
352 U_DEFAULT_SHOW_DRAFT=1
354 [ --enable-draft enable draft APIs (and internal APIs) [default=yes]],
355 [ case "${enableval}" in
356 no) enabled=no; U_DEFAULT_SHOW_DRAFT=0;
357 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEFAULT_SHOW_DRAFT=0"
362 AC_MSG_RESULT($enabled)
363 # Make sure that we can use draft API in ICU.
364 if test "$U_DEFAULT_SHOW_DRAFT" = 0; then
365 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_SHOW_DRAFT_API"
367 AC_SUBST(U_DEFAULT_SHOW_DRAFT)
371 # look for 'ar' the proper way
372 AC_CHECK_TOOL(AR, ar, false)
374 AC_MSG_CHECKING([whether to enable renaming of symbols])
377 AC_ARG_ENABLE(renaming,
378 [ --enable-renaming add a version suffix to symbols [default=yes]],
379 [ case "${enableval}" in
380 yes|"") enabled=yes ;;
381 no) enabled=no; U_DISABLE_RENAMING=1;
382 UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_DISABLE_RENAMING=1"
387 AC_MSG_RESULT($enabled)
388 AC_SUBST(U_DISABLE_RENAMING)
390 AC_MSG_CHECKING([whether to enable function and data tracing])
393 AC_ARG_ENABLE(tracing,
394 [ --enable-tracing enable function and data tracing [default=no]],
395 [ case "${enableval}" in
397 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_TRACING=1";
398 U_ENABLE_TRACING=1 ;;
399 no) enabled=no; U_ENABLE_TRACING=0 ;;
403 AC_MSG_RESULT($enabled)
404 AC_SUBST(U_ENABLE_TRACING)
406 # check if elf.h is present.
407 AC_CHECK_HEADERS([elf.h])
408 if test "x$ac_cv_header_elf_h" = "xyes"; then
409 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1";
414 AC_MSG_CHECKING([whether to enable dynamic loading of plugins])
415 AC_ARG_ENABLE(dyload,
416 [ --disable-dyload disable dynamic loading [default=no]],
417 [ case "${enableval}" in
425 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_DYLOAD=0";
430 AC_MSG_RESULT($enable)
431 AC_SUBST(U_ENABLE_DYLOAD)
433 if test "$enable" = "yes"; then
434 AC_CHECK_HEADERS([dlfcn.h])
435 #AC_MSG_RESULT($enabled)
436 AC_SEARCH_LIBS([dlopen], [dl])
437 AC_CHECK_FUNCS([dlopen])
439 if test "x$ac_cv_func_dlopen" != xyes; then
440 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DHAVE_DLOPEN=0"
444 # Check for miscellanous functions.
445 # So, use for putil / tools only.
446 # Note that this will generate HAVE_GETTIMEOFDAY, not U_HAVE_GETTIMEOFDAY
447 AC_CHECK_FUNCS([gettimeofday])
450 # Check whether to use the evil rpath or not
452 [ --enable-rpath use rpath when linking [default is only if necessary]],
453 [ case "${enableval}" in
454 yes|"") ENABLE_RPATH=YES ;;
460 AC_SUBST(ENABLE_RPATH)
465 AC_MSG_CHECKING([[if we have a C++ compiler]])
466 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx_okay=yes],[cxx_okay=no])
467 if test $cxx_okay = yes
469 AC_MSG_RESULT([[Good]])
471 AC_MSG_RESULT([[no]])
472 AC_MSG_ERROR([[C++ compiler $CXX does not work or no compiler found]])
475 if [[ "$GXX" = yes ]]; then
476 # if CXXFLAGS does not have a "-std=" setting, set it now to -std=c++0x,
477 # and check that the compiler still works.
478 if ! echo "$CXXFLAGS" | grep '\-std=' >/dev/null 2>&1; then
479 OLD_CXXFLAGS="${CXXFLAGS}"
480 CXXFLAGS="$CXXFLAGS --std=c++0x"
481 AC_MSG_CHECKING([[if we have a C++11 compiler]])
482 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx11_okay=yes],[cxx11_okay=no])
483 AC_MSG_RESULT($cxx11_okay)
484 if [[ $cxx11_okay = yes ]]; then
485 AC_MSG_NOTICE([Adding CXXFLAGS option --std=c++0x])
486 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=c++0x"
488 CXXFLAGS="$OLD_CXXFLAGS"
493 AC_MSG_CHECKING([[if #include <string> works]])
494 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string>]], [[]])], [ac_cv_header_stdstring=yes], [ac_cv_header_stdstring=no])
495 AC_MSG_RESULT($ac_cv_header_stdstring)
496 if test $ac_cv_header_stdstring = yes
501 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STD_STRING=0"
503 AC_SUBST(U_HAVE_STD_STRING)
506 AC_MSG_CHECKING([[if #include <atomic> works]])
507 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no])
508 AC_MSG_RESULT($ac_cv_header_atomic)
509 if test $ac_cv_header_atomic = yes
515 # Make this available via CPPFLAGS
516 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=${U_HAVE_ATOMIC}"
517 AC_SUBST(U_HAVE_ATOMIC)
521 # Always build ICU with multi-threading support.
526 if test $threads = true; then
527 # For Compaq Tru64 (OSF1), we must look for pthread_attr_init
528 # and must do this before seaching for pthread_mutex_destroy, or
529 # we will pick up libpthreads.so not libpthread.so
530 # If this fails, then we must test for HPUX specials, before
531 # moving on to a more generic test
533 AC_CHECK_LIB(pthread, pthread_attr_init)
534 if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
537 # Locate the right library for POSIX threads. We look for the
538 # symbols in the libraries first, because on Solaris libc provides
539 # pthread_create but libpthread has the real code :(
540 # AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread
541 # FreeBSD users may need libpthread if they do not have libc_r.
543 AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r )
545 if test "$ac_cv_search_pthread_mutex_destroy" != no; then
549 AC_CHECK_LIB(pthread, pthread_mutex_init)
550 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
555 AC_CHECK_FUNC(pthread_mutex_lock)
557 if test $ac_cv_func_pthread_mutex_lock = yes; then
561 # Check to see if we are using CygWin with MSVC
563 *-pc-cygwin*|*-pc-mingw*)
564 # For gcc, the thread options are set by mh-mingw/mh-cygwin
565 # For msvc, the thread options are set by runConfigureICU
569 # Add -mt because it does several nice things on newer compilers.
570 case "${icu_cv_host_frag}" in
572 OLD_CXXFLAGS="${CXXFLAGS}"
573 CXXFLAGS="${CXXFLAGS} -mt"
574 if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
575 CXXFLAGS="${OLD_CXXFLAGS}"
577 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -mt"
583 case "${icu_cv_host_frag}" in
592 AC_ARG_ENABLE(weak-threads,
593 [ --enable-weak-threads weakly reference the threading library [default=no]],
594 [case "${enableval}" in
596 LIB_THREAD="${LIBS%${OLD_LIBS}}"
600 *) AC_MSG_ERROR(bad value ${enableval} for --enable-weak-threads) ;;
606 # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
607 # Do this check instead.
609 AC_MSG_CHECKING([for mmap])
610 AC_CACHE_VAL(ac_cv_func_mmap_ok,
611 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
612 #include <sys/mman.h>
613 #include <sys/stat.h>
614 #include <fcntl.h>], [mmap((void *)0, 0, PROT_READ, 0, 0, 0);])],[ac_cv_func_mmap_ok=yes],[ac_cv_func_mmap_ok=no])] )
615 AC_MSG_RESULT($ac_cv_func_mmap_ok)
616 if test $ac_cv_func_mmap_ok = yes
620 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_MMAP=0"
624 AC_MSG_CHECKING([for genccode assembly])
626 # Check to see if genccode can generate simple assembly.
629 *-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu)
630 if test "$GCC" = yes; then
631 # We're using gcc, and the simple -a gcc command line works for genccode
632 GENCCODE_ASSEMBLY="-a gcc"
635 if test "$GCC" = yes; then
636 # When using gcc, look if we're also using GNU as.
637 # When using GNU as, the simple -a gcc command line works for genccode.
638 asv=`"${CC}" -print-prog-name=as 2>/dev/null`
639 asv=`"${asv}" --version 2>/dev/null`
641 X*GNU*) GENCCODE_ASSEMBLY="-a gcc" ;;
642 X*) GENCCODE_ASSEMBLY="-a sun-x86" ;;
646 GENCCODE_ASSEMBLY="-a sun-x86"
649 GENCCODE_ASSEMBLY="-a sun"
652 GENCCODE_ASSEMBLY="-a aCC-ia64"
655 AC_SUBST(GENCCODE_ASSEMBLY)
657 AC_MSG_RESULT($GENCCODE_ASSEMBLY)
659 # Checks for header files
660 AC_CHECK_HEADERS(inttypes.h)
661 if test $ac_cv_header_inttypes_h = no; then
663 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
667 if test "$CC" = ccc; then
668 AC_MSG_RESULT("C compiler set to CCC ${CC}" )
670 alpha*-*-*) U_HAVE_INTTYPES_H=0;
671 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
675 AC_SUBST(U_HAVE_INTTYPES_H)
677 AC_CHECK_HEADERS(dirent.h)
678 if test $ac_cv_header_dirent_h = no; then
680 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_DIRENT_H=0"
685 AC_SUBST(U_HAVE_DIRENT_H)
687 # Check for endianness
689 if test $ac_cv_c_bigendian = no; then
696 AC_SUBST(U_IS_BIG_ENDIAN)
698 # Do various POSIX related checks
699 U_HAVE_NL_LANGINFO_CODESET=0
700 U_NL_LANGINFO_CODESET=-1
701 AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
702 dnl AC_SUBST(U_HAVE_NL_LANGINFO)
703 if test $U_HAVE_NL_LANGINFO -eq 1; then
704 AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
705 ac_cv_nl_langinfo_codeset,
706 [ac_cv_nl_langinfo_codeset="unknown"
707 for a in CODESET _NL_CTYPE_CODESET_NAME; do
708 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo($a);]])],[ac_cv_nl_langinfo_codeset="$a"; break],[])]
710 if test x$ac_cv_nl_langinfo_codeset != xunknown
712 U_HAVE_NL_LANGINFO_CODESET=1
713 U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
714 if test "x${ac_cv_nl_langinfo_codeset}" != "xCODESET"
716 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DNL_LANGINFO_CODESET=${ac_cv_nl_langinfo_codeset}"
719 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_NL_LANGINFO_CODESET=0"
722 AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
723 AC_SUBST(U_NL_LANGINFO_CODESET)
725 # Namespace support checks
727 AC_MSG_CHECKING([for namespace support])
728 AC_CACHE_VAL(ac_cv_namespace_ok,
729 [AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace x_version {void f(){}}
730 namespace x = x_version;
731 using namespace x_version;
732 ], [f();])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] )
733 AC_MSG_RESULT($ac_cv_namespace_ok)
734 if test $ac_cv_namespace_ok = no
736 AC_MSG_ERROR(Namespace support is required to build ICU.)
739 AC_MSG_CHECKING([for properly overriding new and delete])
740 U_OVERRIDE_CXX_ALLOCATION=0
741 U_HAVE_PLACEMENT_NEW=0
742 AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
743 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
746 void *operator new(size_t size) {return malloc(size);}
747 void *operator new[](size_t size) {return malloc(size);}
748 void operator delete(void *p) {free(p);}
749 void operator delete[](void *p) {free(p);}
751 ]], [])],[ac_cv_override_cxx_allocation_ok=yes],[ac_cv_override_cxx_allocation_ok=no])] )
752 AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
753 if test $ac_cv_override_cxx_allocation_ok = yes
755 U_OVERRIDE_CXX_ALLOCATION=1
756 AC_MSG_CHECKING([for placement new and delete])
757 AC_CACHE_VAL(ac_cv_override_placement_new_ok,
758 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
761 void *operator new(size_t size) {return malloc(size);}
762 void *operator new[](size_t size) {return malloc(size);}
763 void operator delete(void *p) {free(p);}
764 void operator delete[](void *p) {free(p);}
765 void * operator new(size_t, void *ptr) { return ptr; }
766 void operator delete(void *, void *) {}
768 ]], [])],[ac_cv_override_placement_new_ok=yes],[ac_cv_override_placement_new_ok=no])] )
769 AC_MSG_RESULT($ac_cv_override_placement_new_ok)
770 if test $ac_cv_override_placement_new_ok = yes
772 U_HAVE_PLACEMENT_NEW=1
774 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_PLACEMENT_NEW=0"
777 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_OVERRIDE_CXX_ALLOCATION=0"
779 AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
780 AC_SUBST(U_HAVE_PLACEMENT_NEW)
784 if test x$ac_cv_func_popen = xyes
788 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_POPEN=0"
791 AC_SUBST(U_HAVE_POPEN)
795 if test x$ac_cv_func_tzset = xyes
800 AC_CHECK_FUNC(_tzset)
801 if test x$ac_cv_func__tzset = xyes
806 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"
809 AC_SUBST(U_HAVE_TZSET)
813 AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
814 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef __USE_POSIX
819 #ifndef tzname /* For SGI. */
820 extern char *tzname[]; /* RS6000 and others reject char **tzname. */
821 #endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])])
822 if test $ac_cv_var_tzname = yes; then
826 AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
827 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
829 extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])])
830 if test $ac_cv_var__tzname = yes; then
834 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZNAME=0"
837 AC_SUBST(U_HAVE_TZNAME)
840 AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
841 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#ifndef __USE_POSIX
848 ], [[timezone = 1;]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])])
850 if test $ac_cv_var_timezone = yes; then
854 AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
855 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[__timezone = 1;]])],[ac_cv_var___timezone=yes],[ac_cv_var___timezone=no])])
856 if test $ac_cv_var___timezone = yes; then
857 U_TIMEZONE=__timezone
860 AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
861 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[_timezone = 1;]])],[ac_cv_var__timezone=yes],[ac_cv_var__timezone=no])])
862 if test $ac_cv_var__timezone = yes; then
866 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TIMEZONE=0"
870 AC_SUBST(U_HAVE_TIMEZONE)
873 # Checks for typedefs
874 AC_CHECK_TYPE(int8_t,signed char)
875 AC_CHECK_TYPE(uint8_t,unsigned char)
876 AC_CHECK_TYPE(int16_t,signed short)
877 AC_CHECK_TYPE(uint16_t,unsigned short)
878 AC_CHECK_TYPE(int32_t,signed long)
879 AC_CHECK_TYPE(uint32_t,unsigned long)
880 AC_CHECK_TYPE(int64_t,signed long long)
881 AC_CHECK_TYPE(uint64_t,unsigned long long)
883 if test $ac_cv_type_int8_t = no; then
884 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT8_T=0"
887 if test $ac_cv_type_uint8_t = no; then
888 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT8_T=0"
891 if test $ac_cv_type_int16_t = no; then
892 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT16_T=0"
895 if test $ac_cv_type_uint16_t = no; then
896 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT16_T=0"
899 if test $ac_cv_type_int32_t = no; then
900 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT32_T=0"
903 if test $ac_cv_type_uint32_t = no; then
904 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT32_T=0"
907 if test $ac_cv_type_int64_t = no; then
908 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT64_T=0"
911 if test $ac_cv_type_uint64_t = no; then
912 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT64_T=0"
915 # Do various wchar_t related checks
916 AC_CHECK_HEADER(wchar.h)
917 if test "$ac_cv_header_wchar_h" = no
921 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCHAR_H=0 -DU_HAVE_WCSCPY=0"
923 AC_DEFINE([HAVE_WCHAR_H], [1], [wchar.h was found.])
925 # Some broken systems have wchar.h but not some of its functions...
926 AC_SEARCH_LIBS(wcscpy, wcs w)
927 if test "$ac_cv_search_wcscpy" != no; then
931 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCSCPY=0"
934 AC_SUBST(U_HAVE_WCHAR_H)
935 AC_SUBST(U_HAVE_WCSCPY)
937 AC_CHECK_SIZEOF([wchar_t], 0, [
946 U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
947 # We do this check to verify that everything is okay.
948 if test $U_SIZEOF_WCHAR_T = 0; then
949 if test $U_HAVE_WCHAR_H=1; then
950 AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
954 AC_MSG_CHECKING([for UTF-16 string literal support])
955 U_CHECK_UTF16_STRING=1
956 CHECK_UTF16_STRING_RESULT="unknown"
959 *-*-aix*|powerpc64-*-linux*)
960 if test "$GCC" = no; then
961 OLD_CFLAGS="${CFLAGS}"
962 OLD_CXXFLAGS="${CXXFLAGS}"
963 CFLAGS="${CFLAGS} -qutf"
964 CXXFLAGS="${CXXFLAGS} -qutf"
965 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = u"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
966 if test "$U_CHECK_UTF16_STRING" = 0; then
967 CFLAGS="${OLD_CFLAGS}"
968 CXXFLAGS="${OLD_CXXFLAGS}"
970 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -qutf"
971 CHECK_UTF16_STRING_RESULT="-qutf"
976 if test "$GCC" = no; then
977 OLD_CFLAGS="${CFLAGS}"
978 OLD_CXXFLAGS="${CXXFLAGS}"
979 CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
980 CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort"
981 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = U"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
982 if test "$U_CHECK_UTF16_STRING" = 0; then
983 CFLAGS="${OLD_CFLAGS}"
984 CXXFLAGS="${OLD_CXXFLAGS}"
986 CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
987 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -xustr=ascii_utf16_ushort"
988 UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -xustr=ascii_utf16_ushort"
989 # Since we can't detect the availability of this UTF-16 syntax at compile time,
990 # we depend on configure telling us that we can use it.
991 # Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
992 # we only use this macro within ICU.
993 # If an ICU user uses icu-config, this feature will be enabled.
994 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_CHECK_UTF16_STRING=1"
995 U_CHECK_UTF16_STRING=0
1000 if test "$GCC" = no; then
1001 # The option will be detected at compile time without additional compiler options.
1002 CHECK_UTF16_STRING_RESULT="available"
1006 # wchar_t can be used
1007 CHECK_UTF16_STRING_RESULT="available"
1013 # GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future.
1014 if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
1015 if test "$GCC" = yes; then
1016 OLD_CFLAGS="${CFLAGS}"
1017 CFLAGS="${CFLAGS} -std=gnu99"
1018 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1019 static const char16_t test[] = u"This is a UTF16 literal string.";
1020 ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0])
1021 if test "$CC_UTF16_STRING" = 1; then
1022 UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=gnu99"
1023 CHECK_UTF16_STRING_RESULT="C only";
1025 CFLAGS="${OLD_CFLAGS}"
1028 if test "$GXX" = yes; then
1029 # -Wno-return-type-c-linkage is desired so that stable ICU API is not warned about.
1031 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1032 static const char16_t test[] = u"This is a UTF16 literal string.";
1033 ]], [[]])],[CXX_UTF16_STRING=1],[CXX_UTF16_STRING=0])
1035 if test "$CXX_UTF16_STRING" = 1; then
1036 if test "$CC_UTF16_STRING" = 1; then
1037 CHECK_UTF16_STRING_RESULT="available";
1039 CHECK_UTF16_STRING_RESULT="C++ only";
1044 AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT)
1046 # Enable/disable extras
1047 AC_ARG_ENABLE(extras,
1048 [ --enable-extras build ICU extras [default=yes]],
1049 [case "${enableval}" in
1052 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
1055 ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
1056 AC_ARG_ENABLE(icuio,
1057 [ --enable-icuio build ICU's icuio library [default=yes]],
1058 [case "${enableval}" in
1061 *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
1064 ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
1066 # Enable/disable layout
1067 AC_ARG_ENABLE(layout,
1068 [ --enable-layout build ICU's DEPRECATED layout library [default=yes]],
1069 [case "${enableval}" in
1072 *) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;;
1075 ICU_CONDITIONAL(LAYOUT, test "$layout" = true)
1077 # Enable/disable layoutex
1078 AC_ARG_ENABLE(layoutex,
1079 [ --enable-layoutex build ICU's Paragraph Layout library [default=same-as-layout].
1080 If not building with the ICU Layout library, then icu-le-hb must be installed via pkg-config.
1081 See http://harfbuzz.org],
1082 [case "${enableval}" in
1083 yes) layoutex=true ;;
1084 no) layoutex=false ;;
1085 *) AC_MSG_ERROR(bad value ${enableval} for --enable-layoutex) ;;
1088 ICU_CONDITIONAL(LAYOUTEX, test "$layoutex" = true)
1090 # Enable/disable tools
1091 AC_ARG_ENABLE(tools,
1092 [ --enable-tools build ICU's tools [default=yes]],
1093 [case "${enableval}" in
1096 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
1099 ICU_CONDITIONAL(TOOLS, test "$tools" = true)
1101 AC_ARG_WITH(data-packaging,
1102 [ --with-data-packaging specify how to package ICU data. Possible values:
1103 files raw files (.res, etc)
1104 archive build a single icudtXX.dat file
1105 library shared library (.dll/.so/etc.)
1106 static static library (.a/.lib/etc.)
1107 auto build shared if possible (default)
1108 See http://userguide.icu-project.org/icudata for more info.],
1109 [case "${withval}" in
1110 files|archive|library) datapackaging=$withval ;;
1111 auto) datapackaging=$withval ;;
1112 common) datapackaging=archive ;;
1113 dll) datapackaging=library ;;
1114 static) datapackaging=static ;;
1115 *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
1119 # Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
1120 # thesysconfdir=`eval echo $sysconfdir`
1121 dnl# AC_SUBST(thesysconfdir)
1122 dnl# thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
1123 dnl# AC_SUBST(thelibdir)
1124 thedatadir=`eval echo $datadir`
1125 dnl# AC_SUBST(thedatadir)
1126 # 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}.
1127 pkgicudatadir=$datadir
1128 thepkgicudatadir=$thedatadir
1129 AC_SUBST(pkgicudatadir)
1130 AC_SUBST(thepkgicudatadir)
1132 dnl# Shouldn't need the AC_SUBST
1134 if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
1135 # default to library
1136 datapackaging=library
1137 if test "$ENABLE_STATIC" = "YES"; then
1138 if test "$ENABLE_SHARED" != "YES"; then
1139 datapackaging=static
1144 datapackaging_dir=`eval echo $thedatadir`"/icu/${VERSION}"
1146 datapackaging_msg="(No explaination for mode $datapackaging.)"
1148 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."
1149 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."
1150 datapackaging_howfound="(unknown)"
1152 case "$datapackaging" in
1154 DATA_PACKAGING_MODE=files
1155 datapackaging_msg="ICU data will be stored in individual files."
1156 datapackaging_howfound="$datapackaging_msg_path"
1159 DATA_PACKAGING_MODE=common
1160 datapackaging_msg="ICU data will be stored in a single .dat file."
1161 datapackaging_howfound="$datapackaging_msg_path"
1164 DATA_PACKAGING_MODE=dll
1165 datapackaging_msg="ICU data will be linked with ICU."
1166 if test "$ENABLE_STATIC" = "YES"; then
1167 datapackaging_msg="$datapackaging_msg A static data library will be built. "
1169 if test "$ENABLE_SHARED" = "YES"; then
1170 datapackaging_msg="$datapackaging_msg A shared data library will be built. "
1172 datapackaging_howfound="$datapackaging_msg_set"
1175 DATA_PACKAGING_MODE=static
1176 datapackaging_msg="ICU data will be stored in a static library."
1177 datapackaging_howfound="$datapackaging_msg_set"
1180 AC_SUBST(DATA_PACKAGING_MODE)
1182 # Sets a library suffix
1183 AC_MSG_CHECKING([for a library suffix to use])
1184 AC_ARG_WITH(library-suffix,
1185 [ --with-library-suffix=suffix tag a suffix to the library names [default=]],
1186 [ICULIBSUFFIX="${withval}"],
1189 if test "$msg" = ""; then
1193 AC_SUBST(ICULIBSUFFIX)
1194 if test "$ICULIBSUFFIX" != ""
1197 ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
1198 UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} "
1202 AC_SUBST(U_HAVE_LIB_SUFFIX)
1203 AC_SUBST(ICULIBSUFFIXCNAME)
1205 # Enable/disable tests
1206 AC_ARG_ENABLE(tests,
1207 [ --enable-tests build ICU tests [default=yes]],
1208 [case "${enableval}" in
1211 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
1214 ICU_CONDITIONAL(TESTS, test "$tests" = true)
1216 # Enable/disable samples
1217 AC_ARG_ENABLE(samples,
1218 [ --enable-samples build ICU samples [default=yes]
1220 Additionally, the variable FORCE_LIBS may be set before calling configure.
1221 If set, it will REPLACE any automatic list of libraries.],
1222 [case "${enableval}" in
1223 yes) samples=true ;;
1224 no) samples=false ;;
1225 *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
1228 ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
1230 ICUDATA_CHAR=$U_ENDIAN_CHAR
1232 # Platform-specific Makefile setup
1233 # set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
1235 *-*-solaris*) platform=U_SOLARIS ;;
1236 *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) platform=U_LINUX ;;
1237 *-*-*bsd*|*-*-dragonfly*) platform=U_BSD ;;
1238 *-*-aix*) platform=U_AIX ;;
1239 *-*-hpux*) platform=U_HPUX ;;
1240 *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
1241 *-*-cygwin*) platform=U_CYGWIN ;;
1242 *-*-mingw*) platform=U_MINGW ;;
1243 *-*ibm-openedition*|*-*-os390*) platform=OS390
1244 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
1247 *-*-os400*) platform=OS400
1248 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
1251 *-*-nto*) platform=U_QNX ;;
1252 *-dec-osf*) platform=U_OSF ;;
1253 *-*-beos) platform=U_BEOS ;;
1254 *-*-irix*) platform=U_IRIX ;;
1255 *-ncr-*) platform=U_MPRAS ;;
1256 *) platform=U_UNKNOWN_PLATFORM ;;
1258 AC_SUBST(ICUDATA_CHAR)
1260 platform_make_fragment_name="$icu_cv_host_frag"
1261 platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
1262 AC_SUBST(platform_make_fragment_name)
1263 AC_SUBST(platform_make_fragment)
1265 if test "${FORCE_LIBS}" != ""; then
1266 echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
1270 # Now that we're done using CPPFLAGS etc. for tests, we can change it
1273 if test "${CC}" == "clang"; then
1274 CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality"
1279 if test "${CXX}" == "clang++"; then
1280 CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality"
1285 CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
1286 CFLAGS="$CFLAGS \$(THREADSCFLAGS) $CLANGCFLAGS"
1287 CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS) $CLANGCXXFLAGS"
1290 AC_SUBST(LIBCXXFLAGS)
1292 # append all config cppflags
1293 CPPFLAGS="$CPPFLAGS $CONFIG_CPPFLAGS $UCONFIG_CPPFLAGS"
1295 echo "CPPFLAGS=$CPPFLAGS"
1296 echo "CFLAGS=$CFLAGS"
1297 echo "CXXFLAGS=$CXXFLAGS"
1300 # output the Makefiles
1301 AC_CONFIG_FILES([icudefs.mk \
1303 data/pkgdataMakefile \
1304 config/Makefile.inc \
1306 config/pkgdataMakefile \
1315 extra/uconv/Makefile \
1316 extra/uconv/pkgdataMakefile \
1317 extra/scrptrun/Makefile \
1319 tools/ctestfw/Makefile \
1320 tools/toolutil/Makefile \
1321 tools/makeconv/Makefile \
1322 tools/genrb/Makefile \
1323 tools/genccode/Makefile \
1324 tools/gencmn/Makefile \
1325 tools/gencnval/Makefile \
1326 tools/gendict/Makefile \
1327 tools/gentest/Makefile \
1328 tools/gennorm2/Makefile \
1329 tools/genbrk/Makefile \
1330 tools/gensprep/Makefile \
1331 tools/icuinfo/Makefile \
1332 tools/icupkg/Makefile \
1333 tools/icuswap/Makefile \
1334 tools/pkgdata/Makefile \
1335 tools/tzcode/Makefile \
1336 tools/gencfu/Makefile \
1338 test/compat/Makefile \
1339 test/testdata/Makefile \
1340 test/testdata/pkgdataMakefile \
1341 test/hdrtst/Makefile \
1342 test/intltest/Makefile \
1343 test/cintltst/Makefile \
1344 test/iotest/Makefile \
1345 test/letest/Makefile \
1346 test/perf/Makefile \
1347 test/perf/collationperf/Makefile \
1348 test/perf/collperf/Makefile \
1349 test/perf/collperf2/Makefile \
1350 test/perf/dicttrieperf/Makefile \
1351 test/perf/ubrkperf/Makefile \
1352 test/perf/charperf/Makefile \
1353 test/perf/convperf/Makefile \
1354 test/perf/normperf/Makefile \
1355 test/perf/DateFmtPerf/Makefile \
1356 test/perf/howExpensiveIs/Makefile \
1357 test/perf/strsrchperf/Makefile \
1358 test/perf/unisetperf/Makefile \
1359 test/perf/usetperf/Makefile \
1360 test/perf/ustrperf/Makefile \
1361 test/perf/utfperf/Makefile \
1362 test/perf/utrie2perf/Makefile \
1363 test/perf/leperf/Makefile \
1364 samples/Makefile samples/date/Makefile \
1365 samples/cal/Makefile samples/layout/Makefile])
1369 echo "ICU for C/C++ $VERSION is ready to be built."
1370 echo "=== Important Notes: ==="
1372 echo "Data Packaging: $datapackaging"
1373 echo " This means: $datapackaging_msg"
1374 echo " To locate data: $datapackaging_howfound"
1376 if test -n "`$U_MAKE -v 2>&1 | grep '^GNU Make'`"; then
1377 echo "Building ICU: Use a GNU make such as $U_MAKE to build ICU."
1379 echo "** WARNING: $U_MAKE may not be GNU make."
1380 echo "This may cause ICU to fail to build. Please make sure that GNU make"
1381 echo "is in your PATH so that the configure script can detect its location."
1383 if test "x$AR" = "xfalse"; then
1384 echo "*** WARNING: Archiver ar not found. Set AR= or fix PATH. Some builds (such as static) may fail."
1387 AC_MSG_CHECKING([the version of "$U_MAKE"])
1388 if "$U_MAKE" -f "$srcdir/config/gmakever.mk" PLATFORM="$platform"; then
1391 AC_MSG_RESULT([too old or test failed - try upgrading GNU Make])
1394 AC_SUBST(UCONFIG_CPPFLAGS)
1395 if test -n "$UCONFIG_CPPFLAGS"; then
1396 HDRFILE="uconfig.h.prepend"
1397 echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:"
1399 echo " ${UCONFIG_CPPFLAGS}"
1401 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.'
1402 echo "Creating the file ${HDRFILE}"
1404 echo '--------------- ' "${HDRFILE}"
1406 echo '/* ICU customizations: put these lines at the top of uconfig.h */' >> "${HDRFILE}"
1407 echo >> "${HDRFILE}"
1408 for flag in ${UCONFIG_CPPFLAGS};
1410 echo " /* $flag */" >> "${HDRFILE}"
1413 [ \echo "${flag}" | sed -n 's%-D\([^=]*\)=%#define \1 %p' >> "${HDRFILE}" ]
1414 \echo >> "${HDRFILE}"
1417 [ \echo "${flag}" | sed -n 's%-D\([^=]*\)%#define \1 %p' >> "${HDRFILE}" ]
1418 \echo >> "${HDRFILE}"
1421 \echo "/* Not sure how to handle this argument: ${flag} */" >> "${HDRFILE}"
1422 \echo >> "${HDRFILE}"
1427 \echo "/* End of ${HDRFILE} ------------ */" >> "${HDRFILE}"
1428 echo >> "${HDRFILE}"
1429 echo '--------------- end ' "${HDRFILE}"
1432 AC_SUBST(UCONFIG_CFLAGS)
1433 if test -n "$UCONFIG_CFLAGS"; then
1434 echo "C apps may want to build with CFLAGS = ${UCONFIG_CFLAGS}"
1436 AC_SUBST(UCONFIG_CXXFLAGS)
1437 if test -n "$UCONFIG_CXXFLAGS"; then
1438 echo "C++ apps may want to build with CXXFLAGS = ${UCONFIG_CXXFLAGS}"
1441 if test "$tools" = false;
1443 echo "## Note: you have disabled ICU's tools. This ICU cannot build its own data or tests."
1444 echo "## Expect build failures in the 'data', 'test', and other directories."
1447 $as_unset _CXX_CXXSUFFIX