2 dnl configure.in for ICU
3 dnl Copyright (c) 1999-2006, International Business Machines Corporation and
4 dnl others. All Rights Reserved.
5 dnl Stephen F. Booth, heavily modified by Yves and others
7 dnl Process this file with autoconf to produce a configure script
8 AC_INIT(common/unicode/utypes.h)
10 AC_CONFIG_HEADER(common/icucfg.h)
14 AC_MSG_CHECKING(for ICU version numbers)
16 dnl Get the ICU version from uversion.h or other headers
18 [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
20 VERSION=`geticuversion $srcdir/common/unicode/uversion.h`
21 if test x"$VERSION" = x; then
22 VERSION=`geticuversion $srcdir/common/unicode/*.h`
23 if test x"$VERSION" = x; then
24 AC_MSG_ERROR([Cannot determine ICU version number from header files])
27 dnl Compute a reasonable library version from the release version. This is
28 dnl very bad, but that's wanted... We want to make sure that the LIB_VERSION
29 dnl has at least a dot in it, so we'll add a .0 if needed.
30 [LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
31 LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
34 AC_SUBST(LIB_VERSION_MAJOR)
35 AC_MSG_RESULT([release $VERSION, library $LIB_VERSION])
38 AC_SUBST(UNICODE_VERSION)
40 dnl Determine the host system
45 dnl This variable is needed on z/OS because the C++ compiler only recognizes .C
48 dnl Checks for programs
53 # make sure install is relative to srcdir - if a script
54 if test "$srcdir" = "."; then
55 # If srcdir isn't just ., then (srcdir) is already prepended.
56 if test "${ac_install_sh}" = "${INSTALL}"; then
57 INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
61 #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
62 #AC_CHECK_PROG(STRIP, strip, strip, true)
64 dnl Check for the platform make
65 AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
68 dnl Check for doxygen to generate documentation
69 AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
71 dnl Check that the linker is usable
74 dnl Determine the executable suffix
75 dnl We don't use AC_EXEEXT because some compilers output separate debugging
76 dnl files, which confuses the AC_EXEEXT macro.
77 AC_MSG_CHECKING(checking for executable suffix)
79 *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;;
83 AC_MSG_RESULT($EXEEXT)
86 dnl Determine how strict we want to be when compiling
87 AC_CHECK_STRICT_COMPILE
89 dnl Check if we can build and use 64-bit libraries
92 AC_SUBST(COMPILE_LINK_ENVVAR)
94 dnl Determine the Makefile fragment
97 dnl Checks for libraries and other host specific stuff
98 dnl On HP/UX, don't link to -lm from a shared lib because it isn't
99 dnl PIC (at least on 10.2)
101 *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
103 *) AC_CHECK_LIB(m, floor)
108 dnl Check whether to build shared libraries
109 AC_MSG_CHECKING([whether to build shared libraries])
111 AC_ARG_ENABLE(shared,
112 [ --enable-shared build shared libraries [default=yes]],
113 [ case "${enableval}" in
114 yes|"") enabled=yes; ENABLE_SHARED=YES ;;
118 [enabled=yes; ENABLE_SHARED=YES]
120 AC_MSG_RESULT($enabled)
121 AC_SUBST(ENABLE_SHARED)
123 dnl Check whether to build static libraries
124 AC_MSG_CHECKING([whether to build static libraries])
126 AC_ARG_ENABLE(static,
127 [ --enable-static build static libraries [default=no]],
128 [ case "${enableval}" in
129 yes|"") enabled=yes; ENABLE_STATIC=YES ;;
134 AC_MSG_RESULT($enabled)
135 AC_SUBST(ENABLE_STATIC)
137 dnl Check whether to build debug libraries
138 AC_MSG_CHECKING([whether to build debug libraries])
142 [ --enable-debug build debug libraries [default=no]],
143 [ case "${enableval}" in
144 yes|"") enabled=yes; ENABLE_DEBUG=1 ;;
148 AC_MSG_RESULT($enabled)
149 AC_SUBST(ENABLE_DEBUG)
151 dnl Check whether to build release libraries
152 AC_MSG_CHECKING([whether to build release libraries])
155 AC_ARG_ENABLE(release,
156 [ --enable-release build release libraries [default=yes]],
157 [ case "${enableval}" in
158 no) enabled=no; ENABLE_RELEASE=0 ;;
162 AC_MSG_RESULT($enabled)
163 AC_SUBST(ENABLE_RELEASE)
165 dnl Check whether to enabled draft APIs
166 AC_MSG_CHECKING([whether to enable draft APIs])
168 U_DEFAULT_SHOW_DRAFT=1
170 [ --enable-draft enable draft APIs [default=yes]],
171 [ case "${enableval}" in
172 no) enabled=no; U_DEFAULT_SHOW_DRAFT=0 ;;
176 AC_MSG_RESULT($enabled)
177 dnl Make sure that we can use draft API in ICU.
178 if test "$U_DEFAULT_SHOW_DRAFT" = 0; then
179 CPPFLAGS="$CPPFLAGS -DU_SHOW_DRAFT_API"
181 AC_SUBST(U_DEFAULT_SHOW_DRAFT)
184 AC_PATH_PROG(AR,ar,[echo archiver ar not found re-run configure ; false],$PATH:/bin:/usr/bin:/usr/ccs/bin)
186 AC_MSG_CHECKING([whether to enable renaming of symbols])
189 AC_ARG_ENABLE(renaming,
190 [ --enable-renaming add a version suffix to symbols [default=yes]],
191 [ case "${enableval}" in
192 yes|"") enabled=yes ;;
193 no) enabled=no; U_DISABLE_RENAMING=1 ;;
197 AC_MSG_RESULT($enabled)
198 AC_SUBST(U_DISABLE_RENAMING)
200 AC_MSG_CHECKING([whether to enable function and data tracing])
203 AC_ARG_ENABLE(tracing,
204 [ --enable-tracing enable function and data tracing [default=yes]],
205 [ case "${enableval}" in
206 yes|"") enabled=yes ;;
207 no) enabled=no; U_ENABLE_TRACING=0 ;;
211 AC_MSG_RESULT($enabled)
212 AC_SUBST(U_ENABLE_TRACING)
214 dnl Check whether to use the evil rpath or not
216 [ --enable-rpath use rpath when linking [default is only if necessary]],
217 [ case "${enableval}" in
218 yes|"") ENABLE_RPATH=YES ;;
224 AC_SUBST(ENABLE_RPATH)
228 dnl Copy the definition of AC_C_INLINE, with slight mods.
230 AC_CACHE_CHECK([for definition of U_INLINE for C], ac_cv_c_inline,
232 for ac_kw in inline __inline__ __inline; do
233 AC_TRY_COMPILE(, [return 0;} $ac_kw int foo() {], [ac_cv_c_inline=$ac_kw; break])
236 case "$ac_cv_c_inline" in
237 yes) U_INLINE= "inline" ;;
239 *) U_INLINE=$ac_cv_c_inline ;;
245 dnl Enable/disable threads
246 AC_ARG_ENABLE(threads,
247 [ --enable-threads build ICU with thread safety [default=yes]],
248 [case "${enableval}" in
251 *) AC_MSG_ERROR(bad value ${enableval} for --enable-threads) ;;
254 ICU_CONDITIONAL(THREADS, test "$threads" = true)
258 if test $threads = true; then
259 dnl For Compaq Tru64 (OSF1), we must look for pthread_attr_init
260 dnl and must do this before seaching for pthread_mutex_destroy, or
261 dnl we will pick up libpthreads.so not libpthread.so
262 dnl If this fails, then we must test for HPUX specials, before
263 dnl moving on to a more generic test
265 AC_CHECK_LIB(pthread, pthread_attr_init)
266 if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
269 dnl Locate the right library for POSIX threads. We look for the
270 dnl symbols in the libraries first, because on Solaris libc provides
271 dnl pthread_create but libpthread has the real code :(
272 dnl AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread
273 dnl FreeBSD users may need libpthread if they do not have libc_r.
275 AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r )
277 if test "$ac_cv_search_pthread_mutex_destroy" != no; then
281 AC_CHECK_LIB(pthread, pthread_mutex_init)
282 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
287 AC_CHECK_FUNC(pthread_mutex_lock)
289 if test $ac_cv_func_pthread_mutex_lock = yes; then
293 dnl Check to see if we are using CygWin with MSVC
295 *-pc-cygwin*|*-pc-mingw*)
296 dnl For gcc, the thread options are set by mh-mingw/mh-cygwin
298 if test "$ac_cv_prog_gcc" = no; then
299 dnl We're using normal windows compilers. Threading is available.
301 if test $ENABLE_DEBUG = 1; then
302 dnl /MDd means 'compiles and links a debugable multithreaded program with DLL'
303 CFLAGS="${CFLAGS} /MDd"
304 CXXFLAGS="${CXXFLAGS} /MDd"
306 dnl /MD means 'compiles and links a multithreaded program with DLL'
307 CFLAGS="${CFLAGS} /MD"
308 CXXFLAGS="${CXXFLAGS} /MD"
312 dnl Add -mt because it does several nice things on newer compilers.
313 case "${icu_cv_host_frag}" in
315 OLD_CXXFLAGS="${CXXFLAGS}"
316 CXXFLAGS="${CXXFLAGS} -mt"
317 if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
318 CXXFLAGS="${OLD_CXXFLAGS}"
326 AC_SUBST(ICU_USE_THREADS)
330 # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
331 # Do this check instead.
333 AC_MSG_CHECKING([for mmap])
334 AC_CACHE_VAL(ac_cv_func_mmap_ok,
336 changequote(<<, >>)dnl
339 #include <sys/mman.h>
340 #include <sys/stat.h>
344 [mmap((void *)0, 0, PROT_READ, 0, 0, 0);],
345 ac_cv_func_mmap_ok=yes,
346 ac_cv_func_mmap_ok=no)] )
347 AC_MSG_RESULT($ac_cv_func_mmap_ok)
348 if test $ac_cv_func_mmap_ok = yes
354 dnl Check to see if genccode can generate simple assembly.
357 i*86-*-linux*|x86_64-*-linux*|powerpc*-*-linux*|i*86-*-*bsd*|i*86-*-solaris*)
358 if test "$GCC" = yes; then
359 dnl We're using gcc, and the simple -a gcc command line works for genccode
360 GENCCODE_ASSEMBLY="-a gcc"
363 GENCCODE_ASSEMBLY="-a sun"
366 AC_SUBST(GENCCODE_ASSEMBLY)
369 dnl Checks for header files
370 AC_CHECK_HEADERS(inttypes.h)
371 if test $ac_cv_header_inttypes_h = no; then
376 if test "$CC" = ccc; then
377 AC_MSG_RESULT("C compiler set to CCC ${CC}" )
379 alpha*-*-*) U_HAVE_INTTYPES_H=0;
383 AC_SUBST(U_HAVE_INTTYPES_H)
385 AC_ARG_WITH(iostream,
386 [ --with-iostream=version specify the version of iostream to use (none, old, std, auto) [default=auto]],
387 [case "${withval}" in
388 none) streams=none ;;
389 old) streams=198506 ;;
390 std) streams=199711 ;;
392 *) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
397 if test x$streams != xnone
401 OLD_CXXFLAGS="${CXXFLAGS}"
402 case "${icu_cv_host_frag}" in
404 CXXFLAGS="${CXXFLAGS} -AA"
407 AC_MSG_CHECKING([for iostream usability])
408 AC_TRY_COMPILE([#include <iostream>],[],
409 [ac_cv_header_iostream=yes],[ac_cv_header_iostream=no])
410 if test $icu_cv_host_frag = mh-cygwin-msvc
412 dnl <iostream> is always there on Windows.
413 dnl We do this to prevent the C++ preprocessor from being used because
414 dnl autoconf can't deal with the Windows C++ preprocessor
415 ac_cv_header_iostream=yes
417 AC_MSG_RESULT($ac_cv_header_iostream)
418 if test $ac_cv_header_iostream = yes
420 U_IOSTREAM_SOURCE=199711
422 CXXFLAGS="${OLD_CXXFLAGS}"
423 AC_MSG_CHECKING([whether ostream in iostream.h is really defined])
424 AC_CACHE_VAL(ac_cv_iostream_ok,
425 AC_TRY_LINK([#include <iostream.h>],[ostream &testout = cout; testout << "test" << endl;],ac_cv_iostream_ok=yes,ac_cv_iostream_ok=no))
426 AC_MSG_RESULT($ac_cv_iostream_ok)
427 if test $ac_cv_iostream_ok = yes
429 U_IOSTREAM_SOURCE=198506
432 if test x$streams != x
434 if test $U_IOSTREAM_SOURCE -ge $streams
436 U_IOSTREAM_SOURCE=$streams
437 case "${icu_cv_host_frag}" in
439 if test $U_IOSTREAM_SOURCE -lt 199711; then
440 CXXFLAGS=${OLD_CXXFLAGS}
445 AC_MSG_ERROR(${withval} iostream is not available)
449 AC_SUBST(U_IOSTREAM_SOURCE)
452 dnl Check for endianness
454 if test $ac_cv_c_bigendian = no; then
461 AC_SUBST(U_IS_BIG_ENDIAN)
463 dnl Do various POSIX related checks
464 U_HAVE_NL_LANGINFO_CODESET=0
465 U_NL_LANGINFO_CODESET=-1
466 AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
467 AC_SUBST(U_HAVE_NL_LANGINFO)
468 if test $U_HAVE_NL_LANGINFO -eq 1; then
469 AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
470 ac_cv_nl_langinfo_codeset,
471 [ac_cv_nl_langinfo_codeset="unknown"
472 for a in CODESET _NL_CTYPE_CODESET_NAME; do
473 AC_TRY_LINK([#include <langinfo.h>],[nl_langinfo($a);],[ac_cv_nl_langinfo_codeset="$a"; break])]
475 if test x$ac_cv_nl_langinfo_codeset != xunknown
477 U_HAVE_NL_LANGINFO_CODESET=1
478 U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
481 AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
482 AC_SUBST(U_NL_LANGINFO_CODESET)
484 dnl Namespace support checks
486 AC_MSG_CHECKING([for namespace support])
487 AC_CACHE_VAL(ac_cv_namespace_ok,
489 changequote(<<, >>)dnl
490 <<namespace x_version {void f(){}}
491 namespace x = x_version;
492 using namespace x_version;
495 [f();], ac_cv_namespace_ok=yes, ac_cv_namespace_ok=no)] )
496 AC_MSG_RESULT($ac_cv_namespace_ok)
498 if test $ac_cv_namespace_ok = no
502 AC_SUBST(U_HAVE_NAMESPACE)
504 AC_MSG_CHECKING([for properly overriding new and delete])
505 U_OVERRIDE_CXX_ALLOCATION=0
506 U_HAVE_PLACEMENT_NEW=0
507 AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
509 changequote(<<, >>)dnl
510 <<#include <stdlib.h>
513 void *operator new(size_t size) {return malloc(size);}
514 void *operator new[](size_t size) {return malloc(size);}
515 void operator delete(void *p) {free(p);}
516 void operator delete[](void *p) {free(p);}
520 [], ac_cv_override_cxx_allocation_ok=yes, ac_cv_override_cxx_allocation_ok=no)] )
521 AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
522 if test $ac_cv_override_cxx_allocation_ok = yes
524 U_OVERRIDE_CXX_ALLOCATION=1
525 AC_MSG_CHECKING([for placement new and delete])
526 AC_CACHE_VAL(ac_cv_override_placement_new_ok,
528 changequote(<<, >>)dnl
529 <<#include <stdlib.h>
532 void *operator new(size_t size) {return malloc(size);}
533 void *operator new[](size_t size) {return malloc(size);}
534 void operator delete(void *p) {free(p);}
535 void operator delete[](void *p) {free(p);}
536 void * operator new(size_t, void *ptr) { return ptr; }
537 void operator delete(void *, void *) {}
541 [], ac_cv_override_placement_new_ok=yes, ac_cv_override_placement_new_ok=no)] )
542 AC_MSG_RESULT($ac_cv_override_placement_new_ok)
543 if test $ac_cv_override_placement_new_ok = yes
545 U_HAVE_PLACEMENT_NEW=1
548 AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
549 AC_SUBST(U_HAVE_PLACEMENT_NEW)
553 if test x$ac_cv_func_popen = xyes
559 AC_SUBST(U_HAVE_POPEN)
563 if test x$ac_cv_func_tzset = xyes
568 AC_CHECK_FUNC(_tzset)
569 if test x$ac_cv_func__tzset = xyes
575 AC_SUBST(U_HAVE_TZSET)
579 AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
581 changequote(<<, >>)dnl
582 <<#ifndef __USE_POSIX
587 #ifndef tzname /* For SGI. */
588 extern char *tzname[]; /* RS6000 and others reject char **tzname. */
591 [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
592 if test $ac_cv_var_tzname = yes; then
596 AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
598 changequote(<<, >>)dnl
599 <<#include <stdlib.h>
601 extern char *_tzname[];
604 [atoi(*_tzname);], ac_cv_var__tzname=yes, ac_cv_var__tzname=no)])
605 if test $ac_cv_var__tzname = yes; then
610 AC_SUBST(U_HAVE_TZNAME)
613 AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
615 changequote(<<, >>)dnl
616 <<#ifndef __USE_POSIX
625 [timezone = 1;], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)])
627 if test $ac_cv_var_timezone = yes; then
631 AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
633 changequote(<<, >>)dnl
637 [__timezone = 1;], ac_cv_var___timezone=yes, ac_cv_var___timezone=no)])
638 if test $ac_cv_var___timezone = yes; then
639 U_TIMEZONE=__timezone
642 AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
644 changequote(<<, >>)dnl
648 [_timezone = 1;], ac_cv_var__timezone=yes, ac_cv_var__timezone=no)])
649 if test $ac_cv_var__timezone = yes; then
655 AC_SUBST(U_HAVE_TIMEZONE)
658 dnl Checks for typedefs
659 AC_CHECK_TYPE(int8_t,signed char)
660 AC_CHECK_TYPE(uint8_t,unsigned char)
661 AC_CHECK_TYPE(int16_t,signed short)
662 AC_CHECK_TYPE(uint16_t,unsigned short)
663 AC_CHECK_TYPE(int32_t,signed long)
664 AC_CHECK_TYPE(uint32_t,unsigned long)
665 AC_CHECK_TYPE(int64_t,signed long long)
666 AC_CHECK_TYPE(uint64_t,unsigned long long)
668 if test $ac_cv_type_int8_t = no; then
673 AC_SUBST(HAVE_INT8_T)
675 if test $ac_cv_type_uint8_t = no; then
680 AC_SUBST(HAVE_UINT8_T)
682 if test $ac_cv_type_int16_t = no; then
687 AC_SUBST(HAVE_INT16_T)
689 if test $ac_cv_type_uint16_t = no; then
694 AC_SUBST(HAVE_UINT16_T)
696 if test $ac_cv_type_int32_t = no; then
701 AC_SUBST(HAVE_INT32_T)
703 if test $ac_cv_type_uint32_t = no; then
708 AC_SUBST(HAVE_UINT32_T)
710 if test $ac_cv_type_int64_t = no; then
715 AC_SUBST(HAVE_INT64_T)
717 if test $ac_cv_type_uint64_t = no; then
722 AC_SUBST(HAVE_UINT64_T)
724 dnl Do various wchar_t related checks
725 AC_CHECK_HEADER(wchar.h)
726 if test "$ac_cv_header_wchar_h" = no
731 AC_DEFINE(HAVE_WCHAR_H)
733 dnl Some broken systems have wchar.h but not some of its functions...
734 AC_SEARCH_LIBS(wcscpy, wcs w)
735 if test "$ac_cv_search_wcscpy" != no; then
741 AC_SUBST(U_HAVE_WCHAR_H)
742 AC_SUBST(U_HAVE_WCSCPY)
744 ac_default_sizeof_wchar_t=4
745 AC_DO_CHECK_SIZEOF(wchar_t,$ac_default_sizeof_wchar_t,[
754 dnl We could set ac_cv_sizeof_wchar_t to the default if the check returned
755 dnl 0 (unknown) but we'd rather do it in the headers, so we know we had no
756 dnl clue at configure time.
757 U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
758 if test $U_SIZEOF_WCHAR_T = 0; then
759 if test $U_HAVE_WCHAR_H=1; then
760 AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
763 AC_SUBST(U_SIZEOF_WCHAR_T)
771 dnl Enable/disable extras
772 AC_ARG_ENABLE(extras,
773 [ --enable-extras build ICU extras [default=yes]],
774 [case "${enableval}" in
777 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
780 ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
782 [ --enable-icuio build ICU's icuio library [default=yes]],
783 [case "${enableval}" in
786 *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
789 ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
791 dnl Enable/disable layout
792 AC_ARG_ENABLE(layout,
793 [ --enable-layout build ICU's layout library [default=yes]],
794 [case "${enableval}" in
797 *) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;;
800 ICU_CONDITIONAL(LAYOUT, test "$layout" = true)
802 AC_ARG_WITH(data-packaging,
803 [ --with-data-packaging=type specify how to package ICU data (files, archive, library, auto) [default=auto]],
804 [case "${withval}" in
805 files|archive|library) datapackaging=$withval ;;
806 auto) datapackaging=$withval ;;
807 common) datapackaging=archive ;;
808 dll) datapackaging=library ;;
809 static) datapackaging=static ;;
810 *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
814 dnl Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
815 #thesysconfdir=`eval echo $sysconfdir`
816 #AC_SUBST(thesysconfdir)
817 #thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
819 thedatadir=`eval echo $datadir`
821 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}.
822 pkgicudatadir=$datadir
823 thepkgicudatadir=$thedatadir
824 AC_SUBST(pkgicudatadir)
825 AC_SUBST(thepkgicudatadir)
827 dnl Shouldn't need the AC_SUBST
829 if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
830 datapackaging=library
833 case "$datapackaging" in
835 DATA_PACKAGING_MODE=files
838 DATA_PACKAGING_MODE=common
841 DATA_PACKAGING_MODE=dll
844 AC_SUBST(DATA_PACKAGING_MODE)
846 dnl Sets a library suffix
847 AC_MSG_CHECKING([for a library suffix to use])
848 AC_ARG_WITH(library-suffix,
849 [ --with-library-suffix=suffix tag a suffix to the library names [default=]],
850 [ICULIBSUFFIX="${withval}"],
853 if test "$msg" = ""; then
857 AC_SUBST(ICULIBSUFFIX)
858 changequote(<<, >>)dnl
859 if test "$ICULIBSUFFIX" != ""
862 ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
867 AC_SUBST(U_HAVE_LIB_SUFFIX)
868 AC_SUBST(ICULIBSUFFIXCNAME)
870 dnl Enable/disable tests
872 [ --enable-tests build ICU tests [default=yes]],
873 [case "${enableval}" in
876 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
879 ICU_CONDITIONAL(TESTS, test "$tests" = true)
881 dnl Enable/disable samples
882 AC_ARG_ENABLE(samples,
883 [ --enable-samples build ICU samples [default=yes]
884 Additionally, the variable FORCE_LIBS may be set before calling configure. If set, it will REPLACE any automatic list of libraries.],
885 [case "${enableval}" in
888 *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
891 ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
893 ICUDATA_CHAR=$U_ENDIAN_CHAR
895 dnl Platform-specific Makefile setup
896 dnl set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
898 *-*-solaris*) platform=U_SOLARIS ;;
899 *-*-linux*) platform=U_LINUX ;;
900 *-*-*bsd*|*-*-dragonfly*) platform=U_BSD ;;
901 *-*-aix*) platform=U_AIX ;;
902 *-*-hpux*) platform=U_HPUX ;;
903 *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
904 *-*-cygwin*|*-*-mingw*) platform=U_CYGWIN ;;
905 *-*ibm-openedition*|*-*-os390*) platform=OS390
906 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
909 *-*-os400*) platform=OS400
910 if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
913 *-*-nto*) platform=U_QNX ;;
914 *-dec-osf*) platform=U_OSF ;;
915 *-*-beos) platform=U_BEOS ;;
916 *-*-irix*) platform=U_IRIX ;;
917 *-ncr-*) platform=U_MPRAS ;;
918 *) platform=U_UNKNOWN_PLATFORM ;;
920 AC_SUBST(ICUDATA_CHAR)
922 platform_make_fragment_name="$icu_cv_host_frag"
923 platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
924 AC_SUBST(platform_make_fragment_name)
925 AC_SUBST(platform_make_fragment)
927 dnl Handle -rpath options for shared library paths
929 *-*-solaris*) ld_rpath_suf=":" ;;
930 *-*-linux*) ld_rpath_suf=" " ;;
931 *-*-*bsd*|*-*-dragonfly*) ld_rpath_suf=" " ;;
932 *-*-aix*) ld_rpath_suf="" ;;
933 *-*-hpux*) ld_rpath_suf=":" ;;
934 *-*ibm-openedition*|*-*-os390*) ld_rpath_suf="" ;;
935 *-*-os400*) ld_rpath_suf=" " ;;
936 *-*-irix*) ld_rpath_suf=" " ;;
937 *) ld_rpath_suf="" ;;
939 AC_SUBST(ld_rpath_suf)
941 dnl On HP/UX, main() functions compiled in C don't invoke
942 dnl static constructors in C++ libs. Hack around that here
943 dnl by renaming some .c files to .cpp
946 if test "${icu_cv_host_frag}" = "mh-hpux-cc"; then
947 for file in samples/date/date \
948 samples/cal/cal test/cintltst/cintltst \
949 tools/makeconv/makeconv tools/genrb/genrb \
950 tools/genrb/derb tools/genccode/genccode \
951 tools/gencmn/gencmn tools/gencmn/decmn \
952 tools/gencnval/gencnval tools/gennorm/gennorm \
953 tools/gennames/gennames tools/gentest/gentest \
954 tools/pkgdata/pkgdata tools/genprops/genprops \
955 tools/gencase/gencase \
956 tools/genbidi/genbidi \
957 tools/gensprep/gensprep
959 if test -f $file.c; then
962 echo "# $file.c does not exist or is already renamed [warning]"
969 if test "${FORCE_LIBS}" != ""; then
970 echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
975 if test "${AIX_SHLIB}" != ""; then
976 echo " *** setting AIX_SHLIB (AIX only) to ${AIX_SHLIB}]" 1>&6
978 AIX_SHLIB=makeC++SharedLib_r
984 dnl Now that we're done using CPPFLAGS etc. for tests, we can change it
987 if test $ICU_USE_THREADS -ne 0
989 CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
990 CFLAGS="$CFLAGS \$(THREADSCFLAGS)"
991 CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)"
994 dnl output the Makefiles
995 AC_OUTPUT([icudefs.mk \
998 config/Makefile.inc \
1007 extra/uconv/Makefile \
1008 extra/scrptrun/Makefile \
1010 tools/ctestfw/Makefile \
1011 tools/toolutil/Makefile \
1012 tools/makeconv/Makefile \
1013 tools/genrb/Makefile \
1014 tools/genuca/Makefile \
1015 tools/genccode/Makefile \
1016 tools/gencmn/Makefile \
1017 tools/gencnval/Makefile \
1018 tools/genctd/Makefile \
1019 tools/gennames/Makefile \
1020 tools/gentest/Makefile \
1021 tools/gennorm/Makefile \
1022 tools/genprops/Makefile \
1023 tools/gencase/Makefile \
1024 tools/genbidi/Makefile \
1025 tools/genpname/Makefile \
1026 tools/genbrk/Makefile \
1027 tools/gensprep/Makefile \
1028 tools/icupkg/Makefile \
1029 tools/icuswap/Makefile \
1030 tools/pkgdata/Makefile \
1031 tools/dumpce/Makefile \
1032 tools/tzcode/Makefile \
1034 test/testdata/Makefile \
1035 test/testdata/pkgdata.inc \
1036 test/hdrtst/Makefile \
1037 test/intltest/Makefile \
1038 test/cintltst/Makefile \
1039 test/iotest/Makefile \
1040 test/thaitest/Makefile \
1041 test/testmap/Makefile \
1042 test/letest/Makefile \
1043 test/threadtest/Makefile \
1044 samples/Makefile samples/date/Makefile \
1045 samples/cal/Makefile samples/csdet/Makefile samples/layout/Makefile \
1046 common/unicode/platform.h])
1048 if test $ICU_USE_THREADS = 0; then
1049 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
1052 if test -n "`$U_MAKE -v 2>&1 | grep '^GNU Make'`"; then
1053 echo "You must use $U_MAKE to build ICU."
1055 echo "WARNING: $U_MAKE may not be GNU make."
1056 echo "This may cause ICU to fail to build. Please make sure that GNU make"
1057 echo "is in your PATH so that this configure script can detect its location."
1060 $as_unset _CXX_CXXSUFFIX