1999-09-03 22:08:47 +00:00
dnl -*-m4-*-
1999-08-16 21:50:52 +00:00
dnl configure.in for ICU
2000-01-17 19:48:20 +00:00
dnl Copyright (c) 1999-2000, International Business Machines Corporation and
dnl others. All Rights Reserved.
2000-10-16 17:43:48 +00:00
dnl Stephen F. Booth, heavily modified by Yves and others
2001-06-06 23:32:41 +00:00
dnl $Id: configure.in,v 1.107 2001/06/06 23:32:41 yves Exp $
1999-08-16 21:50:52 +00:00
dnl Process this file with autoconf to produce a configure script
2000-02-16 22:38:38 +00:00
AC_INIT(common/unicode/utypes.h)
1999-12-09 23:11:48 +00:00
1999-08-16 21:50:52 +00:00
AC_CONFIG_HEADER(common/icucfg.h)
PACKAGE="icu"
AC_SUBST(PACKAGE)
2000-10-13 18:27:39 +00:00
AC_MSG_CHECKING(for ICU version numbers)
dnl Get the ICU version from utypes.h
changequote(<<, >>)dnl
VERSION=`sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' $srcdir/common/unicode/utypes.h`
2000-10-13 18:29:14 +00:00
dnl Compute a reasonable library version from the release version. This is
dnl very bad, but that's wanted... We want to make sure that the LIB_VERSION
dnl has at least a dot in it, so we'll add a .0 if needed.
LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`
LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
2000-10-13 18:27:39 +00:00
changequote([, ])dnl
2000-10-13 20:40:38 +00:00
AC_SUBST(VERSION)
2000-10-13 18:29:14 +00:00
AC_SUBST(LIB_VERSION)
AC_SUBST(LIB_VERSION_MAJOR)
AC_MSG_RESULT([release $VERSION, library $LIB_VERSION])
2000-10-13 18:27:39 +00:00
1999-11-23 04:49:35 +00:00
UNICODE_VERSION="3.0.0"
AC_SUBST(UNICODE_VERSION)
1999-08-16 21:50:52 +00:00
2000-10-02 16:34:03 +00:00
thedatadir=`eval echo $datadir`
AC_SUBST(thedatadir)
2000-10-25 22:26:17 +00:00
thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
AC_SUBST(thelibdir)
2000-10-02 16:34:03 +00:00
2000-01-06 20:14:26 +00:00
dnl Shouldn't need the AC_SUBST
CPPFLAGS="${CPPFLAGS} -I."
AC_SUBST(CPPFLAGS)
1999-08-16 21:50:52 +00:00
dnl Checks for programs
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
2000-11-09 23:03:25 +00:00
# make sure install is relative to srcdir - if a script
if test "$srcdir" = "."; then
# If srcdir isn't just ., then (srcdir) is already prepended.
if test "${ac_install_sh}" = "${INSTALL}"; then
INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
fi
fi
1999-08-16 21:50:52 +00:00
AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
1999-11-23 04:49:35 +00:00
AC_CHECK_PROG(STRIP, strip, strip, true)
1999-08-16 21:50:52 +00:00
2000-07-11 22:25:51 +00:00
dnl Check for the platform make
AC_PATH_PROGS(U_MAKE, gmake, make)
AC_SUBST(U_MAKE)
2000-04-10 21:54:53 +00:00
dnl Determine how strict we want to be when compiling
AC_CHECK_STRICT_COMPILE
1999-08-16 21:50:52 +00:00
dnl Determine the host system and Makefile fragment
AC_CANONICAL_HOST
2000-05-23 21:06:02 +00:00
2000-10-16 18:31:29 +00:00
SOL64=no
2000-05-23 21:06:02 +00:00
case "${host}" in
*-*-solaris*)
if test "$ac_cv_prog_gcc" = no; then
AC_MSG_CHECKING([if we have a 64-bit (sparcv9) compiler])
2000-08-01 00:39:55 +00:00
SOL64=`$CXX -xarch=v9 && $CC -xarch=v9 2>&1 |grep -v usage:`
2000-05-23 21:06:02 +00:00
if test -z "$SOL64"; then
AC_MSG_RESULT(yes)
SOL64=yes
else
AC_MSG_RESULT(no)
SOL64=no
fi
fi ;;
2001-05-25 18:00:38 +00:00
#alpha*-*-linux-gnu)
# CFLAGS="${CFLAGS} -mieee -O2"
# CXXFLAGS="${CXXFLAGS} -mieee -O2"
# ;;
2000-05-23 21:06:02 +00:00
esac
1999-08-16 21:50:52 +00:00
ICU_CHECK_MH_FRAG
2000-01-17 22:22:29 +00:00
hpuxcma=false
2000-05-23 21:06:02 +00:00
dnl Checks for libraries and other host specific stuff
1999-08-16 21:50:52 +00:00
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
2000-01-17 22:22:29 +00:00
*-*-hpux10*) hpuxcma=true
AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
1999-08-16 21:50:52 +00:00
*-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
2000-05-23 21:06:02 +00:00
1999-08-16 21:50:52 +00:00
*) AC_CHECK_LIB(m, floor)
LIB_M="" ;;
esac
AC_SUBST(LIB_M)
2000-01-17 22:22:29 +00:00
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
2000-09-22 22:58:36 +00:00
dnl Check whether to build shared libraries
2000-10-20 05:48:22 +00:00
AC_MSG_CHECKING([whether to build shared libraries])
enabled=no
2000-09-22 22:58:36 +00:00
AC_ARG_ENABLE(shared,
2001-03-16 18:54:36 +00:00
[ --enable-shared[=PKGS] build shared libraries [default=yes]],
2000-09-22 22:58:36 +00:00
[ case "${enableval}" in
2000-10-20 05:48:22 +00:00
yes|"") enabled=yes; ENABLE_SHARED=YES ;;
2000-09-22 22:58:36 +00:00
no) ;;
*) ;;
esac],
[ENABLE_SHARED=YES]
)
2000-10-20 05:48:22 +00:00
AC_MSG_RESULT($enabled)
2000-09-22 22:58:36 +00:00
AC_SUBST(ENABLE_SHARED)
dnl Check whether to build static libraries
2000-10-20 05:48:22 +00:00
AC_MSG_CHECKING([whether to build static libraries])
enabled=no
2000-09-22 22:58:36 +00:00
AC_ARG_ENABLE(static,
[ --enable-static[=PKGS] build static libraries [default=no]],
[ case "${enableval}" in
2000-10-20 05:48:22 +00:00
yes|"") enabled=yes; ENABLE_STATIC=YES ;;
2000-09-22 22:58:36 +00:00
no) ;;
*) ;;
esac],
)
2000-10-20 05:48:22 +00:00
AC_MSG_RESULT($enabled)
2000-09-22 22:58:36 +00:00
AC_SUBST(ENABLE_STATIC)
AC_PROG_RANLIB
2000-10-03 18:27:36 +00:00
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]],
[ case "${enableval}" in
yes|"") ENABLE_RPATH=YES ;;
no) ;;
*) ;;
esac],
[ENABLE_RPATH=NO]
)
AC_SUBST(ENABLE_RPATH)
1999-12-09 23:11:48 +00:00
threads=true
dnl Enable/disable threads
AC_ARG_ENABLE(threads,
[ --enable-threads build ICU with threads [default=yes]],
[case "${enableval}" in
yes) threads=true ;;
no) threads=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-threads) ;;
esac],
2000-09-15 23:32:52 +00:00
threads=true)
1999-12-09 23:11:48 +00:00
ICU_CONDITIONAL(THREADS, test "$threads" = true)
ICU_USE_THREADS=0
2000-01-17 22:22:29 +00:00
dnl Test for HPUX cma threads first..
if test $hpuxcma = true; then
dnl HPUX cma case
if test $threads = true; then
AC_CHECK_LIB(cma, pthread_create)
if test $ac_cv_lib_cma_pthread_create = yes; then
ICU_USE_THREADS=1
fi
fi
else
1999-12-09 23:47:30 +00:00
if test $threads = true; then
2000-01-17 22:22:29 +00:00
2000-10-18 20:35:21 +00:00
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.
2000-10-19 22:59:55 +00:00
AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r cma)
1999-12-09 23:11:48 +00:00
2000-10-19 22:59:55 +00:00
if test "$ac_cv_search_pthread_mutex_destroy" != no; then
1999-12-09 23:11:48 +00:00
ICU_USE_THREADS=1
2000-01-17 22:22:29 +00:00
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
1999-12-09 23:11:48 +00:00
fi
2000-01-17 22:22:29 +00:00
2000-01-20 21:31:01 +00:00
AC_CHECK_FUNC(pthread_mutex_lock)
if test $ac_cv_func_pthread_mutex_lock = yes; then
ICU_USE_THREADS=1
fi
1999-08-16 21:50:52 +00:00
fi
2000-01-17 22:22:29 +00:00
fi
1999-08-16 21:50:52 +00:00
1999-12-09 23:11:48 +00:00
AC_SUBST(ICU_USE_THREADS)
1999-12-04 02:31:40 +00:00
# check for dlopen()
HAVE_DLOPEN=0
#add more libs here..
2000-10-05 23:55:00 +00:00
AC_SEARCH_LIBS(dlopen, c dl)
1999-11-23 04:49:35 +00:00
2000-10-05 23:55:00 +00:00
if test "$ac_cv_search_dlopen" != no; then
1999-12-04 02:31:40 +00:00
HAVE_DLOPEN=1
fi
2000-01-19 07:23:50 +00:00
if test $HAVE_DLOPEN = 0; then
AC_CHECK_LIB(dld, shl_load)
if test $ac_cv_lib_dld_shl_load = yes; then
HAVE_DLOPEN=1
fi
fi
2000-03-20 23:29:45 +00:00
dnl added for s/390 DLL loading detection
2000-01-19 07:23:50 +00:00
2000-03-20 23:29:45 +00:00
if test $HAVE_DLOPEN = 0; then
AC_CHECK_FUNC(dllload)
if test $ac_cv_func_dllload = yes; then
HAVE_DLOPEN=1
fi
fi
1999-12-04 02:31:40 +00:00
AC_SUBST(HAVE_DLOPEN)
2000-09-22 19:02:20 +00:00
dnl Check for mmap()
AC_FUNC_MMAP
if test $ac_cv_func_mmap_fixed_mapped = yes; then
HAVE_MMAP=1
fi
AC_SUBST(HAVE_MMAP)
1999-08-16 21:50:52 +00:00
dnl Checks for header files
AC_CHECK_HEADERS(inttypes.h)
if test $ac_cv_header_inttypes_h = no; then
2000-06-30 21:35:03 +00:00
U_HAVE_INTTYPES_H=0
1999-08-16 21:50:52 +00:00
else
2000-06-30 21:35:03 +00:00
U_HAVE_INTTYPES_H=1
1999-08-16 21:50:52 +00:00
fi
2000-06-30 21:35:03 +00:00
AC_SUBST(U_HAVE_INTTYPES_H)
1999-08-16 21:50:52 +00:00
2000-09-11 21:20:51 +00:00
AC_ARG_WITH(iostream,
2000-09-22 19:02:20 +00:00
[ --with-iostream=version specify the version of iostream to use (old, std, auto) [default=auto]],
2000-09-11 21:20:51 +00:00
[case "${withval}" in
none) streams=none ;;
old) streams=198506 ;;
std) streams=199711 ;;
auto) streams= ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
esac],
[streams=])
if test x$streams != xnone
2000-04-25 21:18:35 +00:00
then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
2000-04-27 21:20:16 +00:00
U_IOSTREAM_SOURCE=0
2000-04-25 21:18:35 +00:00
AC_CHECK_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
fi
fi
2000-09-11 21:20:51 +00:00
if test x$streams != x
then
if test $U_IOSTREAM_SOURCE -ge $streams
then
U_IOSTREAM_SOURCE=$streams
else
AC_MSG_ERROR(${withval} iostream is not available)
fi
fi
2000-04-25 21:18:35 +00:00
fi
AC_SUBST(U_IOSTREAM_SOURCE)
AC_LANG_RESTORE
1999-10-09 01:19:08 +00:00
dnl Check for endianness
AC_C_BIGENDIAN(unknown)
if test $ac_cv_c_bigendian = no; then
U_IS_BIG_ENDIAN=0
2000-11-22 05:08:51 +00:00
U_ENDIAN_CHAR="l"
1999-10-09 01:19:08 +00:00
else
U_IS_BIG_ENDIAN=1
2000-11-22 05:08:51 +00:00
U_ENDIAN_CHAR="b"
1999-10-09 01:19:08 +00:00
fi
AC_SUBST(U_IS_BIG_ENDIAN)
2000-04-06 23:36:17 +00:00
dnl Do various wchar_t related checks
AC_CHECK_HEADER(wchar.h)
if test "$ac_cv_header_wchar_h" = no
then
U_HAVE_WCHAR_H=0
2000-10-05 19:33:35 +00:00
U_HAVE_WCSCPY=0
2000-04-06 23:36:17 +00:00
else
AC_DEFINE(HAVE_WCHAR_H)
U_HAVE_WCHAR_H=1
2000-10-05 19:33:35 +00:00
dnl Some broken systems have wchar.h but not some of its functions...
2000-10-09 18:04:44 +00:00
AC_SEARCH_LIBS(wcscpy, wcs)
if test "$ac_cv_search_wcscpy" != no; then
U_HAVE_WCSCPY=1
else
U_HAVE_WCSCPY=0
fi
2000-04-06 23:36:17 +00:00
fi
AC_SUBST(U_HAVE_WCHAR_H)
2000-10-05 19:33:35 +00:00
AC_SUBST(U_HAVE_WCSCPY)
dnl Do various POSIX related checks
2000-10-17 16:31:36 +00:00
U_HAVE_NL_LANGINFO_CODESET=0
U_NL_LANGINFO_CODESET=-1
2000-10-05 19:33:35 +00:00
AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
AC_SUBST(U_HAVE_NL_LANGINFO)
if test $U_HAVE_NL_LANGINFO -eq 1; then
2000-10-16 17:32:22 +00:00
AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
2000-10-16 17:26:31 +00:00
ac_cv_nl_langinfo_codeset,
2000-10-16 17:32:22 +00:00
[ac_cv_nl_langinfo_codeset="unknown"
2000-10-16 17:26:31 +00:00
for a in CODESET _NL_CTYPE_CODESET_NAME; do
AC_TRY_LINK([#include <langinfo.h>],[nl_langinfo($a);],[ac_cv_nl_langinfo_codeset="$a"; break])]
done)
2000-10-17 16:31:36 +00:00
if test x$ac_cv_nl_langinfo_codeset != xunknown
2000-10-05 19:33:35 +00:00
then
2000-10-16 17:26:31 +00:00
U_HAVE_NL_LANGINFO_CODESET=1
U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
2000-10-05 19:33:35 +00:00
fi
fi
2000-10-16 17:26:31 +00:00
AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
AC_SUBST(U_NL_LANGINFO_CODESET)
2000-10-05 23:41:59 +00:00
AC_CHECK_FUNC(tzset)
if test x$ac_cv_func_tzset = xyes
then
U_TZSET=tzset
else
AC_CHECK_FUNC(_tzset)
if test x$ac_cv_func__tzset = xyes
then
U_TZSET=_tzset
fi
fi
AC_SUBST(U_TZSET)
AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#ifndef __USE_POSIX
#define __USE_POSIX
#endif
#include <time.h>
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
#endif>>,
changequote([, ])dnl
[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
if test $ac_cv_var_tzname = yes; then
U_TZNAME=tzname
else
AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#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
fi
fi
AC_SUBST(U_TZNAME)
AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#ifndef __USE_POSIX
#define __USE_POSIX
#endif
#ifndef __USE_XOPEN
#define __USE_XOPEN
#endif
#include <time.h>
>>,
changequote([, ])dnl
[timezone = 1;], ac_cv_var_timezone=yes, ac_cv_var_timezone=no)])
if test $ac_cv_var_timezone = yes; then
U_TIMEZONE=timezone
else
2000-10-09 18:04:44 +00:00
AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
2000-10-05 23:41:59 +00:00
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <time.h>
>>,
changequote([, ])dnl
2000-10-09 18:04:44 +00:00
[__timezone = 1;], ac_cv_var___timezone=yes, ac_cv_var___timezone=no)])
if test $ac_cv_var___timezone = yes; then
U_TIMEZONE=__timezone
else
AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
[AC_TRY_LINK(
changequote(<<, >>)dnl
<<#include <time.h>
>>,
changequote([, ])dnl
[_timezone = 1;], ac_cv_var__timezone=yes, ac_cv_var__timezone=no)])
2000-10-05 23:41:59 +00:00
if test $ac_cv_var__timezone = yes; then
U_TIMEZONE=_timezone
fi
2000-10-09 18:04:44 +00:00
fi
2000-10-05 23:41:59 +00:00
fi
AC_SUBST(U_TIMEZONE)
2000-04-06 23:36:17 +00:00
ac_default_sizeof_wchar_t=4
AC_DO_CHECK_SIZEOF(wchar_t,$ac_default_sizeof_wchar_t,[
#if STDC_HEADERS
#include <stddef.h>
#endif
#if HAVE_WCHAR_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
AC_SUBST(U_SIZEOF_WCHAR_T)
1999-10-09 01:19:08 +00:00
1999-08-16 21:50:52 +00:00
dnl Checks for typedefs
AC_CHECK_TYPE(int8_t,signed char)
AC_CHECK_TYPE(uint8_t,unsigned char)
AC_CHECK_TYPE(int16_t,signed short)
AC_CHECK_TYPE(uint16_t,unsigned short)
AC_CHECK_TYPE(int32_t,signed long)
AC_CHECK_TYPE(uint32_t,unsigned long)
AC_CHECK_TYPE(bool_t,signed char)
if test $ac_cv_type_int8_t = no; then
HAVE_INT8_T=0
else
HAVE_INT8_T=1
fi
AC_SUBST(HAVE_INT8_T)
if test $ac_cv_type_uint8_t = no; then
HAVE_UINT8_T=0
else
HAVE_UINT8_T=1
fi
AC_SUBST(HAVE_UINT8_T)
if test $ac_cv_type_int16_t = no; then
HAVE_INT16_T=0
else
HAVE_INT16_T=1
fi
AC_SUBST(HAVE_INT16_T)
if test $ac_cv_type_uint16_t = no; then
HAVE_UINT16_T=0
else
HAVE_UINT16_T=1
fi
AC_SUBST(HAVE_UINT16_T)
if test $ac_cv_type_int32_t = no; then
HAVE_INT32_T=0
else
HAVE_INT32_T=1
fi
AC_SUBST(HAVE_INT32_T)
if test $ac_cv_type_uint32_t = no; then
HAVE_UINT32_T=0
else
HAVE_UINT32_T=1
fi
AC_SUBST(HAVE_UINT32_T)
if test $ac_cv_type_bool_t = no; then
HAVE_BOOL_T=0
else
HAVE_BOOL_T=1
fi
AC_SUBST(HAVE_BOOL_T)
2000-09-15 05:05:51 +00:00
dnl Echo
ECHO_N=$ac_n
ECHO_C=$ac_c
AC_SUBST(ECHO_N)
AC_SUBST(ECHO_C)
1999-08-16 21:50:52 +00:00
dnl Enable/disable extras
AC_ARG_ENABLE(extras,
[ --enable-extras build ICU extras [default=yes]],
[case "${enableval}" in
yes) extras=true ;;
no) extras=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
esac],
extras=true)
ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
2000-12-01 18:50:37 +00:00
dnl Enable/disable layout
AC_ARG_ENABLE(layout,
[ --enable-layout build ICU layout [default=no]],
[case "${enableval}" in
yes) layout=true ;;
no) layout=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;;
esac],
layout=false)
ICU_CONDITIONAL(LAYOUT, test "$layout" = true)
2000-09-22 19:02:20 +00:00
AC_ARG_WITH(data-packaging,
[ --with-data-packaging=type specify how to package ICU data (files, archive, library, auto) [default=auto]],
[case "${withval}" in
files|archive|library) datapackaging=$withval ;;
2000-09-22 19:21:38 +00:00
auto) datapackaging=$withval ;;
2000-09-22 19:02:20 +00:00
*) AC_MSG_ERROR(bad value ${withval} for --with-iostream) ;;
1999-11-23 04:49:35 +00:00
esac],
2000-09-22 19:02:20 +00:00
[datapackaging=])
1999-12-04 02:31:40 +00:00
2000-09-22 19:21:38 +00:00
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
2000-09-22 19:23:11 +00:00
datapackaging=$mapped
2000-09-22 19:21:38 +00:00
fi
if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
2000-09-22 19:02:20 +00:00
if test "$HAVE_DLOPEN" -eq 1; then
datapackaging=library
else
datapackaging=archive
fi
fi
1999-12-04 02:31:40 +00:00
2000-09-22 19:02:20 +00:00
case "$datapackaging" in
files)
2001-06-06 23:32:41 +00:00
DATA_PACKAGING_CPPFLAGS=-DUDATA_FILES
2000-09-22 19:02:20 +00:00
DATA_PACKAGING_MODE=files
;;
archive)
2000-09-22 19:31:42 +00:00
DATA_PACKAGING_CPPFLAGS=-DUDATA_MAP
2000-09-22 19:02:20 +00:00
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)
1999-11-23 04:49:35 +00:00
1999-08-16 21:50:52 +00:00
dnl Enable/disable tests
AC_ARG_ENABLE(tests,
[ --enable-tests build ICU tests [default=yes]],
[case "${enableval}" in
yes) tests=true ;;
no) tests=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
esac],
tests=true)
ICU_CONDITIONAL(TESTS, test "$tests" = true)
dnl Enable/disable samples
AC_ARG_ENABLE(samples,
1999-12-09 23:11:48 +00:00
[ --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.],
1999-08-16 21:50:52 +00:00
[case "${enableval}" in
yes) samples=true ;;
no) samples=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
esac],
samples=true)
ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
2000-11-22 05:08:51 +00:00
ICUDATA_CHAR=$U_ENDIAN_CHAR
1999-08-16 21:50:52 +00:00
dnl Platform-specific Makefile setup
2000-11-22 05:08:51 +00:00
dnl set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
1999-08-16 21:50:52 +00:00
case "${host}" in
2000-06-30 21:35:03 +00:00
*-*-solaris*) platform=U_SOLARIS ;;
*-*-linux*) platform=U_LINUX ;;
*-*-freebsd*) platform=U_LINUX ;;
1999-08-16 21:50:52 +00:00
*-*-aix*) platform=AIX ;;
2000-06-28 22:18:27 +00:00
*-sequent-*) platform=PTX ;;
1999-08-16 21:50:52 +00:00
*-*-hpux*) platform=HPUX ;;
1999-12-30 06:55:24 +00:00
*-*-irix*) platform=IRIX ;;
2000-11-22 05:08:51 +00:00
*-*-os390*) platform=OS390
ICUDATA_CHAR="e" ;;
*-*-os400*) platform=OS400
ICUDATA_CHAR="e" ;;
2000-07-19 04:29:20 +00:00
*-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
2000-06-30 21:35:03 +00:00
*) platform=U_UNKNOWN_PLATFORM ;;
1999-08-16 21:50:52 +00:00
esac
2000-11-22 05:08:51 +00:00
AC_SUBST(ICUDATA_CHAR)
1999-08-16 21:50:52 +00:00
AC_SUBST(platform)
2000-10-24 19:50:20 +00:00
platform_make_fragment_name="$icu_cv_host_frag"
platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
AC_SUBST(platform_make_fragment_name)
AC_SUBST(platform_make_fragment)
1999-08-16 21:50:52 +00:00
dnl Handle -rpath options for shared library paths
case "${host}" in
*-*-solaris*) ld_rpath_suf=":" ;;
*-*-linux*) ld_rpath_suf=" " ;;
1999-12-29 01:09:27 +00:00
*-*-freebsd*) ld_rpath_suf=" " ;;
1999-08-16 21:50:52 +00:00
*-*-aix*) ld_rpath_suf="" ;;
2000-06-28 22:18:27 +00:00
*-sequent-*) ld_rpath_suf="" ;;
1999-08-16 21:50:52 +00:00
*-*-hpux*) ld_rpath_suf=":" ;;
1999-12-30 06:55:24 +00:00
*-*-irix*) ld_rpath_suf=" " ;;
2000-01-21 07:30:58 +00:00
*-*-os390*) ld_rpath_suf="" ;;
2000-03-07 01:28:09 +00:00
*-*-os400*) ld_rpath_suf=" " ;;
1999-08-16 21:50:52 +00:00
*) 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
2000-08-16 17:02:34 +00:00
*-*-hpux*)
2000-07-07 23:39:54 +00:00
for file in samples/date/date \
1999-12-15 21:48:22 +00:00
samples/cal/cal test/cintltst/cintltst \
tools/makeconv/makeconv tools/genrb/genrb \
tools/rbdump/read tools/genccode/genccode \
2001-05-02 23:50:22 +00:00
tools/gencmn/gencmn tools/gencmn/decmn \
tools/gencnval/gencnval \
2000-08-15 02:41:58 +00:00
tools/gennames/gennames tools/gentest/gentest \
2001-04-26 17:54:30 +00:00
tools/pkgdata/pkgdata tools/genprops/genprops
1999-08-16 21:50:52 +00:00
do
if test -f $file.c; then
mv $file.c $file.cpp
2001-05-02 23:50:22 +00:00
else
1999-12-15 21:48:22 +00:00
echo "# $file.c does not exist or is already renamed [warning]"
1999-08-16 21:50:52 +00:00
fi
done
;;
esac
1999-12-09 23:11:48 +00:00
if test "${FORCE_LIBS}" != ""; then
echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
LIBS=${FORCE_LIBS}
fi
1999-08-16 21:50:52 +00:00
2000-01-17 22:22:29 +00:00
dnl SPECIAL handling for HPUX 10 and also '11 & --enable-hpuxcma=true'
if test $hpuxcma = true; then
CPPFLAGS="${CPPFLAGS} -D_PTHREADS_DRAFT_4 -DHPUX_CMA"
fi
dnl END special
2000-10-02 23:37:16 +00:00
dnl Now that we're done using CPPFLAGS etc. for tests, we can change it
dnl for build.
2000-10-03 18:27:36 +00:00
if test $ICU_USE_THREADS -ne 0
then
2000-10-20 06:17:23 +00:00
CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
CFLAGS="$CFLAGS \$(THREADSCFLAGS)"
CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS)"
2000-10-02 23:37:16 +00:00
fi
2000-01-19 07:23:50 +00:00
2000-01-22 01:41:16 +00:00
if test "$ac_cv_lib_dld_shl_load" = "yes"; then
2000-01-19 07:23:50 +00:00
CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
fi
2000-02-16 22:38:38 +00:00
2000-03-20 23:29:45 +00:00
dnl added for s/390 DLL loading detection
if test "$ac_cv_func_dllload" = "yes"; then
2000-03-20 23:34:54 +00:00
CPPFLAGS="${CPPFLAGS} -DICU_USE_SHL_LOAD"
2000-03-20 23:29:45 +00:00
fi
1999-08-16 21:50:52 +00:00
dnl output the Makefiles
2000-10-25 22:26:17 +00:00
AC_OUTPUT([README icudefs.mk \
Makefile \
2000-12-01 18:50:37 +00:00
data/Makefile data/build/Makefile \
2000-06-13 19:44:38 +00:00
common/Makefile config/Makefile.inc i18n/Makefile \
2000-11-28 21:01:17 +00:00
layout/Makefile \
1999-08-16 21:50:52 +00:00
extra/Makefile extra/ustdio/Makefile \
tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \
2000-07-07 23:39:54 +00:00
tools/genrb/Makefile \
2001-02-22 21:25:01 +00:00
tools/genuca/Makefile \
2000-08-15 02:41:58 +00:00
tools/pkgdata/Makefile tools/pkgdata/icupkg.inc \
2001-05-02 23:50:22 +00:00
tools/genccode/Makefile tools/gencmn/Makefile \
tools/gencnval/Makefile tools/gentz/Makefile \
2001-04-04 02:31:28 +00:00
tools/gennames/Makefile tools/toolutil/Makefile tools/gentest/Makefile \
tools/genqchk/Makefile tools/genfchk/Makefile tools/genprops/Makefile \
2000-08-29 07:28:22 +00:00
test/Makefile test/testdata/Makefile test/intltest/Makefile test/cintltst/Makefile \
1999-08-16 21:50:52 +00:00
test/ieeetest/Makefile \
2001-04-25 01:06:38 +00:00
test/collperf/Makefile \
2001-05-08 17:30:04 +00:00
test/thaitest/Makefile \
1999-08-16 21:50:52 +00:00
samples/Makefile samples/date/Makefile samples/cal/Makefile \
2000-04-06 23:36:17 +00:00
common/unicode/platform.h])
1999-12-09 23:11:48 +00:00
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
2000-08-29 22:26:15 +00:00
2000-11-30 19:02:44 +00:00
echo "You must use $U_MAKE to build ICU."