]> git.saurik.com Git - apple/icu.git/blame - icuSources/configure.in
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / configure.in
CommitLineData
b75a7d8f
A
1dnl -*-m4-*-
2dnl configure.in for ICU
3dnl Copyright (c) 1999-2003, International Business Machines Corporation and
4dnl others. All Rights Reserved.
5dnl Stephen F. Booth, heavily modified by Yves and others
6
7dnl $Id: configure.in,v 1.1.1.2 2003/07/03 18:13:30 avery Exp $
8
9dnl Process this file with autoconf to produce a configure script
10AC_INIT(common/unicode/utypes.h)
11
12AC_CONFIG_HEADER(common/icucfg.h)
13PACKAGE="icu"
14AC_SUBST(PACKAGE)
15
16AC_MSG_CHECKING(for ICU version numbers)
17
18dnl Get the ICU version from uversion.h or other headers
19geticuversion() {
20 [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
21}
22VERSION=`geticuversion $srcdir/common/unicode/uversion.h`
23if test x"$VERSION" = x; then
24 VERSION=`geticuversion $srcdir/common/unicode/*.h`
25 if test x"$VERSION" = x; then
26 AC_MSG_ERROR([Cannot determine ICU version number from header files])
27 fi
28fi
29dnl Compute a reasonable library version from the release version. This is
30dnl very bad, but that's wanted... We want to make sure that the LIB_VERSION
31dnl has at least a dot in it, so we'll add a .0 if needed.
32[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
33LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
34AC_SUBST(VERSION)
35AC_SUBST(LIB_VERSION)
36AC_SUBST(LIB_VERSION_MAJOR)
37AC_MSG_RESULT([release $VERSION, library $LIB_VERSION])
38
39UNICODE_VERSION="4"
40AC_SUBST(UNICODE_VERSION)
41
42AC_SUBST(CPPFLAGS)
43
44dnl Checks for programs
45AC_PROG_CC
46AC_PROG_CXX
47AC_PROG_INSTALL
48
49# make sure install is relative to srcdir - if a script
50if test "$srcdir" = "."; then
51 # If srcdir isn't just ., then (srcdir) is already prepended.
52 if test "${ac_install_sh}" = "${INSTALL}"; then
53 INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
54 fi
55fi
56
57AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
58AC_CHECK_PROG(STRIP, strip, strip, true)
59
60dnl Check for the platform make
61AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
62AC_SUBST(U_MAKE)
63
64dnl Check for doxygen to generate documentation
65AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
66
67dnl Determine the host system and Makefile fragment
68AC_CANONICAL_HOST
69AC_EXEEXT
70
71dnl Determine how strict we want to be when compiling
72AC_CHECK_STRICT_COMPILE
73
74dnl Check if we can build and use 64-bit libraries
75AC_CHECK_64BIT_LIBS
76AC_SUBST(ARFLAGS)
77AC_SUBST(COMPILE_LINK_ENVVAR)
78
79ICU_CHECK_MH_FRAG
80
81hpuxcma=false
82
83dnl Checks for libraries and other host specific stuff
84dnl On HP/UX, don't link to -lm from a shared lib because it isn't
85dnl PIC (at least on 10.2)
86case "${host}" in
87 *-*-hpux10*) hpuxcma=true
88 AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
89 *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
90
91 *) AC_CHECK_LIB(m, floor)
92 LIB_M="" ;;
93esac
94AC_SUBST(LIB_M)
95
96dnl Enable/disable hpuxcma
97
98if test $hpuxcma = false; then
99 AC_ARG_ENABLE(hpuxcma,
100 [ --enable-hpuxcma build ICU with HPUX CMA threads (only ver>=11) [default=no]],
101 [case "${enableval}" in
102 yes) hpuxcma=true;;
103 no) hpuxcma=false;;
104 *) AC_MSG_ERROR(bad value ${enableval} for --enable-hpuxcma) ;;
105 esac],
106 )
107fi
108
109dnl Note, we set the conditional outside of IF for non hpux plats
110ICU_CONDITIONAL(HPUX_CMA, test "$hpuxcma" = true)
111
112dnl Should this be a nested CASE?
113if test $hpuxcma = true; then
114 case "${host}" in
115 *-*-hpux*) hpuxcma=true ;;
116 *) AC_MSG_ERROR(--enable-hpuxcma is not valid on this platform ${host}) ;;
117 esac
118fi
119
120dnl Check whether to build shared libraries
121AC_MSG_CHECKING([whether to build shared libraries])
122enabled=no
123AC_ARG_ENABLE(shared,
124 [ --enable-shared[=PKGS] build shared libraries [default=yes]],
125 [ case "${enableval}" in
126 yes|"") enabled=yes; ENABLE_SHARED=YES ;;
127 no);;
128 *) ;;
129 esac],
130 [enabled=yes; ENABLE_SHARED=YES]
131)
132AC_MSG_RESULT($enabled)
133AC_SUBST(ENABLE_SHARED)
134
135dnl Check whether to build static libraries
136AC_MSG_CHECKING([whether to build static libraries])
137enabled=no
138AC_ARG_ENABLE(static,
139 [ --enable-static[=PKGS] build static libraries [default=no]],
140 [ case "${enableval}" in
141 yes|"") enabled=yes; ENABLE_STATIC=YES ;;
142 no) ;;
143 *) ;;
144 esac],
145)
146AC_MSG_RESULT($enabled)
147AC_SUBST(ENABLE_STATIC)
148
149AC_PROG_RANLIB
150AC_PATH_PROG(AR,ar,[echo archiver ar not found re-run configure ; false],$PATH:/bin:/usr/bin:/usr/ccs/bin)
151
152AC_MSG_CHECKING([whether to enable renaming of symbols])
153enabled=yes
154U_DISABLE_RENAMING=0
155AC_ARG_ENABLE(renaming,
156 [ --enable-renaming add a version suffix to symbols [default=yes]],
157 [ case "${enableval}" in
158 yes|"") enabled=yes ;;
159 no) enabled=no; U_DISABLE_RENAMING=1 ;;
160 *) ;;
161 esac],
162)
163AC_MSG_RESULT($enabled)
164AC_SUBST(U_DISABLE_RENAMING)
165
166dnl Check whether to use the evil rpath or not
167AC_ARG_ENABLE(rpath,
168 [ --enable-rpath use rpath when linking [default is only if necessary]],
169 [ case "${enableval}" in
170 yes|"") ENABLE_RPATH=YES ;;
171 no) ;;
172 *) ;;
173 esac],
174 [ENABLE_RPATH=NO]
175)
176AC_SUBST(ENABLE_RPATH)
177
178
179dnl set up U_INLINE.
180dnl Copy the definition of AC_C_INLINE, with slight mods.
181dnl
182AC_CACHE_CHECK([for definition of U_INLINE for C], ac_cv_c_inline,
183[ac_cv_c_inline=no
184for ac_kw in inline __inline__ __inline; do
185 AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_c_inline=$ac_kw; break])
186 done
187 ])
188case "$ac_cv_c_inline" in
189 yes) U_INLINE= "inline" ;;
190 no ) U_INLINE= ;;
191 *) U_INLINE=$ac_cv_c_inline ;;
192esac
193AC_SUBST(U_INLINE)
194
195threads=true
196
197dnl Enable/disable threads
198AC_ARG_ENABLE(threads,
199 [ --enable-threads build ICU with threads [default=yes]],
200 [case "${enableval}" in
201 yes) threads=true ;;
202 no) threads=false ;;
203 *) AC_MSG_ERROR(bad value ${enableval} for --enable-threads) ;;
204 esac],
205 threads=true)
206ICU_CONDITIONAL(THREADS, test "$threads" = true)
207
208ICU_USE_THREADS=0
209
210if test $threads = true; then
211 dnl Test for HPUX cma threads first..
212 if test $hpuxcma = true; then
213 dnl HPUX cma case
214 AC_CHECK_LIB(cma, pthread_create)
215 if test $ac_cv_lib_cma_pthread_create = yes; then
216 ICU_USE_THREADS=1
217 fi
218 else
219 dnl For Compaq Tru64 (OSF1), we must look for pthread_attr_init
220 dnl and must do this before seaching for pthread_mutex_destroy, or
221 dnl we will pick up libpthreads.so not libpthread.so
222 dnl If this fails, then we must test for HPUX specials, before
223 dnl moving on to a more generic test
224
225 AC_CHECK_LIB(pthread, pthread_attr_init)
226 if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
227 ICU_USE_THREADS=1
228 else
229 dnl Locate the right library for POSIX threads. We look for the
230 dnl symbols in the libraries first, because on Solaris libc provides
231 dnl pthread_create but libpthread has the real code :(
232 dnl AIX uses libpthreads instead of libpthread, and HP/UX uses libcma
233 dnl (but that was checked above).
234 dnl FreeBSD users may need libpthread if they do not have libc_r.
235
236 AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r cma)
237
238 if test "$ac_cv_search_pthread_mutex_destroy" != no; then
239 ICU_USE_THREADS=1
240 else
241 dnl For HP 11
242 AC_CHECK_LIB(pthread, pthread_mutex_init)
243 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
244 ICU_USE_THREADS=1
245 fi
246 fi
247
248 AC_CHECK_FUNC(pthread_mutex_lock)
249
250 if test $ac_cv_func_pthread_mutex_lock = yes; then
251 ICU_USE_THREADS=1
252 fi
253 fi
254 fi
255fi
256
257AC_SUBST(ICU_USE_THREADS)
258
259dnl Check for mmap()
260
261# The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
262# Do this check instead.
263HAVE_MMAP=0
264AC_MSG_CHECKING([for mmap])
265AC_CACHE_VAL(ac_cv_func_mmap_ok,
266 [AC_TRY_LINK(
267 changequote(<<, >>)dnl
268 <<
269#include <unistd.h>
270#include <sys/mman.h>
271#include <sys/stat.h>
272#include <fcntl.h>
273 >>,
274 changequote([, ])dnl
275 [mmap((void *)0, 0, PROT_READ, 0, 0, 0);],
276 ac_cv_func_mmap_ok=yes,
277 ac_cv_func_mmap_ok=no)] )
278AC_MSG_RESULT($ac_cv_func_mmap_ok)
279if test $ac_cv_func_mmap_ok = yes
280then
281 HAVE_MMAP=1
282fi
283AC_SUBST(HAVE_MMAP)
284
285dnl Checks for header files
286AC_CHECK_HEADERS(inttypes.h)
287if test $ac_cv_header_inttypes_h = no; then
288 U_HAVE_INTTYPES_H=0
289else
290 U_HAVE_INTTYPES_H=1
291fi
292if test "$CC" = ccc; then
293 AC_MSG_RESULT("C compiler set to CCC ${CC}" )
294 case "${host}" in
295 alpha*-*-*) U_HAVE_INTTYPES_H=0;
296 esac
297fi
298
299AC_SUBST(U_HAVE_INTTYPES_H)
300
301AC_ARG_WITH(iostream,
302 [ --with-iostream=version specify the version of iostream to use (none, old, std, auto) [default=auto]],
303 [case "${withval}" in
304 none) streams=none ;;
305 old) streams=198506 ;;
306 std) streams=199711 ;;
307 auto) streams= ;;
308 *) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
309 esac],
310 [streams=])
311
312U_IOSTREAM_SOURCE=0
313if test x$streams != xnone
314then
315 AC_LANG_SAVE
316 AC_LANG_CPLUSPLUS
317 AC_MSG_CHECKING([iostream usability])
318 AC_TRY_COMPILE([#include <iostream>],[],
319 [ac_cv_header_iostream=yes],[ac_cv_header_iostream=no])
320 AC_MSG_RESULT($ac_cv_header_iostream)
321 if test $ac_cv_header_iostream = yes
322 then
323 U_IOSTREAM_SOURCE=199711
324 else
325 AC_CHECK_HEADER(iostream.h)
326 if test $ac_cv_header_iostream_h = yes; then
327 AC_MSG_CHECKING([whether ostream is really defined])
328 AC_CACHE_VAL(ac_cv_iostream_ok,
329 AC_TRY_LINK([#include <iostream.h>],[ostream &testout = cout; testout << "test" << endl;],ac_cv_iostream_ok=yes,ac_cv_iostream_ok=no))
330 AC_MSG_RESULT($ac_cv_iostream_ok)
331 if test $ac_cv_iostream_ok = yes
332 then
333 U_IOSTREAM_SOURCE=198506
334 fi
335 fi
336 fi
337 if test x$streams != x
338 then
339 if test $U_IOSTREAM_SOURCE -ge $streams
340 then
341 U_IOSTREAM_SOURCE=$streams
342 else
343 AC_MSG_ERROR(${withval} iostream is not available)
344 fi
345 fi
346fi
347AC_SUBST(U_IOSTREAM_SOURCE)
348AC_LANG_RESTORE
349
350dnl Check for endianness
351AC_C_BIGENDIAN()
352if test $ac_cv_c_bigendian = no; then
353U_IS_BIG_ENDIAN=0
354U_ENDIAN_CHAR="l"
355else
356U_IS_BIG_ENDIAN=1
357U_ENDIAN_CHAR="b"
358fi
359AC_SUBST(U_IS_BIG_ENDIAN)
360
361dnl Do various POSIX related checks
362U_HAVE_NL_LANGINFO_CODESET=0
363U_NL_LANGINFO_CODESET=-1
364AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
365AC_SUBST(U_HAVE_NL_LANGINFO)
366if test $U_HAVE_NL_LANGINFO -eq 1; then
367 AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
368 ac_cv_nl_langinfo_codeset,
369 [ac_cv_nl_langinfo_codeset="unknown"
370 for a in CODESET _NL_CTYPE_CODESET_NAME; do
371 AC_TRY_LINK([#include <langinfo.h>],[nl_langinfo($a);],[ac_cv_nl_langinfo_codeset="$a"; break])]
372 done)
373 if test x$ac_cv_nl_langinfo_codeset != xunknown
374 then
375 U_HAVE_NL_LANGINFO_CODESET=1
376 U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
377 fi
378fi
379AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
380AC_SUBST(U_NL_LANGINFO_CODESET)
381
382dnl Namespace support checks
383AC_LANG_CPLUSPLUS
384AC_MSG_CHECKING([for namespace support])
385AC_CACHE_VAL(ac_cv_namespace_ok,
386 [AC_TRY_LINK(
387 changequote(<<, >>)dnl
388 <<namespace x_version {void f(){}};
389 namespace x = x_version;
390 using namespace x_version;
391 >>,
392 changequote([, ])dnl
393 [f();], ac_cv_namespace_ok=yes, ac_cv_namespace_ok=no)] )
394AC_MSG_RESULT($ac_cv_namespace_ok)
395U_HAVE_NAMESPACE=1
396if test $ac_cv_namespace_ok = no
397then
398 U_HAVE_NAMESPACE=0
399fi
400AC_SUBST(U_HAVE_NAMESPACE)
401
402AC_MSG_CHECKING([for properly overriding new and delete])
403U_OVERRIDE_CXX_ALLOCATION=0
404U_HAVE_PLACEMENT_NEW=0
405AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
406 [AC_TRY_LINK(
407 changequote(<<, >>)dnl
408 <<#include <stdlib.h>
409 class UObject {
410 void *operator new(size_t size) {return malloc(size);}
411 void *operator new[](size_t size) {return malloc(size);}
412 void operator delete(void *p) {free(p);}
413 void operator delete[](void *p) {free(p);}
414 };
415 >>,
416 changequote([, ])dnl
417 [], ac_cv_override_cxx_allocation_ok=yes, ac_cv_override_cxx_allocation_ok=no)] )
418AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
419if test $ac_cv_override_cxx_allocation_ok = yes
420then
421 U_OVERRIDE_CXX_ALLOCATION=1
422 AC_MSG_CHECKING([for placement new and delete])
423 AC_CACHE_VAL(ac_cv_override_placement_new_ok,
424 [AC_TRY_LINK(
425 changequote(<<, >>)dnl
426 <<#include <stdlib.h>
427 class UObject {
428 void *operator new(size_t size) {return malloc(size);}
429 void *operator new[](size_t size) {return malloc(size);}
430 void operator delete(void *p) {free(p);}
431 void operator delete[](void *p) {free(p);}
432 void * operator new(size_t, void *ptr) { return ptr; }
433 void operator delete(void *, void *) {}
434 };
435 >>,
436 changequote([, ])dnl
437 [], ac_cv_override_placement_new_ok=yes, ac_cv_override_placement_new_ok=no)] )
438 AC_MSG_RESULT($ac_cv_override_placement_new_ok)
439 if test $ac_cv_override_placement_new_ok = yes
440 then
441 U_HAVE_PLACEMENT_NEW=1
442 fi
443fi
444AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
445AC_SUBST(U_HAVE_PLACEMENT_NEW)
446
447AC_LANG_C
448AC_CHECK_FUNC(popen)
449if test x$ac_cv_func_popen = xyes
450then
451 U_HAVE_POPEN=1
452else
453 U_HAVE_POPEN=0
454fi
455AC_SUBST(U_HAVE_POPEN)
456
457AC_CHECK_FUNC(tzset)
458if test x$ac_cv_func_tzset = xyes
459then
460 U_TZSET=tzset
461else
462 AC_CHECK_FUNC(_tzset)
463 if test x$ac_cv_func__tzset = xyes
464 then
465 U_TZSET=_tzset
466 fi
467fi
468AC_SUBST(U_TZSET)
469AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
470[AC_TRY_LINK(
471changequote(<<, >>)dnl
472<<#ifndef __USE_POSIX
473#define __USE_POSIX
474#endif
475#include <time.h>
476#ifndef tzname /* For SGI. */
477extern char *tzname[]; /* RS6000 and others reject char **tzname. */
478#endif>>,
479changequote([, ])dnl
480[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
481if test $ac_cv_var_tzname = yes; then
482 U_TZNAME=tzname
483else
484 AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
485 [AC_TRY_LINK(
486 changequote(<<, >>)dnl
487 <<#include <time.h>
488 extern char *_tzname[];
489 >>,
490 changequote([, ])dnl
491 [atoi(*_tzname);], ac_cv_var__tzname=yes, ac_cv_var__tzname=no)])
492 if test $ac_cv_var__tzname = yes; then
493 U_TZNAME=_tzname
494 fi
495fi
496AC_SUBST(U_TZNAME)
497
498AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
499[AC_TRY_LINK(
500changequote(<<, >>)dnl
501<<#ifndef __USE_POSIX
502#define __USE_POSIX
503#endif
504#ifndef __USE_XOPEN
505#define __USE_XOPEN
506#endif
507#include <time.h>
508>>,
509changequote([, ])dnl
510[timezone = 1;], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)])
511U_HAVE_TIMEZONE=0
512if test $ac_cv_var_timezone = yes; then
513 U_TIMEZONE=timezone
514 U_HAVE_TIMEZONE=1
515else
516 AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
517 [AC_TRY_LINK(
518 changequote(<<, >>)dnl
519 <<#include <time.h>
520 >>,
521 changequote([, ])dnl
522 [__timezone = 1;], ac_cv_var___timezone=yes, ac_cv_var___timezone=no)])
523 if test $ac_cv_var___timezone = yes; then
524 U_TIMEZONE=__timezone
525 U_HAVE_TIMEZONE=1
526 else
527 AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
528 [AC_TRY_LINK(
529 changequote(<<, >>)dnl
530 <<#include <time.h>
531 >>,
532 changequote([, ])dnl
533 [_timezone = 1;], ac_cv_var__timezone=yes, ac_cv_var__timezone=no)])
534 if test $ac_cv_var__timezone = yes; then
535 U_TIMEZONE=_timezone
536 U_HAVE_TIMEZONE=1
537 fi
538 fi
539fi
540AC_SUBST(U_HAVE_TIMEZONE)
541AC_SUBST(U_TIMEZONE)
542
543dnl Checks for typedefs
544AC_CHECK_TYPE(int8_t,signed char)
545AC_CHECK_TYPE(uint8_t,unsigned char)
546AC_CHECK_TYPE(int16_t,signed short)
547AC_CHECK_TYPE(uint16_t,unsigned short)
548AC_CHECK_TYPE(int32_t,signed long)
549AC_CHECK_TYPE(uint32_t,unsigned long)
550AC_CHECK_TYPE(int64_t,signed long long)
551AC_CHECK_TYPE(uint64_t,unsigned long long)
552
553if test $ac_cv_type_int8_t = no; then
554HAVE_INT8_T=0
555else
556HAVE_INT8_T=1
557fi
558AC_SUBST(HAVE_INT8_T)
559
560if test $ac_cv_type_uint8_t = no; then
561HAVE_UINT8_T=0
562else
563HAVE_UINT8_T=1
564fi
565AC_SUBST(HAVE_UINT8_T)
566
567if test $ac_cv_type_int16_t = no; then
568HAVE_INT16_T=0
569else
570HAVE_INT16_T=1
571fi
572AC_SUBST(HAVE_INT16_T)
573
574if test $ac_cv_type_uint16_t = no; then
575HAVE_UINT16_T=0
576else
577HAVE_UINT16_T=1
578fi
579AC_SUBST(HAVE_UINT16_T)
580
581if test $ac_cv_type_int32_t = no; then
582HAVE_INT32_T=0
583else
584HAVE_INT32_T=1
585fi
586AC_SUBST(HAVE_INT32_T)
587
588if test $ac_cv_type_uint32_t = no; then
589HAVE_UINT32_T=0
590else
591HAVE_UINT32_T=1
592fi
593AC_SUBST(HAVE_UINT32_T)
594
595if test $ac_cv_type_int64_t = no; then
596HAVE_INT64_T=0
597else
598HAVE_INT64_T=1
599fi
600AC_SUBST(HAVE_INT64_T)
601
602if test $ac_cv_type_uint64_t = no; then
603HAVE_UINT64_T=0
604else
605HAVE_UINT64_T=1
606fi
607AC_SUBST(HAVE_UINT64_T)
608
609dnl Do various wchar_t related checks
610AC_CHECK_HEADER(wchar.h)
611if test "$ac_cv_header_wchar_h" = no
612then
613 U_HAVE_WCHAR_H=0
614 U_HAVE_WCSCPY=0
615else
616 AC_DEFINE(HAVE_WCHAR_H)
617 U_HAVE_WCHAR_H=1
618 dnl Some broken systems have wchar.h but not some of its functions...
619 AC_SEARCH_LIBS(wcscpy, wcs w)
620 if test "$ac_cv_search_wcscpy" != no; then
621 U_HAVE_WCSCPY=1
622 else
623 U_HAVE_WCSCPY=0
624 fi
625fi
626AC_SUBST(U_HAVE_WCHAR_H)
627AC_SUBST(U_HAVE_WCSCPY)
628
629ac_default_sizeof_wchar_t=4
630AC_DO_CHECK_SIZEOF(wchar_t,$ac_default_sizeof_wchar_t,[
631#if STDC_HEADERS
632#include <stddef.h>
633#endif
634#if HAVE_WCHAR_H
635#include <string.h>
636#include <wchar.h>
637#endif])
638dnl We could set ac_cv_sizeof_wchar_t to the default if the check returned
639dnl 0 (unknown) but we'd rather do it in the headers, so we know we had no
640dnl clue at configure time.
641U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
642if test $U_SIZEOF_WCHAR_T = 0; then
643 if test $U_HAVE_WCHAR_H=1; then
644 AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
645 fi
646fi
647AC_SUBST(U_SIZEOF_WCHAR_T)
648
649dnl Echo
650ECHO_N=$ac_n
651ECHO_C=$ac_c
652AC_SUBST(ECHO_N)
653AC_SUBST(ECHO_C)
654
655dnl Enable/disable extras
656AC_ARG_ENABLE(extras,
657 [ --enable-extras build ICU extras [default=yes]],
658 [case "${enableval}" in
659 yes) extras=true ;;
660 no) extras=false ;;
661 *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
662 esac],
663 extras=true)
664ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
665AC_ARG_ENABLE(extras,
666 [ --enable-ustdio build ICU's ustdio library [default=yes]],
667 [case "${enableval}" in
668 yes) ustdio=true ;;
669 no) ustdio=false ;;
670 *) AC_MSG_ERROR(bad value ${enableval} for --enable-ustdio) ;;
671 esac],
672 ustdio=true)
673ICU_CONDITIONAL(USTDIO, test "$ustdio" = true)
674
675dnl Enable/disable layout
676AC_ARG_ENABLE(layout,
677 [ --enable-layout build ICU's layout library [default=yes]],
678 [case "${enableval}" in
679 yes) layout=true ;;
680 no) layout=false ;;
681 *) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;;
682 esac],
683 layout=true)
684ICU_CONDITIONAL(LAYOUT, test "$layout" = true)
685
686AC_ARG_WITH(data-packaging,
687 [ --with-data-packaging=type specify how to package ICU data (files, archive, library, auto) [default=auto]],
688 [case "${withval}" in
689 files|archive|library) datapackaging=$withval ;;
690 auto) datapackaging=$withval ;;
691 common) datapackaging=archive ;;
692 dll) datapackaging=library ;;
693 *) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
694 esac],
695 [datapackaging=])
696
697thesysconfdir=`eval echo $sysconfdir`
698AC_SUBST(thesysconfdir)
699thedatadir=`eval echo $datadir`
700AC_SUBST(thedatadir)
701thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
702AC_SUBST(thelibdir)
703case $datapackaging in
704 common)
705 pkgicudatadir=$datadir
706 thepkgicudatadir=$thedatadir
707 ;;
708 *)
709 pkgicudatadir=$libdir
710 thepkgicudatadir=$thelibdir
711 ;;
712esac
713AC_SUBST(pkgicudatadir)
714AC_SUBST(thepkgicudatadir)
715
716dnl Shouldn't need the AC_SUBST
717dnl Deprecated support for --enable-mapped
718
719AC_ARG_ENABLE(mapped,,
720 [case "${enableval}" in
721 yes) mapped=archive ;;
722 no) mapped=library ;;
723 *) AC_MSG_ERROR(bad value ${enableval} for --enable-mapped; use --with-data-packaging now) ;;
724 esac],
725 [mapped=])
726
727if test x"$mapped" != x; then
728 case $mapped in
729 archive)
730 AC_MSG_WARN(use --with-data-packaging=archive instead of --enable-mapped)
731 ;;
732 library)
733 AC_MSG_WARN(use --with-data-packaging=library instead of --disable-mapped)
734 ;;
735 esac
736 if test x"$datapackaging" != x -a x"$mapped" != x"$datapackaging"; then
737 AC_MSG_ERROR(conflicting values used for --with-data-packaging and deprecated --enable-mapped)
738 fi
739 datapackaging=$mapped
740fi
741
742if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
743 datapackaging=library
744fi
745
746case "$datapackaging" in
747 files)
748 DATA_PACKAGING_CPPFLAGS=-DUDATA_FILES
749 DATA_PACKAGING_MODE=files
750 ;;
751 archive)
752 DATA_PACKAGING_CPPFLAGS=-DUDATA_MAP
753 DATA_PACKAGING_MODE=common
754 ;;
755 library)
756 DATA_PACKAGING_CPPFLAGS=-DUDATA_DLL
757 DATA_PACKAGING_MODE=dll
758 ;;
759esac
760AC_SUBST(DATA_PACKAGING_CPPFLAGS)
761AC_SUBST(DATA_PACKAGING_MODE)
762
763dnl Sets a library suffix
764AC_MSG_CHECKING([for a library suffix to use])
765AC_ARG_WITH(library-suffix,
766 [ --with-library-suffix=suffix tag a suffix to the library names [default=]],
767 [ICULIBSUFFIX="${withval}"],
768 [ICULIBSUFFIX=])
769msg=$ICULIBSUFFIX
770if test "$msg" = ""; then
771 msg=none
772fi
773AC_MSG_RESULT($msg)
774AC_SUBST(ICULIBSUFFIX)
775changequote(<<, >>)dnl
776if test "$ICULIBSUFFIX" != ""
777then
778 U_HAVE_LIB_SUFFIX=1
779 ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
780else
781 U_HAVE_LIB_SUFFIX=0
782fi
783changequote([, ])dnl
784AC_SUBST(U_HAVE_LIB_SUFFIX)
785AC_SUBST(ICULIBSUFFIXCNAME)
786
787dnl Enable/disable tests
788AC_ARG_ENABLE(tests,
789 [ --enable-tests build ICU tests [default=yes]],
790 [case "${enableval}" in
791 yes) tests=true ;;
792 no) tests=false ;;
793 *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
794 esac],
795 tests=true)
796ICU_CONDITIONAL(TESTS, test "$tests" = true)
797
798dnl Enable/disable samples
799AC_ARG_ENABLE(samples,
800 [ --enable-samples build ICU samples [default=yes]
801Additionally, the variable FORCE_LIBS may be set before calling configure. If set, it will REPLACE any automatic list of libraries.],
802 [case "${enableval}" in
803 yes) samples=true ;;
804 no) samples=false ;;
805 *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
806 esac],
807 samples=true)
808ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
809
810ICUDATA_CHAR=$U_ENDIAN_CHAR
811
812dnl Platform-specific Makefile setup
813dnl set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
814case "${host}" in
815 *-*-solaris*) platform=U_SOLARIS ;;
816 *-*-linux*) platform=U_LINUX ;;
817 *-*-*bsd*) platform=U_BSD ;;
818 *-*-aix*) platform=AIX ;;
819 *-*-hpux*) platform=HPUX ;;
820 *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
821 *-*-cygwin*|*-*-mingw*) platform=U_CYGWIN ;;
822 *-*ibm-openedition*|*-*-os390*) platform=OS390
823 ICUDATA_CHAR="e" ;;
824 *-*-os400*) platform=OS400
825 ICUDATA_CHAR="e" ;;
826 *-*-nto*) platform=U_QNX ;;
827 *-dec-osf*) platform=U_OSF ;;
828 *-*-irix*) platform=IRIX ;;
829 *-sequent-*) platform=PTX ;;
830 *) platform=U_UNKNOWN_PLATFORM ;;
831esac
832AC_SUBST(ICUDATA_CHAR)
833AC_SUBST(platform)
834platform_make_fragment_name="$icu_cv_host_frag"
835platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
836AC_SUBST(platform_make_fragment_name)
837AC_SUBST(platform_make_fragment)
838
839dnl Handle -rpath options for shared library paths
840case "${host}" in
841 *-*-solaris*) ld_rpath_suf=":" ;;
842 *-*-linux*) ld_rpath_suf=" " ;;
843 *-*-*bsd*) ld_rpath_suf=" " ;;
844 *-*-aix*) ld_rpath_suf="" ;;
845 *-*-hpux*) ld_rpath_suf=":" ;;
846 *-*ibm-openedition*|*-*-os390*) ld_rpath_suf="" ;;
847 *-*-os400*) ld_rpath_suf=" " ;;
848 *-sequent-*) ld_rpath_suf="" ;;
849 *-*-irix*) ld_rpath_suf=" " ;;
850 *) ld_rpath_suf="" ;;
851esac
852AC_SUBST(ld_rpath_suf)
853
854dnl On HP/UX, main() functions compiled in C don't invoke
855dnl static constructors in C++ libs. Hack around that here
856dnl by renaming some .c files to .cpp
857case "${host}" in
858 *-*-hpux*)
859 if test "$ac_cv_prog_gcc" != yes; then
860 for file in samples/date/date \
861 samples/cal/cal test/cintltst/cintltst \
862 tools/makeconv/makeconv tools/genrb/genrb \
863 tools/genrb/derb tools/genccode/genccode \
864 tools/gencmn/gencmn tools/gencmn/decmn \
865 tools/gencnval/gencnval tools/gennorm/gennorm \
866 tools/gennames/gennames tools/gentest/gentest \
867 tools/pkgdata/pkgdata tools/genprops/genprops \
868 tools/genidna/genidna
869 do
870 if test -f $file.c; then
871 mv $file.c $file.cpp
872 else
873 echo "# $file.c does not exist or is already renamed [warning]"
874 fi
875 done
876 fi
877 ;;
878esac
879
880if test "${FORCE_LIBS}" != ""; then
881 echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
882 LIBS=${FORCE_LIBS}
883fi
884
885
886if test "${AIX_SHLIB}" != ""; then
887 echo " *** setting AIX_SHLIB (AIX only) to ${AIX_SHLIB}]" 1>&6
888else
889 AIX_SHLIB=makeC++SharedLib_r
890fi
891
892AC_SUBST(AIX_SHLIB)
893
894
895dnl SPECIAL handling for HPUX 10 and also '11 & --enable-hpuxcma=true'
896if test $hpuxcma = true; then
897 CPPFLAGS="${CPPFLAGS} -D_PTHREADS_DRAFT4 -DHPUX_CMA"
898fi
899dnl END special
900
901dnl Now that we're done using CPPFLAGS etc. for tests, we can change it
902dnl for build.
903
904if test $ICU_USE_THREADS -ne 0
905then
906 CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
907 CFLAGS="$CFLAGS \$(THREADSCFLAGS)"
908 CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)"
909fi
910
911if test "$ac_cv_lib_dld_shl_load" = "yes"; then
912 CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
913fi
914
915dnl added for s/390 DLL loading detection
916
917if test "$ac_cv_func_dllload" = "yes"; then
918 CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
919fi
920
921dnl output the Makefiles
922AC_OUTPUT([README icudefs.mk \
923 Makefile \
924 data/Makefile data/icupkg.inc \
925 common/Makefile config/Makefile.inc i18n/Makefile \
926 layout/Makefile \
927 layoutex/Makefile \
928 extra/Makefile extra/ustdio/Makefile \
929 extra/uconv/Makefile extra/scrptrun/Makefile
930 stubdata/Makefile \
931 tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \
932 tools/genrb/Makefile \
933 tools/genuca/Makefile \
934 tools/pkgdata/Makefile \
935 tools/genccode/Makefile tools/gencmn/Makefile \
936 tools/gencnval/Makefile tools/gentz/Makefile \
937 tools/gennames/Makefile tools/toolutil/Makefile \
938 tools/gentest/Makefile \
939 tools/gennorm/Makefile \
940 tools/genprops/Makefile \
941 tools/genpname/Makefile \
942 tools/genbrk/Makefile \
943 tools/genidna/Makefile \
944 tools/dumpce/Makefile \
945 test/Makefile test/testdata/Makefile \
946 test/intltest/Makefile \
947 test/cintltst/Makefile \
948 test/iotest/Makefile \
949 test/ieeetest/Makefile \
950 test/thaitest/Makefile \
951 test/testmap/Makefile \
952 test/letest/Makefile \
953 test/threadtest/Makefile \
954 samples/Makefile samples/date/Makefile \
955 samples/cal/Makefile samples/layout/Makefile \
956 common/unicode/platform.h])
957
958if test $ICU_USE_THREADS = 0; then
959 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
960fi
961
962echo "You must use $U_MAKE to build ICU."