intl/icu/source/configure.ac

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1 # -*-autoconf-*-
michael@0 2 AC_COPYRIGHT([ Copyright (c) 1999-2013, International Business Machines Corporation and others. All Rights Reserved. ])
michael@0 3 # configure.in for ICU
michael@0 4 # Stephen F. Booth, heavily modified by Yves and others
michael@0 5
michael@0 6 # Check for autoconf version
michael@0 7 AC_PREREQ(2.68)
michael@0 8
michael@0 9 # Process this file with autoconf to produce a configure script
michael@0 10 AC_INIT([ICU])
michael@0 11
michael@0 12 #TODO: IcuBug:8502
michael@0 13 #AC_INIT([ICU],
michael@0 14 # m4_esyscmd_s([sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "./common/unicode/uvernum.h]"),
michael@0 15 # [http://icu-project.org/bugs],
michael@0 16 # [International Components for Unicode],
michael@0 17 # [http://icu-project.org])
michael@0 18
michael@0 19 AC_CONFIG_SRCDIR([common/unicode/utypes.h])
michael@0 20
michael@0 21 PACKAGE="icu"
michael@0 22 AC_SUBST(PACKAGE)
michael@0 23
michael@0 24 # Use custom echo test for newline option
michael@0 25 # Current autoconf (2.65) gives incorrect echo newline option
michael@0 26 # for icu-config
michael@0 27 # This may be removed later - mow (June 17, 2010)
michael@0 28 ICU_ECHO_C= ICU_ECHO_N= ICU_ECHO_T=
michael@0 29 case `/bin/sh -c "echo -n x"` in
michael@0 30 -n*)
michael@0 31 case `/bin/sh -c "echo 'x\c'"` in
michael@0 32 *c*) ICU_ECHO_T=' ';; # ECHO_T is single tab character.
michael@0 33 *) ICU_ECHO_C='\c';;
michael@0 34 esac;;
michael@0 35 *)
michael@0 36 ICU_ECHO_N='-n';;
michael@0 37 esac
michael@0 38 AC_SUBST(ICU_ECHO_N)
michael@0 39 AC_SUBST(ICU_ECHO_C)
michael@0 40 AC_SUBST(ICU_ECHO_T)
michael@0 41
michael@0 42 AC_MSG_CHECKING(for ICU version numbers)
michael@0 43
michael@0 44 # Get the ICU version from uversion.h or other headers
michael@0 45 geticuversion() {
michael@0 46 [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
michael@0 47 }
michael@0 48 getuversion() {
michael@0 49 [sed -n 's/^[ ]*#[ ]*define[ ]*U_UNICODE_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
michael@0 50 }
michael@0 51 VERSION=`geticuversion $srcdir/common/unicode/uvernum.h`
michael@0 52 if test x"$VERSION" = x; then
michael@0 53 as_fn_error $? "Cannot determine ICU version number from uvernum.h header file" "$LINENO" 5
michael@0 54 fi
michael@0 55
michael@0 56 #TODO: IcuBug:8502
michael@0 57 #if test "$VERSION" != "$PACKAGE_VERSION"; then
michael@0 58 # AC_MSG_ERROR([configure was generated for $PACKAGE_VERSION but uvernum.h has $VERSION - please rerun autoconf])
michael@0 59 #fi
michael@0 60
michael@0 61 UNICODE_VERSION=`getuversion $srcdir/common/unicode/uchar.h`
michael@0 62 if test x"$UNICODE_VERSION" = x; then
michael@0 63 AC_MSG_ERROR([Cannot determine Unicode version number from uchar.h header file])
michael@0 64 fi
michael@0 65 # Compute a reasonable library version from the release version. This is
michael@0 66 # very bad, but that's wanted... We want to make sure that the LIB_VERSION
michael@0 67 # has at least a dot in it, so we'll add a .0 if needed.
michael@0 68 #[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
michael@0 69 LIB_VERSION=$VERSION
michael@0 70 LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
michael@0 71 AC_SUBST(VERSION)
michael@0 72 AC_SUBST(LIB_VERSION)
michael@0 73 AC_SUBST(LIB_VERSION_MAJOR)
michael@0 74 AC_MSG_RESULT([release $VERSION, library $LIB_VERSION, unicode version $UNICODE_VERSION])
michael@0 75
michael@0 76 AC_SUBST(UNICODE_VERSION)
michael@0 77
michael@0 78 # Determine the host system
michael@0 79 AC_CANONICAL_HOST
michael@0 80
michael@0 81 AC_SUBST(CPPFLAGS)
michael@0 82
michael@0 83 # This variable is needed on z/OS because the C++ compiler only recognizes .C
michael@0 84 _CXX_CXXSUFFIX=cpp
michael@0 85 export _CXX_CXXSUFFIX
michael@0 86
michael@0 87 # Accumulate #defines
michael@0 88
michael@0 89 # CONFIG_CPPFLAGS: These are defines that are set for ICU Build time only.
michael@0 90 # They are only needed for building ICU itself. Example: platform stuff
michael@0 91 CONFIG_CPPFLAGS=""
michael@0 92 # UCONFIG_CPPFLAGS: These are defines which are set for ICU build time,
michael@0 93 # and also a notice is output that they need to be set
michael@0 94 # for end-users of ICU also. uconfig.h.prepend is generated
michael@0 95 # with, for example, "#define U_DISABLE_RENAMING 1"
michael@0 96 # Example: ICU configuration stuff
michael@0 97 UCONFIG_CPPFLAGS=""
michael@0 98 # UCONFIG_CFLAGS: contains a copy of anything that needs to be set by end users
michael@0 99 # such as -std
michael@0 100 UCONFIG_CFLAGS=""
michael@0 101
michael@0 102 # Check whether to build debug libraries
michael@0 103 AC_MSG_CHECKING([whether to build debug libraries])
michael@0 104 enabled=no
michael@0 105 ENABLE_DEBUG=0
michael@0 106 AC_ARG_ENABLE(debug,
michael@0 107 [ --enable-debug build debug libraries and enable the U_DEBUG define [default=no]],
michael@0 108 [ case "${enableval}" in
michael@0 109 yes|"") enabled=yes; ENABLE_DEBUG=1; CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEBUG=1" ;;
michael@0 110 *) ;;
michael@0 111 esac],
michael@0 112 )
michael@0 113 AC_MSG_RESULT($enabled)
michael@0 114 AC_SUBST(ENABLE_DEBUG)
michael@0 115
michael@0 116 # Check whether to build release libraries
michael@0 117 AC_MSG_CHECKING([whether to build release libraries])
michael@0 118 enabled=yes
michael@0 119 ENABLE_RELEASE=1
michael@0 120 AC_ARG_ENABLE(release,
michael@0 121 [ --enable-release build release libraries [default=yes]],
michael@0 122 [ case "${enableval}" in
michael@0 123 no) enabled=no; ENABLE_RELEASE=0 ;;
michael@0 124 *) ;;
michael@0 125 esac],
michael@0 126 )
michael@0 127 AC_MSG_RESULT($enabled)
michael@0 128 AC_SUBST(ENABLE_RELEASE)
michael@0 129
michael@0 130 # Don't use the default C/CXXFLags
michael@0 131 : ${CFLAGS=""}
michael@0 132 : ${CXXFLAGS=""}
michael@0 133
michael@0 134 # Checks for compilers
michael@0 135 AC_PROG_CC([clang gcc cc c99 c89 xlc_r xlc cl.exe icc])
michael@0 136 # Make sure that we try clang++ first, which provides C++11 support.
michael@0 137 # The g++ compiler is less likely to support C++11.
michael@0 138 AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RCC])
michael@0 139
michael@0 140 # Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option
michael@0 141 # The release mode use is the default one for autoconf
michael@0 142 if test "$GCC" = yes; then
michael@0 143 if test "$CFLAGS" = ""; then
michael@0 144 if test "$ENABLE_DEBUG" = 1; then
michael@0 145 CFLAGS=-g
michael@0 146 fi
michael@0 147 if test "$ENABLE_RELEASE" = 1; then
michael@0 148 CFLAGS="$CFLAGS -O2"
michael@0 149 fi
michael@0 150 fi
michael@0 151 if test "$CXXFLAGS" = ""; then
michael@0 152 if test "$ENABLE_DEBUG" = 1; then
michael@0 153 CXXFLAGS=-g
michael@0 154 fi
michael@0 155 if test "$ENABLE_RELEASE" = 1; then
michael@0 156 CXXFLAGS="$CXXFLAGS -O2"
michael@0 157 fi
michael@0 158 fi
michael@0 159 fi
michael@0 160
michael@0 161 AC_PROG_CPP
michael@0 162
michael@0 163 AC_PROG_INSTALL
michael@0 164
michael@0 165 AC_SUBST(cross_compiling)
michael@0 166
michael@0 167 dnl use the pld hack to get ac_fn_cxx_try_link defined globally and not local
michael@0 168 AC_LANG_PUSH([C++])
michael@0 169 AC_LINK_IFELSE([AC_LANG_PROGRAM()])
michael@0 170 AC_LANG_POP([C++])
michael@0 171
michael@0 172 # make sure install is relative to srcdir - if a script
michael@0 173 if test "$srcdir" = "."; then
michael@0 174 # If srcdir isn't just ., then (srcdir) is already prepended.
michael@0 175 if test "${ac_install_sh}" = "${INSTALL}"; then
michael@0 176 INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
michael@0 177 fi
michael@0 178 fi
michael@0 179
michael@0 180 #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
michael@0 181 #AC_CHECK_PROG(STRIP, strip, strip, true)
michael@0 182
michael@0 183 # Check for the platform make
michael@0 184 AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
michael@0 185 AC_SUBST(U_MAKE)
michael@0 186
michael@0 187
michael@0 188 AC_ARG_WITH(cross-build,
michael@0 189 [ --with-cross-build=dir specify an absolute path to the build directory of an ICU built for the current platform [default=no cross dir]],
michael@0 190 [cross_buildroot="${withval}"],
michael@0 191 [cross_buildroot=""])
michael@0 192
michael@0 193 if test "X$cross_buildroot" = "X"; then
michael@0 194 if test "$cross_compiling" = "yes"; then
michael@0 195 AC_MSG_ERROR([Error! Cross compiling but no --with-cross-build option specified - please supply the path to an executable ICU's build root])
michael@0 196 dnl '
michael@0 197 fi
michael@0 198 else
michael@0 199 if test -f "${cross_buildroot}/config/icucross.mk"; then
michael@0 200 AC_MSG_RESULT([Using cross buildroot: $cross_buildroot])
michael@0 201 else
michael@0 202 if test -d "${cross_buildroot}"; then
michael@0 203 AC_MSG_ERROR([${cross_buildroot}/config/icucross.mk not found. Please build ICU in ${cross_buildroot} first.])
michael@0 204 else
michael@0 205 AC_MSG_ERROR([No such directory ${cross_buildroot} supplied as the argument to --with-cross-build. Use an absolute path.])
michael@0 206 fi
michael@0 207 fi
michael@0 208 fi
michael@0 209 AC_SUBST(cross_buildroot)
michael@0 210
michael@0 211 # Check for doxygen to generate documentation
michael@0 212 AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
michael@0 213
michael@0 214 # Check that the linker is usable
michael@0 215 ICU_PROG_LINK
michael@0 216
michael@0 217 # Determine the executable suffix
michael@0 218 # We don't use AC_EXEEXT because some compilers output separate debugging
michael@0 219 # files, which confuses the AC_EXEEXT macro.
michael@0 220 AC_MSG_CHECKING(checking for executable suffix)
michael@0 221 case "${host}" in
michael@0 222 *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;;
michael@0 223 *) EXEEXT="" ;;
michael@0 224 esac
michael@0 225 ac_exeext=$EXEEXT
michael@0 226 AC_MSG_RESULT($EXEEXT)
michael@0 227 AC_SUBST(EXEEXT)
michael@0 228
michael@0 229 # Determine how strict we want to be when compiling
michael@0 230 AC_CHECK_STRICT_COMPILE
michael@0 231
michael@0 232 # Check if we can build and use 64-bit libraries
michael@0 233 AC_CHECK_64BIT_LIBS
michael@0 234 AC_SUBST(ARFLAGS)
michael@0 235 AC_SUBST(COMPILE_LINK_ENVVAR)
michael@0 236
michael@0 237 # Determine the Makefile fragment
michael@0 238 ICU_CHECK_MH_FRAG
michael@0 239
michael@0 240 # Checks for libraries and other host specific stuff
michael@0 241 # On HP/UX, don't link to -lm from a shared lib because it isn't
michael@0 242 # PIC (at least on 10.2)
michael@0 243 case "${host}" in
michael@0 244 *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
michael@0 245
michael@0 246 *) AC_CHECK_LIB(m, floor)
michael@0 247 LIB_M="" ;;
michael@0 248 esac
michael@0 249 AC_SUBST(LIB_M)
michael@0 250
michael@0 251 # Check whether to build shared libraries
michael@0 252 AC_MSG_CHECKING([whether to build shared libraries])
michael@0 253 enabled=no
michael@0 254 AC_ARG_ENABLE(shared,
michael@0 255 [ --enable-shared build shared libraries [default=yes]],
michael@0 256 [ case "${enableval}" in
michael@0 257 yes|"") enabled=yes; ENABLE_SHARED=YES ;;
michael@0 258 no);;
michael@0 259 *) ;;
michael@0 260 esac],
michael@0 261 [enabled=yes; ENABLE_SHARED=YES]
michael@0 262 )
michael@0 263 AC_MSG_RESULT($enabled)
michael@0 264 AC_SUBST(ENABLE_SHARED)
michael@0 265
michael@0 266 # Check whether to build static libraries
michael@0 267 AC_MSG_CHECKING([whether to build static libraries])
michael@0 268 enabled=no
michael@0 269 AC_ARG_ENABLE(static,
michael@0 270 [ --enable-static build static libraries [default=no]],
michael@0 271 [ case "${enableval}" in
michael@0 272 yes|"") enabled=yes; ENABLE_STATIC=YES ;;
michael@0 273 no) ;;
michael@0 274 *) ;;
michael@0 275 esac],
michael@0 276 )
michael@0 277 AC_MSG_RESULT($enabled)
michael@0 278 AC_SUBST(ENABLE_STATIC)
michael@0 279
michael@0 280 # When building release static library, there might be some optimization flags we can use
michael@0 281 if test "$ENABLE_STATIC" = "YES"; then
michael@0 282 if test "$ENABLE_SHARED" != "YES"; then
michael@0 283 if test "$ENABLE_RELEASE" = 1; then
michael@0 284 AC_MSG_CHECKING([whether we can use static library optimization option])
michael@0 285 CHECK_STATIC_OPT_FLAG=no
michael@0 286
michael@0 287 OLD_CPPFLAGS="${CPPFLAGS}"
michael@0 288 OLD_LDFLAGS="${LDFLAGS}"
michael@0 289
michael@0 290 case "${host}" in
michael@0 291 *-linux*|i*86-*-*bsd*|i*86-pc-gnu)
michael@0 292 if test "$GCC" = yes; then
michael@0 293 CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections"
michael@0 294 LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
michael@0 295 fi
michael@0 296 ;;
michael@0 297 *)
michael@0 298 ;;
michael@0 299 esac
michael@0 300
michael@0 301 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [CHECK_STATIC_OPT_FLAG=yes], [CHECK_STATIC_OPT_FLAG=no])
michael@0 302 AC_MSG_RESULT($CHECK_STATIC_OPT_FLAG)
michael@0 303 if test "$CHECK_STATIC_OPT_FLAG" = no; then
michael@0 304 CPPFLAGS="${OLD_CPPFLAGS}"
michael@0 305 LDFLAGS="${OLD_LDFLAGS}"
michael@0 306 fi
michael@0 307 fi
michael@0 308 fi
michael@0 309 fi
michael@0 310
michael@0 311
michael@0 312 # Check whether to enable auto cleanup of libraries
michael@0 313 AC_MSG_CHECKING([whether to enable auto cleanup of libraries])
michael@0 314 enabled=no
michael@0 315 UCLN_NO_AUTO_CLEANUP=1
michael@0 316 AC_ARG_ENABLE(auto-cleanup,
michael@0 317 [ --enable-auto-cleanup enable auto cleanup of libraries [default=no]],
michael@0 318 [ case "${enableval}" in
michael@0 319 yes) enabled=yes;
michael@0 320 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DUCLN_NO_AUTO_CLEANUP=0";
michael@0 321 UCLN_NO_AUTO_CLEANUP=0
michael@0 322 ;;
michael@0 323 *) ;;
michael@0 324 esac],
michael@0 325 )
michael@0 326 AC_MSG_RESULT($enabled)
michael@0 327 AC_SUBST(UCLN_NO_AUTO_CLEANUP)
michael@0 328
michael@0 329 # MSVC floating-point option
michael@0 330 MSVC_RELEASE_FLAG=""
michael@0 331 if test $enabled = yes
michael@0 332 then
michael@0 333 if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc
michael@0 334 then
michael@0 335 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
michael@0 336 #if defined _MSC_VER && _MSC_VER >= 1400
michael@0 337 #else
michael@0 338 Microsoft Visual C++ < 2005
michael@0 339 #endif
michael@0 340 ]], [[]])],[MSVC_RELEASE_FLAG="/fp:precise"],[MSVC_RELEASE_FLAG="/Op"])
michael@0 341
michael@0 342 CFLAGS="${CFLAGS} ${MSVC_RELEASE_FLAG}"
michael@0 343 CXXFLAGS="${CXXFLAGS} ${MSVC_RELEASE_FLAG}"
michael@0 344 fi
michael@0 345 fi
michael@0 346
michael@0 347 # Check whether to enabled draft APIs
michael@0 348 AC_MSG_CHECKING([whether to enable draft APIs])
michael@0 349 enabled=yes
michael@0 350 U_DEFAULT_SHOW_DRAFT=1
michael@0 351 AC_ARG_ENABLE(draft,
michael@0 352 [ --enable-draft enable draft APIs (and internal APIs) [default=yes]],
michael@0 353 [ case "${enableval}" in
michael@0 354 no) enabled=no; U_DEFAULT_SHOW_DRAFT=0;
michael@0 355 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEFAULT_SHOW_DRAFT=0"
michael@0 356 ;;
michael@0 357 *) ;;
michael@0 358 esac],
michael@0 359 )
michael@0 360 AC_MSG_RESULT($enabled)
michael@0 361 # Make sure that we can use draft API in ICU.
michael@0 362 if test "$U_DEFAULT_SHOW_DRAFT" = 0; then
michael@0 363 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_SHOW_DRAFT_API"
michael@0 364 fi
michael@0 365 AC_SUBST(U_DEFAULT_SHOW_DRAFT)
michael@0 366
michael@0 367 AC_PROG_RANLIB
michael@0 368
michael@0 369 # look for 'ar' the proper way
michael@0 370 AC_CHECK_TOOL(AR, ar, false)
michael@0 371
michael@0 372 AC_MSG_CHECKING([whether to enable renaming of symbols])
michael@0 373 enabled=yes
michael@0 374 U_DISABLE_RENAMING=0
michael@0 375 AC_ARG_ENABLE(renaming,
michael@0 376 [ --enable-renaming add a version suffix to symbols [default=yes]],
michael@0 377 [ case "${enableval}" in
michael@0 378 yes|"") enabled=yes ;;
michael@0 379 no) enabled=no; U_DISABLE_RENAMING=1;
michael@0 380 UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_DISABLE_RENAMING=1"
michael@0 381 ;;
michael@0 382 *) ;;
michael@0 383 esac],
michael@0 384 )
michael@0 385 AC_MSG_RESULT($enabled)
michael@0 386 AC_SUBST(U_DISABLE_RENAMING)
michael@0 387
michael@0 388 AC_MSG_CHECKING([whether to enable function and data tracing])
michael@0 389 enabled=no
michael@0 390 U_ENABLE_TRACING=0
michael@0 391 AC_ARG_ENABLE(tracing,
michael@0 392 [ --enable-tracing enable function and data tracing [default=no]],
michael@0 393 [ case "${enableval}" in
michael@0 394 yes|"") enabled=yes;
michael@0 395 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_TRACING=1";
michael@0 396 U_ENABLE_TRACING=1 ;;
michael@0 397 no) enabled=no; U_ENABLE_TRACING=0 ;;
michael@0 398 *) ;;
michael@0 399 esac],
michael@0 400 )
michael@0 401 AC_MSG_RESULT($enabled)
michael@0 402 AC_SUBST(U_ENABLE_TRACING)
michael@0 403
michael@0 404 # check if elf.h is present.
michael@0 405 AC_CHECK_HEADERS([elf.h])
michael@0 406 if test "x$ac_cv_header_elf_h" = "xyes"; then
michael@0 407 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1";
michael@0 408 fi
michael@0 409
michael@0 410 U_ENABLE_DYLOAD=1
michael@0 411 enable=yes
michael@0 412 AC_MSG_CHECKING([whether to enable dynamic loading of plugins])
michael@0 413 AC_ARG_ENABLE(dyload,
michael@0 414 [ --disable-dyload disable dynamic loading [default=no]],
michael@0 415 [ case "${enableval}" in
michael@0 416 yes|"")
michael@0 417 U_ENABLE_DYLOAD=1
michael@0 418 enable=yes
michael@0 419 ;;
michael@0 420 no)
michael@0 421 U_ENABLE_DYLOAD=0;
michael@0 422 enable=no;
michael@0 423 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_DYLOAD=0";
michael@0 424 ;;
michael@0 425 *) ;;
michael@0 426 esac],
michael@0 427 )
michael@0 428 AC_MSG_RESULT($enable)
michael@0 429 AC_SUBST(U_ENABLE_DYLOAD)
michael@0 430
michael@0 431 if test "$enable" = "yes"; then
michael@0 432 AC_CHECK_HEADERS([dlfcn.h])
michael@0 433 #AC_MSG_RESULT($enabled)
michael@0 434 AC_SEARCH_LIBS([dlopen], [dl])
michael@0 435 AC_CHECK_FUNCS([dlopen])
michael@0 436
michael@0 437 if test "x$ac_cv_func_dlopen" != xyes; then
michael@0 438 CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DHAVE_DLOPEN=0"
michael@0 439 fi
michael@0 440 fi
michael@0 441
michael@0 442 # Check for miscellanous functions.
michael@0 443 # So, use for putil / tools only.
michael@0 444 # Note that this will generate HAVE_GETTIMEOFDAY, not U_HAVE_GETTIMEOFDAY
michael@0 445 AC_CHECK_FUNCS([gettimeofday])
michael@0 446
michael@0 447
michael@0 448 # Check whether to use the evil rpath or not
michael@0 449 AC_ARG_ENABLE(rpath,
michael@0 450 [ --enable-rpath use rpath when linking [default is only if necessary]],
michael@0 451 [ case "${enableval}" in
michael@0 452 yes|"") ENABLE_RPATH=YES ;;
michael@0 453 no) ;;
michael@0 454 *) ;;
michael@0 455 esac],
michael@0 456 [ENABLE_RPATH=NO]
michael@0 457 )
michael@0 458 AC_SUBST(ENABLE_RPATH)
michael@0 459
michael@0 460
michael@0 461
michael@0 462 AC_LANG_PUSH([C++])
michael@0 463 AC_MSG_CHECKING([[if we have a C++ compiler]])
michael@0 464 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx_okay=yes],[cxx_okay=no])
michael@0 465 if test $cxx_okay = yes
michael@0 466 then
michael@0 467 AC_MSG_RESULT([[Good]])
michael@0 468 else
michael@0 469 AC_MSG_RESULT([[no]])
michael@0 470 AC_MSG_ERROR([[C++ compiler $CXX does not work or no compiler found]])
michael@0 471 fi
michael@0 472
michael@0 473 if [[ "$GXX" = yes ]]; then
michael@0 474 # if CXXFLAGS does not have a "-std=" setting, set it now to -std=c++0x,
michael@0 475 # and check that the compiler still works.
michael@0 476 if ! echo "$CXXFLAGS" | grep '\-std=' >/dev/null 2>&1; then
michael@0 477 OLD_CXXFLAGS="${CXXFLAGS}"
michael@0 478 CXXFLAGS="$CXXFLAGS --std=c++0x"
michael@0 479 AC_MSG_CHECKING([[if we have a C++11 compiler]])
michael@0 480 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx11_okay=yes],[cxx11_okay=no])
michael@0 481 AC_MSG_RESULT($cxx11_okay)
michael@0 482 if [[ $cxx11_okay = yes ]]; then
michael@0 483 AC_MSG_NOTICE([Adding CXXFLAGS option --std=c++0x])
michael@0 484 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=c++0x"
michael@0 485 else
michael@0 486 CXXFLAGS="$OLD_CXXFLAGS"
michael@0 487 fi
michael@0 488 fi
michael@0 489 fi
michael@0 490
michael@0 491 AC_MSG_CHECKING([[if #include <string> works]])
michael@0 492 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string>]], [[]])], [ac_cv_header_stdstring=yes], [ac_cv_header_stdstring=no])
michael@0 493 AC_MSG_RESULT($ac_cv_header_stdstring)
michael@0 494 if test $ac_cv_header_stdstring = yes
michael@0 495 then
michael@0 496 U_HAVE_STD_STRING=1
michael@0 497 else
michael@0 498 U_HAVE_STD_STRING=0
michael@0 499 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STD_STRING=0"
michael@0 500 fi
michael@0 501 AC_SUBST(U_HAVE_STD_STRING)
michael@0 502
michael@0 503
michael@0 504 AC_MSG_CHECKING([[if #include <atomic> works]])
michael@0 505 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no])
michael@0 506 AC_MSG_RESULT($ac_cv_header_atomic)
michael@0 507 if test $ac_cv_header_atomic = yes
michael@0 508 then
michael@0 509 U_HAVE_ATOMIC=1
michael@0 510 else
michael@0 511 U_HAVE_ATOMIC=0
michael@0 512 fi
michael@0 513 # Make this available via CPPFLAGS
michael@0 514 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=${U_HAVE_ATOMIC}"
michael@0 515 AC_SUBST(U_HAVE_ATOMIC)
michael@0 516
michael@0 517 AC_LANG_POP([C++])
michael@0 518
michael@0 519 # Always build ICU with multi-threading support.
michael@0 520 threads=true
michael@0 521 ICU_USE_THREADS=1
michael@0 522 OLD_LIBS=${LIBS}
michael@0 523
michael@0 524 if test $threads = true; then
michael@0 525 # For Compaq Tru64 (OSF1), we must look for pthread_attr_init
michael@0 526 # and must do this before seaching for pthread_mutex_destroy, or
michael@0 527 # we will pick up libpthreads.so not libpthread.so
michael@0 528 # If this fails, then we must test for HPUX specials, before
michael@0 529 # moving on to a more generic test
michael@0 530
michael@0 531 AC_CHECK_LIB(pthread, pthread_attr_init)
michael@0 532 if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
michael@0 533 ICU_USE_THREADS=1
michael@0 534 else
michael@0 535 # Locate the right library for POSIX threads. We look for the
michael@0 536 # symbols in the libraries first, because on Solaris libc provides
michael@0 537 # pthread_create but libpthread has the real code :(
michael@0 538 # AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread
michael@0 539 # FreeBSD users may need libpthread if they do not have libc_r.
michael@0 540
michael@0 541 AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r )
michael@0 542
michael@0 543 if test "$ac_cv_search_pthread_mutex_destroy" != no; then
michael@0 544 ICU_USE_THREADS=1
michael@0 545 else
michael@0 546 # For HP 11
michael@0 547 AC_CHECK_LIB(pthread, pthread_mutex_init)
michael@0 548 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
michael@0 549 ICU_USE_THREADS=1
michael@0 550 fi
michael@0 551 fi
michael@0 552
michael@0 553 AC_CHECK_FUNC(pthread_mutex_lock)
michael@0 554
michael@0 555 if test $ac_cv_func_pthread_mutex_lock = yes; then
michael@0 556 ICU_USE_THREADS=1
michael@0 557 fi
michael@0 558 fi
michael@0 559 # Check to see if we are using CygWin with MSVC
michael@0 560 case "${host}" in
michael@0 561 *-pc-cygwin*|*-pc-mingw*)
michael@0 562 # For gcc, the thread options are set by mh-mingw/mh-cygwin
michael@0 563 # For msvc, the thread options are set by runConfigureICU
michael@0 564 ICU_USE_THREADS=1
michael@0 565 ;;
michael@0 566 *-*-hpux*)
michael@0 567 # Add -mt because it does several nice things on newer compilers.
michael@0 568 case "${icu_cv_host_frag}" in
michael@0 569 mh-hpux-acc)
michael@0 570 OLD_CXXFLAGS="${CXXFLAGS}"
michael@0 571 CXXFLAGS="${CXXFLAGS} -mt"
michael@0 572 if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
michael@0 573 CXXFLAGS="${OLD_CXXFLAGS}"
michael@0 574 else
michael@0 575 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -mt"
michael@0 576 fi
michael@0 577 ;;
michael@0 578 esac
michael@0 579 ;;
michael@0 580 *-*-solaris*)
michael@0 581 case "${icu_cv_host_frag}" in
michael@0 582 mh-solaris)
michael@0 583 LIBS="${LIBS} -mt"
michael@0 584 ;;
michael@0 585 esac
michael@0 586 ;;
michael@0 587 esac
michael@0 588 fi
michael@0 589
michael@0 590 AC_ARG_ENABLE(weak-threads,
michael@0 591 [ --enable-weak-threads weakly reference the threading library [default=no]],
michael@0 592 [case "${enableval}" in
michael@0 593 yes)
michael@0 594 LIB_THREAD="${LIBS%${OLD_LIBS}}"
michael@0 595 LIBS=${OLD_LIBS}
michael@0 596 ;;
michael@0 597 no) ;;
michael@0 598 *) AC_MSG_ERROR(bad value ${enableval} for --enable-weak-threads) ;;
michael@0 599 esac])
michael@0 600 AC_SUBST(LIB_THREAD)
michael@0 601
michael@0 602 # Check for mmap()
michael@0 603
michael@0 604 # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
michael@0 605 # Do this check instead.
michael@0 606 HAVE_MMAP=0
michael@0 607 AC_MSG_CHECKING([for mmap])
michael@0 608 AC_CACHE_VAL(ac_cv_func_mmap_ok,
michael@0 609 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
michael@0 610 #include <sys/mman.h>
michael@0 611 #include <sys/stat.h>
michael@0 612 #include <fcntl.h>], [mmap((void *)0, 0, PROT_READ, 0, 0, 0);])],[ac_cv_func_mmap_ok=yes],[ac_cv_func_mmap_ok=no])] )
michael@0 613 AC_MSG_RESULT($ac_cv_func_mmap_ok)
michael@0 614 if test $ac_cv_func_mmap_ok = yes
michael@0 615 then
michael@0 616 HAVE_MMAP=1
michael@0 617 else
michael@0 618 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_MMAP=0"
michael@0 619 fi
michael@0 620 AC_SUBST(HAVE_MMAP)
michael@0 621
michael@0 622 AC_MSG_CHECKING([for genccode assembly])
michael@0 623
michael@0 624 # Check to see if genccode can generate simple assembly.
michael@0 625 GENCCODE_ASSEMBLY=
michael@0 626 case "${host}" in
michael@0 627 *-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu)
michael@0 628 if test "$GCC" = yes; then
michael@0 629 # We're using gcc, and the simple -a gcc command line works for genccode
michael@0 630 GENCCODE_ASSEMBLY="-a gcc"
michael@0 631 fi ;;
michael@0 632 i*86-*-solaris*)
michael@0 633 if test "$GCC" = yes; then
michael@0 634 # When using gcc, look if we're also using GNU as.
michael@0 635 # When using GNU as, the simple -a gcc command line works for genccode.
michael@0 636 asv=`"${CC}" -print-prog-name=as 2>/dev/null`
michael@0 637 asv=`"${asv}" --version 2>/dev/null`
michael@0 638 case "X${asv}" in
michael@0 639 X*GNU*) GENCCODE_ASSEMBLY="-a gcc" ;;
michael@0 640 X*) GENCCODE_ASSEMBLY="-a sun-x86" ;;
michael@0 641 esac
michael@0 642 unset asv
michael@0 643 else
michael@0 644 GENCCODE_ASSEMBLY="-a sun-x86"
michael@0 645 fi ;;
michael@0 646 sparc-*-solaris*)
michael@0 647 GENCCODE_ASSEMBLY="-a sun"
michael@0 648 ;;
michael@0 649 ia64-*-hpux*)
michael@0 650 GENCCODE_ASSEMBLY="-a aCC-ia64"
michael@0 651 ;;
michael@0 652 esac
michael@0 653 AC_SUBST(GENCCODE_ASSEMBLY)
michael@0 654
michael@0 655 AC_MSG_RESULT($GENCCODE_ASSEMBLY)
michael@0 656
michael@0 657 # Checks for header files
michael@0 658 AC_CHECK_HEADERS(inttypes.h)
michael@0 659 if test $ac_cv_header_inttypes_h = no; then
michael@0 660 U_HAVE_INTTYPES_H=0
michael@0 661 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
michael@0 662 else
michael@0 663 U_HAVE_INTTYPES_H=1
michael@0 664 fi
michael@0 665 if test "$CC" = ccc; then
michael@0 666 AC_MSG_RESULT("C compiler set to CCC ${CC}" )
michael@0 667 case "${host}" in
michael@0 668 alpha*-*-*) U_HAVE_INTTYPES_H=0;
michael@0 669 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
michael@0 670 esac
michael@0 671 fi
michael@0 672
michael@0 673 AC_SUBST(U_HAVE_INTTYPES_H)
michael@0 674
michael@0 675 AC_CHECK_HEADERS(dirent.h)
michael@0 676 if test $ac_cv_header_dirent_h = no; then
michael@0 677 U_HAVE_DIRENT_H=0
michael@0 678 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_DIRENT_H=0"
michael@0 679 else
michael@0 680 U_HAVE_DIRENT_H=1
michael@0 681 fi
michael@0 682
michael@0 683 AC_SUBST(U_HAVE_DIRENT_H)
michael@0 684
michael@0 685 # Check for endianness
michael@0 686 AC_C_BIGENDIAN()
michael@0 687 if test $ac_cv_c_bigendian = no; then
michael@0 688 U_IS_BIG_ENDIAN=0
michael@0 689 U_ENDIAN_CHAR="l"
michael@0 690 else
michael@0 691 U_IS_BIG_ENDIAN=1
michael@0 692 U_ENDIAN_CHAR="b"
michael@0 693 fi
michael@0 694 AC_SUBST(U_IS_BIG_ENDIAN)
michael@0 695
michael@0 696 # Do various POSIX related checks
michael@0 697 U_HAVE_NL_LANGINFO_CODESET=0
michael@0 698 U_NL_LANGINFO_CODESET=-1
michael@0 699 AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
michael@0 700 dnl AC_SUBST(U_HAVE_NL_LANGINFO)
michael@0 701 if test $U_HAVE_NL_LANGINFO -eq 1; then
michael@0 702 AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
michael@0 703 ac_cv_nl_langinfo_codeset,
michael@0 704 [ac_cv_nl_langinfo_codeset="unknown"
michael@0 705 for a in CODESET _NL_CTYPE_CODESET_NAME; do
michael@0 706 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo($a);]])],[ac_cv_nl_langinfo_codeset="$a"; break],[])]
michael@0 707 done)
michael@0 708 if test x$ac_cv_nl_langinfo_codeset != xunknown
michael@0 709 then
michael@0 710 U_HAVE_NL_LANGINFO_CODESET=1
michael@0 711 U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
michael@0 712 if test "x${ac_cv_nl_langinfo_codeset}" != "xCODESET"
michael@0 713 then
michael@0 714 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DNL_LANGINFO_CODESET=${ac_cv_nl_langinfo_codeset}"
michael@0 715 fi
michael@0 716 else
michael@0 717 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_NL_LANGINFO_CODESET=0"
michael@0 718 fi
michael@0 719 fi
michael@0 720 AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
michael@0 721 AC_SUBST(U_NL_LANGINFO_CODESET)
michael@0 722
michael@0 723 # Namespace support checks
michael@0 724 AC_LANG(C++)
michael@0 725 AC_MSG_CHECKING([for namespace support])
michael@0 726 AC_CACHE_VAL(ac_cv_namespace_ok,
michael@0 727 [AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace x_version {void f(){}}
michael@0 728 namespace x = x_version;
michael@0 729 using namespace x_version;
michael@0 730 ], [f();])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] )
michael@0 731 AC_MSG_RESULT($ac_cv_namespace_ok)
michael@0 732 if test $ac_cv_namespace_ok = no
michael@0 733 then
michael@0 734 AC_MSG_ERROR(Namespace support is required to build ICU.)
michael@0 735 fi
michael@0 736
michael@0 737 AC_MSG_CHECKING([for properly overriding new and delete])
michael@0 738 U_OVERRIDE_CXX_ALLOCATION=0
michael@0 739 U_HAVE_PLACEMENT_NEW=0
michael@0 740 AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
michael@0 741 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
michael@0 742 class UMemory {
michael@0 743 public:
michael@0 744 void *operator new(size_t size) {return malloc(size);}
michael@0 745 void *operator new[](size_t size) {return malloc(size);}
michael@0 746 void operator delete(void *p) {free(p);}
michael@0 747 void operator delete[](void *p) {free(p);}
michael@0 748 };
michael@0 749 ]], [])],[ac_cv_override_cxx_allocation_ok=yes],[ac_cv_override_cxx_allocation_ok=no])] )
michael@0 750 AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
michael@0 751 if test $ac_cv_override_cxx_allocation_ok = yes
michael@0 752 then
michael@0 753 U_OVERRIDE_CXX_ALLOCATION=1
michael@0 754 AC_MSG_CHECKING([for placement new and delete])
michael@0 755 AC_CACHE_VAL(ac_cv_override_placement_new_ok,
michael@0 756 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
michael@0 757 class UMemory {
michael@0 758 public:
michael@0 759 void *operator new(size_t size) {return malloc(size);}
michael@0 760 void *operator new[](size_t size) {return malloc(size);}
michael@0 761 void operator delete(void *p) {free(p);}
michael@0 762 void operator delete[](void *p) {free(p);}
michael@0 763 void * operator new(size_t, void *ptr) { return ptr; }
michael@0 764 void operator delete(void *, void *) {}
michael@0 765 };
michael@0 766 ]], [])],[ac_cv_override_placement_new_ok=yes],[ac_cv_override_placement_new_ok=no])] )
michael@0 767 AC_MSG_RESULT($ac_cv_override_placement_new_ok)
michael@0 768 if test $ac_cv_override_placement_new_ok = yes
michael@0 769 then
michael@0 770 U_HAVE_PLACEMENT_NEW=1
michael@0 771 else
michael@0 772 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_PLACEMENT_NEW=0"
michael@0 773 fi
michael@0 774 else
michael@0 775 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_OVERRIDE_CXX_ALLOCATION=0"
michael@0 776 fi
michael@0 777 AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
michael@0 778 AC_SUBST(U_HAVE_PLACEMENT_NEW)
michael@0 779
michael@0 780 AC_LANG(C)
michael@0 781 AC_CHECK_FUNC(popen)
michael@0 782 if test x$ac_cv_func_popen = xyes
michael@0 783 then
michael@0 784 U_HAVE_POPEN=1
michael@0 785 else
michael@0 786 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_POPEN=0"
michael@0 787 U_HAVE_POPEN=0
michael@0 788 fi
michael@0 789 AC_SUBST(U_HAVE_POPEN)
michael@0 790
michael@0 791 AC_CHECK_FUNC(tzset)
michael@0 792 U_HAVE_TZSET=0
michael@0 793 if test x$ac_cv_func_tzset = xyes
michael@0 794 then
michael@0 795 U_TZSET=tzset
michael@0 796 U_HAVE_TZSET=1
michael@0 797 else
michael@0 798 AC_CHECK_FUNC(_tzset)
michael@0 799 if test x$ac_cv_func__tzset = xyes
michael@0 800 then
michael@0 801 U_TZSET=_tzset
michael@0 802 U_HAVE_TZSET=1
michael@0 803 else
michael@0 804 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"
michael@0 805 fi
michael@0 806 fi
michael@0 807 AC_SUBST(U_HAVE_TZSET)
michael@0 808 AC_SUBST(U_TZSET)
michael@0 809
michael@0 810 U_HAVE_TZNAME=0
michael@0 811 AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
michael@0 812 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef __USE_POSIX
michael@0 813 #define __USE_POSIX
michael@0 814 #endif
michael@0 815 #include <stdlib.h>
michael@0 816 #include <time.h>
michael@0 817 #ifndef tzname /* For SGI. */
michael@0 818 extern char *tzname[]; /* RS6000 and others reject char **tzname. */
michael@0 819 #endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])])
michael@0 820 if test $ac_cv_var_tzname = yes; then
michael@0 821 U_TZNAME=tzname
michael@0 822 U_HAVE_TZNAME=1
michael@0 823 else
michael@0 824 AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
michael@0 825 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
michael@0 826 #include <time.h>
michael@0 827 extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])])
michael@0 828 if test $ac_cv_var__tzname = yes; then
michael@0 829 U_TZNAME=_tzname
michael@0 830 U_HAVE_TZNAME=1
michael@0 831 else
michael@0 832 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZNAME=0"
michael@0 833 fi
michael@0 834 fi
michael@0 835 AC_SUBST(U_HAVE_TZNAME)
michael@0 836 AC_SUBST(U_TZNAME)
michael@0 837
michael@0 838 AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
michael@0 839 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#ifndef __USE_POSIX
michael@0 840 #define __USE_POSIX
michael@0 841 #endif
michael@0 842 #ifndef __USE_XOPEN
michael@0 843 #define __USE_XOPEN
michael@0 844 #endif
michael@0 845 #include <time.h>
michael@0 846 ], [[timezone = 1;]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])])
michael@0 847 U_HAVE_TIMEZONE=0
michael@0 848 if test $ac_cv_var_timezone = yes; then
michael@0 849 U_TIMEZONE=timezone
michael@0 850 U_HAVE_TIMEZONE=1
michael@0 851 else
michael@0 852 AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
michael@0 853 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[__timezone = 1;]])],[ac_cv_var___timezone=yes],[ac_cv_var___timezone=no])])
michael@0 854 if test $ac_cv_var___timezone = yes; then
michael@0 855 U_TIMEZONE=__timezone
michael@0 856 U_HAVE_TIMEZONE=1
michael@0 857 else
michael@0 858 AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
michael@0 859 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[_timezone = 1;]])],[ac_cv_var__timezone=yes],[ac_cv_var__timezone=no])])
michael@0 860 if test $ac_cv_var__timezone = yes; then
michael@0 861 U_TIMEZONE=_timezone
michael@0 862 U_HAVE_TIMEZONE=1
michael@0 863 else
michael@0 864 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TIMEZONE=0"
michael@0 865 fi
michael@0 866 fi
michael@0 867 fi
michael@0 868 AC_SUBST(U_HAVE_TIMEZONE)
michael@0 869 AC_SUBST(U_TIMEZONE)
michael@0 870
michael@0 871 # Checks for typedefs
michael@0 872 AC_CHECK_TYPE(int8_t,signed char)
michael@0 873 AC_CHECK_TYPE(uint8_t,unsigned char)
michael@0 874 AC_CHECK_TYPE(int16_t,signed short)
michael@0 875 AC_CHECK_TYPE(uint16_t,unsigned short)
michael@0 876 AC_CHECK_TYPE(int32_t,signed long)
michael@0 877 AC_CHECK_TYPE(uint32_t,unsigned long)
michael@0 878 AC_CHECK_TYPE(int64_t,signed long long)
michael@0 879 AC_CHECK_TYPE(uint64_t,unsigned long long)
michael@0 880
michael@0 881 if test $ac_cv_type_int8_t = no; then
michael@0 882 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT8_T=0"
michael@0 883 fi
michael@0 884
michael@0 885 if test $ac_cv_type_uint8_t = no; then
michael@0 886 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT8_T=0"
michael@0 887 fi
michael@0 888
michael@0 889 if test $ac_cv_type_int16_t = no; then
michael@0 890 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT16_T=0"
michael@0 891 fi
michael@0 892
michael@0 893 if test $ac_cv_type_uint16_t = no; then
michael@0 894 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT16_T=0"
michael@0 895 fi
michael@0 896
michael@0 897 if test $ac_cv_type_int32_t = no; then
michael@0 898 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT32_T=0"
michael@0 899 fi
michael@0 900
michael@0 901 if test $ac_cv_type_uint32_t = no; then
michael@0 902 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT32_T=0"
michael@0 903 fi
michael@0 904
michael@0 905 if test $ac_cv_type_int64_t = no; then
michael@0 906 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT64_T=0"
michael@0 907 fi
michael@0 908
michael@0 909 if test $ac_cv_type_uint64_t = no; then
michael@0 910 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT64_T=0"
michael@0 911 fi
michael@0 912
michael@0 913 # Do various wchar_t related checks
michael@0 914 AC_CHECK_HEADER(wchar.h)
michael@0 915 if test "$ac_cv_header_wchar_h" = no
michael@0 916 then
michael@0 917 U_HAVE_WCHAR_H=0
michael@0 918 U_HAVE_WCSCPY=0
michael@0 919 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCHAR_H=0 -DU_HAVE_WCSCPY=0"
michael@0 920 else
michael@0 921 AC_DEFINE([HAVE_WCHAR_H], [1], [wchar.h was found.])
michael@0 922 U_HAVE_WCHAR_H=1
michael@0 923 # Some broken systems have wchar.h but not some of its functions...
michael@0 924 AC_SEARCH_LIBS(wcscpy, wcs w)
michael@0 925 if test "$ac_cv_search_wcscpy" != no; then
michael@0 926 U_HAVE_WCSCPY=1
michael@0 927 else
michael@0 928 U_HAVE_WCSCPY=0
michael@0 929 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCSCPY=0"
michael@0 930 fi
michael@0 931 fi
michael@0 932 AC_SUBST(U_HAVE_WCHAR_H)
michael@0 933 AC_SUBST(U_HAVE_WCSCPY)
michael@0 934
michael@0 935 AC_CHECK_SIZEOF([wchar_t], 0, [
michael@0 936 #if STDC_HEADERS
michael@0 937 #include <stddef.h>
michael@0 938 #endif
michael@0 939 #include <stdlib.h>
michael@0 940 #if HAVE_WCHAR_H
michael@0 941 #include <string.h>
michael@0 942 #include <wchar.h>
michael@0 943 #endif])
michael@0 944 U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
michael@0 945 # We do this check to verify that everything is okay.
michael@0 946 if test $U_SIZEOF_WCHAR_T = 0; then
michael@0 947 if test $U_HAVE_WCHAR_H=1; then
michael@0 948 AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
michael@0 949 fi
michael@0 950 fi
michael@0 951
michael@0 952 AC_MSG_CHECKING([for UTF-16 string literal support])
michael@0 953 U_CHECK_UTF16_STRING=1
michael@0 954 CHECK_UTF16_STRING_RESULT="unknown"
michael@0 955
michael@0 956 case "${host}" in
michael@0 957 *-*-aix*|powerpc64-*-linux*)
michael@0 958 if test "$GCC" = no; then
michael@0 959 OLD_CFLAGS="${CFLAGS}"
michael@0 960 OLD_CXXFLAGS="${CXXFLAGS}"
michael@0 961 CFLAGS="${CFLAGS} -qutf"
michael@0 962 CXXFLAGS="${CXXFLAGS} -qutf"
michael@0 963 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = u"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
michael@0 964 if test "$U_CHECK_UTF16_STRING" = 0; then
michael@0 965 CFLAGS="${OLD_CFLAGS}"
michael@0 966 CXXFLAGS="${OLD_CXXFLAGS}"
michael@0 967 else
michael@0 968 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -qutf"
michael@0 969 CHECK_UTF16_STRING_RESULT="-qutf"
michael@0 970 fi
michael@0 971 fi
michael@0 972 ;;
michael@0 973 *-*-solaris*)
michael@0 974 if test "$GCC" = no; then
michael@0 975 OLD_CFLAGS="${CFLAGS}"
michael@0 976 OLD_CXXFLAGS="${CXXFLAGS}"
michael@0 977 CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
michael@0 978 CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort"
michael@0 979 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = U"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
michael@0 980 if test "$U_CHECK_UTF16_STRING" = 0; then
michael@0 981 CFLAGS="${OLD_CFLAGS}"
michael@0 982 CXXFLAGS="${OLD_CXXFLAGS}"
michael@0 983 else
michael@0 984 CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
michael@0 985 UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -xustr=ascii_utf16_ushort"
michael@0 986 UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -xustr=ascii_utf16_ushort"
michael@0 987 # Since we can't detect the availability of this UTF-16 syntax at compile time,
michael@0 988 # we depend on configure telling us that we can use it.
michael@0 989 # Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
michael@0 990 # we only use this macro within ICU.
michael@0 991 # If an ICU user uses icu-config, this feature will be enabled.
michael@0 992 CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_CHECK_UTF16_STRING=1"
michael@0 993 U_CHECK_UTF16_STRING=0
michael@0 994 fi
michael@0 995 fi
michael@0 996 ;;
michael@0 997 *-*-hpux*)
michael@0 998 if test "$GCC" = no; then
michael@0 999 # The option will be detected at compile time without additional compiler options.
michael@0 1000 CHECK_UTF16_STRING_RESULT="available"
michael@0 1001 fi
michael@0 1002 ;;
michael@0 1003 *-*-cygwin)
michael@0 1004 # wchar_t can be used
michael@0 1005 CHECK_UTF16_STRING_RESULT="available"
michael@0 1006 ;;
michael@0 1007 *)
michael@0 1008 ;;
michael@0 1009 esac
michael@0 1010
michael@0 1011 # GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future.
michael@0 1012 if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
michael@0 1013 if test "$GCC" = yes; then
michael@0 1014 OLD_CFLAGS="${CFLAGS}"
michael@0 1015 CFLAGS="${CFLAGS} -std=gnu99"
michael@0 1016 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
michael@0 1017 static const char16_t test[] = u"This is a UTF16 literal string.";
michael@0 1018 ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0])
michael@0 1019 if test "$CC_UTF16_STRING" = 1; then
michael@0 1020 UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=gnu99"
michael@0 1021 CHECK_UTF16_STRING_RESULT="C only";
michael@0 1022 else
michael@0 1023 CFLAGS="${OLD_CFLAGS}"
michael@0 1024 fi
michael@0 1025 fi
michael@0 1026 if test "$GXX" = yes; then
michael@0 1027 # -Wno-return-type-c-linkage is desired so that stable ICU API is not warned about.
michael@0 1028 AC_LANG_PUSH([C++])
michael@0 1029 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
michael@0 1030 static const char16_t test[] = u"This is a UTF16 literal string.";
michael@0 1031 ]], [[]])],[CXX_UTF16_STRING=1],[CXX_UTF16_STRING=0])
michael@0 1032 AC_LANG_POP([C++])
michael@0 1033 if test "$CXX_UTF16_STRING" = 1; then
michael@0 1034 if test "$CC_UTF16_STRING" = 1; then
michael@0 1035 CHECK_UTF16_STRING_RESULT="available";
michael@0 1036 else
michael@0 1037 CHECK_UTF16_STRING_RESULT="C++ only";
michael@0 1038 fi
michael@0 1039 fi
michael@0 1040 fi
michael@0 1041 fi
michael@0 1042 AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT)
michael@0 1043
michael@0 1044 # Enable/disable extras
michael@0 1045 AC_ARG_ENABLE(extras,
michael@0 1046 [ --enable-extras build ICU extras [default=yes]],
michael@0 1047 [case "${enableval}" in
michael@0 1048 yes) extras=true ;;
michael@0 1049 no) extras=false ;;
michael@0 1050 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
michael@0 1051 esac],
michael@0 1052 extras=true)
michael@0 1053 ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
michael@0 1054 AC_ARG_ENABLE(icuio,
michael@0 1055 [ --enable-icuio build ICU's icuio library [default=yes]],
michael@0 1056 [case "${enableval}" in
michael@0 1057 yes) icuio=true ;;
michael@0 1058 no) icuio=false ;;
michael@0 1059 *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
michael@0 1060 esac],
michael@0 1061 icuio=true)
michael@0 1062 ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
michael@0 1063
michael@0 1064 # Enable/disable layout
michael@0 1065 AC_ARG_ENABLE(layout,
michael@0 1066 [ --enable-layout build ICU's layout library [default=yes]],
michael@0 1067 [case "${enableval}" in
michael@0 1068 yes) layout=true ;;
michael@0 1069 no) layout=false ;;
michael@0 1070 *) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;;
michael@0 1071 esac],
michael@0 1072 layout=true)
michael@0 1073 ICU_CONDITIONAL(LAYOUT, test "$layout" = true)
michael@0 1074
michael@0 1075 # Enable/disable tools
michael@0 1076 AC_ARG_ENABLE(tools,
michael@0 1077 [ --enable-tools build ICU's tools [default=yes]],
michael@0 1078 [case "${enableval}" in
michael@0 1079 yes) tools=true ;;
michael@0 1080 no) tools=false ;;
michael@0 1081 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
michael@0 1082 esac],
michael@0 1083 tools=true)
michael@0 1084 ICU_CONDITIONAL(TOOLS, test "$tools" = true)
michael@0 1085
michael@0 1086 AC_ARG_WITH(data-packaging,
michael@0 1087 [ --with-data-packaging=type specify how to package ICU data (files, archive, library, static, auto) [default=auto]],
michael@0 1088 [case "${withval}" in
michael@0 1089 files|archive|library) datapackaging=$withval ;;
michael@0 1090 auto) datapackaging=$withval ;;
michael@0 1091 common) datapackaging=archive ;;
michael@0 1092 dll) datapackaging=library ;;
michael@0 1093 static) datapackaging=static ;;
michael@0 1094 *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
michael@0 1095 esac],
michael@0 1096 [datapackaging=])
michael@0 1097
michael@0 1098 # Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
michael@0 1099 # thesysconfdir=`eval echo $sysconfdir`
michael@0 1100 dnl# AC_SUBST(thesysconfdir)
michael@0 1101 dnl# thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
michael@0 1102 dnl# AC_SUBST(thelibdir)
michael@0 1103 thedatadir=`eval echo $datadir`
michael@0 1104 dnl# AC_SUBST(thedatadir)
michael@0 1105 # 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}.
michael@0 1106 pkgicudatadir=$datadir
michael@0 1107 thepkgicudatadir=$thedatadir
michael@0 1108 AC_SUBST(pkgicudatadir)
michael@0 1109 AC_SUBST(thepkgicudatadir)
michael@0 1110
michael@0 1111 dnl# Shouldn't need the AC_SUBST
michael@0 1112
michael@0 1113 if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
michael@0 1114 # default to library
michael@0 1115 datapackaging=library
michael@0 1116 if test "$ENABLE_STATIC" = "YES"; then
michael@0 1117 if test "$ENABLE_SHARED" != "YES"; then
michael@0 1118 datapackaging=static
michael@0 1119 fi
michael@0 1120 fi
michael@0 1121 fi
michael@0 1122
michael@0 1123 datapackaging_dir=`eval echo $thedatadir`"/icu/${VERSION}"
michael@0 1124
michael@0 1125 datapackaging_msg="(No explaination for mode $datapackaging.)"
michael@0 1126
michael@0 1127 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."
michael@0 1128 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."
michael@0 1129 datapackaging_howfound="(unknown)"
michael@0 1130
michael@0 1131 case "$datapackaging" in
michael@0 1132 files)
michael@0 1133 DATA_PACKAGING_MODE=files
michael@0 1134 datapackaging_msg="ICU data will be stored in individual files."
michael@0 1135 datapackaging_howfound="$datapackaging_msg_path"
michael@0 1136 ;;
michael@0 1137 archive)
michael@0 1138 DATA_PACKAGING_MODE=common
michael@0 1139 datapackaging_msg="ICU data will be stored in a single .dat file."
michael@0 1140 datapackaging_howfound="$datapackaging_msg_path"
michael@0 1141 ;;
michael@0 1142 library)
michael@0 1143 DATA_PACKAGING_MODE=dll
michael@0 1144 datapackaging_msg="ICU data will be linked with ICU."
michael@0 1145 if test "$ENABLE_STATIC" = "YES"; then
michael@0 1146 datapackaging_msg="$datapackaging_msg A static data library will be built. "
michael@0 1147 fi
michael@0 1148 if test "$ENABLE_SHARED" = "YES"; then
michael@0 1149 datapackaging_msg="$datapackaging_msg A shared data library will be built. "
michael@0 1150 fi
michael@0 1151 datapackaging_howfound="$datapackaging_msg_set"
michael@0 1152 ;;
michael@0 1153 static)
michael@0 1154 DATA_PACKAGING_MODE=static
michael@0 1155 datapackaging_msg="ICU data will be stored in a static library."
michael@0 1156 datapackaging_howfound="$datapackaging_msg_set"
michael@0 1157 ;;
michael@0 1158 esac
michael@0 1159 AC_SUBST(DATA_PACKAGING_MODE)
michael@0 1160
michael@0 1161 # Sets a library suffix
michael@0 1162 AC_MSG_CHECKING([for a library suffix to use])
michael@0 1163 AC_ARG_WITH(library-suffix,
michael@0 1164 [ --with-library-suffix=suffix tag a suffix to the library names [default=]],
michael@0 1165 [ICULIBSUFFIX="${withval}"],
michael@0 1166 [ICULIBSUFFIX=])
michael@0 1167 msg=$ICULIBSUFFIX
michael@0 1168 if test "$msg" = ""; then
michael@0 1169 msg=none
michael@0 1170 fi
michael@0 1171 AC_MSG_RESULT($msg)
michael@0 1172 AC_SUBST(ICULIBSUFFIX)
michael@0 1173 if test "$ICULIBSUFFIX" != ""
michael@0 1174 then
michael@0 1175 U_HAVE_LIB_SUFFIX=1
michael@0 1176 ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
michael@0 1177 UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} "
michael@0 1178 else
michael@0 1179 U_HAVE_LIB_SUFFIX=0
michael@0 1180 fi
michael@0 1181 AC_SUBST(U_HAVE_LIB_SUFFIX)
michael@0 1182 AC_SUBST(ICULIBSUFFIXCNAME)
michael@0 1183
michael@0 1184 # Enable/disable tests
michael@0 1185 AC_ARG_ENABLE(tests,
michael@0 1186 [ --enable-tests build ICU tests [default=yes]],
michael@0 1187 [case "${enableval}" in
michael@0 1188 yes) tests=true ;;
michael@0 1189 no) tests=false ;;
michael@0 1190 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
michael@0 1191 esac],
michael@0 1192 tests=true)
michael@0 1193 ICU_CONDITIONAL(TESTS, test "$tests" = true)
michael@0 1194
michael@0 1195 # Enable/disable samples
michael@0 1196 AC_ARG_ENABLE(samples,
michael@0 1197 [ --enable-samples build ICU samples [default=yes]
michael@0 1198
michael@0 1199 Additionally, the variable FORCE_LIBS may be set before calling configure.
michael@0 1200 If set, it will REPLACE any automatic list of libraries.],
michael@0 1201 [case "${enableval}" in
michael@0 1202 yes) samples=true ;;
michael@0 1203 no) samples=false ;;
michael@0 1204 *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
michael@0 1205 esac],
michael@0 1206 samples=true)
michael@0 1207 ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
michael@0 1208
michael@0 1209 ICUDATA_CHAR=$U_ENDIAN_CHAR
michael@0 1210
michael@0 1211 # Platform-specific Makefile setup
michael@0 1212 # set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
michael@0 1213 case "${host}" in
michael@0 1214 *-*-solaris*) platform=U_SOLARIS ;;
michael@0 1215 *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) platform=U_LINUX ;;
michael@0 1216 *-*-*bsd*|*-*-dragonfly*) platform=U_BSD ;;
michael@0 1217 *-*-aix*) platform=U_AIX ;;
michael@0 1218 *-*-hpux*) platform=U_HPUX ;;
michael@0 1219 *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
michael@0 1220 *-*-cygwin*) platform=U_CYGWIN ;;
michael@0 1221 *-*-mingw*) platform=U_MINGW ;;
michael@0 1222 *-*ibm-openedition*|*-*-os390*) platform=OS390
michael@0 1223 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
michael@0 1224 ICUDATA_CHAR="e"
michael@0 1225 fi ;;
michael@0 1226 *-*-os400*) platform=OS400
michael@0 1227 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
michael@0 1228 ICUDATA_CHAR="e"
michael@0 1229 fi ;;
michael@0 1230 *-*-nto*) platform=U_QNX ;;
michael@0 1231 *-dec-osf*) platform=U_OSF ;;
michael@0 1232 *-*-beos) platform=U_BEOS ;;
michael@0 1233 *-*-irix*) platform=U_IRIX ;;
michael@0 1234 *-ncr-*) platform=U_MPRAS ;;
michael@0 1235 *) platform=U_UNKNOWN_PLATFORM ;;
michael@0 1236 esac
michael@0 1237 AC_SUBST(ICUDATA_CHAR)
michael@0 1238 AC_SUBST(platform)
michael@0 1239 platform_make_fragment_name="$icu_cv_host_frag"
michael@0 1240 platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
michael@0 1241 AC_SUBST(platform_make_fragment_name)
michael@0 1242 AC_SUBST(platform_make_fragment)
michael@0 1243
michael@0 1244 if test "${FORCE_LIBS}" != ""; then
michael@0 1245 echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
michael@0 1246 LIBS=${FORCE_LIBS}
michael@0 1247 fi
michael@0 1248
michael@0 1249 # Now that we're done using CPPFLAGS etc. for tests, we can change it
michael@0 1250 # for build.
michael@0 1251
michael@0 1252 if test "${CC}" == "clang"; then
michael@0 1253 CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality"
michael@0 1254 else
michael@0 1255 CLANGCFLAGS=""
michael@0 1256 fi
michael@0 1257
michael@0 1258 if test "${CXX}" == "clang++"; then
michael@0 1259 CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality"
michael@0 1260 else
michael@0 1261 CLANGCXXFLAGS=""
michael@0 1262 fi
michael@0 1263
michael@0 1264 CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
michael@0 1265 CFLAGS="$CFLAGS \$(THREADSCFLAGS) $CLANGCFLAGS"
michael@0 1266 CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS) $CLANGCXXFLAGS"
michael@0 1267
michael@0 1268 AC_SUBST(LIBCFLAGS)
michael@0 1269 AC_SUBST(LIBCXXFLAGS)
michael@0 1270
michael@0 1271 # append all config cppflags
michael@0 1272 CPPFLAGS="$CPPFLAGS $CONFIG_CPPFLAGS $UCONFIG_CPPFLAGS"
michael@0 1273
michael@0 1274 echo "CPPFLAGS=$CPPFLAGS"
michael@0 1275 echo "CFLAGS=$CFLAGS"
michael@0 1276 echo "CXXFLAGS=$CXXFLAGS"
michael@0 1277
michael@0 1278
michael@0 1279 # output the Makefiles
michael@0 1280 AC_CONFIG_FILES([icudefs.mk \
michael@0 1281 Makefile \
michael@0 1282 data/pkgdataMakefile \
michael@0 1283 config/Makefile.inc \
michael@0 1284 config/icu.pc \
michael@0 1285 config/pkgdataMakefile \
michael@0 1286 data/Makefile \
michael@0 1287 stubdata/Makefile \
michael@0 1288 common/Makefile \
michael@0 1289 i18n/Makefile \
michael@0 1290 layout/Makefile \
michael@0 1291 layoutex/Makefile \
michael@0 1292 io/Makefile \
michael@0 1293 extra/Makefile \
michael@0 1294 extra/uconv/Makefile \
michael@0 1295 extra/uconv/pkgdataMakefile \
michael@0 1296 extra/scrptrun/Makefile \
michael@0 1297 tools/Makefile \
michael@0 1298 tools/ctestfw/Makefile \
michael@0 1299 tools/toolutil/Makefile \
michael@0 1300 tools/makeconv/Makefile \
michael@0 1301 tools/genrb/Makefile \
michael@0 1302 tools/genccode/Makefile \
michael@0 1303 tools/gencmn/Makefile \
michael@0 1304 tools/gencnval/Makefile \
michael@0 1305 tools/gendict/Makefile \
michael@0 1306 tools/gentest/Makefile \
michael@0 1307 tools/gennorm2/Makefile \
michael@0 1308 tools/genbrk/Makefile \
michael@0 1309 tools/gensprep/Makefile \
michael@0 1310 tools/icuinfo/Makefile \
michael@0 1311 tools/icupkg/Makefile \
michael@0 1312 tools/icuswap/Makefile \
michael@0 1313 tools/pkgdata/Makefile \
michael@0 1314 tools/tzcode/Makefile \
michael@0 1315 tools/gencfu/Makefile \
michael@0 1316 test/Makefile \
michael@0 1317 test/compat/Makefile \
michael@0 1318 test/testdata/Makefile \
michael@0 1319 test/testdata/pkgdataMakefile \
michael@0 1320 test/hdrtst/Makefile \
michael@0 1321 test/intltest/Makefile \
michael@0 1322 test/cintltst/Makefile \
michael@0 1323 test/iotest/Makefile \
michael@0 1324 test/letest/Makefile \
michael@0 1325 test/perf/Makefile \
michael@0 1326 test/perf/collationperf/Makefile \
michael@0 1327 test/perf/collperf/Makefile \
michael@0 1328 test/perf/dicttrieperf/Makefile \
michael@0 1329 test/perf/ubrkperf/Makefile \
michael@0 1330 test/perf/charperf/Makefile \
michael@0 1331 test/perf/convperf/Makefile \
michael@0 1332 test/perf/normperf/Makefile \
michael@0 1333 test/perf/DateFmtPerf/Makefile \
michael@0 1334 test/perf/howExpensiveIs/Makefile \
michael@0 1335 test/perf/strsrchperf/Makefile \
michael@0 1336 test/perf/unisetperf/Makefile \
michael@0 1337 test/perf/usetperf/Makefile \
michael@0 1338 test/perf/ustrperf/Makefile \
michael@0 1339 test/perf/utfperf/Makefile \
michael@0 1340 test/perf/utrie2perf/Makefile \
michael@0 1341 test/perf/leperf/Makefile \
michael@0 1342 samples/Makefile samples/date/Makefile \
michael@0 1343 samples/cal/Makefile samples/layout/Makefile])
michael@0 1344 AC_OUTPUT
michael@0 1345
michael@0 1346 echo
michael@0 1347 echo "ICU for C/C++ $VERSION is ready to be built."
michael@0 1348 echo "=== Important Notes: ==="
michael@0 1349
michael@0 1350 echo "Data Packaging: $datapackaging"
michael@0 1351 echo " This means: $datapackaging_msg"
michael@0 1352 echo " To locate data: $datapackaging_howfound"
michael@0 1353
michael@0 1354 if test -n "`$U_MAKE -v 2>&1 | grep '^GNU Make'`"; then
michael@0 1355 echo "Building ICU: Use a GNU make such as $U_MAKE to build ICU."
michael@0 1356 else
michael@0 1357 echo "** WARNING: $U_MAKE may not be GNU make."
michael@0 1358 echo "This may cause ICU to fail to build. Please make sure that GNU make"
michael@0 1359 echo "is in your PATH so that the configure script can detect its location."
michael@0 1360 fi
michael@0 1361 if test "x$AR" = "xfalse"; then
michael@0 1362 echo "*** WARNING: Archiver ar not found. Set AR= or fix PATH. Some builds (such as static) may fail."
michael@0 1363 fi
michael@0 1364
michael@0 1365 AC_MSG_CHECKING([the version of "$U_MAKE"])
michael@0 1366 if "$U_MAKE" -f "$srcdir/config/gmakever.mk" PLATFORM="$platform"; then
michael@0 1367 AC_MSG_RESULT([ok])
michael@0 1368 else
michael@0 1369 AC_MSG_RESULT([too old or test failed - try upgrading GNU Make])
michael@0 1370 fi
michael@0 1371
michael@0 1372 AC_SUBST(UCONFIG_CPPFLAGS)
michael@0 1373 if test -n "$UCONFIG_CPPFLAGS"; then
michael@0 1374 HDRFILE="uconfig.h.prepend"
michael@0 1375 echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:"
michael@0 1376 echo
michael@0 1377 echo " ${UCONFIG_CPPFLAGS}"
michael@0 1378 echo
michael@0 1379 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.'
michael@0 1380 echo "Creating the file ${HDRFILE}"
michael@0 1381 echo
michael@0 1382 echo '--------------- ' "${HDRFILE}"
michael@0 1383 echo > "${HDRFILE}"
michael@0 1384 echo '/* ICU customizations: put these lines at the top of uconfig.h */' >> "${HDRFILE}"
michael@0 1385 echo >> "${HDRFILE}"
michael@0 1386 for flag in ${UCONFIG_CPPFLAGS};
michael@0 1387 do
michael@0 1388 echo " /* $flag */" >> "${HDRFILE}"
michael@0 1389 case "${flag}" in
michael@0 1390 -D*=*)
michael@0 1391 [ \echo "${flag}" | sed -n 's%-D\([^=]*\)=%#define \1 %p' >> "${HDRFILE}" ]
michael@0 1392 \echo >> "${HDRFILE}"
michael@0 1393 ;;
michael@0 1394 -D*)
michael@0 1395 [ \echo "${flag}" | sed -n 's%-D\([^=]*\)%#define \1 %p' >> "${HDRFILE}" ]
michael@0 1396 \echo >> "${HDRFILE}"
michael@0 1397 ;;
michael@0 1398 *)
michael@0 1399 \echo "/* Not sure how to handle this argument: ${flag} */" >> "${HDRFILE}"
michael@0 1400 \echo >> "${HDRFILE}"
michael@0 1401 ;;
michael@0 1402 esac
michael@0 1403 done
michael@0 1404 cat "${HDRFILE}"
michael@0 1405 \echo "/* End of ${HDRFILE} ------------ */" >> "${HDRFILE}"
michael@0 1406 echo >> "${HDRFILE}"
michael@0 1407 echo '--------------- end ' "${HDRFILE}"
michael@0 1408 fi
michael@0 1409
michael@0 1410 AC_SUBST(UCONFIG_CFLAGS)
michael@0 1411 if test -n "$UCONFIG_CFLAGS"; then
michael@0 1412 echo "C apps may want to build with CFLAGS = ${UCONFIG_CFLAGS}"
michael@0 1413 fi
michael@0 1414 AC_SUBST(UCONFIG_CXXFLAGS)
michael@0 1415 if test -n "$UCONFIG_CXXFLAGS"; then
michael@0 1416 echo "C++ apps may want to build with CXXFLAGS = ${UCONFIG_CXXFLAGS}"
michael@0 1417 fi
michael@0 1418
michael@0 1419 if test "$tools" = false;
michael@0 1420 then
michael@0 1421 echo "## Note: you have disabled ICU's tools. This ICU cannot build its own data or tests."
michael@0 1422 echo "## Expect build failures in the 'data', 'test', and other directories."
michael@0 1423 fi
michael@0 1424
michael@0 1425 $as_unset _CXX_CXXSUFFIX

mercurial