2 dnl configure.in for ICU
3 dnl Copyright (c) 1999-2004, 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])
37 UNICODE_VERSION="4.0.1"
38 AC_SUBST(UNICODE_VERSION)
41 #AC_SUBST(CINTLTST_CPPFLAGS)
43 dnl Checks for programs
48 # make sure install is relative to srcdir - if a script
49 if test "$srcdir" = "."; then
50 # If srcdir isn't just ., then (srcdir) is already prepended.
51 if test "${ac_install_sh}" = "${INSTALL}"; then
52 INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
56 #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
57 AC_CHECK_PROG(STRIP, strip, strip, true)
59 dnl Check for the platform make
60 AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
63 dnl Check for doxygen to generate documentation
64 AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
66 dnl Determine the host system and Makefile fragment
70 dnl Determine how strict we want to be when compiling
71 AC_CHECK_STRICT_COMPILE
73 dnl Check if we can build and use 64-bit libraries
76 AC_SUBST(COMPILE_LINK_ENVVAR)
80 dnl Checks for libraries and other host specific stuff
81 dnl On HP/UX, don't link to -lm from a shared lib because it isn't
82 dnl PIC (at least on 10.2)
84 *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
86 *) AC_CHECK_LIB(m, floor)
91 dnl Check whether to build shared libraries
92 AC_MSG_CHECKING([whether to build shared libraries])
95 [ --enable-shared build shared libraries [default=yes]],
96 [ case "${enableval}" in
97 yes|"") enabled=yes; ENABLE_SHARED=YES ;;
101 [enabled=yes; ENABLE_SHARED=YES]
103 AC_MSG_RESULT($enabled)
104 AC_SUBST(ENABLE_SHARED)
106 dnl Check whether to build static libraries
107 AC_MSG_CHECKING([whether to build static libraries])
109 AC_ARG_ENABLE(static,
110 [ --enable-static build static libraries [default=no]],
111 [ case "${enableval}" in
112 yes|"") enabled=yes; ENABLE_STATIC=YES ;;
117 AC_MSG_RESULT($enabled)
118 AC_SUBST(ENABLE_STATIC)
120 dnl Check whether to build debug libraries
121 AC_MSG_CHECKING([whether to build debug libraries])
125 [ --enable-debug build debug libraries [default=no]],
126 [ case "${enableval}" in
127 yes|"") enabled=yes; ENABLE_DEBUG=1 ;;
131 AC_MSG_RESULT($enabled)
132 AC_SUBST(ENABLE_DEBUG)
134 dnl Check whether to build release libraries
135 AC_MSG_CHECKING([whether to build release libraries])
138 AC_ARG_ENABLE(release,
139 [ --enable-release build release libraries [default=yes]],
140 [ case "${enableval}" in
141 no) enabled=no; ENABLE_RELEASE=0 ;;
145 AC_MSG_RESULT($enabled)
146 AC_SUBST(ENABLE_RELEASE)
149 AC_PATH_PROG(AR,ar,[echo archiver ar not found re-run configure ; false],$PATH:/bin:/usr/bin:/usr/ccs/bin)
151 AC_MSG_CHECKING([whether to enable renaming of symbols])
154 AC_ARG_ENABLE(renaming,
155 [ --enable-renaming add a version suffix to symbols [default=yes]],
156 [ case "${enableval}" in
157 yes|"") enabled=yes ;;
158 no) enabled=no; U_DISABLE_RENAMING=1 ;;
162 AC_MSG_RESULT($enabled)
163 AC_SUBST(U_DISABLE_RENAMING)
165 AC_MSG_CHECKING([whether to enable function and data tracing])
168 AC_ARG_ENABLE(tracing,
169 [ --enable-tracing enable function and data tracing [default=yes]],
170 [ case "${enableval}" in
171 yes|"") enabled=yes ;;
172 no) enabled=no; U_ENABLE_TRACING=0 ;;
176 AC_MSG_RESULT($enabled)
177 AC_SUBST(U_ENABLE_TRACING)
179 dnl Check whether to use the evil rpath or not
181 [ --enable-rpath use rpath when linking [default is only if necessary]],
182 [ case "${enableval}" in
183 yes|"") ENABLE_RPATH=YES ;;
189 AC_SUBST(ENABLE_RPATH)
193 dnl Copy the definition of AC_C_INLINE, with slight mods.
195 AC_CACHE_CHECK([for definition of U_INLINE for C], ac_cv_c_inline,
197 for ac_kw in inline __inline__ __inline; do
198 AC_TRY_COMPILE(, [return 0;} $ac_kw int foo() {], [ac_cv_c_inline=$ac_kw; break])
201 case "$ac_cv_c_inline" in
202 yes) U_INLINE= "inline" ;;
204 *) U_INLINE=$ac_cv_c_inline ;;
210 dnl Enable/disable threads
211 AC_ARG_ENABLE(threads,
212 [ --enable-threads build ICU with thread safety [default=yes]],
213 [case "${enableval}" in
216 *) AC_MSG_ERROR(bad value ${enableval} for --enable-threads) ;;
219 ICU_CONDITIONAL(THREADS, test "$threads" = true)
223 if test $threads = true; then
224 dnl For Compaq Tru64 (OSF1), we must look for pthread_attr_init
225 dnl and must do this before seaching for pthread_mutex_destroy, or
226 dnl we will pick up libpthreads.so not libpthread.so
227 dnl If this fails, then we must test for HPUX specials, before
228 dnl moving on to a more generic test
230 AC_CHECK_LIB(pthread, pthread_attr_init)
231 if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
234 dnl Locate the right library for POSIX threads. We look for the
235 dnl symbols in the libraries first, because on Solaris libc provides
236 dnl pthread_create but libpthread has the real code :(
237 dnl AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread
238 dnl FreeBSD users may need libpthread if they do not have libc_r.
240 AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r )
242 if test "$ac_cv_search_pthread_mutex_destroy" != no; then
246 AC_CHECK_LIB(pthread, pthread_mutex_init)
247 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
252 AC_CHECK_FUNC(pthread_mutex_lock)
254 if test $ac_cv_func_pthread_mutex_lock = yes; then
257 dnl Check to see if we are using CygWin with MSVC
259 *-pc-cygwin*|*-pc-mingw*)
260 if test "$ac_cv_prog_gcc" = no; then
261 dnl We're using normal windows compilers. Threading is available.
265 dnl Add -mt because it does several nice things on newer compilers.
266 case "${icu_cv_host_frag}" in
268 OLD_CXXFLAGS="${CXXFLAGS}"
269 CXXFLAGS="${CXXFLAGS} -mt"
270 if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
271 CXXFLAGS="${OLD_CXXFLAGS}"
280 AC_SUBST(ICU_USE_THREADS)
284 # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
285 # Do this check instead.
287 AC_MSG_CHECKING([for mmap])
288 AC_CACHE_VAL(ac_cv_func_mmap_ok,
290 changequote(<<, >>)dnl
293 #include <sys/mman.h>
294 #include <sys/stat.h>
298 [mmap((void *)0, 0, PROT_READ, 0, 0, 0);],
299 ac_cv_func_mmap_ok=yes,
300 ac_cv_func_mmap_ok=no)] )
301 AC_MSG_RESULT($ac_cv_func_mmap_ok)
302 if test $ac_cv_func_mmap_ok = yes
308 dnl Check to see if genccode can generate simple assembly.
311 i*86-*-*bsd*|i*86-*-linux*|x86_64-*-linux*|powerpc*-*-linux*)
312 if test "$GCC" = yes; then
313 dnl We're using gcc, and the simple -a gcc command line works for genccode
314 GENCCODE_ASSEMBLY="-a gcc"
317 AC_SUBST(GENCCODE_ASSEMBLY)
320 dnl Checks for header files
321 AC_CHECK_HEADERS(inttypes.h)
322 if test $ac_cv_header_inttypes_h = no; then
327 if test "$CC" = ccc; then
328 AC_MSG_RESULT("C compiler set to CCC ${CC}" )
330 alpha*-*-*) U_HAVE_INTTYPES_H=0;
334 AC_SUBST(U_HAVE_INTTYPES_H)
336 AC_ARG_WITH(iostream,
337 [ --with-iostream=version specify the version of iostream to use (none, old, std, auto) [default=auto]],
338 [case "${withval}" in
339 none) streams=none ;;
340 old) streams=198506 ;;
341 std) streams=199711 ;;
343 *) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
348 if test x$streams != xnone
352 OLD_CXXFLAGS="${CXXFLAGS}"
353 case "${icu_cv_host_frag}" in
355 CXXFLAGS="${CXXFLAGS} -AA"
358 AC_MSG_CHECKING([iostream usability])
359 AC_TRY_COMPILE([#include <iostream>],[],
360 [ac_cv_header_iostream=yes],[ac_cv_header_iostream=no])
361 if test $icu_cv_host_frag = mh-cygwin-msvc
363 dnl <iostream> is always there on Windows.
364 dnl We do this to prevent the C++ preprocessor from being used because
365 dnl autoconf can't deal with the Windows C++ preprocessor
366 ac_cv_header_iostream=yes
368 AC_MSG_RESULT($ac_cv_header_iostream)
369 if test $ac_cv_header_iostream = yes
371 U_IOSTREAM_SOURCE=199711
373 CXXFLAGS="${OLD_CXXFLAGS}"
374 AC_CHECK_HEADER(iostream.h)
375 if test $ac_cv_header_iostream_h = yes; then
376 AC_MSG_CHECKING([whether ostream is really defined])
377 AC_CACHE_VAL(ac_cv_iostream_ok,
378 AC_TRY_LINK([#include <iostream.h>],[ostream &testout = cout; testout << "test" << endl;],ac_cv_iostream_ok=yes,ac_cv_iostream_ok=no))
379 AC_MSG_RESULT($ac_cv_iostream_ok)
380 if test $ac_cv_iostream_ok = yes
382 U_IOSTREAM_SOURCE=198506
386 if test x$streams != x
388 if test $U_IOSTREAM_SOURCE -ge $streams
390 U_IOSTREAM_SOURCE=$streams
391 case "${icu_cv_host_frag}" in
393 if test $U_IOSTREAM_SOURCE -lt 199711; then
394 CXXFLAGS=${OLD_CXXFLAGS}
399 AC_MSG_ERROR(${withval} iostream is not available)
403 AC_SUBST(U_IOSTREAM_SOURCE)
406 dnl Check for endianness
408 if test $ac_cv_c_bigendian = no; then
415 AC_SUBST(U_IS_BIG_ENDIAN)
417 dnl Do various POSIX related checks
418 U_HAVE_NL_LANGINFO_CODESET=0
419 U_NL_LANGINFO_CODESET=-1
420 AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
421 AC_SUBST(U_HAVE_NL_LANGINFO)
422 if test $U_HAVE_NL_LANGINFO -eq 1; then
423 AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
424 ac_cv_nl_langinfo_codeset,
425 [ac_cv_nl_langinfo_codeset="unknown"
426 for a in CODESET _NL_CTYPE_CODESET_NAME; do
427 AC_TRY_LINK([#include <langinfo.h>],[nl_langinfo($a);],[ac_cv_nl_langinfo_codeset="$a"; break])]
429 if test x$ac_cv_nl_langinfo_codeset != xunknown
431 U_HAVE_NL_LANGINFO_CODESET=1
432 U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
435 AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
436 AC_SUBST(U_NL_LANGINFO_CODESET)
438 dnl Namespace support checks
440 AC_MSG_CHECKING([for namespace support])
441 AC_CACHE_VAL(ac_cv_namespace_ok,
443 changequote(<<, >>)dnl
444 <<namespace x_version {void f(){}};
445 namespace x = x_version;
446 using namespace x_version;
449 [f();], ac_cv_namespace_ok=yes, ac_cv_namespace_ok=no)] )
450 AC_MSG_RESULT($ac_cv_namespace_ok)
452 if test $ac_cv_namespace_ok = no
456 AC_SUBST(U_HAVE_NAMESPACE)
458 AC_MSG_CHECKING([for properly overriding new and delete])
459 U_OVERRIDE_CXX_ALLOCATION=0
460 U_HAVE_PLACEMENT_NEW=0
461 AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
463 changequote(<<, >>)dnl
464 <<#include <stdlib.h>
467 void *operator new(size_t size) {return malloc(size);}
468 void *operator new[](size_t size) {return malloc(size);}
469 void operator delete(void *p) {free(p);}
470 void operator delete[](void *p) {free(p);}
474 [], ac_cv_override_cxx_allocation_ok=yes, ac_cv_override_cxx_allocation_ok=no)] )
475 AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
476 if test $ac_cv_override_cxx_allocation_ok = yes
478 U_OVERRIDE_CXX_ALLOCATION=1
479 AC_MSG_CHECKING([for placement new and delete])
480 AC_CACHE_VAL(ac_cv_override_placement_new_ok,
482 changequote(<<, >>)dnl
483 <<#include <stdlib.h>
486 void *operator new(size_t size) {return malloc(size);}
487 void *operator new[](size_t size) {return malloc(size);}
488 void operator delete(void *p) {free(p);}
489 void operator delete[](void *p) {free(p);}
490 void * operator new(size_t, void *ptr) { return ptr; }
491 void operator delete(void *, void *) {}
495 [], ac_cv_override_placement_new_ok=yes, ac_cv_override_placement_new_ok=no)] )
496 AC_MSG_RESULT($ac_cv_override_placement_new_ok)
497 if test $ac_cv_override_placement_new_ok = yes
499 U_HAVE_PLACEMENT_NEW=1
502 AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
503 AC_SUBST(U_HAVE_PLACEMENT_NEW)
507 if test x$ac_cv_func_popen = xyes
513 AC_SUBST(U_HAVE_POPEN)
517 if test x$ac_cv_func_tzset = xyes
522 AC_CHECK_FUNC(_tzset)
523 if test x$ac_cv_func__tzset = xyes
529 AC_SUBST(U_HAVE_TZSET)
533 AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
535 changequote(<<, >>)dnl
536 <<#ifndef __USE_POSIX
541 #ifndef tzname /* For SGI. */
542 extern char *tzname[]; /* RS6000 and others reject char **tzname. */
545 [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
546 if test $ac_cv_var_tzname = yes; then
550 AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
552 changequote(<<, >>)dnl
553 <<#include <stdlib.h>
555 extern char *_tzname[];
558 [atoi(*_tzname);], ac_cv_var__tzname=yes, ac_cv_var__tzname=no)])
559 if test $ac_cv_var__tzname = yes; then
564 AC_SUBST(U_HAVE_TZNAME)
567 AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
569 changequote(<<, >>)dnl
570 <<#ifndef __USE_POSIX
579 [timezone = 1;], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)])
581 if test $ac_cv_var_timezone = yes; then
585 AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
587 changequote(<<, >>)dnl
591 [__timezone = 1;], ac_cv_var___timezone=yes, ac_cv_var___timezone=no)])
592 if test $ac_cv_var___timezone = yes; then
593 U_TIMEZONE=__timezone
596 AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
598 changequote(<<, >>)dnl
602 [_timezone = 1;], ac_cv_var__timezone=yes, ac_cv_var__timezone=no)])
603 if test $ac_cv_var__timezone = yes; then
609 AC_SUBST(U_HAVE_TIMEZONE)
612 dnl Checks for typedefs
613 AC_CHECK_TYPE(int8_t,signed char)
614 AC_CHECK_TYPE(uint8_t,unsigned char)
615 AC_CHECK_TYPE(int16_t,signed short)
616 AC_CHECK_TYPE(uint16_t,unsigned short)
617 AC_CHECK_TYPE(int32_t,signed long)
618 AC_CHECK_TYPE(uint32_t,unsigned long)
619 AC_CHECK_TYPE(int64_t,signed long long)
620 AC_CHECK_TYPE(uint64_t,unsigned long long)
622 if test $ac_cv_type_int8_t = no; then
627 AC_SUBST(HAVE_INT8_T)
629 if test $ac_cv_type_uint8_t = no; then
634 AC_SUBST(HAVE_UINT8_T)
636 if test $ac_cv_type_int16_t = no; then
641 AC_SUBST(HAVE_INT16_T)
643 if test $ac_cv_type_uint16_t = no; then
648 AC_SUBST(HAVE_UINT16_T)
650 if test $ac_cv_type_int32_t = no; then
655 AC_SUBST(HAVE_INT32_T)
657 if test $ac_cv_type_uint32_t = no; then
662 AC_SUBST(HAVE_UINT32_T)
664 if test $ac_cv_type_int64_t = no; then
669 AC_SUBST(HAVE_INT64_T)
671 if test $ac_cv_type_uint64_t = no; then
676 AC_SUBST(HAVE_UINT64_T)
678 dnl Do various wchar_t related checks
679 AC_CHECK_HEADER(wchar.h)
680 if test "$ac_cv_header_wchar_h" = no
685 AC_DEFINE(HAVE_WCHAR_H)
687 dnl Some broken systems have wchar.h but not some of its functions...
688 AC_SEARCH_LIBS(wcscpy, wcs w)
689 if test "$ac_cv_search_wcscpy" != no; then
695 AC_SUBST(U_HAVE_WCHAR_H)
696 AC_SUBST(U_HAVE_WCSCPY)
698 ac_default_sizeof_wchar_t=4
699 AC_DO_CHECK_SIZEOF(wchar_t,$ac_default_sizeof_wchar_t,[
707 dnl We could set ac_cv_sizeof_wchar_t to the default if the check returned
708 dnl 0 (unknown) but we'd rather do it in the headers, so we know we had no
709 dnl clue at configure time.
710 U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
711 if test $U_SIZEOF_WCHAR_T = 0; then
712 if test $U_HAVE_WCHAR_H=1; then
713 AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
716 AC_SUBST(U_SIZEOF_WCHAR_T)
724 dnl Enable/disable extras
725 AC_ARG_ENABLE(extras,
726 [ --enable-extras build ICU extras [default=yes]],
727 [case "${enableval}" in
730 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
733 ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
734 AC_ARG_ENABLE(extras,
735 [ --enable-icuio build ICU's icuio library [default=yes]],
736 [case "${enableval}" in
739 *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
742 ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
744 dnl Enable/disable layout
745 AC_ARG_ENABLE(layout,
746 [ --enable-layout build ICU's layout library [default=yes]],
747 [case "${enableval}" in
750 *) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;;
753 ICU_CONDITIONAL(LAYOUT, test "$layout" = true)
755 AC_ARG_WITH(data-packaging,
756 [ --with-data-packaging=type specify how to package ICU data (files, archive, library, auto) [default=auto]],
757 [case "${withval}" in
758 files|archive|library) datapackaging=$withval ;;
759 auto) datapackaging=$withval ;;
760 common) datapackaging=archive ;;
761 dll) datapackaging=library ;;
762 static) datapackaging=static ;;
763 *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
767 dnl Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
768 thesysconfdir=`eval echo $sysconfdir`
769 AC_SUBST(thesysconfdir)
770 thedatadir=`eval echo $datadir`
772 thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
774 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}.
775 pkgicudatadir=$datadir
776 thepkgicudatadir=$thedatadir
777 AC_SUBST(pkgicudatadir)
778 AC_SUBST(thepkgicudatadir)
780 dnl Shouldn't need the AC_SUBST
781 dnl Deprecated support for --enable-mapped
783 AC_ARG_ENABLE(mapped,,
784 [case "${enableval}" in
785 yes) mapped=archive ;;
786 no) mapped=library ;;
787 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mapped; use --with-data-packaging now) ;;
791 if test x"$mapped" != x; then
794 AC_MSG_WARN(use --with-data-packaging=archive instead of --enable-mapped)
797 AC_MSG_WARN(use --with-data-packaging=library instead of --disable-mapped)
800 if test x"$datapackaging" != x -a x"$mapped" != x"$datapackaging"; then
801 AC_MSG_ERROR(conflicting values used for --with-data-packaging and deprecated --enable-mapped)
803 datapackaging=$mapped
806 if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
807 datapackaging=library
810 case "$datapackaging" in
812 DATA_PACKAGING_CPPFLAGS=-DUDATA_FILES
813 DATA_PACKAGING_MODE=files
816 DATA_PACKAGING_CPPFLAGS=-DUDATA_MAP
817 DATA_PACKAGING_MODE=common
820 DATA_PACKAGING_CPPFLAGS=-DUDATA_DLL
821 DATA_PACKAGING_MODE=dll
824 AC_SUBST(DATA_PACKAGING_CPPFLAGS)
825 AC_SUBST(DATA_PACKAGING_MODE)
827 dnl Sets a library suffix
828 AC_MSG_CHECKING([for a library suffix to use])
829 AC_ARG_WITH(library-suffix,
830 [ --with-library-suffix=suffix tag a suffix to the library names [default=]],
831 [ICULIBSUFFIX="${withval}"],
834 if test "$msg" = ""; then
838 AC_SUBST(ICULIBSUFFIX)
839 changequote(<<, >>)dnl
840 if test "$ICULIBSUFFIX" != ""
843 ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
848 AC_SUBST(U_HAVE_LIB_SUFFIX)
849 AC_SUBST(ICULIBSUFFIXCNAME)
851 dnl Enable/disable tests
853 [ --enable-tests build ICU tests [default=yes]],
854 [case "${enableval}" in
857 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
860 ICU_CONDITIONAL(TESTS, test "$tests" = true)
862 dnl Enable/disable samples
863 AC_ARG_ENABLE(samples,
864 [ --enable-samples build ICU samples [default=yes]
865 Additionally, the variable FORCE_LIBS may be set before calling configure. If set, it will REPLACE any automatic list of libraries.],
866 [case "${enableval}" in
869 *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
872 ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
874 ICUDATA_CHAR=$U_ENDIAN_CHAR
876 dnl Platform-specific Makefile setup
877 dnl set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
879 *-*-solaris*) platform=U_SOLARIS ;;
880 *-*-linux*) platform=U_LINUX ;;
881 *-*-*bsd*) platform=U_BSD ;;
882 *-*-aix*) platform=U_AIX ;;
883 *-*-hpux*) platform=U_HPUX ;;
884 *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
885 *-*-cygwin*|*-*-mingw*) platform=U_CYGWIN ;;
886 *-*ibm-openedition*|*-*-os390*) platform=OS390
888 *-*-os400*) platform=OS400
890 *-*-nto*) platform=U_QNX ;;
891 *-dec-osf*) platform=U_OSF ;;
892 *-*-beos) platform=U_BEOS ;;
893 *-*-irix*) platform=U_IRIX ;;
894 *-ncr-*) platform=U_MPRAS ;;
895 *-sequent-*) platform=PTX ;;
896 *) platform=U_UNKNOWN_PLATFORM ;;
898 AC_SUBST(ICUDATA_CHAR)
900 platform_make_fragment_name="$icu_cv_host_frag"
901 platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
902 AC_SUBST(platform_make_fragment_name)
903 AC_SUBST(platform_make_fragment)
905 dnl Handle -rpath options for shared library paths
907 *-*-solaris*) ld_rpath_suf=":" ;;
908 *-*-linux*) ld_rpath_suf=" " ;;
909 *-*-*bsd*) ld_rpath_suf=" " ;;
910 *-*-aix*) ld_rpath_suf="" ;;
911 *-*-hpux*) ld_rpath_suf=":" ;;
912 *-*ibm-openedition*|*-*-os390*) ld_rpath_suf="" ;;
913 *-*-os400*) ld_rpath_suf=" " ;;
914 *-sequent-*) ld_rpath_suf="" ;;
915 *-*-irix*) ld_rpath_suf=" " ;;
916 *) ld_rpath_suf="" ;;
918 AC_SUBST(ld_rpath_suf)
920 dnl On HP/UX, main() functions compiled in C don't invoke
921 dnl static constructors in C++ libs. Hack around that here
922 dnl by renaming some .c files to .cpp
925 if test "${icu_cv_host_frag}" = "mh-hpux-cc"; then
926 for file in samples/date/date \
927 samples/cal/cal test/cintltst/cintltst \
928 tools/makeconv/makeconv tools/genrb/genrb \
929 tools/genrb/derb tools/genccode/genccode \
930 tools/gencmn/gencmn tools/gencmn/decmn \
931 tools/gencnval/gencnval tools/gennorm/gennorm \
932 tools/gennames/gennames tools/gentest/gentest \
933 tools/pkgdata/pkgdata tools/genprops/genprops \
934 tools/gencase/gencase \
935 tools/gensprep/gensprep
937 if test -f $file.c; then
940 echo "# $file.c does not exist or is already renamed [warning]"
947 if test "${FORCE_LIBS}" != ""; then
948 echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
953 if test "${AIX_SHLIB}" != ""; then
954 echo " *** setting AIX_SHLIB (AIX only) to ${AIX_SHLIB}]" 1>&6
956 AIX_SHLIB=makeC++SharedLib_r
962 dnl Now that we're done using CPPFLAGS etc. for tests, we can change it
965 if test $ICU_USE_THREADS -ne 0
967 CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
968 CFLAGS="$CFLAGS \$(THREADSCFLAGS)"
969 CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)"
972 dnl output the Makefiles
973 AC_OUTPUT([icudefs.mk \
976 config/Makefile.inc \
985 extra/uconv/Makefile extra/scrptrun/Makefile \
986 tools/Makefile tools/ctestfw/Makefile \
987 tools/makeconv/Makefile \
988 tools/genrb/Makefile \
989 tools/genuca/Makefile \
990 tools/genccode/Makefile \
991 tools/gencmn/Makefile \
992 tools/gencnval/Makefile \
993 tools/gennames/Makefile \
994 tools/gentest/Makefile \
995 tools/gennorm/Makefile \
996 tools/genprops/Makefile \
997 tools/gencase/Makefile \
998 tools/genpname/Makefile \
999 tools/genbrk/Makefile \
1000 tools/gensprep/Makefile \
1001 tools/icuswap/Makefile \
1002 tools/pkgdata/Makefile \
1003 tools/toolutil/Makefile \
1004 tools/dumpce/Makefile \
1006 test/testdata/Makefile \
1007 test/testdata/pkgdata.inc \
1008 test/hdrtst/Makefile \
1009 test/intltest/Makefile \
1010 test/cintltst/Makefile \
1011 test/iotest/Makefile \
1012 test/thaitest/Makefile \
1013 test/testmap/Makefile \
1014 test/letest/Makefile \
1015 test/threadtest/Makefile \
1016 samples/Makefile samples/date/Makefile \
1017 samples/cal/Makefile samples/layout/Makefile \
1018 common/unicode/platform.h])
1020 if test $ICU_USE_THREADS = 0; then
1021 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
1024 echo "You must use $U_MAKE to build ICU."