From f2211fa7b9238358055bd7fc4e52caf20fdac8e3 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 3 Oct 2008 08:08:02 +0000 Subject: [PATCH] ICU-6564 fix configure, update to new comment style, and fix solaris 64bit test. X-SVN-Rev: 24710 --- icu4c/source/aclocal.m4 | 55 +++++---- icu4c/source/configure | 198 ++++++++++++++++++++++--------- icu4c/source/configure.in | 239 ++++++++++++++++++-------------------- 3 files changed, 283 insertions(+), 209 deletions(-) diff --git a/icu4c/source/aclocal.m4 b/icu4c/source/aclocal.m4 index dcbcb305b77..da80a148777 100644 --- a/icu4c/source/aclocal.m4 +++ b/icu4c/source/aclocal.m4 @@ -1,11 +1,11 @@ -dnl aclocal.m4 for ICU -dnl Copyright (c) 1999-2008, International Business Machines Corporation and -dnl others. All Rights Reserved. -dnl Stephen F. Booth +# aclocal.m4 for ICU +# Copyright (c) 1999-2008, International Business Machines Corporation and +# others. All Rights Reserved. +# Stephen F. Booth -dnl @TOP@ +# @TOP@ -dnl ICU_CHECK_MH_FRAG +# ICU_CHECK_MH_FRAG AC_DEFUN(ICU_CHECK_MH_FRAG, [ AC_CACHE_CHECK( [which Makefile fragment to use], @@ -70,7 +70,7 @@ esac ) ]) -dnl ICU_CONDITIONAL - similar example taken from Automake 1.4 +# ICU_CONDITIONAL - similar example taken from Automake 1.4 AC_DEFUN(ICU_CONDITIONAL, [AC_SUBST($1_TRUE) if $2; then @@ -79,7 +79,7 @@ else $1_TRUE='#' fi]) -dnl ICU_PROG_LINK - Make sure that the linker is usable +# ICU_PROG_LINK - Make sure that the linker is usable AC_DEFUN(ICU_PROG_LINK, [ case "${host}" in @@ -91,9 +91,9 @@ case "${host}" in *);; esac]) -dnl AC_SEARCH_LIBS_FIRST(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND -dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) -dnl Search for a library defining FUNC, then see if it's not already available. +# AC_SEARCH_LIBS_FIRST(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND +# [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) +# Search for a library defining FUNC, then see if it's not already available. AC_DEFUN(AC_SEARCH_LIBS_FIRST, [AC_PREREQ([2.13]) @@ -117,7 +117,7 @@ else : $4 fi]) -dnl Check if we can build and use 64-bit libraries +# Check if we can build and use 64-bit libraries AC_DEFUN(AC_CHECK_64BIT_LIBS, [ AC_ARG_ENABLE(64bit-libs, @@ -125,16 +125,16 @@ AC_DEFUN(AC_CHECK_64BIT_LIBS, [ENABLE_64BIT_LIBS=${enableval}], [ENABLE_64BIT_LIBS=yes] ) - dnl These results can't be cached because is sets compiler flags. + # These results can't be cached because is sets compiler flags. AC_MSG_CHECKING([for 64-bit executable support]) if test "$ENABLE_64BIT_LIBS" != no; then if test "$GCC" = yes; then - dnl First we check that gcc already compiles as 64-bit + # First we check that gcc already compiles as 64-bit if test -n "`$CXX -dumpspecs 2>&1 && $CC -dumpspecs 2>&1 | grep -v __LP64__`"; then ENABLE_64BIT_LIBS=yes else - dnl Now we check a little more forcefully. - dnl Maybe the compiler builds as 32-bit on a 64-bit machine. + # Now we check a little more forcefully. + # Maybe the compiler builds as 32-bit on a 64-bit machine. OLD_CFLAGS="${CFLAGS}" OLD_CXXFLAGS="${CXXFLAGS}" CFLAGS="${CFLAGS} -m64" @@ -151,6 +151,7 @@ AC_DEFUN(AC_CHECK_64BIT_LIBS, case "${host}" in sparc*-*-solaris*) SPARCV9=`isainfo -n 2>&1 | grep sparcv9` + # "Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs" SOL64=`$CXX -xarch=v9 2>&1 && $CC -xarch=v9 2>&1 | grep -v usage:` if test -z "$SOL64" && test -n "$SPARCV9"; then CFLAGS="${CFLAGS} -xtarget=ultra -xarch=v9" @@ -158,7 +159,15 @@ AC_DEFUN(AC_CHECK_64BIT_LIBS, LDFLAGS="${LDFLAGS} -xtarget=ultra -xarch=v9" ENABLE_64BIT_LIBS=yes else - ENABLE_64BIT_LIBS=no + SOL64=`$CXX -m64 2>&1 && $CC -m64 2>&1 | grep -v usage:` + if test -z "$SOL64" && test -n "$SPARCV9"; then + CFLAGS="${CFLAGS} -m64 " + CXXFLAGS="${CXXFLAGS} -m64 " + LDFLAGS="${LDFLAGS} -m64 " + ENABLE_64BIT_LIBS=yes + else + ENABLE_64BIT_LIBS=no + fi fi ;; i386-*-solaris*) @@ -195,8 +204,8 @@ AC_DEFUN(AC_CHECK_64BIT_LIBS, fi ;; *-*-cygwin) - dnl vcvarsamd64.bat should have been used to enable 64-bit builds. - dnl We only do this check to display the correct answer. + # vcvarsamd64.bat should have been used to enable 64-bit builds. + # We only do this check to display the correct answer. if test -n "`$CXX -help 2>&1 | grep 'for x64'`"; then ENABLE_64BIT_LIBS=yes else @@ -225,8 +234,8 @@ AC_DEFUN(AC_CHECK_64BIT_LIBS, fi ;; *-*-hpux*) - dnl First we try the newer +DD64, if that doesn't work, - dnl try other options. + # First we try the newer +DD64, if that doesn't work, + # try other options. OLD_CFLAGS="${CFLAGS}" OLD_CXXFLAGS="${CXXFLAGS}" @@ -281,11 +290,11 @@ AC_DEFUN(AC_CHECK_64BIT_LIBS, fi fi fi - dnl Individual tests that fail should reset their own flags. + # Individual tests that fail should reset their own flags. AC_MSG_RESULT($ENABLE_64BIT_LIBS) ]) -dnl Strict compilation options. +# Strict compilation options. AC_DEFUN(AC_CHECK_STRICT_COMPILE, [ AC_MSG_CHECKING([whether strict compiling is on]) diff --git a/icu4c/source/configure b/icu4c/source/configure index adcc47c1c46..107d3db91f6 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -2,6 +2,8 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63. # +# Copyright (c) 1999-2008, International Business Machines Corporation and others. All Rights Reserved. +# # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -1541,6 +1543,8 @@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. + + Copyright (c) 1999-2008, International Business Machines Corporation and others. All Rights Reserved. _ACEOF exit fi @@ -1918,6 +1922,7 @@ PACKAGE="icu" { $as_echo "$as_me:$LINENO: checking for ICU version numbers" >&5 $as_echo_n "checking for ICU version numbers... " >&6; } +# Get the ICU version from uversion.h or other headers geticuversion() { sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@" } @@ -1930,6 +1935,9 @@ $as_echo "$as_me: error: Cannot determine ICU version number from header files" { (exit 1); exit 1; }; } fi fi +# Compute a reasonable library version from the release version. This is +# very bad, but that's wanted... We want to make sure that the LIB_VERSION +# has at least a dot in it, so we'll add a .0 if needed. LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'` LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'` @@ -1941,6 +1949,7 @@ $as_echo "release $VERSION, library $LIB_VERSION" >&6; } UNICODE_VERSION="5.1" +# Determine the host system ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -2058,8 +2067,10 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +# This variable is needed on z/OS because the C++ compiler only recognizes .C _CXX_CXXSUFFIX=cc export _CXX_CXXSUFFIX +# Checks for programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3470,6 +3481,7 @@ fi #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true) #AC_CHECK_PROG(STRIP, strip, strip, true) +# Check for the platform make for ac_prog in gmake gnumake do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -3518,6 +3530,7 @@ test -n "$U_MAKE" || U_MAKE="make" +# Check for doxygen to generate documentation # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -3560,6 +3573,7 @@ fi +# Check that the linker is usable case "${host}" in *-*-cygwin*|*-*-mingw*) @@ -3573,6 +3587,9 @@ $as_echo "$as_me: error: link.exe is not a valid linker. Your PATH is incorrect. *);; esac +# Determine the executable suffix +# We don't use AC_EXEEXT because some compilers output separate debugging +# files, which confuses the AC_EXEEXT macro. { $as_echo "$as_me:$LINENO: checking checking for executable suffix" >&5 $as_echo_n "checking checking for executable suffix... " >&6; } case "${host}" in @@ -3584,6 +3601,7 @@ ac_exeext=$EXEEXT $as_echo "$EXEEXT" >&6; } +# Determine how strict we want to be when compiling { $as_echo "$as_me:$LINENO: checking whether strict compiling is on" >&5 $as_echo_n "checking whether strict compiling is on... " >&6; } @@ -3641,6 +3659,7 @@ $as_echo "$ac_use_strict_options" >&6; } fi +# Check if we can build and use 64-bit libraries # Check whether --enable-64bit-libs was given. @@ -3651,14 +3670,18 @@ else fi - { $as_echo "$as_me:$LINENO: checking for 64-bit executable support" >&5 + # These results can't be cached because is sets compiler flags. + { $as_echo "$as_me:$LINENO: checking for 64-bit executable support" >&5 $as_echo_n "checking for 64-bit executable support... " >&6; } if test "$ENABLE_64BIT_LIBS" != no; then if test "$GCC" = yes; then - if test -n "`$CXX -dumpspecs 2>&1 && $CC -dumpspecs 2>&1 | grep -v __LP64__`"; then + # First we check that gcc already compiles as 64-bit + if test -n "`$CXX -dumpspecs 2>&1 && $CC -dumpspecs 2>&1 | grep -v __LP64__`"; then ENABLE_64BIT_LIBS=yes else - OLD_CFLAGS="${CFLAGS}" + # Now we check a little more forcefully. + # Maybe the compiler builds as 32-bit on a 64-bit machine. + OLD_CFLAGS="${CFLAGS}" OLD_CXXFLAGS="${CXXFLAGS}" CFLAGS="${CFLAGS} -m64" CXXFLAGS="${CXXFLAGS} -m64" @@ -3719,6 +3742,7 @@ fi case "${host}" in sparc*-*-solaris*) SPARCV9=`isainfo -n 2>&1 | grep sparcv9` + # "Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs" SOL64=`$CXX -xarch=v9 2>&1 && $CC -xarch=v9 2>&1 | grep -v usage:` if test -z "$SOL64" && test -n "$SPARCV9"; then CFLAGS="${CFLAGS} -xtarget=ultra -xarch=v9" @@ -3726,7 +3750,15 @@ fi LDFLAGS="${LDFLAGS} -xtarget=ultra -xarch=v9" ENABLE_64BIT_LIBS=yes else - ENABLE_64BIT_LIBS=no + SOL64=`$CXX -m64 2>&1 && $CC -m64 2>&1 | grep -v usage:` + if test -z "$SOL64" && test -n "$SPARCV9"; then + CFLAGS="${CFLAGS} -m64 " + CXXFLAGS="${CXXFLAGS} -m64 " + LDFLAGS="${LDFLAGS} -m64 " + ENABLE_64BIT_LIBS=yes + else + ENABLE_64BIT_LIBS=no + fi fi ;; i386-*-solaris*) @@ -3763,7 +3795,9 @@ fi fi ;; *-*-cygwin) - if test -n "`$CXX -help 2>&1 | grep 'for x64'`"; then + # vcvarsamd64.bat should have been used to enable 64-bit builds. + # We only do this check to display the correct answer. + if test -n "`$CXX -help 2>&1 | grep 'for x64'`"; then ENABLE_64BIT_LIBS=yes else # unknown @@ -3836,6 +3870,8 @@ fi fi ;; *-*-hpux*) + # First we try the newer +DD64, if that doesn't work, + # try other options. OLD_CFLAGS="${CFLAGS}" OLD_CXXFLAGS="${CXXFLAGS}" @@ -4070,12 +4106,14 @@ fi fi fi fi - { $as_echo "$as_me:$LINENO: result: $ENABLE_64BIT_LIBS" >&5 + # Individual tests that fail should reset their own flags. + { $as_echo "$as_me:$LINENO: result: $ENABLE_64BIT_LIBS" >&5 $as_echo "$ENABLE_64BIT_LIBS" >&6; } +# Determine the Makefile fragment { $as_echo "$as_me:$LINENO: checking which Makefile fragment to use" >&5 $as_echo_n "checking which Makefile fragment to use... " >&6; } @@ -4186,6 +4224,9 @@ fi $as_echo "$icu_cv_host_frag" >&6; } +# Checks for libraries and other host specific stuff +# On HP/UX, don't link to -lm from a shared lib because it isn't +# PIC (at least on 10.2) case "${host}" in *-*-hpux*) { $as_echo "$as_me:$LINENO: checking for floor in -lm" >&5 $as_echo_n "checking for floor in -lm... " >&6; } @@ -4336,6 +4377,7 @@ fi esac +# Check whether to build shared libraries { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } enabled=no @@ -4355,6 +4397,7 @@ fi $as_echo "$enabled" >&6; } +# Check whether to build static libraries { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } enabled=no @@ -4371,6 +4414,7 @@ fi $as_echo "$enabled" >&6; } +# Check whether to build debug libraries { $as_echo "$as_me:$LINENO: checking whether to build debug libraries" >&5 $as_echo_n "checking whether to build debug libraries... " >&6; } enabled=no @@ -4387,6 +4431,7 @@ fi $as_echo "$enabled" >&6; } +# Check whether to build release libraries { $as_echo "$as_me:$LINENO: checking whether to build release libraries" >&5 $as_echo_n "checking whether to build release libraries... " >&6; } enabled=yes @@ -4403,6 +4448,7 @@ fi $as_echo "$enabled" >&6; } +# Check whether to enabled draft APIs { $as_echo "$as_me:$LINENO: checking whether to enable draft APIs" >&5 $as_echo_n "checking whether to enable draft APIs... " >&6; } enabled=yes @@ -4417,11 +4463,13 @@ fi { $as_echo "$as_me:$LINENO: result: $enabled" >&5 $as_echo "$enabled" >&6; } +# Make sure that we can use draft API in ICU. if test "$U_DEFAULT_SHOW_DRAFT" = 0; then CPPFLAGS="$CPPFLAGS -DU_SHOW_DRAFT_API" fi +# Check if we can hide variables from { $as_echo "$as_me:$LINENO: checking for library API export" >&5 $as_echo_n "checking for library API export... " >&6; } SHAREDLIBEXPORT=no @@ -4548,7 +4596,8 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ fi ;; *-*-hpux*) - ;; + # ICU isn't set up to follow the HP syntax yet. + ;; *) esac fi @@ -4732,6 +4781,7 @@ fi $as_echo "$enabled" >&6; } +# Check whether to use the evil rpath or not # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; case "${enableval}" in @@ -4747,6 +4797,9 @@ fi +# set up U_INLINE. +# Copy the definition of AC_C_INLINE, with slight mods. +# { $as_echo "$as_me:$LINENO: checking for definition of U_INLINE for C" >&5 $as_echo_n "checking for definition of U_INLINE for C... " >&6; } if test "${ac_cv_c_inline+set}" = set; then @@ -4810,6 +4863,7 @@ esac threads=true +# Enable/disable threads # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then enableval=$enable_threads; case "${enableval}" in @@ -4834,6 +4888,11 @@ ICU_USE_THREADS=0 OLD_LIBS=${LIBS} if test $threads = true; then + # For Compaq Tru64 (OSF1), we must look for pthread_attr_init + # and must do this before seaching for pthread_mutex_destroy, or + # we will pick up libpthreads.so not libpthread.so + # If this fails, then we must test for HPUX specials, before + # moving on to a more generic test { $as_echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthread" >&5 @@ -4913,6 +4972,11 @@ fi if test $ac_cv_lib_pthread_pthread_attr_init = yes; then ICU_USE_THREADS=1 else + # Locate the right library for POSIX threads. We look for the + # symbols in the libraries first, because on Solaris libc provides + # pthread_create but libpthread has the real code :( + # AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread + # FreeBSD users may need libpthread if they do not have libc_r. { $as_echo "$as_me:$LINENO: checking for library containing pthread_mutex_destroy" >&5 @@ -5050,6 +5114,7 @@ fi if test "$ac_cv_search_pthread_mutex_destroy" != no; then ICU_USE_THREADS=1 else + # For HP 11 { $as_echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } @@ -5221,21 +5286,27 @@ $as_echo "$ac_cv_func_pthread_mutex_lock" >&6; } ICU_USE_THREADS=1 fi fi - case "${host}" in + # Check to see if we are using CygWin with MSVC + case "${host}" in *-pc-cygwin*|*-pc-mingw*) - ICU_USE_THREADS=1 + # For gcc, the thread options are set by mh-mingw/mh-cygwin + ICU_USE_THREADS=1 if test "$ac_cv_c_compiler_gnu" = no; then - ICU_USE_THREADS=1 + # We're using normal windows compilers. Threading is available. + ICU_USE_THREADS=1 if test $ENABLE_DEBUG = 1; then - CFLAGS="${CFLAGS} /MDd" + # /MDd means 'compiles and links a debugable multithreaded program with DLL' + CFLAGS="${CFLAGS} /MDd" CXXFLAGS="${CXXFLAGS} /MDd" else - CFLAGS="${CFLAGS} /MD" + # /MD means 'compiles and links a multithreaded program with DLL' + CFLAGS="${CFLAGS} /MD" CXXFLAGS="${CXXFLAGS} /MD" fi fi ;; *-*-hpux*) - case "${icu_cv_host_frag}" in + # Add -mt because it does several nice things on newer compilers. + case "${icu_cv_host_frag}" in mh-hpux-acc) OLD_CXXFLAGS="${CXXFLAGS}" CXXFLAGS="${CXXFLAGS} -mt" @@ -5266,6 +5337,7 @@ fi +# Check for mmap() # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific. # Do this check instead. @@ -5281,18 +5353,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -changequote(<<, >>)dnl - << #include #include #include #include - >> int main () { -changequote(, )dnl - mmap((void *)0, 0, PROT_READ, 0, 0, 0); +mmap((void *)0, 0, PROT_READ, 0, 0, 0); ; return 0; } @@ -5339,15 +5407,19 @@ then fi +# Check to see if genccode can generate simple assembly. GENCCODE_ASSEMBLY= case "${host}" in i*86-*-linux*|x86_64-*-linux*|powerpc*-*-linux*|i*86-*-*bsd*|i*86-pc-gnu) if test "$GCC" = yes; then - GENCCODE_ASSEMBLY="-a gcc" + # We're using gcc, and the simple -a gcc command line works for genccode + GENCCODE_ASSEMBLY="-a gcc" fi ;; i*86-*-solaris*) if test "$GCC" = yes; then - asv=`"${CC}" -print-prog-name=as 2>/dev/null` + # When using gcc, look if we're also using GNU as. + # When using GNU as, the simple -a gcc command line works for genccode. + asv=`"${CC}" -print-prog-name=as 2>/dev/null` asv=`"${asv}" --version 2>/dev/null` case "X${asv}" in X*GNU*) GENCCODE_ASSEMBLY="-a gcc" ;; @@ -5367,6 +5439,7 @@ esac +# Checks for header files ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6384,7 +6457,10 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $icu_cv_host_frag = mh-cygwin-msvc then - ac_cv_header_iostream=yes + # is always there on Windows. + # We do this to prevent the C++ preprocessor from being used because + # autoconf can't deal with the Windows C++ preprocessor + ac_cv_header_iostream=yes fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_iostream" >&5 $as_echo "$ac_cv_header_iostream" >&6; } @@ -6481,6 +6557,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Check for endianness { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } @@ -6896,6 +6973,7 @@ U_ENDIAN_CHAR="b" fi +# Do various POSIX related checks U_HAVE_NL_LANGINFO_CODESET=0 U_NL_LANGINFO_CODESET=-1 { $as_echo "$as_me:$LINENO: checking for nl_langinfo" >&5 @@ -7057,6 +7135,7 @@ fi +# Namespace support checks ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7074,16 +7153,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -changequote(<<, >>)dnl - <> + int main () { -changequote(, )dnl - f(); +f(); ; return 0; } @@ -7144,20 +7221,18 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -changequote(<<, >>)dnl - <<#include +#include class UMemory { public: void *operator new(size_t size) {return malloc(size);} - void *operator new(size_t size) {return malloc(size);} - void operator delete(void *p) {free(p);} + void *operator new[](size_t size) {return malloc(size);} void operator delete(void *p) {free(p);} + void operator delete[](void *p) {free(p);} }; - >> + int main () { -changequote(, )dnl ; return 0; @@ -7213,22 +7288,20 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -changequote(<<, >>)dnl - <<#include +#include class UMemory { public: void *operator new(size_t size) {return malloc(size);} - void *operator new(size_t size) {return malloc(size);} - void operator delete(void *p) {free(p);} + void *operator new[](size_t size) {return malloc(size);} void operator delete(void *p) {free(p);} + void operator delete[](void *p) {free(p);} void * operator new(size_t, void *ptr) { return ptr; } void operator delete(void *, void *) {} }; - >> + int main () { -changequote(, )dnl ; return 0; @@ -7577,19 +7650,17 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -changequote(<<, >>)dnl -<<#ifndef __USE_POSIX +#ifndef __USE_POSIX #define __USE_POSIX #endif #include #include #ifndef tzname /* For SGI. */ -extern char *tzname; /* RS6000 and others reject char **tzname. */ -#endif>> +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ +#endif int main () { -changequote(, )dnl atoi(*tzname); ; return 0; @@ -7645,16 +7716,13 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -changequote(<<, >>)dnl - <<#include +#include #include - extern char *_tzname; - >> + extern char *_tzname[]; int main () { -changequote(, )dnl - atoi(*_tzname); +atoi(*_tzname); ; return 0; } @@ -7713,19 +7781,17 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -changequote(<<, >>)dnl -<<#ifndef __USE_POSIX +#ifndef __USE_POSIX #define __USE_POSIX #endif #ifndef __USE_XOPEN #define __USE_XOPEN #endif #include ->> + int main () { -changequote(, )dnl timezone = 1; ; return 0; @@ -7894,6 +7960,7 @@ fi +# Checks for typedefs { $as_echo "$as_me:$LINENO: checking for int8_t" >&5 $as_echo_n "checking for int8_t... " >&6; } if test "${ac_cv_type_int8_t+set}" = set; then @@ -8783,6 +8850,7 @@ HAVE_UINT64_T=1 fi +# Do various wchar_t related checks if test "${ac_cv_header_wchar_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 $as_echo_n "checking for wchar.h... " >&6; } @@ -8922,7 +8990,8 @@ else _ACEOF U_HAVE_WCHAR_H=1 - { $as_echo "$as_me:$LINENO: checking for library containing wcscpy" >&5 + # Some broken systems have wchar.h but not some of its functions... + { $as_echo "$as_me:$LINENO: checking for library containing wcscpy" >&5 $as_echo_n "checking for library containing wcscpy... " >&6; } if test "${ac_cv_search_wcscpy+set}" = set; then $as_echo_n "(cached) " >&6 @@ -9569,11 +9638,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; *-*-hpux*) if test "$ac_cv_c_compiler_gnu" = no; then - CHECK_UTF16_STRING_RESULT="available" + # The option will be detected at compile time without additional compiler options. + CHECK_UTF16_STRING_RESULT="available" fi ;; *-*-cygwin) - CHECK_UTF16_STRING_RESULT="available" + # wchar_t can be used + CHECK_UTF16_STRING_RESULT="available" ;; *) ;; @@ -9582,6 +9653,7 @@ esac $as_echo "$CHECK_UTF16_STRING_RESULT" >&6; } +# Enable/disable extras # Check whether --enable-extras was given. if test "${enable_extras+set}" = set; then enableval=$enable_extras; case "${enableval}" in @@ -9621,6 +9693,7 @@ else ICUIO_TRUE='#' fi +# Enable/disable layout # Check whether --enable-layout was given. if test "${enable_layout+set}" = set; then enableval=$enable_layout; case "${enableval}" in @@ -9659,7 +9732,10 @@ else fi +# Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc.. +# thesysconfdir=`eval echo $sysconfdir` thedatadir=`eval echo $datadir` +# 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}. pkgicudatadir=$datadir thepkgicudatadir=$thedatadir @@ -9683,6 +9759,7 @@ case "$datapackaging" in esac +# Sets a library suffix { $as_echo "$as_me:$LINENO: checking for a library suffix to use" >&5 $as_echo_n "checking for a library suffix to use... " >&6; } @@ -9703,13 +9780,14 @@ $as_echo "$msg" >&6; } if test "$ICULIBSUFFIX" != "" then U_HAVE_LIB_SUFFIX=1 - ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'` + ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/^A-Za-z0-9_/_/g'` else U_HAVE_LIB_SUFFIX=0 fi +# Enable/disable tests # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then enableval=$enable_tests; case "${enableval}" in @@ -9730,6 +9808,7 @@ else TESTS_TRUE='#' fi +# Enable/disable samples # Check whether --enable-samples was given. if test "${enable_samples+set}" = set; then enableval=$enable_samples; case "${enableval}" in @@ -9752,6 +9831,8 @@ fi ICUDATA_CHAR=$U_ENDIAN_CHAR +# Platform-specific Makefile setup +# set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform. case "${host}" in *-*-solaris*) platform=U_SOLARIS ;; *-*-linux*) platform=U_LINUX ;; @@ -9789,6 +9870,8 @@ if test "${FORCE_LIBS}" != ""; then fi +# Now that we're done using CPPFLAGS etc. for tests, we can change it +# for build. if test $ICU_USE_THREADS -ne 0 then @@ -9797,6 +9880,7 @@ then CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)" fi +# output the Makefiles ac_config_files="$ac_config_files icudefs.mk Makefile data/icupkg.inc config/Makefile.inc data/Makefile stubdata/Makefile common/Makefile i18n/Makefile layout/Makefile layoutex/Makefile io/Makefile extra/Makefile extra/uconv/Makefile extra/scrptrun/Makefile tools/Makefile tools/ctestfw/Makefile tools/toolutil/Makefile tools/makeconv/Makefile tools/genrb/Makefile tools/genuca/Makefile tools/genccode/Makefile tools/gencmn/Makefile tools/gencnval/Makefile tools/genctd/Makefile tools/gennames/Makefile tools/gentest/Makefile tools/gennorm/Makefile tools/genprops/Makefile tools/gencase/Makefile tools/genbidi/Makefile tools/genpname/Makefile tools/genbrk/Makefile tools/gensprep/Makefile tools/icupkg/Makefile tools/icuswap/Makefile tools/pkgdata/Makefile tools/tzcode/Makefile test/Makefile test/compat/Makefile test/testdata/Makefile test/testdata/pkgdata.inc test/hdrtst/Makefile test/intltest/Makefile test/cintltst/Makefile test/iotest/Makefile test/letest/Makefile test/perf/Makefile test/perf/collationperf/Makefile test/perf/ubrkperf/Makefile test/perf/charperf/Makefile test/perf/convperf/Makefile test/perf/normperf/Makefile test/perf/strsrchperf/Makefile test/perf/unisetperf/Makefile test/perf/usetperf/Makefile test/perf/ustrperf/Makefile test/perf/utfperf/Makefile samples/Makefile samples/date/Makefile samples/cal/Makefile samples/layout/Makefile common/unicode/platform.h" cat >confcache <<\_ACEOF diff --git a/icu4c/source/configure.in b/icu4c/source/configure.in index 1dbc1c8ca5e..9c6dfafa6b2 100644 --- a/icu4c/source/configure.in +++ b/icu4c/source/configure.in @@ -1,13 +1,13 @@ -dnl -*-m4-*- -dnl configure.in for ICU -dnl Copyright (c) 1999-2008, International Business Machines Corporation and -dnl others. All Rights Reserved. -dnl Stephen F. Booth, heavily modified by Yves and others +# -*-autoconf-*- +AC_COPYRIGHT([ Copyright (c) 1999-2008, International Business Machines Corporation and others. All Rights Reserved. ]) +# configure.in for ICU +# Stephen F. Booth, heavily modified by Yves and others -dnl Check for autoconf version +# Check for autoconf version AC_PREREQ(2.63) -dnl Process this file with autoconf to produce a configure script + +# Process this file with autoconf to produce a configure script AC_INIT AC_CONFIG_SRCDIR([common/unicode/utypes.h]) @@ -17,7 +17,7 @@ AC_SUBST(PACKAGE) AC_MSG_CHECKING(for ICU version numbers) -dnl Get the ICU version from uversion.h or other headers +# Get the ICU version from uversion.h or other headers geticuversion() { [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"] } @@ -28,9 +28,9 @@ if test x"$VERSION" = x; then AC_MSG_ERROR([Cannot determine ICU version number from header files]) fi fi -dnl Compute a reasonable library version from the release version. This is -dnl very bad, but that's wanted... We want to make sure that the LIB_VERSION -dnl has at least a dot in it, so we'll add a .0 if needed. +# Compute a reasonable library version from the release version. This is +# very bad, but that's wanted... We want to make sure that the LIB_VERSION +# has at least a dot in it, so we'll add a .0 if needed. [LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`] LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'` AC_SUBST(VERSION) @@ -41,15 +41,15 @@ AC_MSG_RESULT([release $VERSION, library $LIB_VERSION]) UNICODE_VERSION="5.1" AC_SUBST(UNICODE_VERSION) -dnl Determine the host system +# Determine the host system AC_CANONICAL_HOST AC_SUBST(CPPFLAGS) -dnl This variable is needed on z/OS because the C++ compiler only recognizes .C +# This variable is needed on z/OS because the C++ compiler only recognizes .C _CXX_CXXSUFFIX=cc export _CXX_CXXSUFFIX -dnl Checks for programs +# Checks for programs AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL @@ -65,19 +65,19 @@ fi #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true) #AC_CHECK_PROG(STRIP, strip, strip, true) -dnl Check for the platform make +# Check for the platform make AC_PATH_PROGS(U_MAKE, gmake gnumake, make) AC_SUBST(U_MAKE) -dnl Check for doxygen to generate documentation +# Check for doxygen to generate documentation AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin) -dnl Check that the linker is usable +# Check that the linker is usable ICU_PROG_LINK -dnl Determine the executable suffix -dnl We don't use AC_EXEEXT because some compilers output separate debugging -dnl files, which confuses the AC_EXEEXT macro. +# Determine the executable suffix +# We don't use AC_EXEEXT because some compilers output separate debugging +# files, which confuses the AC_EXEEXT macro. AC_MSG_CHECKING(checking for executable suffix) case "${host}" in *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;; @@ -87,20 +87,20 @@ ac_exeext=$EXEEXT AC_MSG_RESULT($EXEEXT) AC_SUBST(EXEEXT) -dnl Determine how strict we want to be when compiling +# Determine how strict we want to be when compiling AC_CHECK_STRICT_COMPILE -dnl Check if we can build and use 64-bit libraries +# Check if we can build and use 64-bit libraries AC_CHECK_64BIT_LIBS AC_SUBST(ARFLAGS) AC_SUBST(COMPILE_LINK_ENVVAR) -dnl Determine the Makefile fragment +# Determine the Makefile fragment ICU_CHECK_MH_FRAG -dnl Checks for libraries and other host specific stuff -dnl On HP/UX, don't link to -lm from a shared lib because it isn't -dnl PIC (at least on 10.2) +# Checks for libraries and other host specific stuff +# On HP/UX, don't link to -lm from a shared lib because it isn't +# PIC (at least on 10.2) case "${host}" in *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;; @@ -109,7 +109,7 @@ case "${host}" in esac AC_SUBST(LIB_M) -dnl Check whether to build shared libraries +# Check whether to build shared libraries AC_MSG_CHECKING([whether to build shared libraries]) enabled=no AC_ARG_ENABLE(shared, @@ -124,7 +124,7 @@ AC_ARG_ENABLE(shared, AC_MSG_RESULT($enabled) AC_SUBST(ENABLE_SHARED) -dnl Check whether to build static libraries +# Check whether to build static libraries AC_MSG_CHECKING([whether to build static libraries]) enabled=no AC_ARG_ENABLE(static, @@ -138,7 +138,7 @@ AC_ARG_ENABLE(static, AC_MSG_RESULT($enabled) AC_SUBST(ENABLE_STATIC) -dnl Check whether to build debug libraries +# Check whether to build debug libraries AC_MSG_CHECKING([whether to build debug libraries]) enabled=no ENABLE_DEBUG=0 @@ -152,7 +152,7 @@ AC_ARG_ENABLE(debug, AC_MSG_RESULT($enabled) AC_SUBST(ENABLE_DEBUG) -dnl Check whether to build release libraries +# Check whether to build release libraries AC_MSG_CHECKING([whether to build release libraries]) enabled=yes ENABLE_RELEASE=1 @@ -166,7 +166,7 @@ AC_ARG_ENABLE(release, AC_MSG_RESULT($enabled) AC_SUBST(ENABLE_RELEASE) -dnl Check whether to enabled draft APIs +# Check whether to enabled draft APIs AC_MSG_CHECKING([whether to enable draft APIs]) enabled=yes U_DEFAULT_SHOW_DRAFT=1 @@ -178,13 +178,13 @@ AC_ARG_ENABLE(draft, esac], ) AC_MSG_RESULT($enabled) -dnl Make sure that we can use draft API in ICU. +# Make sure that we can use draft API in ICU. if test "$U_DEFAULT_SHOW_DRAFT" = 0; then CPPFLAGS="$CPPFLAGS -DU_SHOW_DRAFT_API" fi AC_SUBST(U_DEFAULT_SHOW_DRAFT) -dnl Check if we can hide variables from +# Check if we can hide variables from AC_MSG_CHECKING([for library API export]) SHAREDLIBEXPORT=no U_USE_GCC_VISIBILITY_ATTRIBUTE=0 @@ -218,7 +218,7 @@ else fi ;; *-*-hpux*) - dnl ICU isn't set up to follow the HP syntax yet. + # ICU isn't set up to follow the HP syntax yet. ;; *) esac @@ -264,7 +264,7 @@ AC_ARG_ENABLE(tracing, AC_MSG_RESULT($enabled) AC_SUBST(U_ENABLE_TRACING) -dnl Check whether to use the evil rpath or not +# Check whether to use the evil rpath or not AC_ARG_ENABLE(rpath, [ --enable-rpath use rpath when linking [default is only if necessary]], [ case "${enableval}" in @@ -277,9 +277,9 @@ AC_ARG_ENABLE(rpath, AC_SUBST(ENABLE_RPATH) -dnl set up U_INLINE. -dnl Copy the definition of AC_C_INLINE, with slight mods. -dnl +# set up U_INLINE. +# Copy the definition of AC_C_INLINE, with slight mods. +# AC_CACHE_CHECK([for definition of U_INLINE for C], ac_cv_c_inline, [ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do @@ -295,7 +295,7 @@ AC_SUBST(U_INLINE) threads=true -dnl Enable/disable threads +# Enable/disable threads AC_ARG_ENABLE(threads, [ --enable-threads build ICU with thread safety [default=yes]], [case "${enableval}" in @@ -310,28 +310,28 @@ ICU_USE_THREADS=0 OLD_LIBS=${LIBS} if test $threads = true; then - dnl For Compaq Tru64 (OSF1), we must look for pthread_attr_init - dnl and must do this before seaching for pthread_mutex_destroy, or - dnl we will pick up libpthreads.so not libpthread.so - dnl If this fails, then we must test for HPUX specials, before - dnl moving on to a more generic test + # For Compaq Tru64 (OSF1), we must look for pthread_attr_init + # and must do this before seaching for pthread_mutex_destroy, or + # we will pick up libpthreads.so not libpthread.so + # If this fails, then we must test for HPUX specials, before + # moving on to a more generic test AC_CHECK_LIB(pthread, pthread_attr_init) if test $ac_cv_lib_pthread_pthread_attr_init = yes; then ICU_USE_THREADS=1 else - dnl Locate the right library for POSIX threads. We look for the - dnl symbols in the libraries first, because on Solaris libc provides - dnl pthread_create but libpthread has the real code :( - dnl AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread - dnl FreeBSD users may need libpthread if they do not have libc_r. + # Locate the right library for POSIX threads. We look for the + # symbols in the libraries first, because on Solaris libc provides + # pthread_create but libpthread has the real code :( + # AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread + # FreeBSD users may need libpthread if they do not have libc_r. AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r ) if test "$ac_cv_search_pthread_mutex_destroy" != no; then ICU_USE_THREADS=1 else - dnl For HP 11 + # For HP 11 AC_CHECK_LIB(pthread, pthread_mutex_init) if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then ICU_USE_THREADS=1 @@ -344,26 +344,26 @@ if test $threads = true; then ICU_USE_THREADS=1 fi fi - dnl Check to see if we are using CygWin with MSVC + # Check to see if we are using CygWin with MSVC case "${host}" in *-pc-cygwin*|*-pc-mingw*) - dnl For gcc, the thread options are set by mh-mingw/mh-cygwin + # For gcc, the thread options are set by mh-mingw/mh-cygwin ICU_USE_THREADS=1 if test "$ac_cv_c_compiler_gnu" = no; then - dnl We're using normal windows compilers. Threading is available. + # We're using normal windows compilers. Threading is available. ICU_USE_THREADS=1 if test $ENABLE_DEBUG = 1; then - dnl /MDd means 'compiles and links a debugable multithreaded program with DLL' + # /MDd means 'compiles and links a debugable multithreaded program with DLL' CFLAGS="${CFLAGS} /MDd" CXXFLAGS="${CXXFLAGS} /MDd" else - dnl /MD means 'compiles and links a multithreaded program with DLL' + # /MD means 'compiles and links a multithreaded program with DLL' CFLAGS="${CFLAGS} /MD" CXXFLAGS="${CXXFLAGS} /MD" fi fi ;; *-*-hpux*) - dnl Add -mt because it does several nice things on newer compilers. + # Add -mt because it does several nice things on newer compilers. case "${icu_cv_host_frag}" in mh-hpux-acc) OLD_CXXFLAGS="${CXXFLAGS}" @@ -391,21 +391,17 @@ AC_ARG_ENABLE(weak-threads, esac]) AC_SUBST(LIB_THREAD) -dnl Check for mmap() +# Check for mmap() # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific. # Do this check instead. HAVE_MMAP=0 AC_MSG_CHECKING([for mmap]) AC_CACHE_VAL(ac_cv_func_mmap_ok, - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[changequote(<<, >>)dnl - << -#include + [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include #include #include -#include - >>]], [[changequote(, )dnl - mmap((void *)0, 0, PROT_READ, 0, 0, 0);]])],[ac_cv_func_mmap_ok=yes],[ac_cv_func_mmap_ok=no])] ) +#include ], [mmap((void *)0, 0, PROT_READ, 0, 0, 0);])],[ac_cv_func_mmap_ok=yes],[ac_cv_func_mmap_ok=no])] ) AC_MSG_RESULT($ac_cv_func_mmap_ok) if test $ac_cv_func_mmap_ok = yes then @@ -413,18 +409,18 @@ then fi AC_SUBST(HAVE_MMAP) -dnl Check to see if genccode can generate simple assembly. +# Check to see if genccode can generate simple assembly. GENCCODE_ASSEMBLY= case "${host}" in i*86-*-linux*|x86_64-*-linux*|powerpc*-*-linux*|i*86-*-*bsd*|i*86-pc-gnu) if test "$GCC" = yes; then - dnl We're using gcc, and the simple -a gcc command line works for genccode + # We're using gcc, and the simple -a gcc command line works for genccode GENCCODE_ASSEMBLY="-a gcc" fi ;; i*86-*-solaris*) if test "$GCC" = yes; then - dnl When using gcc, look if we're also using GNU as. - dnl When using GNU as, the simple -a gcc command line works for genccode. + # When using gcc, look if we're also using GNU as. + # When using GNU as, the simple -a gcc command line works for genccode. asv=`"${CC}" -print-prog-name=as 2>/dev/null` asv=`"${asv}" --version 2>/dev/null` case "X${asv}" in @@ -445,7 +441,7 @@ esac AC_SUBST(GENCCODE_ASSEMBLY) -dnl Checks for header files +# Checks for header files AC_CHECK_HEADERS(inttypes.h) if test $ac_cv_header_inttypes_h = no; then U_HAVE_INTTYPES_H=0 @@ -496,9 +492,9 @@ then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[]])],[ac_cv_header_iostream=yes],[ac_cv_header_iostream=no]) if test $icu_cv_host_frag = mh-cygwin-msvc then - dnl is always there on Windows. - dnl We do this to prevent the C++ preprocessor from being used because - dnl autoconf can't deal with the Windows C++ preprocessor + # is always there on Windows. + # We do this to prevent the C++ preprocessor from being used because + # autoconf can't deal with the Windows C++ preprocessor ac_cv_header_iostream=yes fi AC_MSG_RESULT($ac_cv_header_iostream) @@ -536,7 +532,7 @@ fi AC_SUBST(U_IOSTREAM_SOURCE) AC_LANG_POP -dnl Check for endianness +# Check for endianness AC_C_BIGENDIAN() if test $ac_cv_c_bigendian = no; then U_IS_BIG_ENDIAN=0 @@ -547,7 +543,7 @@ U_ENDIAN_CHAR="b" fi AC_SUBST(U_IS_BIG_ENDIAN) -dnl Do various POSIX related checks +# Do various POSIX related checks U_HAVE_NL_LANGINFO_CODESET=0 U_NL_LANGINFO_CODESET=-1 AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0]) @@ -568,16 +564,14 @@ fi AC_SUBST(U_HAVE_NL_LANGINFO_CODESET) AC_SUBST(U_NL_LANGINFO_CODESET) -dnl Namespace support checks +# Namespace support checks AC_LANG(C++) AC_MSG_CHECKING([for namespace support]) AC_CACHE_VAL(ac_cv_namespace_ok, - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[changequote(<<, >>)dnl - <>]], [[changequote(, )dnl - f();]])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] ) + ], [f();])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] ) AC_MSG_RESULT($ac_cv_namespace_ok) U_HAVE_NAMESPACE=1 if test $ac_cv_namespace_ok = no @@ -590,36 +584,32 @@ AC_MSG_CHECKING([for properly overriding new and delete]) U_OVERRIDE_CXX_ALLOCATION=0 U_HAVE_PLACEMENT_NEW=0 AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok, - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[changequote(<<, >>)dnl - <<#include + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include class UMemory { public: void *operator new(size_t size) {return malloc(size);} - void *operator new(size_t size) {return malloc(size);} - void operator delete(void *p) {free(p);} + void *operator new[](size_t size) {return malloc(size);} void operator delete(void *p) {free(p);} + void operator delete[](void *p) {free(p);} }; - >>]], [[changequote(, )dnl - ]])],[ac_cv_override_cxx_allocation_ok=yes],[ac_cv_override_cxx_allocation_ok=no])] ) + ]], [])],[ac_cv_override_cxx_allocation_ok=yes],[ac_cv_override_cxx_allocation_ok=no])] ) AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok) if test $ac_cv_override_cxx_allocation_ok = yes then U_OVERRIDE_CXX_ALLOCATION=1 AC_MSG_CHECKING([for placement new and delete]) AC_CACHE_VAL(ac_cv_override_placement_new_ok, - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[changequote(<<, >>)dnl - <<#include + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include class UMemory { public: void *operator new(size_t size) {return malloc(size);} - void *operator new(size_t size) {return malloc(size);} - void operator delete(void *p) {free(p);} + void *operator new[](size_t size) {return malloc(size);} void operator delete(void *p) {free(p);} + void operator delete[](void *p) {free(p);} void * operator new(size_t, void *ptr) { return ptr; } void operator delete(void *, void *) {} }; - >>]], [[changequote(, )dnl - ]])],[ac_cv_override_placement_new_ok=yes],[ac_cv_override_placement_new_ok=no])] ) + ]], [])],[ac_cv_override_placement_new_ok=yes],[ac_cv_override_placement_new_ok=no])] ) AC_MSG_RESULT($ac_cv_override_placement_new_ok) if test $ac_cv_override_placement_new_ok = yes then @@ -658,27 +648,22 @@ AC_SUBST(U_TZSET) U_HAVE_TZNAME=0 AC_CACHE_CHECK(for tzname,ac_cv_var_tzname, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[changequote(<<, >>)dnl -<<#ifndef __USE_POSIX +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef __USE_POSIX #define __USE_POSIX #endif #include #include #ifndef tzname /* For SGI. */ -extern char *tzname; /* RS6000 and others reject char **tzname. */ -#endif>>]], [[changequote(, )dnl -atoi(*tzname);]])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])]) +extern char *tzname[]; /* RS6000 and others reject char **tzname. */ +#endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])]) if test $ac_cv_var_tzname = yes; then U_TZNAME=tzname U_HAVE_TZNAME=1 else AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname, - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[changequote(<<, >>)dnl - <<#include + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include - extern char *_tzname; - >>]], [[changequote(, )dnl - atoi(*_tzname);]])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])]) + extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])]) if test $ac_cv_var__tzname = yes; then U_TZNAME=_tzname U_HAVE_TZNAME=1 @@ -688,16 +673,14 @@ AC_SUBST(U_HAVE_TZNAME) AC_SUBST(U_TZNAME) AC_CACHE_CHECK(for timezone,ac_cv_var_timezone, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[changequote(<<, >>)dnl -<<#ifndef __USE_POSIX +[AC_LINK_IFELSE([AC_LANG_PROGRAM([#ifndef __USE_POSIX #define __USE_POSIX #endif #ifndef __USE_XOPEN #define __USE_XOPEN #endif #include ->>]], [[changequote(, )dnl -timezone = 1;]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])]) +], [[timezone = 1;]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])]) U_HAVE_TIMEZONE=0 if test $ac_cv_var_timezone = yes; then U_TIMEZONE=timezone @@ -720,7 +703,7 @@ fi AC_SUBST(U_HAVE_TIMEZONE) AC_SUBST(U_TIMEZONE) -dnl Checks for typedefs +# Checks for typedefs AC_CHECK_TYPE(int8_t,signed char) AC_CHECK_TYPE(uint8_t,unsigned char) AC_CHECK_TYPE(int16_t,signed short) @@ -786,7 +769,7 @@ HAVE_UINT64_T=1 fi AC_SUBST(HAVE_UINT64_T) -dnl Do various wchar_t related checks +# Do various wchar_t related checks AC_CHECK_HEADER(wchar.h) if test "$ac_cv_header_wchar_h" = no then @@ -795,7 +778,7 @@ then else AC_DEFINE(HAVE_WCHAR_H) U_HAVE_WCHAR_H=1 - dnl Some broken systems have wchar.h but not some of its functions... + # Some broken systems have wchar.h but not some of its functions... AC_SEARCH_LIBS(wcscpy, wcs w) if test "$ac_cv_search_wcscpy" != no; then U_HAVE_WCSCPY=1 @@ -868,12 +851,12 @@ case "${host}" in ;; *-*-hpux*) if test "$ac_cv_c_compiler_gnu" = no; then - dnl The option will be detected at compile time without additional compiler options. + # The option will be detected at compile time without additional compiler options. CHECK_UTF16_STRING_RESULT="available" fi ;; *-*-cygwin) - dnl wchar_t can be used + # wchar_t can be used CHECK_UTF16_STRING_RESULT="available" ;; *) @@ -882,7 +865,7 @@ esac AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT) AC_SUBST(U_CHECK_UTF16_STRING) -dnl Enable/disable extras +# Enable/disable extras AC_ARG_ENABLE(extras, [ --enable-extras build ICU extras [default=yes]], [case "${enableval}" in @@ -902,7 +885,7 @@ AC_ARG_ENABLE(icuio, icuio=true) ICU_CONDITIONAL(ICUIO, test "$icuio" = true) -dnl Enable/disable layout +# Enable/disable layout AC_ARG_ENABLE(layout, [ --enable-layout build ICU's layout library [default=yes]], [case "${enableval}" in @@ -925,20 +908,20 @@ AC_ARG_WITH(data-packaging, esac], [datapackaging=]) -dnl Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc.. -dnl thesysconfdir=`eval echo $sysconfdir` -dnl AC_SUBST(thesysconfdir) -dnl thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir` -dnl AC_SUBST(thelibdir) +# Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc.. +# thesysconfdir=`eval echo $sysconfdir` +dnl# AC_SUBST(thesysconfdir) +dnl# thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir` +dnl# AC_SUBST(thelibdir) thedatadir=`eval echo $datadir` -dnl AC_SUBST(thedatadir) -dnl 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}. +dnl# AC_SUBST(thedatadir) +# 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}. pkgicudatadir=$datadir thepkgicudatadir=$thedatadir AC_SUBST(pkgicudatadir) AC_SUBST(thepkgicudatadir) -dnl Shouldn't need the AC_SUBST +dnl# Shouldn't need the AC_SUBST if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then datapackaging=library @@ -957,7 +940,7 @@ case "$datapackaging" in esac AC_SUBST(DATA_PACKAGING_MODE) -dnl Sets a library suffix +# Sets a library suffix AC_MSG_CHECKING([for a library suffix to use]) AC_ARG_WITH(library-suffix, [ --with-library-suffix=suffix tag a suffix to the library names [default=]], @@ -969,7 +952,6 @@ if test "$msg" = ""; then fi AC_MSG_RESULT($msg) AC_SUBST(ICULIBSUFFIX) -changequote(<<, >>)dnl if test "$ICULIBSUFFIX" != "" then U_HAVE_LIB_SUFFIX=1 @@ -977,11 +959,10 @@ then else U_HAVE_LIB_SUFFIX=0 fi -changequote([, ])dnl AC_SUBST(U_HAVE_LIB_SUFFIX) AC_SUBST(ICULIBSUFFIXCNAME) -dnl Enable/disable tests +# Enable/disable tests AC_ARG_ENABLE(tests, [ --enable-tests build ICU tests [default=yes]], [case "${enableval}" in @@ -992,7 +973,7 @@ AC_ARG_ENABLE(tests, tests=true) ICU_CONDITIONAL(TESTS, test "$tests" = true) -dnl Enable/disable samples +# Enable/disable samples AC_ARG_ENABLE(samples, [ --enable-samples build ICU samples [default=yes] @@ -1008,8 +989,8 @@ ICU_CONDITIONAL(SAMPLES, test "$samples" = true) ICUDATA_CHAR=$U_ENDIAN_CHAR -dnl Platform-specific Makefile setup -dnl set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform. +# Platform-specific Makefile setup +# set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform. case "${host}" in *-*-solaris*) platform=U_SOLARIS ;; *-*-linux*) platform=U_LINUX ;; @@ -1047,8 +1028,8 @@ if test "${FORCE_LIBS}" != ""; then fi -dnl Now that we're done using CPPFLAGS etc. for tests, we can change it -dnl for build. +# Now that we're done using CPPFLAGS etc. for tests, we can change it +# for build. if test $ICU_USE_THREADS -ne 0 then @@ -1057,7 +1038,7 @@ then CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)" fi -dnl output the Makefiles +# output the Makefiles AC_CONFIG_FILES([icudefs.mk \ Makefile \ data/icupkg.inc \