]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/configure.in
ICU-400.42.tar.gz
[apple/icu.git] / icuSources / configure.in
index 01420999e057d11c697e52faa26a73d74d717a31..e799dea832c24f1e65819330f3d49a76e5374547 100644 (file)
@@ -1,11 +1,9 @@
 dnl -*-m4-*-
 dnl configure.in for ICU
-dnl Copyright (c) 1999-2003, International Business Machines Corporation and
+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
 
-dnl $Id: configure.in,v 1.1.1.2 2003/07/03 18:13:30 avery Exp $
-
 dnl Process this file with autoconf to produce a configure script
 AC_INIT(common/unicode/utypes.h)
 
@@ -36,11 +34,17 @@ AC_SUBST(LIB_VERSION)
 AC_SUBST(LIB_VERSION_MAJOR)
 AC_MSG_RESULT([release $VERSION, library $LIB_VERSION])
 
-UNICODE_VERSION="4"
+UNICODE_VERSION="5.1"
 AC_SUBST(UNICODE_VERSION)
 
+dnl 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
+_CXX_CXXSUFFIX=cc
+export _CXX_CXXSUFFIX
 dnl Checks for programs
 AC_PROG_CC
 AC_PROG_CXX
@@ -54,8 +58,8 @@ if test "$srcdir" = "."; then
   fi
 fi
 
-AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
-AC_CHECK_PROG(STRIP, strip, strip, true)
+#AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
+#AC_CHECK_PROG(STRIP, strip, strip, true)
 
 dnl Check for the platform make
 AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
@@ -64,9 +68,20 @@ AC_SUBST(U_MAKE)
 dnl Check for doxygen to generate documentation
 AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
 
-dnl Determine the host system and Makefile fragment
-AC_CANONICAL_HOST
-AC_EXEEXT
+dnl 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.
+AC_MSG_CHECKING(checking for executable suffix)
+case "${host}" in
+    *-*-cygwin*|*-*-mingw*)  EXEEXT=.exe ;;
+    *)      EXEEXT="" ;;
+esac
+ac_exeext=$EXEEXT
+AC_MSG_RESULT($EXEEXT)
+AC_SUBST(EXEEXT)
 
 dnl Determine how strict we want to be when compiling
 AC_CHECK_STRICT_COMPILE
@@ -76,16 +91,13 @@ AC_CHECK_64BIT_LIBS
 AC_SUBST(ARFLAGS)
 AC_SUBST(COMPILE_LINK_ENVVAR)
 
+dnl Determine the Makefile fragment
 ICU_CHECK_MH_FRAG
 
-hpuxcma=false
-
 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)
 case "${host}" in
-       *-*-hpux10*)    hpuxcma=true
-                       AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
        *-*-hpux*)      AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
        
        *)              AC_CHECK_LIB(m, floor) 
@@ -93,35 +105,11 @@ case "${host}" in
 esac
 AC_SUBST(LIB_M)
 
-dnl Enable/disable hpuxcma
-
-if test $hpuxcma = false; then
- AC_ARG_ENABLE(hpuxcma,
-       [  --enable-hpuxcma        build ICU with HPUX CMA threads (only ver>=11) [default=no]],
-       [case "${enableval}" in
-            yes) hpuxcma=true;;
-            no) hpuxcma=false;;
-               *) AC_MSG_ERROR(bad value ${enableval} for --enable-hpuxcma) ;;
-               esac], 
-       )
-fi
-
-dnl Note, we set the conditional outside of IF for non hpux plats
-ICU_CONDITIONAL(HPUX_CMA, test "$hpuxcma" = true)
-
-dnl Should this be a nested CASE?
-if test $hpuxcma = true; then
-  case "${host}" in
-       *-*-hpux*)      hpuxcma=true ;;
-       *)              AC_MSG_ERROR(--enable-hpuxcma is not valid on this platform ${host}) ;;
-  esac
-fi
-
 dnl Check whether to build shared libraries
 AC_MSG_CHECKING([whether to build shared libraries])
 enabled=no
 AC_ARG_ENABLE(shared,
-    [  --enable-shared[=PKGS]  build shared libraries [default=yes]],
+    [  --enable-shared         build shared libraries [default=yes]],
     [ case "${enableval}" in
             yes|"") enabled=yes; ENABLE_SHARED=YES ;;
             no);;
@@ -136,7 +124,7 @@ dnl Check whether to build static libraries
 AC_MSG_CHECKING([whether to build static libraries])
 enabled=no
 AC_ARG_ENABLE(static,
-    [  --enable-static[=PKGS]  build static libraries [default=no]],
+    [  --enable-static         build static libraries [default=no]],
     [ case "${enableval}" in
             yes|"") enabled=yes; ENABLE_STATIC=YES ;;
             no) ;;
@@ -146,6 +134,103 @@ AC_ARG_ENABLE(static,
 AC_MSG_RESULT($enabled)
 AC_SUBST(ENABLE_STATIC)
 
+dnl Check whether to build debug libraries
+AC_MSG_CHECKING([whether to build debug libraries])
+enabled=no
+ENABLE_DEBUG=0
+AC_ARG_ENABLE(debug,
+    [  --enable-debug          build debug libraries [default=no]],
+    [ case "${enableval}" in
+         yes|"") enabled=yes; ENABLE_DEBUG=1 ;;
+         *) ;;
+    esac],
+)
+AC_MSG_RESULT($enabled)
+AC_SUBST(ENABLE_DEBUG)
+
+dnl Check whether to build release libraries
+AC_MSG_CHECKING([whether to build release libraries])
+enabled=yes
+ENABLE_RELEASE=1
+AC_ARG_ENABLE(release,
+    [  --enable-release        build release libraries [default=yes]],
+    [ case "${enableval}" in
+         no) enabled=no; ENABLE_RELEASE=0 ;;
+         *) ;;
+    esac],
+)
+AC_MSG_RESULT($enabled)
+AC_SUBST(ENABLE_RELEASE)
+
+dnl Check whether to enabled draft APIs
+AC_MSG_CHECKING([whether to enable draft APIs])
+enabled=yes
+U_DEFAULT_SHOW_DRAFT=1
+AC_ARG_ENABLE(draft,
+    [  --enable-draft          enable draft APIs [default=yes]],
+    [ case "${enableval}" in
+         no) enabled=no; U_DEFAULT_SHOW_DRAFT=0 ;;
+         *) ;;
+    esac],
+)
+AC_MSG_RESULT($enabled)
+dnl 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 
+AC_MSG_CHECKING([for library API export])
+SHAREDLIBEXPORT=no
+U_USE_GCC_VISIBILITY_ATTRIBUTE=0
+OLD_CFLAGS="${CFLAGS}"
+OLD_CXXFLAGS="${CXXFLAGS}"
+if test "$ac_cv_c_compiler_gnu" = yes; then
+    LIBCFLAGS="-fvisibility=hidden"
+    LIBCXXFLAGS="-fvisibility=hidden"
+    CFLAGS="${CFLAGS} ${LIBCFLAGS}"
+    CXXFLAGS="${CXXFLAGS} ${LIBCXXFLAGS}"
+    AC_TRY_LINK([__attribute__ ((visibility ("default"))) void f(void);
+#include <stdlib.h>],[exit(0);],
+        [SHAREDLIBEXPORT=yes],[SHAREDLIBEXPORT=no])
+    if test "$SHAREDLIBEXPORT" = no; then
+        LIBCFLAGS=
+        LIBCXXFLAGS=
+    else
+        U_USE_GCC_VISIBILITY_ATTRIBUTE=1
+    fi
+else
+    case "${host}" in
+    *-*-solaris*)
+        LIBCFLAGS="-xldscope=hidden"
+        LIBCXXFLAGS="-xldscope=hidden"
+        CFLAGS="${CFLAGS} ${LIBCFLAGS}"
+        CXXFLAGS="${CXXFLAGS} ${LIBCXXFLAGS}"
+        AC_TRY_LINK([__global void f(void);
+#include <stdlib.h>],[exit(0);],
+            [SHAREDLIBEXPORT=yes],[SHAREDLIBEXPORT=no])
+        if test "$SHAREDLIBEXPORT" = no; then
+            LIBCFLAGS=
+            LIBCXXFLAGS=
+        fi
+        ;;
+    *-*-hpux*)
+        dnl ICU isn't set up to follow the HP syntax yet.
+        ;;
+    *)
+    esac
+fi
+# Restore to their original state because the Intel compiler chokes
+# on this option when checking for the wchar_t size, but the
+# option otherwise works.
+CFLAGS="${OLD_CFLAGS}"
+CXXFLAGS="${OLD_CXXFLAGS}"
+AC_MSG_RESULT($SHAREDLIBEXPORT)
+AC_SUBST(U_USE_GCC_VISIBILITY_ATTRIBUTE)
+AC_SUBST(LIBCFLAGS)
+AC_SUBST(LIBCXXFLAGS)
+
 AC_PROG_RANLIB
 AC_PATH_PROG(AR,ar,[echo archiver ar not found re-run configure ; false],$PATH:/bin:/usr/bin:/usr/ccs/bin)
 
@@ -163,6 +248,20 @@ AC_ARG_ENABLE(renaming,
 AC_MSG_RESULT($enabled)
 AC_SUBST(U_DISABLE_RENAMING)
 
+AC_MSG_CHECKING([whether to enable function and data tracing])
+enabled=yes
+U_ENABLE_TRACING=0
+AC_ARG_ENABLE(tracing,
+    [  --enable-tracing        enable function and data tracing [default=no]],
+    [ case "${enableval}" in
+            yes|"") enabled=yes ;;
+            no) enabled=no; U_ENABLE_TRACING=0 ;;
+            *) ;;
+    esac],
+)
+AC_MSG_RESULT($enabled)
+AC_SUBST(U_ENABLE_TRACING)
+
 dnl Check whether to use the evil rpath or not
 AC_ARG_ENABLE(rpath,
     [  --enable-rpath          use rpath when linking [default is only if necessary]],
@@ -182,7 +281,7 @@ dnl
 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
-  AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_c_inline=$ac_kw; break])
+  AC_TRY_COMPILE(, [return 0;} $ac_kw int foo() {], [ac_cv_c_inline=$ac_kw; break])
   done
   ])
 case "$ac_cv_c_inline" in
@@ -196,7 +295,7 @@ threads=true
 
 dnl Enable/disable threads
 AC_ARG_ENABLE(threads,
-       [  --enable-threads        build ICU with threads [default=yes]],
+       [  --enable-threads        build ICU with thread safety [default=yes]],
        [case "${enableval}" in
                yes) threads=true ;;
                no)  threads=false ;;
@@ -206,16 +305,9 @@ AC_ARG_ENABLE(threads,
 ICU_CONDITIONAL(THREADS, test "$threads" = true)
 
 ICU_USE_THREADS=0
+OLD_LIBS=${LIBS}
 
 if test $threads = true; then
- dnl Test for HPUX cma threads first.. 
- if test $hpuxcma = true; then
-  dnl HPUX cma case
-  AC_CHECK_LIB(cma, pthread_create)
-  if test $ac_cv_lib_cma_pthread_create = yes; then
-   ICU_USE_THREADS=1
-  fi
- else 
   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
@@ -224,38 +316,79 @@ if test $threads = true; then
  
   AC_CHECK_LIB(pthread, pthread_attr_init)
   if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
-   ICU_USE_THREADS=1
+    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 libcma
-   dnl (but that was checked above).
-   dnl FreeBSD users may need libpthread if they do not have libc_r.
+    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.
 
-   AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r cma)
+    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
-    AC_CHECK_LIB(pthread, pthread_mutex_init)
-    if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
+    if test "$ac_cv_search_pthread_mutex_destroy" != no; then
       ICU_USE_THREADS=1
+    else
+      dnl 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
+      fi
     fi
-   fi
 
-   AC_CHECK_FUNC(pthread_mutex_lock)
+    AC_CHECK_FUNC(pthread_mutex_lock)
 
-   if test $ac_cv_func_pthread_mutex_lock = yes; then
-     ICU_USE_THREADS=1
-   fi
+    if test $ac_cv_func_pthread_mutex_lock = yes; then
+      ICU_USE_THREADS=1
+    fi
   fi
- fi
+  dnl 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
+    ICU_USE_THREADS=1
+    if test "$ac_cv_prog_gcc" = no; then
+      dnl 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'
+        CFLAGS="${CFLAGS} /MDd"
+        CXXFLAGS="${CXXFLAGS} /MDd"
+      else
+        dnl /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.
+    case "${icu_cv_host_frag}" in
+      mh-hpux-acc)
+        OLD_CXXFLAGS="${CXXFLAGS}"
+        CXXFLAGS="${CXXFLAGS} -mt"
+        if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
+           CXXFLAGS="${OLD_CXXFLAGS}"
+       fi
+      ;;
+    esac
+    ;;
+  esac
 fi
 
 AC_SUBST(ICU_USE_THREADS)
 
+AC_ARG_ENABLE(weak-threads,
+       [  --enable-weak-threads   weakly reference the threading library [default=no]],
+       [case "${enableval}" in
+               yes)
+            LIB_THREAD="${LIBS%${OLD_LIBS}}"
+            LIBS=${OLD_LIBS}
+            ;;
+               no)  ;;
+               *) AC_MSG_ERROR(bad value ${enableval} for --enable-weak-threads) ;;
+               esac])
+AC_SUBST(LIB_THREAD)
+
 dnl Check for mmap()
 
 # The AC_FUNC_MMAP macro doesn't work properly.  It seems to be too specific.
@@ -282,6 +415,38 @@ then
 fi
 AC_SUBST(HAVE_MMAP)
 
+dnl 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
+        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.
+        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" ;;
+        X*) GENCCODE_ASSEMBLY="-a sun-x86" ;;
+        esac
+        unset asv
+    else
+        GENCCODE_ASSEMBLY="-a sun-x86"
+    fi ;;
+sparc-*-solaris*)
+    GENCCODE_ASSEMBLY="-a sun"
+    ;;
+ia64-*-hpux*)
+    GENCCODE_ASSEMBLY="-a aCC-ia64"
+    ;;
+esac
+AC_SUBST(GENCCODE_ASSEMBLY)
+
+
 dnl Checks for header files
 AC_CHECK_HEADERS(inttypes.h)
 if test $ac_cv_header_inttypes_h = no; then
@@ -314,24 +479,35 @@ if test x$streams != xnone
 then
     AC_LANG_SAVE
     AC_LANG_CPLUSPLUS
-    AC_MSG_CHECKING([iostream usability])
+    OLD_CXXFLAGS="${CXXFLAGS}"
+    case "${icu_cv_host_frag}" in
+        mh-hpux-acc)
+            CXXFLAGS="${CXXFLAGS} -AA"
+        ;;
+    esac
+    AC_MSG_CHECKING([for iostream usability])
     AC_TRY_COMPILE([#include <iostream>],[],
         [ac_cv_header_iostream=yes],[ac_cv_header_iostream=no])
+    if test $icu_cv_host_frag = mh-cygwin-msvc
+    then
+        dnl <iostream> 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 
+        ac_cv_header_iostream=yes
+    fi
     AC_MSG_RESULT($ac_cv_header_iostream)
     if test $ac_cv_header_iostream = yes
     then
         U_IOSTREAM_SOURCE=199711
     else
-        AC_CHECK_HEADER(iostream.h)
-        if test $ac_cv_header_iostream_h = yes; then
-            AC_MSG_CHECKING([whether ostream is really defined])
-            AC_CACHE_VAL(ac_cv_iostream_ok,
-                AC_TRY_LINK([#include <iostream.h>],[ostream &testout = cout; testout << "test" << endl;],ac_cv_iostream_ok=yes,ac_cv_iostream_ok=no))
-            AC_MSG_RESULT($ac_cv_iostream_ok)
-            if test $ac_cv_iostream_ok = yes
-            then
-                U_IOSTREAM_SOURCE=198506
-            fi
+        CXXFLAGS="${OLD_CXXFLAGS}"
+        AC_MSG_CHECKING([whether ostream in iostream.h is really defined])
+        AC_CACHE_VAL(ac_cv_iostream_ok,
+            AC_TRY_LINK([#include <iostream.h>],[ostream &testout = cout; testout << "test" << endl;],ac_cv_iostream_ok=yes,ac_cv_iostream_ok=no))
+        AC_MSG_RESULT($ac_cv_iostream_ok)
+        if test $ac_cv_iostream_ok = yes
+        then
+            U_IOSTREAM_SOURCE=198506
         fi
     fi
     if test x$streams != x
@@ -339,6 +515,13 @@ then
         if test $U_IOSTREAM_SOURCE -ge $streams
         then
             U_IOSTREAM_SOURCE=$streams
+            case "${icu_cv_host_frag}" in
+                mh-hpux-acc)
+                    if test $U_IOSTREAM_SOURCE -lt 199711; then
+                        CXXFLAGS=${OLD_CXXFLAGS}
+                    fi
+                ;;
+            esac
         else
             AC_MSG_ERROR(${withval} iostream is not available)
         fi
@@ -362,7 +545,7 @@ dnl 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])
-AC_SUBST(U_HAVE_NL_LANGINFO)
+dnl AC_SUBST(U_HAVE_NL_LANGINFO)
 if test $U_HAVE_NL_LANGINFO -eq 1; then
   AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
   ac_cv_nl_langinfo_codeset,
@@ -385,7 +568,7 @@ AC_MSG_CHECKING([for namespace support])
 AC_CACHE_VAL(ac_cv_namespace_ok,
     [AC_TRY_LINK(
     changequote(<<, >>)dnl
-    <<namespace x_version {void f(){}};
+    <<namespace x_version {void f(){}}
     namespace x = x_version;
     using namespace x_version;
     >>,
@@ -406,7 +589,8 @@ AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
     [AC_TRY_LINK(
     changequote(<<, >>)dnl
     <<#include <stdlib.h>
-    class UObject {
+    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);}
@@ -424,7 +608,8 @@ then
         [AC_TRY_LINK(
         changequote(<<, >>)dnl
         <<#include <stdlib.h>
-        class UObject {
+        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);}
@@ -455,23 +640,30 @@ fi
 AC_SUBST(U_HAVE_POPEN)
 
 AC_CHECK_FUNC(tzset)
+U_HAVE_TZSET=0
 if test x$ac_cv_func_tzset = xyes
 then
     U_TZSET=tzset
+    U_HAVE_TZSET=1
 else
     AC_CHECK_FUNC(_tzset)
     if test x$ac_cv_func__tzset = xyes
     then
-       U_TZSET=_tzset
+        U_TZSET=_tzset
+        U_HAVE_TZSET=1
     fi
 fi
+AC_SUBST(U_HAVE_TZSET)
 AC_SUBST(U_TZSET)
+
+U_HAVE_TZNAME=0
 AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
 [AC_TRY_LINK(
 changequote(<<, >>)dnl
 <<#ifndef __USE_POSIX
 #define __USE_POSIX
 #endif
+#include <stdlib.h>
 #include <time.h>
 #ifndef tzname /* For SGI.  */
 extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
@@ -480,19 +672,23 @@ changequote([, ])dnl
 [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_TRY_LINK(
   changequote(<<, >>)dnl
-  <<#include <time.h>
+  <<#include <stdlib.h>
+  #include <time.h>
   extern char *_tzname[];
   >>,
   changequote([, ])dnl
   [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
     fi
 fi
+AC_SUBST(U_HAVE_TZNAME)
 AC_SUBST(U_TZNAME)
 
 AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
@@ -514,22 +710,14 @@ if test $ac_cv_var_timezone = yes; then
   U_HAVE_TIMEZONE=1
 else
   AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
-  [AC_TRY_LINK(
-  changequote(<<, >>)dnl
-  <<#include <time.h>
-  >>,
-  changequote([, ])dnl
+  [AC_TRY_LINK([#include <time.h>], 
   [__timezone = 1;], ac_cv_var___timezone=yes, ac_cv_var___timezone=no)])
   if test $ac_cv_var___timezone = yes; then
     U_TIMEZONE=__timezone
     U_HAVE_TIMEZONE=1
   else
     AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
-    [AC_TRY_LINK(
-    changequote(<<, >>)dnl
-    <<#include <time.h>
-    >>,
-    changequote([, ])dnl
+    [AC_TRY_LINK([#include <time.h>],
     [_timezone = 1;], ac_cv_var__timezone=yes, ac_cv_var__timezone=no)])
     if test $ac_cv_var__timezone = yes; then
       U_TIMEZONE=_timezone
@@ -626,31 +814,83 @@ fi
 AC_SUBST(U_HAVE_WCHAR_H)
 AC_SUBST(U_HAVE_WCSCPY)
 
-ac_default_sizeof_wchar_t=4
-AC_DO_CHECK_SIZEOF(wchar_t,$ac_default_sizeof_wchar_t,[
+AC_CHECK_SIZEOF([wchar_t], 0, [
 #if STDC_HEADERS
 #include <stddef.h>
 #endif
+#include <stdlib.h>
 #if HAVE_WCHAR_H
 #include <string.h>
 #include <wchar.h>
 #endif])
-dnl We could set ac_cv_sizeof_wchar_t to the default if the check returned
-dnl 0 (unknown) but we'd rather do it in the headers, so we know we had no
-dnl clue at configure time.
 U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
+# We do this check to verify that everything is okay.
 if test $U_SIZEOF_WCHAR_T = 0; then
-       if test $U_HAVE_WCHAR_H=1; then
-          AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
-       fi
+    if test $U_HAVE_WCHAR_H=1; then
+       AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
+    fi
 fi
 AC_SUBST(U_SIZEOF_WCHAR_T)
 
-dnl Echo
-ECHO_N=$ac_n
-ECHO_C=$ac_c
-AC_SUBST(ECHO_N)
-AC_SUBST(ECHO_C)
+AC_MSG_CHECKING([for UTF-16 string literal support])
+U_CHECK_UTF16_STRING=1
+CHECK_UTF16_STRING_RESULT="unknown"
+case "${host}" in
+*-*-aix*|powerpc64-*-linux*)
+    if test "$ac_cv_prog_gcc" = no; then
+        OLD_CFLAGS="${CFLAGS}"
+        OLD_CXXFLAGS="${CXXFLAGS}"
+        CFLAGS="${CFLAGS} -qutf"
+        CXXFLAGS="${CXXFLAGS} -qutf"
+        AC_TRY_COMPILE([const unsigned short hello[] = u"hello";],[],
+            [U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
+        if test "$U_CHECK_UTF16_STRING" = 0; then
+            CFLAGS="${OLD_CFLAGS}"
+            CXXFLAGS="${OLD_CXXFLAGS}"
+        else
+            CHECK_UTF16_STRING_RESULT="-qutf"
+        fi
+    fi
+    ;;
+*-*-solaris*)
+    if test "$ac_cv_prog_gcc" = no; then
+        OLD_CFLAGS="${CFLAGS}"
+        OLD_CXXFLAGS="${CXXFLAGS}"
+        CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
+        CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort"
+        AC_TRY_COMPILE([const unsigned short hello[] = U"hello";],[],
+            [U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
+        if test "$U_CHECK_UTF16_STRING" = 0; then
+            CFLAGS="${OLD_CFLAGS}"
+            CXXFLAGS="${OLD_CXXFLAGS}"
+        else
+            CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
+
+            # Since we can't detect the availability of this UTF-16 syntax at compile time,
+            # we depend on configure telling us that we can use it.
+            # Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
+            # we only use this macro within ICU.
+            # If an ICU user uses icu-config, this feature will be enabled.
+            CPPFLAGS="${CPPFLAGS} -DU_CHECK_UTF16_STRING=1"
+            U_CHECK_UTF16_STRING=0
+        fi
+    fi
+    ;;
+*-*-hpux*)
+    if test "$ac_cv_prog_gcc" = no; then
+        dnl 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
+    CHECK_UTF16_STRING_RESULT="available"
+    ;;
+*)
+    ;;
+esac
+AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT)
+AC_SUBST(U_CHECK_UTF16_STRING)
 
 dnl Enable/disable extras
 AC_ARG_ENABLE(extras,
@@ -662,15 +902,15 @@ AC_ARG_ENABLE(extras,
                esac], 
        extras=true)
 ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
-AC_ARG_ENABLE(extras,
-       [  --enable-ustdio         build ICU's ustdio library [default=yes]],
+AC_ARG_ENABLE(icuio,
+       [  --enable-icuio          build ICU's icuio library [default=yes]],
        [case "${enableval}" in
-               yes) ustdio=true ;;
-               no)  ustdio=false ;;
-               *) AC_MSG_ERROR(bad value ${enableval} for --enable-ustdio) ;;
+               yes) icuio=true ;;
+               no)  icuio=false ;;
+               *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
                esac], 
-       ustdio=true)
-ICU_CONDITIONAL(USTDIO, test "$ustdio" = true)
+       icuio=true)
+ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
 
 dnl Enable/disable layout
 AC_ARG_ENABLE(layout,
@@ -690,54 +930,25 @@ AC_ARG_WITH(data-packaging,
                auto) datapackaging=$withval ;;
                common) datapackaging=archive ;;
                dll) datapackaging=library ;;
-               *) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
+               static) datapackaging=static ;;
+               *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
                esac], 
         [datapackaging=])
 
-thesysconfdir=`eval echo $sysconfdir`
-AC_SUBST(thesysconfdir)
+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)
 thedatadir=`eval echo $datadir`
-AC_SUBST(thedatadir)
-thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
-AC_SUBST(thelibdir)
-case $datapackaging in
-    common)
-       pkgicudatadir=$datadir
-       thepkgicudatadir=$thedatadir
-       ;;
-    *)
-       pkgicudatadir=$libdir
-       thepkgicudatadir=$thelibdir
-       ;;
-esac
+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}. 
+pkgicudatadir=$datadir
+thepkgicudatadir=$thedatadir
 AC_SUBST(pkgicudatadir)
 AC_SUBST(thepkgicudatadir)
 
 dnl Shouldn't need the AC_SUBST
-dnl Deprecated support for --enable-mapped
-
-AC_ARG_ENABLE(mapped,,
-       [case "${enableval}" in
-               yes) mapped=archive ;;
-               no)  mapped=library ;;
-               *) AC_MSG_ERROR(bad value ${enableval} for --enable-mapped; use --with-data-packaging now) ;;
-       esac],
-       [mapped=])
-
-if test x"$mapped" != x; then
-    case $mapped in
-       archive)
-           AC_MSG_WARN(use --with-data-packaging=archive instead of --enable-mapped)
-           ;;
-       library)
-           AC_MSG_WARN(use --with-data-packaging=library instead of --disable-mapped)
-           ;;
-    esac
-    if test x"$datapackaging" != x -a x"$mapped" != x"$datapackaging"; then
-       AC_MSG_ERROR(conflicting values used for --with-data-packaging and deprecated --enable-mapped)
-    fi
-    datapackaging=$mapped
-fi
 
 if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
        datapackaging=library
@@ -745,19 +956,15 @@ fi
 
 case "$datapackaging" in
     files)
-       DATA_PACKAGING_CPPFLAGS=-DUDATA_FILES
        DATA_PACKAGING_MODE=files
        ;;
     archive)
-       DATA_PACKAGING_CPPFLAGS=-DUDATA_MAP
        DATA_PACKAGING_MODE=common
        ;;
     library)
-       DATA_PACKAGING_CPPFLAGS=-DUDATA_DLL
        DATA_PACKAGING_MODE=dll
        ;;
 esac
-AC_SUBST(DATA_PACKAGING_CPPFLAGS)
 AC_SUBST(DATA_PACKAGING_MODE)
 
 dnl Sets a library suffix
@@ -798,7 +1005,9 @@ ICU_CONDITIONAL(TESTS, test "$tests" = true)
 dnl Enable/disable samples
 AC_ARG_ENABLE(samples,
        [  --enable-samples        build ICU samples [default=yes]  
-Additionally, the variable FORCE_LIBS may be set before calling configure. If set, it will REPLACE any automatic list of libraries.],
+
+Additionally, the variable FORCE_LIBS may be set before calling configure.
+If set, it will REPLACE any automatic list of libraries.],
        [case "${enableval}" in
                yes) samples=true ;;
                no)  samples=false ;;
@@ -814,19 +1023,25 @@ dnl 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 ;;
-       *-*-*bsd*)      platform=U_BSD ;;
-       *-*-aix*)       platform=AIX ;;
-       *-*-hpux*)      platform=HPUX ;;
+       *-pc-gnu)       platform=U_HURD ;;
+       *-*-*bsd*|*-*-dragonfly*)       platform=U_BSD ;;
+       *-*-aix*)       platform=U_AIX ;;
+       *-*-hpux*)      platform=U_HPUX ;;
        *-apple-darwin*|*-apple-rhapsody*)      platform=U_DARWIN ;;
        *-*-cygwin*|*-*-mingw*) platform=U_CYGWIN ;;
        *-*ibm-openedition*|*-*-os390*) platform=OS390
-                       ICUDATA_CHAR="e" ;;
+                       if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
+                               ICUDATA_CHAR="e"
+                       fi ;;
        *-*-os400*)     platform=OS400
-                       ICUDATA_CHAR="e" ;;
+                       if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
+                               ICUDATA_CHAR="e"
+                       fi ;;
        *-*-nto*)       platform=U_QNX ;;
        *-dec-osf*)     platform=U_OSF ;;
-       *-*-irix*)      platform=IRIX ;;
-       *-sequent-*)    platform=PTX ;;
+       *-*-beos)               platform=U_BEOS ;;
+       *-*-irix*)              platform=U_IRIX ;;
+       *-ncr-*)                platform=U_MPRAS ;;
        *)              platform=U_UNKNOWN_PLATFORM ;;
 esac
 AC_SUBST(ICUDATA_CHAR)
@@ -836,68 +1051,12 @@ platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
 AC_SUBST(platform_make_fragment_name)
 AC_SUBST(platform_make_fragment)
 
-dnl Handle -rpath options for shared library paths
-case "${host}" in
-       *-*-solaris*)   ld_rpath_suf=":" ;;
-       *-*-linux*)     ld_rpath_suf=" " ;;
-       *-*-*bsd*)      ld_rpath_suf=" " ;;
-       *-*-aix*)       ld_rpath_suf="" ;;
-       *-*-hpux*)      ld_rpath_suf=":" ;;
-       *-*ibm-openedition*|*-*-os390*) ld_rpath_suf="" ;;
-       *-*-os400*)     ld_rpath_suf=" " ;;
-       *-sequent-*)    ld_rpath_suf="" ;;
-       *-*-irix*)      ld_rpath_suf=" " ;;
-       *)              ld_rpath_suf="" ;;
-esac
-AC_SUBST(ld_rpath_suf)
-
-dnl On HP/UX, main() functions compiled in C don't invoke
-dnl static constructors in C++ libs.  Hack around that here
-dnl by renaming some .c files to .cpp
-case "${host}" in
-       *-*-hpux*)      
-               if test "$ac_cv_prog_gcc" != yes; then
-                       for file in samples/date/date \
-                         samples/cal/cal test/cintltst/cintltst \
-                         tools/makeconv/makeconv tools/genrb/genrb \
-                         tools/genrb/derb tools/genccode/genccode \
-                         tools/gencmn/gencmn tools/gencmn/decmn \
-                         tools/gencnval/gencnval tools/gennorm/gennorm \
-                         tools/gennames/gennames tools/gentest/gentest \
-                         tools/pkgdata/pkgdata tools/genprops/genprops \
-                         tools/genidna/genidna
-                       do
-                         if test -f $file.c; then
-                           mv $file.c $file.cpp
-                         else
-                           echo "# $file.c does not exist or is already renamed [warning]"
-                         fi
-                       done
-               fi
-       ;;
-esac
-
 if test "${FORCE_LIBS}" != ""; then
    echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]"  1>&6
    LIBS=${FORCE_LIBS}
 fi
 
 
-if test "${AIX_SHLIB}" != ""; then
-   echo " *** setting AIX_SHLIB (AIX only) to ${AIX_SHLIB}]"  1>&6
-else
-   AIX_SHLIB=makeC++SharedLib_r
-fi
-
-AC_SUBST(AIX_SHLIB)
-
-
-dnl SPECIAL handling for HPUX 10 and also '11 & --enable-hpuxcma=true'
-if test $hpuxcma = true; then
-       CPPFLAGS="${CPPFLAGS} -D_PTHREADS_DRAFT4 -DHPUX_CMA"
-fi
-dnl END special 
-
 dnl Now that we're done using CPPFLAGS etc. for tests, we can change it
 dnl for build.
 
@@ -908,49 +1067,64 @@ then
     CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)"
 fi
 
-if test "$ac_cv_lib_dld_shl_load" = "yes"; then
-       CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
-fi
-
-dnl added for s/390 DLL loading detection
-
-if test "$ac_cv_func_dllload" = "yes"; then
-    CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
-fi
-
 dnl output the Makefiles
-AC_OUTPUT([README icudefs.mk \
+AC_OUTPUT([icudefs.mk \
                Makefile \
-               data/Makefile data/icupkg.inc \
-               common/Makefile config/Makefile.inc i18n/Makefile \
+               data/icupkg.inc \
+               config/Makefile.inc \
+               data/Makefile \
+               stubdata/Makefile \
+               common/Makefile \
+               i18n/Makefile \
                layout/Makefile \
                layoutex/Makefile \
-               extra/Makefile extra/ustdio/Makefile \
-               extra/uconv/Makefile extra/scrptrun/Makefile
-               stubdata/Makefile \
-               tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \
-               tools/genrb/Makefile  \
-               tools/genuca/Makefile  \
-               tools/pkgdata/Makefile \
-               tools/genccode/Makefile tools/gencmn/Makefile \
-               tools/gencnval/Makefile tools/gentz/Makefile \
-               tools/gennames/Makefile tools/toolutil/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/genidna/Makefile \
-               tools/dumpce/Makefile \
-               test/Makefile test/testdata/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/ieeetest/Makefile \
-               test/thaitest/Makefile \
-               test/testmap/Makefile \
                test/letest/Makefile \
-               test/threadtest/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])
@@ -959,4 +1133,12 @@ if test $ICU_USE_THREADS = 0; then
   echo  " *** Note: configuring the ICU without pthread support or testing. If this isn't what you want, then run configure with --enable-threads=yes or check the messages [above] to see why we couldn't find pthread_create()" 1>&6
 fi
 
+if test -n "`$U_MAKE -v 2>&1 | grep '^GNU Make'`"; then
 echo "You must use $U_MAKE to build ICU."
+else
+echo "WARNING: $U_MAKE may not be GNU make."
+echo "This may cause ICU to fail to build. Please make sure that GNU make"
+echo "is in your PATH so that this configure script can detect its location."
+fi
+
+$as_unset _CXX_CXXSUFFIX