mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 04:29:31 +00:00
ICU-10255 add U_HAVE_ATOMIC define, whether <atomic> can be included or not. Also zap some whitespace.
X-SVN-Rev: 33935
This commit is contained in:
parent
b8f66e90c3
commit
f844fdd2cb
2 changed files with 82 additions and 35 deletions
37
icu4c/source/configure
vendored
37
icu4c/source/configure
vendored
|
@ -2,7 +2,7 @@
|
|||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69.
|
||||
#
|
||||
# Copyright (c) 1999-2012, International Business Machines Corporation and others. All Rights Reserved.
|
||||
# Copyright (c) 1999-2013, International Business Machines Corporation and others. All Rights Reserved.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||
|
@ -660,6 +660,7 @@ U_HAVE_INTTYPES_H
|
|||
GENCCODE_ASSEMBLY
|
||||
HAVE_MMAP
|
||||
LIB_THREAD
|
||||
U_HAVE_ATOMIC
|
||||
U_HAVE_STD_STRING
|
||||
ENABLE_RPATH
|
||||
U_ENABLE_DYLOAD
|
||||
|
@ -1514,7 +1515,7 @@ Copyright (C) 2012 Free Software Foundation, Inc.
|
|||
This configure script is free software; the Free Software Foundation
|
||||
gives unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Copyright (c) 1999-2012, International Business Machines Corporation and others. All Rights Reserved.
|
||||
Copyright (c) 1999-2013, International Business Machines Corporation and others. All Rights Reserved.
|
||||
_ACEOF
|
||||
exit
|
||||
fi
|
||||
|
@ -5639,6 +5640,38 @@ else
|
|||
CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STD_STRING=0"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if #include <atomic> works" >&5
|
||||
$as_echo_n "checking if #include <atomic> works... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <atomic>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
ac_cv_header_atomic=yes
|
||||
else
|
||||
ac_cv_header_atomic=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_atomic" >&5
|
||||
$as_echo "$ac_cv_header_atomic" >&6; }
|
||||
if test $ac_cv_header_atomic = yes
|
||||
then
|
||||
U_HAVE_ATOMIC=1
|
||||
else
|
||||
U_HAVE_ATOMIC=0
|
||||
CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=0"
|
||||
fi
|
||||
|
||||
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# -*-autoconf-*-
|
||||
AC_COPYRIGHT([ Copyright (c) 1999-2012, International Business Machines Corporation and others. All Rights Reserved. ])
|
||||
AC_COPYRIGHT([ Copyright (c) 1999-2013, International Business Machines Corporation and others. All Rights Reserved. ])
|
||||
# configure.in for ICU
|
||||
# Stephen F. Booth, heavily modified by Yves and others
|
||||
|
||||
|
@ -96,8 +96,8 @@ AC_ARG_ENABLE(debug,
|
|||
[ --enable-debug build debug libraries and enable the U_DEBUG define [default=no]],
|
||||
[ case "${enableval}" in
|
||||
yes|"") enabled=yes; ENABLE_DEBUG=1; CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEBUG=1" ;;
|
||||
*) ;;
|
||||
esac],
|
||||
*) ;;
|
||||
esac],
|
||||
)
|
||||
AC_MSG_RESULT($enabled)
|
||||
AC_SUBST(ENABLE_DEBUG)
|
||||
|
@ -110,8 +110,8 @@ AC_ARG_ENABLE(release,
|
|||
[ --enable-release build release libraries [default=yes]],
|
||||
[ case "${enableval}" in
|
||||
no) enabled=no; ENABLE_RELEASE=0 ;;
|
||||
*) ;;
|
||||
esac],
|
||||
*) ;;
|
||||
esac],
|
||||
)
|
||||
AC_MSG_RESULT($enabled)
|
||||
AC_SUBST(ENABLE_RELEASE)
|
||||
|
@ -176,7 +176,7 @@ AC_SUBST(U_MAKE)
|
|||
|
||||
AC_ARG_WITH(cross-build,
|
||||
[ --with-cross-build=dir specify an absolute path to the build directory of an ICU built for the current platform [default=no cross dir]],
|
||||
[cross_buildroot="${withval}"],
|
||||
[cross_buildroot="${withval}"],
|
||||
[cross_buildroot=""])
|
||||
|
||||
if test "X$cross_buildroot" = "X"; then
|
||||
|
@ -231,8 +231,8 @@ ICU_CHECK_MH_FRAG
|
|||
# PIC (at least on 10.2)
|
||||
case "${host}" in
|
||||
*-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
|
||||
|
||||
*) AC_CHECK_LIB(m, floor)
|
||||
|
||||
*) AC_CHECK_LIB(m, floor)
|
||||
LIB_M="" ;;
|
||||
esac
|
||||
AC_SUBST(LIB_M)
|
||||
|
@ -272,10 +272,10 @@ if test "$ENABLE_STATIC" = "YES"; then
|
|||
if test "$ENABLE_RELEASE" = 1; then
|
||||
AC_MSG_CHECKING([whether we can use static library optimization option])
|
||||
CHECK_STATIC_OPT_FLAG=no
|
||||
|
||||
|
||||
OLD_CPPFLAGS="${CPPFLAGS}"
|
||||
OLD_LDFLAGS="${LDFLAGS}"
|
||||
|
||||
|
||||
case "${host}" in
|
||||
*-linux*|i*86-*-*bsd*|i*86-pc-gnu)
|
||||
if test "$GCC" = yes; then
|
||||
|
@ -286,7 +286,7 @@ if test "$ENABLE_STATIC" = "YES"; then
|
|||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [CHECK_STATIC_OPT_FLAG=yes], [CHECK_STATIC_OPT_FLAG=no])
|
||||
AC_MSG_RESULT($CHECK_STATIC_OPT_FLAG)
|
||||
if test "$CHECK_STATIC_OPT_FLAG" = no; then
|
||||
|
@ -305,7 +305,7 @@ UCLN_NO_AUTO_CLEANUP=1
|
|||
AC_ARG_ENABLE(auto-cleanup,
|
||||
[ --enable-auto-cleanup enable auto cleanup of libraries [default=no]],
|
||||
[ case "${enableval}" in
|
||||
yes) enabled=yes;
|
||||
yes) enabled=yes;
|
||||
CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DUCLN_NO_AUTO_CLEANUP=0";
|
||||
UCLN_NO_AUTO_CLEANUP=0
|
||||
;;
|
||||
|
@ -318,7 +318,7 @@ AC_SUBST(UCLN_NO_AUTO_CLEANUP)
|
|||
# MSVC floating-point option
|
||||
MSVC_RELEASE_FLAG=""
|
||||
if test $enabled = yes
|
||||
then
|
||||
then
|
||||
if test $icu_cv_host_frag = mh-cygwin-msvc
|
||||
then
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
|
@ -327,7 +327,7 @@ then
|
|||
Microsoft Visual C++ < 2005
|
||||
#endif
|
||||
]], [[]])],[MSVC_RELEASE_FLAG="/fp:precise"],[MSVC_RELEASE_FLAG="/Op"])
|
||||
|
||||
|
||||
CFLAGS="${CFLAGS} ${MSVC_RELEASE_FLAG}"
|
||||
CXXFLAGS="${CXXFLAGS} ${MSVC_RELEASE_FLAG}"
|
||||
fi
|
||||
|
@ -380,7 +380,7 @@ U_ENABLE_TRACING=0
|
|||
AC_ARG_ENABLE(tracing,
|
||||
[ --enable-tracing enable function and data tracing [default=no]],
|
||||
[ case "${enableval}" in
|
||||
yes|"") enabled=yes;
|
||||
yes|"") enabled=yes;
|
||||
CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_TRACING=1";
|
||||
U_ENABLE_TRACING=1 ;;
|
||||
no) enabled=no; U_ENABLE_TRACING=0 ;;
|
||||
|
@ -397,11 +397,11 @@ AC_MSG_CHECKING([whether to enable dynamic loading of plugins])
|
|||
AC_ARG_ENABLE(dyload,
|
||||
[ --disable-dyload disable dynamic loading [default=no]],
|
||||
[ case "${enableval}" in
|
||||
yes|"")
|
||||
yes|"")
|
||||
U_ENABLE_DYLOAD=1
|
||||
enable=yes
|
||||
;;
|
||||
no)
|
||||
no)
|
||||
U_ENABLE_DYLOAD=0;
|
||||
enable=no;
|
||||
CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_DYLOAD=0";
|
||||
|
@ -465,6 +465,20 @@ else
|
|||
CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STD_STRING=0"
|
||||
fi
|
||||
AC_SUBST(U_HAVE_STD_STRING)
|
||||
|
||||
|
||||
AC_MSG_CHECKING([[if #include <atomic> works]])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no])
|
||||
AC_MSG_RESULT($ac_cv_header_atomic)
|
||||
if test $ac_cv_header_atomic = yes
|
||||
then
|
||||
U_HAVE_ATOMIC=1
|
||||
else
|
||||
U_HAVE_ATOMIC=0
|
||||
CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=0"
|
||||
fi
|
||||
AC_SUBST(U_HAVE_ATOMIC)
|
||||
|
||||
AC_LANG_POP([C++])
|
||||
|
||||
# Always build ICU with multi-threading support.
|
||||
|
@ -478,7 +492,7 @@ if test $threads = true; then
|
|||
# we will pick up libpthreads.so not libpthread.so
|
||||
# If this fails, then we must test for HPUX specials, before
|
||||
# moving on to a more generic test
|
||||
|
||||
|
||||
AC_CHECK_LIB(pthread, pthread_attr_init)
|
||||
if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
|
||||
ICU_USE_THREADS=1
|
||||
|
@ -607,7 +621,7 @@ AC_MSG_RESULT($GENCCODE_ASSEMBLY)
|
|||
AC_CHECK_HEADERS(inttypes.h)
|
||||
if test $ac_cv_header_inttypes_h = no; then
|
||||
U_HAVE_INTTYPES_H=0
|
||||
CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
|
||||
CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
|
||||
else
|
||||
U_HAVE_INTTYPES_H=1
|
||||
fi
|
||||
|
@ -623,8 +637,8 @@ AC_SUBST(U_HAVE_INTTYPES_H)
|
|||
|
||||
AC_CHECK_HEADERS(dirent.h)
|
||||
if test $ac_cv_header_dirent_h = no; then
|
||||
U_HAVE_DIRENT_H=0
|
||||
CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_DIRENT_H=0"
|
||||
U_HAVE_DIRENT_H=0
|
||||
CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_DIRENT_H=0"
|
||||
else
|
||||
U_HAVE_DIRENT_H=1
|
||||
fi
|
||||
|
@ -998,7 +1012,7 @@ AC_ARG_ENABLE(extras,
|
|||
yes) extras=true ;;
|
||||
no) extras=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
|
||||
esac],
|
||||
esac],
|
||||
extras=true)
|
||||
ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
|
||||
AC_ARG_ENABLE(icuio,
|
||||
|
@ -1007,7 +1021,7 @@ AC_ARG_ENABLE(icuio,
|
|||
yes) icuio=true ;;
|
||||
no) icuio=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
|
||||
esac],
|
||||
esac],
|
||||
icuio=true)
|
||||
ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
|
||||
|
||||
|
@ -1018,7 +1032,7 @@ AC_ARG_ENABLE(layout,
|
|||
yes) layout=true ;;
|
||||
no) layout=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-layout) ;;
|
||||
esac],
|
||||
esac],
|
||||
layout=true)
|
||||
ICU_CONDITIONAL(LAYOUT, test "$layout" = true)
|
||||
|
||||
|
@ -1031,17 +1045,17 @@ AC_ARG_WITH(data-packaging,
|
|||
dll) datapackaging=library ;;
|
||||
static) datapackaging=static ;;
|
||||
*) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
|
||||
esac],
|
||||
esac],
|
||||
[datapackaging=])
|
||||
|
||||
# Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
|
||||
# Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
|
||||
# thesysconfdir=`eval echo $sysconfdir`
|
||||
dnl# AC_SUBST(thesysconfdir)
|
||||
dnl# thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
|
||||
dnl# AC_SUBST(thelibdir)
|
||||
thedatadir=`eval echo $datadir`
|
||||
dnl# AC_SUBST(thedatadir)
|
||||
# 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}.
|
||||
# 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}.
|
||||
pkgicudatadir=$datadir
|
||||
thepkgicudatadir=$thedatadir
|
||||
AC_SUBST(pkgicudatadir)
|
||||
|
@ -1064,7 +1078,7 @@ datapackaging_dir=`eval echo $thedatadir`"/icu/${VERSION}"
|
|||
datapackaging_msg="(No explaination for mode $datapackaging.)"
|
||||
|
||||
datapackaging_msg_path="ICU will look in $datapackaging_dir which is the installation location. Call u_setDataDirectory() or use the ICU_DATA environment variable to override."
|
||||
datapackaging_msg_set="ICU will use the linked data library. If linked with the stub library located in stubdata/, the application can use udata_setCommonData() or set a data path to override."
|
||||
datapackaging_msg_set="ICU will use the linked data library. If linked with the stub library located in stubdata/, the application can use udata_setCommonData() or set a data path to override."
|
||||
datapackaging_howfound="(unknown)"
|
||||
|
||||
case "$datapackaging" in
|
||||
|
@ -1127,13 +1141,13 @@ AC_ARG_ENABLE(tests,
|
|||
yes) tests=true ;;
|
||||
no) tests=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
|
||||
esac],
|
||||
esac],
|
||||
tests=true)
|
||||
ICU_CONDITIONAL(TESTS, test "$tests" = true)
|
||||
|
||||
# Enable/disable samples
|
||||
AC_ARG_ENABLE(samples,
|
||||
[ --enable-samples build ICU samples [default=yes]
|
||||
[ --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.],
|
||||
|
@ -1141,7 +1155,7 @@ If set, it will REPLACE any automatic list of libraries.],
|
|||
yes) samples=true ;;
|
||||
no) samples=false ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
|
||||
esac],
|
||||
esac],
|
||||
samples=true)
|
||||
ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
|
||||
|
||||
|
@ -1270,7 +1284,7 @@ AC_CONFIG_FILES([icudefs.mk \
|
|||
samples/cal/Makefile samples/layout/Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "ICU for C/C++ $VERSION is ready to be built."
|
||||
echo "=== Important Notes: ==="
|
||||
|
||||
|
@ -1299,7 +1313,7 @@ fi
|
|||
if test -n "$UCONFIG_CPPFLAGS"; then
|
||||
HDRFILE="uconfig.h.prepend"
|
||||
echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:"
|
||||
echo
|
||||
echo
|
||||
echo " ${UCONFIG_CPPFLAGS}"
|
||||
echo
|
||||
echo 'The recommended way to do this is to prepend the following lines to source/common/unicode/uconfig.h or #include them near the top of that file.'
|
||||
|
|
Loading…
Add table
Reference in a new issue