scuffed-code/icu4c/source/configure.in
Steven R. Loomis 79442e66b3 ICU-205 updates to BSD fix
X-SVN-Rev: 500
2000-01-08 01:34:45 +00:00

299 lines
7.4 KiB
Plaintext

dnl -*-m4-*-
dnl configure.in for ICU
dnl Stephen F. Booth
dnl Process this file with autoconf to produce a configure script
AC_INIT(common/utypes.h)
AC_CONFIG_HEADER(common/icucfg.h)
PACKAGE="icu"
AC_SUBST(PACKAGE)
VERSION="1.3.1"
AC_SUBST(VERSION)
UNICODE_VERSION="3.0.0"
AC_SUBST(UNICODE_VERSION)
dnl Shouldn't need the AC_SUBST
CPPFLAGS="${CPPFLAGS} -I."
AC_SUBST(CPPFLAGS)
dnl Checks for programs
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
AC_CHECK_PROG(STRIP, strip, strip, true)
dnl Determine the host system and Makefile fragment
AC_CANONICAL_HOST
ICU_CHECK_MH_FRAG
dnl Checks for libraries
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
*-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
*) AC_CHECK_LIB(m, floor)
LIB_M="" ;;
esac
AC_SUBST(LIB_M)
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],
threads=true)
ICU_CONDITIONAL(THREADS, test "$threads" = true)
ICU_USE_THREADS=0
if test $threads = true; then
dnl special pthread handling
dnl AIX uses pthreads instead of pthread, and HP/UX uses cma
dnl FreeBSD users -pthread
AC_CHECK_LIB(pthread, pthread_create)
if test $ac_cv_lib_pthread_pthread_create = yes; then
ICU_USE_THREADS=1
fi
if test $ac_cv_lib_pthread_pthread_create = no; then
AC_CHECK_LIB(pthreads, pthread_create)
if test $ac_cv_lib_pthreads_pthread_create = yes; then
ICU_USE_THREADS=1
fi
fi
if test $ac_cv_lib_pthread_pthread_create = no; then
AC_CHECK_LIB(cma, pthread_create)
if test $ac_cv_lib_cma_pthread_create = yes; then
ICU_USE_THREADS=1
fi
fi
dnl If all other thread tests fail, try BSD's -pthread
if test $ICU_USE_THREADS = 0; then
AC_PTHREAD_FREEBSD
fi
AC_CHECK_FUNC(pthread_mutex_create)
fi
AC_SUBST(ICU_USE_THREADS)
dnl FreeBSD needs a WCS library.
AC_CHECK_LIB(wcs, wcscpy)
# check for dlopen()
HAVE_DLOPEN=0
#add more libs here..
AC_CHECK_LIB(dl, dlopen)
if test $ac_cv_lib_dl_dlopen = yes; then
HAVE_DLOPEN=1
fi
AC_SUBST(HAVE_DLOPEN)
dnl Checks for header files
AC_CHECK_HEADERS(inttypes.h)
if test $ac_cv_header_inttypes_h = no; then
HAVE_INTTYPES_H=0
else
HAVE_INTTYPES_H=1
fi
AC_SUBST(HAVE_INTTYPES_H)
dnl Check for endianness
AC_C_BIGENDIAN(unknown)
if test $ac_cv_c_bigendian = no; then
U_IS_BIG_ENDIAN=0
else
U_IS_BIG_ENDIAN=1
fi
AC_SUBST(U_IS_BIG_ENDIAN)
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)
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)
dnl Enable/disable mapped files [default DLL]
AC_ARG_ENABLE(mapped,
[ --enable-mapped try to use memory-mapped files (instead of DLLs) when possible [default=no]],
[case "${enableval}" in
yes) mapped=true ;;
no) mapped=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mapped) ;;
esac],
mapped=false)
ICU_CONDITIONAL(USE_MAPPED, test "$mapped" = true -o "$HAVE_DLOPEN" = 0)
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,
[ --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.],
[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)
dnl Platform-specific Makefile setup
case "${host}" in
*-*-solaris*) platform=SOLARIS ;;
*-*-linux*) platform=LINUX ;;
*-*-freebsd*) platform=LINUX ;;
*-*-aix*) platform=AIX ;;
*-*-hpux*) platform=HPUX ;;
*-*-irix*) platform=IRIX ;;
*-*-os390*) platform=OS390 ;;
*) platform=UNKNOWN ;;
esac
AC_SUBST(platform)
host_frag=$icu_cv_host_frag
AC_SUBST_FILE(host_frag)
dnl Handle -rpath options for shared library paths
case "${host}" in
*-*-solaris*) ld_rpath_suf=":" ;;
*-*-linux*) ld_rpath_suf=" " ;;
*-*-freebsd*) ld_rpath_suf=" " ;;
*-*-aix*) ld_rpath_suf="" ;;
*-*-hpux*) ld_rpath_suf=":" ;;
*-*-irix*) ld_rpath_suf=" " ;;
*-*-os390*) ld_rpath_suf=" " ;;
*) ld_rpath_suf="" ;;
esac
AC_SUBST(ld_rpath_suf)
dnl On HP/UX, main() functions compiled in C don't invoke
dnl static constructors in C++ libs. Hack around that here
dnl by renaming some .c files to .cpp
case "${host}" in
*-*-hpux*)
for file in tools/gencol/gencol samples/date/date \
samples/cal/cal test/cintltst/cintltst \
tools/makeconv/makeconv tools/genrb/genrb \
tools/rbdump/read tools/genccode/genccode \
tools/gencmn/gencmn tools/gencnval/gencnval \
tools/gennames/gennames
do
if test -f $file.c; then
mv $file.c $file.cpp
else
echo "# $file.c does not exist or is already renamed [warning]"
fi
done
;;
esac
if test "${FORCE_LIBS}" != ""; then
echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
LIBS=${FORCE_LIBS}
fi
dnl output the Makefiles
AC_OUTPUT([Makefile \
common/Makefile common/unicode/platform.h config/Makefile i18n/Makefile \
extra/Makefile extra/ustdio/Makefile \
tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \
tools/genrb/Makefile tools/gencol/Makefile \
tools/rbdump/Makefile tools/genccode/Makefile tools/gencmn/Makefile tools/gencnval/Makefile tools/gentz/Makefile \
tools/gennames/Makefile tools/toolutil/Makefile \
test/Makefile test/intltest/Makefile test/cintltst/Makefile \
test/ieeetest/Makefile \
samples/Makefile samples/date/Makefile samples/cal/Makefile \
samples/XMLConverter/Makefile])
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