1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/configure.ac Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,1425 @@ 1.4 +# -*-autoconf-*- 1.5 +AC_COPYRIGHT([ Copyright (c) 1999-2013, International Business Machines Corporation and others. All Rights Reserved. ]) 1.6 +# configure.in for ICU 1.7 +# Stephen F. Booth, heavily modified by Yves and others 1.8 + 1.9 +# Check for autoconf version 1.10 +AC_PREREQ(2.68) 1.11 + 1.12 +# Process this file with autoconf to produce a configure script 1.13 +AC_INIT([ICU]) 1.14 + 1.15 +#TODO: IcuBug:8502 1.16 +#AC_INIT([ICU], 1.17 +# m4_esyscmd_s([sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "./common/unicode/uvernum.h]"), 1.18 +# [http://icu-project.org/bugs], 1.19 +# [International Components for Unicode], 1.20 +# [http://icu-project.org]) 1.21 + 1.22 +AC_CONFIG_SRCDIR([common/unicode/utypes.h]) 1.23 + 1.24 +PACKAGE="icu" 1.25 +AC_SUBST(PACKAGE) 1.26 + 1.27 +# Use custom echo test for newline option 1.28 +# Current autoconf (2.65) gives incorrect echo newline option 1.29 +# for icu-config 1.30 +# This may be removed later - mow (June 17, 2010) 1.31 +ICU_ECHO_C= ICU_ECHO_N= ICU_ECHO_T= 1.32 +case `/bin/sh -c "echo -n x"` in 1.33 +-n*) 1.34 + case `/bin/sh -c "echo 'x\c'"` in 1.35 + *c*) ICU_ECHO_T=' ';; # ECHO_T is single tab character. 1.36 + *) ICU_ECHO_C='\c';; 1.37 + esac;; 1.38 +*) 1.39 + ICU_ECHO_N='-n';; 1.40 +esac 1.41 +AC_SUBST(ICU_ECHO_N) 1.42 +AC_SUBST(ICU_ECHO_C) 1.43 +AC_SUBST(ICU_ECHO_T) 1.44 + 1.45 +AC_MSG_CHECKING(for ICU version numbers) 1.46 + 1.47 +# Get the ICU version from uversion.h or other headers 1.48 +geticuversion() { 1.49 + [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"] 1.50 +} 1.51 +getuversion() { 1.52 + [sed -n 's/^[ ]*#[ ]*define[ ]*U_UNICODE_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"] 1.53 +} 1.54 +VERSION=`geticuversion $srcdir/common/unicode/uvernum.h` 1.55 +if test x"$VERSION" = x; then 1.56 + as_fn_error $? "Cannot determine ICU version number from uvernum.h header file" "$LINENO" 5 1.57 +fi 1.58 + 1.59 +#TODO: IcuBug:8502 1.60 +#if test "$VERSION" != "$PACKAGE_VERSION"; then 1.61 +# AC_MSG_ERROR([configure was generated for $PACKAGE_VERSION but uvernum.h has $VERSION - please rerun autoconf]) 1.62 +#fi 1.63 + 1.64 +UNICODE_VERSION=`getuversion $srcdir/common/unicode/uchar.h` 1.65 +if test x"$UNICODE_VERSION" = x; then 1.66 + AC_MSG_ERROR([Cannot determine Unicode version number from uchar.h header file]) 1.67 +fi 1.68 +# Compute a reasonable library version from the release version. This is 1.69 +# very bad, but that's wanted... We want to make sure that the LIB_VERSION 1.70 +# has at least a dot in it, so we'll add a .0 if needed. 1.71 +#[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`] 1.72 +LIB_VERSION=$VERSION 1.73 +LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'` 1.74 +AC_SUBST(VERSION) 1.75 +AC_SUBST(LIB_VERSION) 1.76 +AC_SUBST(LIB_VERSION_MAJOR) 1.77 +AC_MSG_RESULT([release $VERSION, library $LIB_VERSION, unicode version $UNICODE_VERSION]) 1.78 + 1.79 +AC_SUBST(UNICODE_VERSION) 1.80 + 1.81 +# Determine the host system 1.82 +AC_CANONICAL_HOST 1.83 + 1.84 +AC_SUBST(CPPFLAGS) 1.85 + 1.86 +# This variable is needed on z/OS because the C++ compiler only recognizes .C 1.87 +_CXX_CXXSUFFIX=cpp 1.88 +export _CXX_CXXSUFFIX 1.89 + 1.90 +# Accumulate #defines 1.91 + 1.92 +# CONFIG_CPPFLAGS: These are defines that are set for ICU Build time only. 1.93 +# They are only needed for building ICU itself. Example: platform stuff 1.94 +CONFIG_CPPFLAGS="" 1.95 +# UCONFIG_CPPFLAGS: These are defines which are set for ICU build time, 1.96 +# and also a notice is output that they need to be set 1.97 +# for end-users of ICU also. uconfig.h.prepend is generated 1.98 +# with, for example, "#define U_DISABLE_RENAMING 1" 1.99 +# Example: ICU configuration stuff 1.100 +UCONFIG_CPPFLAGS="" 1.101 +# UCONFIG_CFLAGS: contains a copy of anything that needs to be set by end users 1.102 +# such as -std 1.103 +UCONFIG_CFLAGS="" 1.104 + 1.105 +# Check whether to build debug libraries 1.106 +AC_MSG_CHECKING([whether to build debug libraries]) 1.107 +enabled=no 1.108 +ENABLE_DEBUG=0 1.109 +AC_ARG_ENABLE(debug, 1.110 + [ --enable-debug build debug libraries and enable the U_DEBUG define [default=no]], 1.111 + [ case "${enableval}" in 1.112 + yes|"") enabled=yes; ENABLE_DEBUG=1; CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEBUG=1" ;; 1.113 + *) ;; 1.114 + esac], 1.115 +) 1.116 +AC_MSG_RESULT($enabled) 1.117 +AC_SUBST(ENABLE_DEBUG) 1.118 + 1.119 +# Check whether to build release libraries 1.120 +AC_MSG_CHECKING([whether to build release libraries]) 1.121 +enabled=yes 1.122 +ENABLE_RELEASE=1 1.123 +AC_ARG_ENABLE(release, 1.124 + [ --enable-release build release libraries [default=yes]], 1.125 + [ case "${enableval}" in 1.126 + no) enabled=no; ENABLE_RELEASE=0 ;; 1.127 + *) ;; 1.128 + esac], 1.129 +) 1.130 +AC_MSG_RESULT($enabled) 1.131 +AC_SUBST(ENABLE_RELEASE) 1.132 + 1.133 +# Don't use the default C/CXXFLags 1.134 +: ${CFLAGS=""} 1.135 +: ${CXXFLAGS=""} 1.136 + 1.137 +# Checks for compilers 1.138 +AC_PROG_CC([clang gcc cc c99 c89 xlc_r xlc cl.exe icc]) 1.139 +# Make sure that we try clang++ first, which provides C++11 support. 1.140 +# The g++ compiler is less likely to support C++11. 1.141 +AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RCC]) 1.142 + 1.143 +# Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option 1.144 +# The release mode use is the default one for autoconf 1.145 +if test "$GCC" = yes; then 1.146 + if test "$CFLAGS" = ""; then 1.147 + if test "$ENABLE_DEBUG" = 1; then 1.148 + CFLAGS=-g 1.149 + fi 1.150 + if test "$ENABLE_RELEASE" = 1; then 1.151 + CFLAGS="$CFLAGS -O2" 1.152 + fi 1.153 + fi 1.154 + if test "$CXXFLAGS" = ""; then 1.155 + if test "$ENABLE_DEBUG" = 1; then 1.156 + CXXFLAGS=-g 1.157 + fi 1.158 + if test "$ENABLE_RELEASE" = 1; then 1.159 + CXXFLAGS="$CXXFLAGS -O2" 1.160 + fi 1.161 + fi 1.162 +fi 1.163 + 1.164 +AC_PROG_CPP 1.165 + 1.166 +AC_PROG_INSTALL 1.167 + 1.168 +AC_SUBST(cross_compiling) 1.169 + 1.170 +dnl use the pld hack to get ac_fn_cxx_try_link defined globally and not local 1.171 +AC_LANG_PUSH([C++]) 1.172 +AC_LINK_IFELSE([AC_LANG_PROGRAM()]) 1.173 +AC_LANG_POP([C++]) 1.174 + 1.175 +# make sure install is relative to srcdir - if a script 1.176 +if test "$srcdir" = "."; then 1.177 + # If srcdir isn't just ., then (srcdir) is already prepended. 1.178 + if test "${ac_install_sh}" = "${INSTALL}"; then 1.179 + INSTALL="\\\$(top_srcdir)/${ac_install_sh}" 1.180 + fi 1.181 +fi 1.182 + 1.183 +#AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true) 1.184 +#AC_CHECK_PROG(STRIP, strip, strip, true) 1.185 + 1.186 +# Check for the platform make 1.187 +AC_PATH_PROGS(U_MAKE, gmake gnumake, make) 1.188 +AC_SUBST(U_MAKE) 1.189 + 1.190 + 1.191 +AC_ARG_WITH(cross-build, 1.192 + [ --with-cross-build=dir specify an absolute path to the build directory of an ICU built for the current platform [default=no cross dir]], 1.193 + [cross_buildroot="${withval}"], 1.194 + [cross_buildroot=""]) 1.195 + 1.196 +if test "X$cross_buildroot" = "X"; then 1.197 + if test "$cross_compiling" = "yes"; then 1.198 + AC_MSG_ERROR([Error! Cross compiling but no --with-cross-build option specified - please supply the path to an executable ICU's build root]) 1.199 + dnl ' 1.200 + fi 1.201 +else 1.202 + if test -f "${cross_buildroot}/config/icucross.mk"; then 1.203 + AC_MSG_RESULT([Using cross buildroot: $cross_buildroot]) 1.204 + else 1.205 + if test -d "${cross_buildroot}"; then 1.206 + AC_MSG_ERROR([${cross_buildroot}/config/icucross.mk not found. Please build ICU in ${cross_buildroot} first.]) 1.207 + else 1.208 + AC_MSG_ERROR([No such directory ${cross_buildroot} supplied as the argument to --with-cross-build. Use an absolute path.]) 1.209 + fi 1.210 + fi 1.211 +fi 1.212 +AC_SUBST(cross_buildroot) 1.213 + 1.214 +# Check for doxygen to generate documentation 1.215 +AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin) 1.216 + 1.217 +# Check that the linker is usable 1.218 +ICU_PROG_LINK 1.219 + 1.220 +# Determine the executable suffix 1.221 +# We don't use AC_EXEEXT because some compilers output separate debugging 1.222 +# files, which confuses the AC_EXEEXT macro. 1.223 +AC_MSG_CHECKING(checking for executable suffix) 1.224 +case "${host}" in 1.225 + *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;; 1.226 + *) EXEEXT="" ;; 1.227 +esac 1.228 +ac_exeext=$EXEEXT 1.229 +AC_MSG_RESULT($EXEEXT) 1.230 +AC_SUBST(EXEEXT) 1.231 + 1.232 +# Determine how strict we want to be when compiling 1.233 +AC_CHECK_STRICT_COMPILE 1.234 + 1.235 +# Check if we can build and use 64-bit libraries 1.236 +AC_CHECK_64BIT_LIBS 1.237 +AC_SUBST(ARFLAGS) 1.238 +AC_SUBST(COMPILE_LINK_ENVVAR) 1.239 + 1.240 +# Determine the Makefile fragment 1.241 +ICU_CHECK_MH_FRAG 1.242 + 1.243 +# Checks for libraries and other host specific stuff 1.244 +# On HP/UX, don't link to -lm from a shared lib because it isn't 1.245 +# PIC (at least on 10.2) 1.246 +case "${host}" in 1.247 + *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;; 1.248 + 1.249 + *) AC_CHECK_LIB(m, floor) 1.250 + LIB_M="" ;; 1.251 +esac 1.252 +AC_SUBST(LIB_M) 1.253 + 1.254 +# Check whether to build shared libraries 1.255 +AC_MSG_CHECKING([whether to build shared libraries]) 1.256 +enabled=no 1.257 +AC_ARG_ENABLE(shared, 1.258 + [ --enable-shared build shared libraries [default=yes]], 1.259 + [ case "${enableval}" in 1.260 + yes|"") enabled=yes; ENABLE_SHARED=YES ;; 1.261 + no);; 1.262 + *) ;; 1.263 + esac], 1.264 + [enabled=yes; ENABLE_SHARED=YES] 1.265 +) 1.266 +AC_MSG_RESULT($enabled) 1.267 +AC_SUBST(ENABLE_SHARED) 1.268 + 1.269 +# Check whether to build static libraries 1.270 +AC_MSG_CHECKING([whether to build static libraries]) 1.271 +enabled=no 1.272 +AC_ARG_ENABLE(static, 1.273 + [ --enable-static build static libraries [default=no]], 1.274 + [ case "${enableval}" in 1.275 + yes|"") enabled=yes; ENABLE_STATIC=YES ;; 1.276 + no) ;; 1.277 + *) ;; 1.278 + esac], 1.279 +) 1.280 +AC_MSG_RESULT($enabled) 1.281 +AC_SUBST(ENABLE_STATIC) 1.282 + 1.283 +# When building release static library, there might be some optimization flags we can use 1.284 +if test "$ENABLE_STATIC" = "YES"; then 1.285 + if test "$ENABLE_SHARED" != "YES"; then 1.286 + if test "$ENABLE_RELEASE" = 1; then 1.287 + AC_MSG_CHECKING([whether we can use static library optimization option]) 1.288 + CHECK_STATIC_OPT_FLAG=no 1.289 + 1.290 + OLD_CPPFLAGS="${CPPFLAGS}" 1.291 + OLD_LDFLAGS="${LDFLAGS}" 1.292 + 1.293 + case "${host}" in 1.294 + *-linux*|i*86-*-*bsd*|i*86-pc-gnu) 1.295 + if test "$GCC" = yes; then 1.296 + CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections" 1.297 + LDFLAGS="${LDFLAGS} -Wl,--gc-sections" 1.298 + fi 1.299 + ;; 1.300 + *) 1.301 + ;; 1.302 + esac 1.303 + 1.304 + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [CHECK_STATIC_OPT_FLAG=yes], [CHECK_STATIC_OPT_FLAG=no]) 1.305 + AC_MSG_RESULT($CHECK_STATIC_OPT_FLAG) 1.306 + if test "$CHECK_STATIC_OPT_FLAG" = no; then 1.307 + CPPFLAGS="${OLD_CPPFLAGS}" 1.308 + LDFLAGS="${OLD_LDFLAGS}" 1.309 + fi 1.310 + fi 1.311 + fi 1.312 +fi 1.313 + 1.314 + 1.315 +# Check whether to enable auto cleanup of libraries 1.316 +AC_MSG_CHECKING([whether to enable auto cleanup of libraries]) 1.317 +enabled=no 1.318 +UCLN_NO_AUTO_CLEANUP=1 1.319 +AC_ARG_ENABLE(auto-cleanup, 1.320 + [ --enable-auto-cleanup enable auto cleanup of libraries [default=no]], 1.321 + [ case "${enableval}" in 1.322 + yes) enabled=yes; 1.323 + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DUCLN_NO_AUTO_CLEANUP=0"; 1.324 + UCLN_NO_AUTO_CLEANUP=0 1.325 + ;; 1.326 + *) ;; 1.327 + esac], 1.328 +) 1.329 +AC_MSG_RESULT($enabled) 1.330 +AC_SUBST(UCLN_NO_AUTO_CLEANUP) 1.331 + 1.332 +# MSVC floating-point option 1.333 +MSVC_RELEASE_FLAG="" 1.334 +if test $enabled = yes 1.335 +then 1.336 + if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc 1.337 + then 1.338 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 1.339 + #if defined _MSC_VER && _MSC_VER >= 1400 1.340 + #else 1.341 + Microsoft Visual C++ < 2005 1.342 + #endif 1.343 + ]], [[]])],[MSVC_RELEASE_FLAG="/fp:precise"],[MSVC_RELEASE_FLAG="/Op"]) 1.344 + 1.345 + CFLAGS="${CFLAGS} ${MSVC_RELEASE_FLAG}" 1.346 + CXXFLAGS="${CXXFLAGS} ${MSVC_RELEASE_FLAG}" 1.347 + fi 1.348 +fi 1.349 + 1.350 +# Check whether to enabled draft APIs 1.351 +AC_MSG_CHECKING([whether to enable draft APIs]) 1.352 +enabled=yes 1.353 +U_DEFAULT_SHOW_DRAFT=1 1.354 +AC_ARG_ENABLE(draft, 1.355 + [ --enable-draft enable draft APIs (and internal APIs) [default=yes]], 1.356 + [ case "${enableval}" in 1.357 + no) enabled=no; U_DEFAULT_SHOW_DRAFT=0; 1.358 + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEFAULT_SHOW_DRAFT=0" 1.359 + ;; 1.360 + *) ;; 1.361 + esac], 1.362 +) 1.363 +AC_MSG_RESULT($enabled) 1.364 +# Make sure that we can use draft API in ICU. 1.365 +if test "$U_DEFAULT_SHOW_DRAFT" = 0; then 1.366 + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_SHOW_DRAFT_API" 1.367 +fi 1.368 +AC_SUBST(U_DEFAULT_SHOW_DRAFT) 1.369 + 1.370 +AC_PROG_RANLIB 1.371 + 1.372 +# look for 'ar' the proper way 1.373 +AC_CHECK_TOOL(AR, ar, false) 1.374 + 1.375 +AC_MSG_CHECKING([whether to enable renaming of symbols]) 1.376 +enabled=yes 1.377 +U_DISABLE_RENAMING=0 1.378 +AC_ARG_ENABLE(renaming, 1.379 + [ --enable-renaming add a version suffix to symbols [default=yes]], 1.380 + [ case "${enableval}" in 1.381 + yes|"") enabled=yes ;; 1.382 + no) enabled=no; U_DISABLE_RENAMING=1; 1.383 + UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_DISABLE_RENAMING=1" 1.384 + ;; 1.385 + *) ;; 1.386 + esac], 1.387 +) 1.388 +AC_MSG_RESULT($enabled) 1.389 +AC_SUBST(U_DISABLE_RENAMING) 1.390 + 1.391 +AC_MSG_CHECKING([whether to enable function and data tracing]) 1.392 +enabled=no 1.393 +U_ENABLE_TRACING=0 1.394 +AC_ARG_ENABLE(tracing, 1.395 + [ --enable-tracing enable function and data tracing [default=no]], 1.396 + [ case "${enableval}" in 1.397 + yes|"") enabled=yes; 1.398 + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_TRACING=1"; 1.399 + U_ENABLE_TRACING=1 ;; 1.400 + no) enabled=no; U_ENABLE_TRACING=0 ;; 1.401 + *) ;; 1.402 + esac], 1.403 +) 1.404 +AC_MSG_RESULT($enabled) 1.405 +AC_SUBST(U_ENABLE_TRACING) 1.406 + 1.407 +# check if elf.h is present. 1.408 +AC_CHECK_HEADERS([elf.h]) 1.409 +if test "x$ac_cv_header_elf_h" = "xyes"; then 1.410 + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1"; 1.411 +fi 1.412 + 1.413 +U_ENABLE_DYLOAD=1 1.414 +enable=yes 1.415 +AC_MSG_CHECKING([whether to enable dynamic loading of plugins]) 1.416 +AC_ARG_ENABLE(dyload, 1.417 + [ --disable-dyload disable dynamic loading [default=no]], 1.418 + [ case "${enableval}" in 1.419 + yes|"") 1.420 + U_ENABLE_DYLOAD=1 1.421 + enable=yes 1.422 + ;; 1.423 + no) 1.424 + U_ENABLE_DYLOAD=0; 1.425 + enable=no; 1.426 + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_DYLOAD=0"; 1.427 + ;; 1.428 + *) ;; 1.429 + esac], 1.430 +) 1.431 +AC_MSG_RESULT($enable) 1.432 +AC_SUBST(U_ENABLE_DYLOAD) 1.433 + 1.434 +if test "$enable" = "yes"; then 1.435 + AC_CHECK_HEADERS([dlfcn.h]) 1.436 + #AC_MSG_RESULT($enabled) 1.437 + AC_SEARCH_LIBS([dlopen], [dl]) 1.438 + AC_CHECK_FUNCS([dlopen]) 1.439 + 1.440 + if test "x$ac_cv_func_dlopen" != xyes; then 1.441 + CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DHAVE_DLOPEN=0" 1.442 + fi 1.443 +fi 1.444 + 1.445 +# Check for miscellanous functions. 1.446 +# So, use for putil / tools only. 1.447 +# Note that this will generate HAVE_GETTIMEOFDAY, not U_HAVE_GETTIMEOFDAY 1.448 +AC_CHECK_FUNCS([gettimeofday]) 1.449 + 1.450 + 1.451 +# Check whether to use the evil rpath or not 1.452 +AC_ARG_ENABLE(rpath, 1.453 + [ --enable-rpath use rpath when linking [default is only if necessary]], 1.454 + [ case "${enableval}" in 1.455 + yes|"") ENABLE_RPATH=YES ;; 1.456 + no) ;; 1.457 + *) ;; 1.458 + esac], 1.459 + [ENABLE_RPATH=NO] 1.460 +) 1.461 +AC_SUBST(ENABLE_RPATH) 1.462 + 1.463 + 1.464 + 1.465 +AC_LANG_PUSH([C++]) 1.466 +AC_MSG_CHECKING([[if we have a C++ compiler]]) 1.467 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx_okay=yes],[cxx_okay=no]) 1.468 +if test $cxx_okay = yes 1.469 +then 1.470 + AC_MSG_RESULT([[Good]]) 1.471 +else 1.472 + AC_MSG_RESULT([[no]]) 1.473 + AC_MSG_ERROR([[C++ compiler $CXX does not work or no compiler found]]) 1.474 +fi 1.475 + 1.476 +if [[ "$GXX" = yes ]]; then 1.477 + # if CXXFLAGS does not have a "-std=" setting, set it now to -std=c++0x, 1.478 + # and check that the compiler still works. 1.479 + if ! echo "$CXXFLAGS" | grep '\-std=' >/dev/null 2>&1; then 1.480 + OLD_CXXFLAGS="${CXXFLAGS}" 1.481 + CXXFLAGS="$CXXFLAGS --std=c++0x" 1.482 + AC_MSG_CHECKING([[if we have a C++11 compiler]]) 1.483 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx11_okay=yes],[cxx11_okay=no]) 1.484 + AC_MSG_RESULT($cxx11_okay) 1.485 + if [[ $cxx11_okay = yes ]]; then 1.486 + AC_MSG_NOTICE([Adding CXXFLAGS option --std=c++0x]) 1.487 + UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=c++0x" 1.488 + else 1.489 + CXXFLAGS="$OLD_CXXFLAGS" 1.490 + fi 1.491 + fi 1.492 +fi 1.493 + 1.494 +AC_MSG_CHECKING([[if #include <string> works]]) 1.495 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string>]], [[]])], [ac_cv_header_stdstring=yes], [ac_cv_header_stdstring=no]) 1.496 +AC_MSG_RESULT($ac_cv_header_stdstring) 1.497 +if test $ac_cv_header_stdstring = yes 1.498 +then 1.499 + U_HAVE_STD_STRING=1 1.500 +else 1.501 + U_HAVE_STD_STRING=0 1.502 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STD_STRING=0" 1.503 +fi 1.504 +AC_SUBST(U_HAVE_STD_STRING) 1.505 + 1.506 + 1.507 +AC_MSG_CHECKING([[if #include <atomic> works]]) 1.508 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no]) 1.509 +AC_MSG_RESULT($ac_cv_header_atomic) 1.510 +if test $ac_cv_header_atomic = yes 1.511 +then 1.512 + U_HAVE_ATOMIC=1 1.513 +else 1.514 + U_HAVE_ATOMIC=0 1.515 +fi 1.516 +# Make this available via CPPFLAGS 1.517 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=${U_HAVE_ATOMIC}" 1.518 +AC_SUBST(U_HAVE_ATOMIC) 1.519 + 1.520 +AC_LANG_POP([C++]) 1.521 + 1.522 +# Always build ICU with multi-threading support. 1.523 +threads=true 1.524 +ICU_USE_THREADS=1 1.525 +OLD_LIBS=${LIBS} 1.526 + 1.527 +if test $threads = true; then 1.528 + # For Compaq Tru64 (OSF1), we must look for pthread_attr_init 1.529 + # and must do this before seaching for pthread_mutex_destroy, or 1.530 + # we will pick up libpthreads.so not libpthread.so 1.531 + # If this fails, then we must test for HPUX specials, before 1.532 + # moving on to a more generic test 1.533 + 1.534 + AC_CHECK_LIB(pthread, pthread_attr_init) 1.535 + if test $ac_cv_lib_pthread_pthread_attr_init = yes; then 1.536 + ICU_USE_THREADS=1 1.537 + else 1.538 + # Locate the right library for POSIX threads. We look for the 1.539 + # symbols in the libraries first, because on Solaris libc provides 1.540 + # pthread_create but libpthread has the real code :( 1.541 + # AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread 1.542 + # FreeBSD users may need libpthread if they do not have libc_r. 1.543 + 1.544 + AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r ) 1.545 + 1.546 + if test "$ac_cv_search_pthread_mutex_destroy" != no; then 1.547 + ICU_USE_THREADS=1 1.548 + else 1.549 + # For HP 11 1.550 + AC_CHECK_LIB(pthread, pthread_mutex_init) 1.551 + if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then 1.552 + ICU_USE_THREADS=1 1.553 + fi 1.554 + fi 1.555 + 1.556 + AC_CHECK_FUNC(pthread_mutex_lock) 1.557 + 1.558 + if test $ac_cv_func_pthread_mutex_lock = yes; then 1.559 + ICU_USE_THREADS=1 1.560 + fi 1.561 + fi 1.562 + # Check to see if we are using CygWin with MSVC 1.563 + case "${host}" in 1.564 + *-pc-cygwin*|*-pc-mingw*) 1.565 + # For gcc, the thread options are set by mh-mingw/mh-cygwin 1.566 + # For msvc, the thread options are set by runConfigureICU 1.567 + ICU_USE_THREADS=1 1.568 + ;; 1.569 + *-*-hpux*) 1.570 + # Add -mt because it does several nice things on newer compilers. 1.571 + case "${icu_cv_host_frag}" in 1.572 + mh-hpux-acc) 1.573 + OLD_CXXFLAGS="${CXXFLAGS}" 1.574 + CXXFLAGS="${CXXFLAGS} -mt" 1.575 + if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then 1.576 + CXXFLAGS="${OLD_CXXFLAGS}" 1.577 + else 1.578 + UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -mt" 1.579 + fi 1.580 + ;; 1.581 + esac 1.582 + ;; 1.583 + *-*-solaris*) 1.584 + case "${icu_cv_host_frag}" in 1.585 + mh-solaris) 1.586 + LIBS="${LIBS} -mt" 1.587 + ;; 1.588 + esac 1.589 + ;; 1.590 + esac 1.591 +fi 1.592 + 1.593 +AC_ARG_ENABLE(weak-threads, 1.594 + [ --enable-weak-threads weakly reference the threading library [default=no]], 1.595 + [case "${enableval}" in 1.596 + yes) 1.597 + LIB_THREAD="${LIBS%${OLD_LIBS}}" 1.598 + LIBS=${OLD_LIBS} 1.599 + ;; 1.600 + no) ;; 1.601 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-weak-threads) ;; 1.602 + esac]) 1.603 +AC_SUBST(LIB_THREAD) 1.604 + 1.605 +# Check for mmap() 1.606 + 1.607 +# The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific. 1.608 +# Do this check instead. 1.609 +HAVE_MMAP=0 1.610 +AC_MSG_CHECKING([for mmap]) 1.611 +AC_CACHE_VAL(ac_cv_func_mmap_ok, 1.612 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <unistd.h> 1.613 +#include <sys/mman.h> 1.614 +#include <sys/stat.h> 1.615 +#include <fcntl.h>], [mmap((void *)0, 0, PROT_READ, 0, 0, 0);])],[ac_cv_func_mmap_ok=yes],[ac_cv_func_mmap_ok=no])] ) 1.616 +AC_MSG_RESULT($ac_cv_func_mmap_ok) 1.617 +if test $ac_cv_func_mmap_ok = yes 1.618 +then 1.619 + HAVE_MMAP=1 1.620 +else 1.621 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_MMAP=0" 1.622 +fi 1.623 +AC_SUBST(HAVE_MMAP) 1.624 + 1.625 +AC_MSG_CHECKING([for genccode assembly]) 1.626 + 1.627 +# Check to see if genccode can generate simple assembly. 1.628 +GENCCODE_ASSEMBLY= 1.629 +case "${host}" in 1.630 +*-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu) 1.631 + if test "$GCC" = yes; then 1.632 + # We're using gcc, and the simple -a gcc command line works for genccode 1.633 + GENCCODE_ASSEMBLY="-a gcc" 1.634 + fi ;; 1.635 +i*86-*-solaris*) 1.636 + if test "$GCC" = yes; then 1.637 + # When using gcc, look if we're also using GNU as. 1.638 + # When using GNU as, the simple -a gcc command line works for genccode. 1.639 + asv=`"${CC}" -print-prog-name=as 2>/dev/null` 1.640 + asv=`"${asv}" --version 2>/dev/null` 1.641 + case "X${asv}" in 1.642 + X*GNU*) GENCCODE_ASSEMBLY="-a gcc" ;; 1.643 + X*) GENCCODE_ASSEMBLY="-a sun-x86" ;; 1.644 + esac 1.645 + unset asv 1.646 + else 1.647 + GENCCODE_ASSEMBLY="-a sun-x86" 1.648 + fi ;; 1.649 +sparc-*-solaris*) 1.650 + GENCCODE_ASSEMBLY="-a sun" 1.651 + ;; 1.652 +ia64-*-hpux*) 1.653 + GENCCODE_ASSEMBLY="-a aCC-ia64" 1.654 + ;; 1.655 +esac 1.656 +AC_SUBST(GENCCODE_ASSEMBLY) 1.657 + 1.658 +AC_MSG_RESULT($GENCCODE_ASSEMBLY) 1.659 + 1.660 +# Checks for header files 1.661 +AC_CHECK_HEADERS(inttypes.h) 1.662 +if test $ac_cv_header_inttypes_h = no; then 1.663 + U_HAVE_INTTYPES_H=0 1.664 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0" 1.665 +else 1.666 + U_HAVE_INTTYPES_H=1 1.667 +fi 1.668 +if test "$CC" = ccc; then 1.669 + AC_MSG_RESULT("C compiler set to CCC ${CC}" ) 1.670 + case "${host}" in 1.671 + alpha*-*-*) U_HAVE_INTTYPES_H=0; 1.672 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0" 1.673 + esac 1.674 +fi 1.675 + 1.676 +AC_SUBST(U_HAVE_INTTYPES_H) 1.677 + 1.678 +AC_CHECK_HEADERS(dirent.h) 1.679 +if test $ac_cv_header_dirent_h = no; then 1.680 + U_HAVE_DIRENT_H=0 1.681 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_DIRENT_H=0" 1.682 +else 1.683 + U_HAVE_DIRENT_H=1 1.684 +fi 1.685 + 1.686 +AC_SUBST(U_HAVE_DIRENT_H) 1.687 + 1.688 +# Check for endianness 1.689 +AC_C_BIGENDIAN() 1.690 +if test $ac_cv_c_bigendian = no; then 1.691 +U_IS_BIG_ENDIAN=0 1.692 +U_ENDIAN_CHAR="l" 1.693 +else 1.694 +U_IS_BIG_ENDIAN=1 1.695 +U_ENDIAN_CHAR="b" 1.696 +fi 1.697 +AC_SUBST(U_IS_BIG_ENDIAN) 1.698 + 1.699 +# Do various POSIX related checks 1.700 +U_HAVE_NL_LANGINFO_CODESET=0 1.701 +U_NL_LANGINFO_CODESET=-1 1.702 +AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0]) 1.703 +dnl AC_SUBST(U_HAVE_NL_LANGINFO) 1.704 +if test $U_HAVE_NL_LANGINFO -eq 1; then 1.705 + AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset], 1.706 + ac_cv_nl_langinfo_codeset, 1.707 + [ac_cv_nl_langinfo_codeset="unknown" 1.708 + for a in CODESET _NL_CTYPE_CODESET_NAME; do 1.709 + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo($a);]])],[ac_cv_nl_langinfo_codeset="$a"; break],[])] 1.710 + done) 1.711 + if test x$ac_cv_nl_langinfo_codeset != xunknown 1.712 + then 1.713 + U_HAVE_NL_LANGINFO_CODESET=1 1.714 + U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset 1.715 + if test "x${ac_cv_nl_langinfo_codeset}" != "xCODESET" 1.716 + then 1.717 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DNL_LANGINFO_CODESET=${ac_cv_nl_langinfo_codeset}" 1.718 + fi 1.719 + else 1.720 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_NL_LANGINFO_CODESET=0" 1.721 + fi 1.722 +fi 1.723 +AC_SUBST(U_HAVE_NL_LANGINFO_CODESET) 1.724 +AC_SUBST(U_NL_LANGINFO_CODESET) 1.725 + 1.726 +# Namespace support checks 1.727 +AC_LANG(C++) 1.728 +AC_MSG_CHECKING([for namespace support]) 1.729 +AC_CACHE_VAL(ac_cv_namespace_ok, 1.730 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace x_version {void f(){}} 1.731 + namespace x = x_version; 1.732 + using namespace x_version; 1.733 + ], [f();])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] ) 1.734 +AC_MSG_RESULT($ac_cv_namespace_ok) 1.735 +if test $ac_cv_namespace_ok = no 1.736 +then 1.737 + AC_MSG_ERROR(Namespace support is required to build ICU.) 1.738 +fi 1.739 + 1.740 +AC_MSG_CHECKING([for properly overriding new and delete]) 1.741 +U_OVERRIDE_CXX_ALLOCATION=0 1.742 +U_HAVE_PLACEMENT_NEW=0 1.743 +AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok, 1.744 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> 1.745 + class UMemory { 1.746 + public: 1.747 + void *operator new(size_t size) {return malloc(size);} 1.748 + void *operator new[](size_t size) {return malloc(size);} 1.749 + void operator delete(void *p) {free(p);} 1.750 + void operator delete[](void *p) {free(p);} 1.751 + }; 1.752 + ]], [])],[ac_cv_override_cxx_allocation_ok=yes],[ac_cv_override_cxx_allocation_ok=no])] ) 1.753 +AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok) 1.754 +if test $ac_cv_override_cxx_allocation_ok = yes 1.755 +then 1.756 + U_OVERRIDE_CXX_ALLOCATION=1 1.757 + AC_MSG_CHECKING([for placement new and delete]) 1.758 + AC_CACHE_VAL(ac_cv_override_placement_new_ok, 1.759 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> 1.760 + class UMemory { 1.761 + public: 1.762 + void *operator new(size_t size) {return malloc(size);} 1.763 + void *operator new[](size_t size) {return malloc(size);} 1.764 + void operator delete(void *p) {free(p);} 1.765 + void operator delete[](void *p) {free(p);} 1.766 + void * operator new(size_t, void *ptr) { return ptr; } 1.767 + void operator delete(void *, void *) {} 1.768 + }; 1.769 + ]], [])],[ac_cv_override_placement_new_ok=yes],[ac_cv_override_placement_new_ok=no])] ) 1.770 + AC_MSG_RESULT($ac_cv_override_placement_new_ok) 1.771 + if test $ac_cv_override_placement_new_ok = yes 1.772 + then 1.773 + U_HAVE_PLACEMENT_NEW=1 1.774 + else 1.775 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_PLACEMENT_NEW=0" 1.776 + fi 1.777 +else 1.778 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_OVERRIDE_CXX_ALLOCATION=0" 1.779 +fi 1.780 +AC_SUBST(U_OVERRIDE_CXX_ALLOCATION) 1.781 +AC_SUBST(U_HAVE_PLACEMENT_NEW) 1.782 + 1.783 +AC_LANG(C) 1.784 +AC_CHECK_FUNC(popen) 1.785 +if test x$ac_cv_func_popen = xyes 1.786 +then 1.787 + U_HAVE_POPEN=1 1.788 +else 1.789 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_POPEN=0" 1.790 + U_HAVE_POPEN=0 1.791 +fi 1.792 +AC_SUBST(U_HAVE_POPEN) 1.793 + 1.794 +AC_CHECK_FUNC(tzset) 1.795 +U_HAVE_TZSET=0 1.796 +if test x$ac_cv_func_tzset = xyes 1.797 +then 1.798 + U_TZSET=tzset 1.799 + U_HAVE_TZSET=1 1.800 +else 1.801 + AC_CHECK_FUNC(_tzset) 1.802 + if test x$ac_cv_func__tzset = xyes 1.803 + then 1.804 + U_TZSET=_tzset 1.805 + U_HAVE_TZSET=1 1.806 + else 1.807 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0" 1.808 + fi 1.809 +fi 1.810 +AC_SUBST(U_HAVE_TZSET) 1.811 +AC_SUBST(U_TZSET) 1.812 + 1.813 +U_HAVE_TZNAME=0 1.814 +AC_CACHE_CHECK(for tzname,ac_cv_var_tzname, 1.815 +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef __USE_POSIX 1.816 +#define __USE_POSIX 1.817 +#endif 1.818 +#include <stdlib.h> 1.819 +#include <time.h> 1.820 +#ifndef tzname /* For SGI. */ 1.821 +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ 1.822 +#endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])]) 1.823 +if test $ac_cv_var_tzname = yes; then 1.824 + U_TZNAME=tzname 1.825 + U_HAVE_TZNAME=1 1.826 +else 1.827 + AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname, 1.828 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h> 1.829 + #include <time.h> 1.830 + extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])]) 1.831 + if test $ac_cv_var__tzname = yes; then 1.832 + U_TZNAME=_tzname 1.833 + U_HAVE_TZNAME=1 1.834 + else 1.835 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZNAME=0" 1.836 + fi 1.837 +fi 1.838 +AC_SUBST(U_HAVE_TZNAME) 1.839 +AC_SUBST(U_TZNAME) 1.840 + 1.841 +AC_CACHE_CHECK(for timezone,ac_cv_var_timezone, 1.842 +[AC_LINK_IFELSE([AC_LANG_PROGRAM([#ifndef __USE_POSIX 1.843 +#define __USE_POSIX 1.844 +#endif 1.845 +#ifndef __USE_XOPEN 1.846 +#define __USE_XOPEN 1.847 +#endif 1.848 +#include <time.h> 1.849 +], [[timezone = 1;]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])]) 1.850 +U_HAVE_TIMEZONE=0 1.851 +if test $ac_cv_var_timezone = yes; then 1.852 + U_TIMEZONE=timezone 1.853 + U_HAVE_TIMEZONE=1 1.854 +else 1.855 + AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone, 1.856 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[__timezone = 1;]])],[ac_cv_var___timezone=yes],[ac_cv_var___timezone=no])]) 1.857 + if test $ac_cv_var___timezone = yes; then 1.858 + U_TIMEZONE=__timezone 1.859 + U_HAVE_TIMEZONE=1 1.860 + else 1.861 + AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone, 1.862 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[_timezone = 1;]])],[ac_cv_var__timezone=yes],[ac_cv_var__timezone=no])]) 1.863 + if test $ac_cv_var__timezone = yes; then 1.864 + U_TIMEZONE=_timezone 1.865 + U_HAVE_TIMEZONE=1 1.866 + else 1.867 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TIMEZONE=0" 1.868 + fi 1.869 + fi 1.870 +fi 1.871 +AC_SUBST(U_HAVE_TIMEZONE) 1.872 +AC_SUBST(U_TIMEZONE) 1.873 + 1.874 +# Checks for typedefs 1.875 +AC_CHECK_TYPE(int8_t,signed char) 1.876 +AC_CHECK_TYPE(uint8_t,unsigned char) 1.877 +AC_CHECK_TYPE(int16_t,signed short) 1.878 +AC_CHECK_TYPE(uint16_t,unsigned short) 1.879 +AC_CHECK_TYPE(int32_t,signed long) 1.880 +AC_CHECK_TYPE(uint32_t,unsigned long) 1.881 +AC_CHECK_TYPE(int64_t,signed long long) 1.882 +AC_CHECK_TYPE(uint64_t,unsigned long long) 1.883 + 1.884 +if test $ac_cv_type_int8_t = no; then 1.885 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT8_T=0" 1.886 +fi 1.887 + 1.888 +if test $ac_cv_type_uint8_t = no; then 1.889 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT8_T=0" 1.890 +fi 1.891 + 1.892 +if test $ac_cv_type_int16_t = no; then 1.893 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT16_T=0" 1.894 +fi 1.895 + 1.896 +if test $ac_cv_type_uint16_t = no; then 1.897 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT16_T=0" 1.898 +fi 1.899 + 1.900 +if test $ac_cv_type_int32_t = no; then 1.901 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT32_T=0" 1.902 +fi 1.903 + 1.904 +if test $ac_cv_type_uint32_t = no; then 1.905 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT32_T=0" 1.906 +fi 1.907 + 1.908 +if test $ac_cv_type_int64_t = no; then 1.909 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT64_T=0" 1.910 +fi 1.911 + 1.912 +if test $ac_cv_type_uint64_t = no; then 1.913 +CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT64_T=0" 1.914 +fi 1.915 + 1.916 +# Do various wchar_t related checks 1.917 +AC_CHECK_HEADER(wchar.h) 1.918 +if test "$ac_cv_header_wchar_h" = no 1.919 +then 1.920 + U_HAVE_WCHAR_H=0 1.921 + U_HAVE_WCSCPY=0 1.922 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCHAR_H=0 -DU_HAVE_WCSCPY=0" 1.923 +else 1.924 + AC_DEFINE([HAVE_WCHAR_H], [1], [wchar.h was found.]) 1.925 + U_HAVE_WCHAR_H=1 1.926 + # Some broken systems have wchar.h but not some of its functions... 1.927 + AC_SEARCH_LIBS(wcscpy, wcs w) 1.928 + if test "$ac_cv_search_wcscpy" != no; then 1.929 + U_HAVE_WCSCPY=1 1.930 + else 1.931 + U_HAVE_WCSCPY=0 1.932 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCSCPY=0" 1.933 + fi 1.934 +fi 1.935 +AC_SUBST(U_HAVE_WCHAR_H) 1.936 +AC_SUBST(U_HAVE_WCSCPY) 1.937 + 1.938 +AC_CHECK_SIZEOF([wchar_t], 0, [ 1.939 +#if STDC_HEADERS 1.940 +#include <stddef.h> 1.941 +#endif 1.942 +#include <stdlib.h> 1.943 +#if HAVE_WCHAR_H 1.944 +#include <string.h> 1.945 +#include <wchar.h> 1.946 +#endif]) 1.947 +U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t 1.948 +# We do this check to verify that everything is okay. 1.949 +if test $U_SIZEOF_WCHAR_T = 0; then 1.950 + if test $U_HAVE_WCHAR_H=1; then 1.951 + AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0) 1.952 + fi 1.953 +fi 1.954 + 1.955 +AC_MSG_CHECKING([for UTF-16 string literal support]) 1.956 +U_CHECK_UTF16_STRING=1 1.957 +CHECK_UTF16_STRING_RESULT="unknown" 1.958 + 1.959 +case "${host}" in 1.960 +*-*-aix*|powerpc64-*-linux*) 1.961 + if test "$GCC" = no; then 1.962 + OLD_CFLAGS="${CFLAGS}" 1.963 + OLD_CXXFLAGS="${CXXFLAGS}" 1.964 + CFLAGS="${CFLAGS} -qutf" 1.965 + CXXFLAGS="${CXXFLAGS} -qutf" 1.966 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = u"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0]) 1.967 + if test "$U_CHECK_UTF16_STRING" = 0; then 1.968 + CFLAGS="${OLD_CFLAGS}" 1.969 + CXXFLAGS="${OLD_CXXFLAGS}" 1.970 + else 1.971 + UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -qutf" 1.972 + CHECK_UTF16_STRING_RESULT="-qutf" 1.973 + fi 1.974 + fi 1.975 + ;; 1.976 +*-*-solaris*) 1.977 + if test "$GCC" = no; then 1.978 + OLD_CFLAGS="${CFLAGS}" 1.979 + OLD_CXXFLAGS="${CXXFLAGS}" 1.980 + CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort" 1.981 + CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort" 1.982 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = U"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0]) 1.983 + if test "$U_CHECK_UTF16_STRING" = 0; then 1.984 + CFLAGS="${OLD_CFLAGS}" 1.985 + CXXFLAGS="${OLD_CXXFLAGS}" 1.986 + else 1.987 + CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort" 1.988 + UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -xustr=ascii_utf16_ushort" 1.989 + UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -xustr=ascii_utf16_ushort" 1.990 + # Since we can't detect the availability of this UTF-16 syntax at compile time, 1.991 + # we depend on configure telling us that we can use it. 1.992 + # Since we can't ensure ICU users use -xustr=ascii_utf16_ushort, 1.993 + # we only use this macro within ICU. 1.994 + # If an ICU user uses icu-config, this feature will be enabled. 1.995 + CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_CHECK_UTF16_STRING=1" 1.996 + U_CHECK_UTF16_STRING=0 1.997 + fi 1.998 + fi 1.999 + ;; 1.1000 +*-*-hpux*) 1.1001 + if test "$GCC" = no; then 1.1002 + # The option will be detected at compile time without additional compiler options. 1.1003 + CHECK_UTF16_STRING_RESULT="available" 1.1004 + fi 1.1005 + ;; 1.1006 +*-*-cygwin) 1.1007 + # wchar_t can be used 1.1008 + CHECK_UTF16_STRING_RESULT="available" 1.1009 + ;; 1.1010 +*) 1.1011 + ;; 1.1012 +esac 1.1013 + 1.1014 +# GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future. 1.1015 +if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then 1.1016 + if test "$GCC" = yes; then 1.1017 + OLD_CFLAGS="${CFLAGS}" 1.1018 + CFLAGS="${CFLAGS} -std=gnu99" 1.1019 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 1.1020 +static const char16_t test[] = u"This is a UTF16 literal string."; 1.1021 + ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0]) 1.1022 + if test "$CC_UTF16_STRING" = 1; then 1.1023 + UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=gnu99" 1.1024 + CHECK_UTF16_STRING_RESULT="C only"; 1.1025 + else 1.1026 + CFLAGS="${OLD_CFLAGS}" 1.1027 + fi 1.1028 + fi 1.1029 + if test "$GXX" = yes; then 1.1030 + # -Wno-return-type-c-linkage is desired so that stable ICU API is not warned about. 1.1031 + AC_LANG_PUSH([C++]) 1.1032 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 1.1033 +static const char16_t test[] = u"This is a UTF16 literal string."; 1.1034 + ]], [[]])],[CXX_UTF16_STRING=1],[CXX_UTF16_STRING=0]) 1.1035 + AC_LANG_POP([C++]) 1.1036 + if test "$CXX_UTF16_STRING" = 1; then 1.1037 + if test "$CC_UTF16_STRING" = 1; then 1.1038 + CHECK_UTF16_STRING_RESULT="available"; 1.1039 + else 1.1040 + CHECK_UTF16_STRING_RESULT="C++ only"; 1.1041 + fi 1.1042 + fi 1.1043 + fi 1.1044 +fi 1.1045 +AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT) 1.1046 + 1.1047 +# Enable/disable extras 1.1048 +AC_ARG_ENABLE(extras, 1.1049 + [ --enable-extras build ICU extras [default=yes]], 1.1050 + [case "${enableval}" in 1.1051 + yes) extras=true ;; 1.1052 + no) extras=false ;; 1.1053 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;; 1.1054 + esac], 1.1055 + extras=true) 1.1056 +ICU_CONDITIONAL(EXTRAS, test "$extras" = true) 1.1057 +AC_ARG_ENABLE(icuio, 1.1058 + [ --enable-icuio build ICU's icuio library [default=yes]], 1.1059 + [case "${enableval}" in 1.1060 + yes) icuio=true ;; 1.1061 + no) icuio=false ;; 1.1062 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;; 1.1063 + esac], 1.1064 + icuio=true) 1.1065 +ICU_CONDITIONAL(ICUIO, test "$icuio" = true) 1.1066 + 1.1067 +# Enable/disable layout 1.1068 +AC_ARG_ENABLE(layout, 1.1069 + [ --enable-layout build ICU's layout library [default=yes]], 1.1070 + [case "${enableval}" in 1.1071 + yes) layout=true ;; 1.1072 + no) layout=false ;; 1.1073 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;; 1.1074 + esac], 1.1075 + layout=true) 1.1076 +ICU_CONDITIONAL(LAYOUT, test "$layout" = true) 1.1077 + 1.1078 +# Enable/disable tools 1.1079 +AC_ARG_ENABLE(tools, 1.1080 + [ --enable-tools build ICU's tools [default=yes]], 1.1081 + [case "${enableval}" in 1.1082 + yes) tools=true ;; 1.1083 + no) tools=false ;; 1.1084 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;; 1.1085 + esac], 1.1086 + tools=true) 1.1087 +ICU_CONDITIONAL(TOOLS, test "$tools" = true) 1.1088 + 1.1089 +AC_ARG_WITH(data-packaging, 1.1090 + [ --with-data-packaging=type specify how to package ICU data (files, archive, library, static, auto) [default=auto]], 1.1091 + [case "${withval}" in 1.1092 + files|archive|library) datapackaging=$withval ;; 1.1093 + auto) datapackaging=$withval ;; 1.1094 + common) datapackaging=archive ;; 1.1095 + dll) datapackaging=library ;; 1.1096 + static) datapackaging=static ;; 1.1097 + *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;; 1.1098 + esac], 1.1099 + [datapackaging=]) 1.1100 + 1.1101 +# Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc.. 1.1102 +# thesysconfdir=`eval echo $sysconfdir` 1.1103 +dnl# AC_SUBST(thesysconfdir) 1.1104 +dnl# thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir` 1.1105 +dnl# AC_SUBST(thelibdir) 1.1106 +thedatadir=`eval echo $datadir` 1.1107 +dnl# AC_SUBST(thedatadir) 1.1108 +# 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}. 1.1109 +pkgicudatadir=$datadir 1.1110 +thepkgicudatadir=$thedatadir 1.1111 +AC_SUBST(pkgicudatadir) 1.1112 +AC_SUBST(thepkgicudatadir) 1.1113 + 1.1114 +dnl# Shouldn't need the AC_SUBST 1.1115 + 1.1116 +if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then 1.1117 + # default to library 1.1118 + datapackaging=library 1.1119 + if test "$ENABLE_STATIC" = "YES"; then 1.1120 + if test "$ENABLE_SHARED" != "YES"; then 1.1121 + datapackaging=static 1.1122 + fi 1.1123 + fi 1.1124 +fi 1.1125 + 1.1126 +datapackaging_dir=`eval echo $thedatadir`"/icu/${VERSION}" 1.1127 + 1.1128 +datapackaging_msg="(No explaination for mode $datapackaging.)" 1.1129 + 1.1130 +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." 1.1131 +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." 1.1132 +datapackaging_howfound="(unknown)" 1.1133 + 1.1134 +case "$datapackaging" in 1.1135 + files) 1.1136 + DATA_PACKAGING_MODE=files 1.1137 + datapackaging_msg="ICU data will be stored in individual files." 1.1138 + datapackaging_howfound="$datapackaging_msg_path" 1.1139 + ;; 1.1140 + archive) 1.1141 + DATA_PACKAGING_MODE=common 1.1142 + datapackaging_msg="ICU data will be stored in a single .dat file." 1.1143 + datapackaging_howfound="$datapackaging_msg_path" 1.1144 + ;; 1.1145 + library) 1.1146 + DATA_PACKAGING_MODE=dll 1.1147 + datapackaging_msg="ICU data will be linked with ICU." 1.1148 + if test "$ENABLE_STATIC" = "YES"; then 1.1149 + datapackaging_msg="$datapackaging_msg A static data library will be built. " 1.1150 + fi 1.1151 + if test "$ENABLE_SHARED" = "YES"; then 1.1152 + datapackaging_msg="$datapackaging_msg A shared data library will be built. " 1.1153 + fi 1.1154 + datapackaging_howfound="$datapackaging_msg_set" 1.1155 + ;; 1.1156 + static) 1.1157 + DATA_PACKAGING_MODE=static 1.1158 + datapackaging_msg="ICU data will be stored in a static library." 1.1159 + datapackaging_howfound="$datapackaging_msg_set" 1.1160 + ;; 1.1161 +esac 1.1162 +AC_SUBST(DATA_PACKAGING_MODE) 1.1163 + 1.1164 +# Sets a library suffix 1.1165 +AC_MSG_CHECKING([for a library suffix to use]) 1.1166 +AC_ARG_WITH(library-suffix, 1.1167 + [ --with-library-suffix=suffix tag a suffix to the library names [default=]], 1.1168 + [ICULIBSUFFIX="${withval}"], 1.1169 + [ICULIBSUFFIX=]) 1.1170 +msg=$ICULIBSUFFIX 1.1171 +if test "$msg" = ""; then 1.1172 + msg=none 1.1173 +fi 1.1174 +AC_MSG_RESULT($msg) 1.1175 +AC_SUBST(ICULIBSUFFIX) 1.1176 +if test "$ICULIBSUFFIX" != "" 1.1177 +then 1.1178 + U_HAVE_LIB_SUFFIX=1 1.1179 + ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'` 1.1180 + UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} " 1.1181 +else 1.1182 + U_HAVE_LIB_SUFFIX=0 1.1183 +fi 1.1184 +AC_SUBST(U_HAVE_LIB_SUFFIX) 1.1185 +AC_SUBST(ICULIBSUFFIXCNAME) 1.1186 + 1.1187 +# Enable/disable tests 1.1188 +AC_ARG_ENABLE(tests, 1.1189 + [ --enable-tests build ICU tests [default=yes]], 1.1190 + [case "${enableval}" in 1.1191 + yes) tests=true ;; 1.1192 + no) tests=false ;; 1.1193 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;; 1.1194 + esac], 1.1195 + tests=true) 1.1196 +ICU_CONDITIONAL(TESTS, test "$tests" = true) 1.1197 + 1.1198 +# Enable/disable samples 1.1199 +AC_ARG_ENABLE(samples, 1.1200 + [ --enable-samples build ICU samples [default=yes] 1.1201 + 1.1202 +Additionally, the variable FORCE_LIBS may be set before calling configure. 1.1203 +If set, it will REPLACE any automatic list of libraries.], 1.1204 + [case "${enableval}" in 1.1205 + yes) samples=true ;; 1.1206 + no) samples=false ;; 1.1207 + *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;; 1.1208 + esac], 1.1209 + samples=true) 1.1210 +ICU_CONDITIONAL(SAMPLES, test "$samples" = true) 1.1211 + 1.1212 +ICUDATA_CHAR=$U_ENDIAN_CHAR 1.1213 + 1.1214 +# Platform-specific Makefile setup 1.1215 +# set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform. 1.1216 +case "${host}" in 1.1217 + *-*-solaris*) platform=U_SOLARIS ;; 1.1218 + *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) platform=U_LINUX ;; 1.1219 + *-*-*bsd*|*-*-dragonfly*) platform=U_BSD ;; 1.1220 + *-*-aix*) platform=U_AIX ;; 1.1221 + *-*-hpux*) platform=U_HPUX ;; 1.1222 + *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;; 1.1223 + *-*-cygwin*) platform=U_CYGWIN ;; 1.1224 + *-*-mingw*) platform=U_MINGW ;; 1.1225 + *-*ibm-openedition*|*-*-os390*) platform=OS390 1.1226 + if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then 1.1227 + ICUDATA_CHAR="e" 1.1228 + fi ;; 1.1229 + *-*-os400*) platform=OS400 1.1230 + if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then 1.1231 + ICUDATA_CHAR="e" 1.1232 + fi ;; 1.1233 + *-*-nto*) platform=U_QNX ;; 1.1234 + *-dec-osf*) platform=U_OSF ;; 1.1235 + *-*-beos) platform=U_BEOS ;; 1.1236 + *-*-irix*) platform=U_IRIX ;; 1.1237 + *-ncr-*) platform=U_MPRAS ;; 1.1238 + *) platform=U_UNKNOWN_PLATFORM ;; 1.1239 +esac 1.1240 +AC_SUBST(ICUDATA_CHAR) 1.1241 +AC_SUBST(platform) 1.1242 +platform_make_fragment_name="$icu_cv_host_frag" 1.1243 +platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name" 1.1244 +AC_SUBST(platform_make_fragment_name) 1.1245 +AC_SUBST(platform_make_fragment) 1.1246 + 1.1247 +if test "${FORCE_LIBS}" != ""; then 1.1248 + echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6 1.1249 + LIBS=${FORCE_LIBS} 1.1250 +fi 1.1251 + 1.1252 +# Now that we're done using CPPFLAGS etc. for tests, we can change it 1.1253 +# for build. 1.1254 + 1.1255 +if test "${CC}" == "clang"; then 1.1256 + CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality" 1.1257 +else 1.1258 + CLANGCFLAGS="" 1.1259 +fi 1.1260 + 1.1261 +if test "${CXX}" == "clang++"; then 1.1262 + CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality" 1.1263 +else 1.1264 + CLANGCXXFLAGS="" 1.1265 +fi 1.1266 + 1.1267 +CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)" 1.1268 +CFLAGS="$CFLAGS \$(THREADSCFLAGS) $CLANGCFLAGS" 1.1269 +CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS) $CLANGCXXFLAGS" 1.1270 + 1.1271 +AC_SUBST(LIBCFLAGS) 1.1272 +AC_SUBST(LIBCXXFLAGS) 1.1273 + 1.1274 +# append all config cppflags 1.1275 +CPPFLAGS="$CPPFLAGS $CONFIG_CPPFLAGS $UCONFIG_CPPFLAGS" 1.1276 + 1.1277 +echo "CPPFLAGS=$CPPFLAGS" 1.1278 +echo "CFLAGS=$CFLAGS" 1.1279 +echo "CXXFLAGS=$CXXFLAGS" 1.1280 + 1.1281 + 1.1282 +# output the Makefiles 1.1283 +AC_CONFIG_FILES([icudefs.mk \ 1.1284 + Makefile \ 1.1285 + data/pkgdataMakefile \ 1.1286 + config/Makefile.inc \ 1.1287 + config/icu.pc \ 1.1288 + config/pkgdataMakefile \ 1.1289 + data/Makefile \ 1.1290 + stubdata/Makefile \ 1.1291 + common/Makefile \ 1.1292 + i18n/Makefile \ 1.1293 + layout/Makefile \ 1.1294 + layoutex/Makefile \ 1.1295 + io/Makefile \ 1.1296 + extra/Makefile \ 1.1297 + extra/uconv/Makefile \ 1.1298 + extra/uconv/pkgdataMakefile \ 1.1299 + extra/scrptrun/Makefile \ 1.1300 + tools/Makefile \ 1.1301 + tools/ctestfw/Makefile \ 1.1302 + tools/toolutil/Makefile \ 1.1303 + tools/makeconv/Makefile \ 1.1304 + tools/genrb/Makefile \ 1.1305 + tools/genccode/Makefile \ 1.1306 + tools/gencmn/Makefile \ 1.1307 + tools/gencnval/Makefile \ 1.1308 + tools/gendict/Makefile \ 1.1309 + tools/gentest/Makefile \ 1.1310 + tools/gennorm2/Makefile \ 1.1311 + tools/genbrk/Makefile \ 1.1312 + tools/gensprep/Makefile \ 1.1313 + tools/icuinfo/Makefile \ 1.1314 + tools/icupkg/Makefile \ 1.1315 + tools/icuswap/Makefile \ 1.1316 + tools/pkgdata/Makefile \ 1.1317 + tools/tzcode/Makefile \ 1.1318 + tools/gencfu/Makefile \ 1.1319 + test/Makefile \ 1.1320 + test/compat/Makefile \ 1.1321 + test/testdata/Makefile \ 1.1322 + test/testdata/pkgdataMakefile \ 1.1323 + test/hdrtst/Makefile \ 1.1324 + test/intltest/Makefile \ 1.1325 + test/cintltst/Makefile \ 1.1326 + test/iotest/Makefile \ 1.1327 + test/letest/Makefile \ 1.1328 + test/perf/Makefile \ 1.1329 + test/perf/collationperf/Makefile \ 1.1330 + test/perf/collperf/Makefile \ 1.1331 + test/perf/dicttrieperf/Makefile \ 1.1332 + test/perf/ubrkperf/Makefile \ 1.1333 + test/perf/charperf/Makefile \ 1.1334 + test/perf/convperf/Makefile \ 1.1335 + test/perf/normperf/Makefile \ 1.1336 + test/perf/DateFmtPerf/Makefile \ 1.1337 + test/perf/howExpensiveIs/Makefile \ 1.1338 + test/perf/strsrchperf/Makefile \ 1.1339 + test/perf/unisetperf/Makefile \ 1.1340 + test/perf/usetperf/Makefile \ 1.1341 + test/perf/ustrperf/Makefile \ 1.1342 + test/perf/utfperf/Makefile \ 1.1343 + test/perf/utrie2perf/Makefile \ 1.1344 + test/perf/leperf/Makefile \ 1.1345 + samples/Makefile samples/date/Makefile \ 1.1346 + samples/cal/Makefile samples/layout/Makefile]) 1.1347 +AC_OUTPUT 1.1348 + 1.1349 +echo 1.1350 +echo "ICU for C/C++ $VERSION is ready to be built." 1.1351 +echo "=== Important Notes: ===" 1.1352 + 1.1353 +echo "Data Packaging: $datapackaging" 1.1354 +echo " This means: $datapackaging_msg" 1.1355 +echo " To locate data: $datapackaging_howfound" 1.1356 + 1.1357 +if test -n "`$U_MAKE -v 2>&1 | grep '^GNU Make'`"; then 1.1358 +echo "Building ICU: Use a GNU make such as $U_MAKE to build ICU." 1.1359 +else 1.1360 +echo "** WARNING: $U_MAKE may not be GNU make." 1.1361 +echo "This may cause ICU to fail to build. Please make sure that GNU make" 1.1362 +echo "is in your PATH so that the configure script can detect its location." 1.1363 +fi 1.1364 +if test "x$AR" = "xfalse"; then 1.1365 + echo "*** WARNING: Archiver ar not found. Set AR= or fix PATH. Some builds (such as static) may fail." 1.1366 +fi 1.1367 + 1.1368 +AC_MSG_CHECKING([the version of "$U_MAKE"]) 1.1369 +if "$U_MAKE" -f "$srcdir/config/gmakever.mk" PLATFORM="$platform"; then 1.1370 +AC_MSG_RESULT([ok]) 1.1371 +else 1.1372 +AC_MSG_RESULT([too old or test failed - try upgrading GNU Make]) 1.1373 +fi 1.1374 + 1.1375 +AC_SUBST(UCONFIG_CPPFLAGS) 1.1376 +if test -n "$UCONFIG_CPPFLAGS"; then 1.1377 + HDRFILE="uconfig.h.prepend" 1.1378 + echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:" 1.1379 + echo 1.1380 + echo " ${UCONFIG_CPPFLAGS}" 1.1381 + echo 1.1382 + 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.' 1.1383 + echo "Creating the file ${HDRFILE}" 1.1384 + echo 1.1385 + echo '--------------- ' "${HDRFILE}" 1.1386 + echo > "${HDRFILE}" 1.1387 + echo '/* ICU customizations: put these lines at the top of uconfig.h */' >> "${HDRFILE}" 1.1388 + echo >> "${HDRFILE}" 1.1389 + for flag in ${UCONFIG_CPPFLAGS}; 1.1390 + do 1.1391 + echo " /* $flag */" >> "${HDRFILE}" 1.1392 + case "${flag}" in 1.1393 + -D*=*) 1.1394 + [ \echo "${flag}" | sed -n 's%-D\([^=]*\)=%#define \1 %p' >> "${HDRFILE}" ] 1.1395 + \echo >> "${HDRFILE}" 1.1396 + ;; 1.1397 + -D*) 1.1398 + [ \echo "${flag}" | sed -n 's%-D\([^=]*\)%#define \1 %p' >> "${HDRFILE}" ] 1.1399 + \echo >> "${HDRFILE}" 1.1400 + ;; 1.1401 + *) 1.1402 + \echo "/* Not sure how to handle this argument: ${flag} */" >> "${HDRFILE}" 1.1403 + \echo >> "${HDRFILE}" 1.1404 + ;; 1.1405 + esac 1.1406 + done 1.1407 + cat "${HDRFILE}" 1.1408 + \echo "/* End of ${HDRFILE} ------------ */" >> "${HDRFILE}" 1.1409 + echo >> "${HDRFILE}" 1.1410 + echo '--------------- end ' "${HDRFILE}" 1.1411 +fi 1.1412 + 1.1413 +AC_SUBST(UCONFIG_CFLAGS) 1.1414 +if test -n "$UCONFIG_CFLAGS"; then 1.1415 + echo "C apps may want to build with CFLAGS = ${UCONFIG_CFLAGS}" 1.1416 +fi 1.1417 +AC_SUBST(UCONFIG_CXXFLAGS) 1.1418 +if test -n "$UCONFIG_CXXFLAGS"; then 1.1419 + echo "C++ apps may want to build with CXXFLAGS = ${UCONFIG_CXXFLAGS}" 1.1420 +fi 1.1421 + 1.1422 +if test "$tools" = false; 1.1423 +then 1.1424 + echo "## Note: you have disabled ICU's tools. This ICU cannot build its own data or tests." 1.1425 + echo "## Expect build failures in the 'data', 'test', and other directories." 1.1426 +fi 1.1427 + 1.1428 +$as_unset _CXX_CXXSUFFIX