configure.ac 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476
  1. # -*-autoconf-*-
  2. AC_COPYRIGHT([ Copyright (C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html ])
  3. # AC_COPYRIGHT([ Copyright (c) 1999-2015, International Business Machines Corporation and others. All Rights Reserved. ])
  4. # configure.in for ICU
  5. # Stephen F. Booth, heavily modified by Yves and others
  6. # NOTE: please use 'autoreconf' to rebuild, otherwise 'aclocal && autoconf'.
  7. # Check for autoconf version
  8. AC_PREREQ(2.69)
  9. # Process this file with autoreconf to produce a configure script
  10. AC_INIT([ICU],
  11. m4_esyscmd_s([sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "./common/unicode/uvernum.h]"),
  12. [http://icu-project.org/bugs],
  13. [International Components for Unicode],
  14. [http://icu-project.org])
  15. AC_CONFIG_MACRO_DIR([config/m4])
  16. AC_CONFIG_SRCDIR([common/unicode/utypes.h])
  17. PACKAGE="icu"
  18. AC_SUBST(PACKAGE)
  19. # Use custom echo test for newline option
  20. # Current autoconf (2.65) gives incorrect echo newline option
  21. # for icu-config
  22. # This may be removed later - mow (June 17, 2010)
  23. ICU_ECHO_C= ICU_ECHO_N= ICU_ECHO_T=
  24. case `/bin/sh -c "echo -n x"` in
  25. -n*)
  26. case `/bin/sh -c "echo 'x\c'"` in
  27. *c*) ICU_ECHO_T=' ';; # ECHO_T is single tab character.
  28. *) ICU_ECHO_C='\c';;
  29. esac;;
  30. *)
  31. ICU_ECHO_N='-n';;
  32. esac
  33. AC_SUBST(ICU_ECHO_N)
  34. AC_SUBST(ICU_ECHO_C)
  35. AC_SUBST(ICU_ECHO_T)
  36. AC_MSG_CHECKING(for ICU version numbers)
  37. # Get the ICU version from uversion.h or other headers
  38. geticuversion() {
  39. [sed -n 's/^[ ]*#[ ]*define[ ]*U_ICU_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
  40. }
  41. getuversion() {
  42. [sed -n 's/^[ ]*#[ ]*define[ ]*U_UNICODE_VERSION[ ]*"\([^"]*\)".*/\1/p' "$@"]
  43. }
  44. VERSION=`geticuversion $srcdir/common/unicode/uvernum.h`
  45. if test x"$VERSION" = x; then
  46. as_fn_error $? "Cannot determine ICU version number from uvernum.h header file" "$LINENO" 5
  47. fi
  48. #TODO: IcuBug:8502
  49. #if test "$VERSION" != "$PACKAGE_VERSION"; then
  50. # AC_MSG_ERROR([configure was generated for $PACKAGE_VERSION but uvernum.h has $VERSION - please rerun autoconf])
  51. #fi
  52. UNICODE_VERSION=`getuversion $srcdir/common/unicode/uchar.h`
  53. if test x"$UNICODE_VERSION" = x; then
  54. AC_MSG_ERROR([Cannot determine Unicode version number from uchar.h header file])
  55. fi
  56. # Compute a reasonable library version from the release version. This is
  57. # very bad, but that's wanted... We want to make sure that the LIB_VERSION
  58. # has at least a dot in it, so we'll add a .0 if needed.
  59. #[LIB_VERSION=`echo $VERSION | sed -e 's/\.//' -e 's/^\([^.]*\)$/\1.0/'`]
  60. LIB_VERSION=$VERSION
  61. LIB_VERSION_MAJOR=`echo $LIB_VERSION | sed 's/\..*//'`
  62. AC_SUBST(VERSION)
  63. AC_SUBST(LIB_VERSION)
  64. AC_SUBST(LIB_VERSION_MAJOR)
  65. AC_MSG_RESULT([release $VERSION, library $LIB_VERSION, unicode version $UNICODE_VERSION])
  66. AC_SUBST(UNICODE_VERSION)
  67. # Determine the host system
  68. AC_CANONICAL_HOST
  69. AC_SUBST(CPPFLAGS)
  70. # This variable is needed on z/OS because the C++ compiler only recognizes .C
  71. _CXX_CXXSUFFIX=cpp
  72. export _CXX_CXXSUFFIX
  73. # Accumulate #defines
  74. # CONFIG_CPPFLAGS: These are defines that are set for ICU Build time only.
  75. # They are only needed for building ICU itself. Example: platform stuff
  76. CONFIG_CPPFLAGS=""
  77. # UCONFIG_CPPFLAGS: These are defines which are set for ICU build time,
  78. # and also a notice is output that they need to be set
  79. # for end-users of ICU also. uconfig.h.prepend is generated
  80. # with, for example, "#define U_DISABLE_RENAMING 1"
  81. # Example: ICU configuration stuff
  82. UCONFIG_CPPFLAGS=""
  83. # UCONFIG_CFLAGS: contains a copy of anything that needs to be set by end users
  84. # such as -std
  85. UCONFIG_CFLAGS=""
  86. # Check whether to build debug libraries
  87. AC_MSG_CHECKING([whether to build debug libraries])
  88. enabled=no
  89. ENABLE_DEBUG=0
  90. AC_ARG_ENABLE(debug,
  91. [ --enable-debug build debug libraries and enable the U_DEBUG define [default=no]],
  92. [ case "${enableval}" in
  93. yes|"") enabled=yes; ENABLE_DEBUG=1; CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEBUG=1" ;;
  94. *) ;;
  95. esac],
  96. )
  97. AC_MSG_RESULT($enabled)
  98. AC_SUBST(ENABLE_DEBUG)
  99. # Check whether to build release libraries
  100. AC_MSG_CHECKING([whether to build release libraries])
  101. enabled=yes
  102. ENABLE_RELEASE=1
  103. AC_ARG_ENABLE(release,
  104. [ --enable-release build release libraries [default=yes]],
  105. [ case "${enableval}" in
  106. no) enabled=no; ENABLE_RELEASE=0 ;;
  107. *) ;;
  108. esac],
  109. )
  110. AC_MSG_RESULT($enabled)
  111. AC_SUBST(ENABLE_RELEASE)
  112. # Don't use the default C/CXXFLags
  113. : ${CFLAGS=""}
  114. : ${CXXFLAGS=""}
  115. # Checks for compilers
  116. AC_PROG_CC([clang gcc cc c99 c89 xlc_r xlc cl.exe icc])
  117. # Make sure that we try clang++ first, which provides C++11 support.
  118. # The g++ compiler is less likely to support C++11.
  119. AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RCC])
  120. # pkg-config is needed for harfbuzz support
  121. PKG_PROG_PKG_CONFIG([0.20])
  122. PKG_CHECK_MODULES(ICULEHB, icu-le-hb, have_icu_le_hb=true, :)
  123. # Ensure that if CXXFLAGS/CFLAGS were not set when calling configure, set it correctly based on (enable/disable) debug or release option
  124. # The release mode use is the default one for autoconf
  125. if test "$GCC" = yes; then
  126. if test "$CFLAGS" = ""; then
  127. if test "$ENABLE_DEBUG" = 1; then
  128. CFLAGS=-g
  129. fi
  130. if test "$ENABLE_RELEASE" = 1; then
  131. CFLAGS="$CFLAGS -O2"
  132. fi
  133. fi
  134. if test "$CXXFLAGS" = ""; then
  135. if test "$ENABLE_DEBUG" = 1; then
  136. CXXFLAGS=-g
  137. fi
  138. if test "$ENABLE_RELEASE" = 1; then
  139. CXXFLAGS="$CXXFLAGS -O2"
  140. fi
  141. fi
  142. fi
  143. AC_PROG_CPP
  144. AC_PROG_INSTALL
  145. AC_SUBST(cross_compiling)
  146. dnl use the pld hack to get ac_fn_cxx_try_link defined globally and not local
  147. AC_LANG_PUSH([C++])
  148. AC_LINK_IFELSE([AC_LANG_PROGRAM()])
  149. AC_LANG_POP([C++])
  150. # make sure install is relative to srcdir - if a script
  151. if test "$srcdir" = "."; then
  152. # If srcdir isn't just ., then (srcdir) is already prepended.
  153. if test "${ac_install_sh}" = "${INSTALL}"; then
  154. INSTALL="\\\$(top_srcdir)/${ac_install_sh}"
  155. fi
  156. fi
  157. #AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
  158. #AC_CHECK_PROG(STRIP, strip, strip, true)
  159. # Check for the platform make
  160. AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
  161. AC_SUBST(U_MAKE)
  162. AC_ARG_WITH(cross-build,
  163. [ --with-cross-build=dir specify an absolute path to the build directory of an ICU built for the current platform [default=no cross dir]],
  164. [cross_buildroot="${withval}"],
  165. [cross_buildroot=""])
  166. if test "X$cross_buildroot" = "X"; then
  167. if test "$cross_compiling" = "yes"; then
  168. AC_MSG_ERROR([Error! Cross compiling but no --with-cross-build option specified - please supply the path to an executable ICU's build root])
  169. dnl '
  170. fi
  171. else
  172. if test -f "${cross_buildroot}/config/icucross.mk"; then
  173. AC_MSG_RESULT([Using cross buildroot: $cross_buildroot])
  174. else
  175. if test -d "${cross_buildroot}"; then
  176. AC_MSG_ERROR([${cross_buildroot}/config/icucross.mk not found. Please build ICU in ${cross_buildroot} first.])
  177. else
  178. AC_MSG_ERROR([No such directory ${cross_buildroot} supplied as the argument to --with-cross-build. Use an absolute path.])
  179. fi
  180. fi
  181. fi
  182. AC_SUBST(cross_buildroot)
  183. # Check for doxygen to generate documentation
  184. AC_PATH_PROG(DOXYGEN,doxygen,,$PATH:/usr/local/bin:/usr/bin)
  185. # Check that the linker is usable
  186. ICU_PROG_LINK
  187. # Determine the executable suffix
  188. # We don't use AC_EXEEXT because some compilers output separate debugging
  189. # files, which confuses the AC_EXEEXT macro.
  190. AC_MSG_CHECKING(checking for executable suffix)
  191. case "${host}" in
  192. *-*-cygwin*|*-*-mingw*) EXEEXT=.exe ;;
  193. *) EXEEXT="" ;;
  194. esac
  195. ac_exeext=$EXEEXT
  196. AC_MSG_RESULT($EXEEXT)
  197. AC_SUBST(EXEEXT)
  198. # Determine how strict we want to be when compiling
  199. AC_CHECK_STRICT_COMPILE
  200. # Check if we can build and use 64-bit libraries
  201. AC_CHECK_64BIT_LIBS
  202. AC_SUBST(ARFLAGS)
  203. AC_SUBST(COMPILE_LINK_ENVVAR)
  204. # Determine the Makefile fragment
  205. ICU_CHECK_MH_FRAG
  206. # Checks for libraries and other host specific stuff
  207. # On HP/UX, don't link to -lm from a shared lib because it isn't
  208. # PIC (at least on 10.2)
  209. case "${host}" in
  210. *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;;
  211. *) AC_CHECK_LIB(m, floor)
  212. LIB_M="" ;;
  213. esac
  214. AC_SUBST(LIB_M)
  215. # Check whether to build shared libraries
  216. AC_MSG_CHECKING([whether to build shared libraries])
  217. enabled=no
  218. AC_ARG_ENABLE(shared,
  219. [ --enable-shared build shared libraries [default=yes]],
  220. [ case "${enableval}" in
  221. yes|"") enabled=yes; ENABLE_SHARED=YES ;;
  222. no);;
  223. *) ;;
  224. esac],
  225. [enabled=yes; ENABLE_SHARED=YES]
  226. )
  227. AC_MSG_RESULT($enabled)
  228. AC_SUBST(ENABLE_SHARED)
  229. # Check whether to build static libraries
  230. AC_MSG_CHECKING([whether to build static libraries])
  231. enabled=no
  232. AC_ARG_ENABLE(static,
  233. [ --enable-static build static libraries [default=no]],
  234. [ case "${enableval}" in
  235. yes|"") enabled=yes; ENABLE_STATIC=YES ;;
  236. no) ;;
  237. *) ;;
  238. esac],
  239. )
  240. AC_MSG_RESULT($enabled)
  241. AC_SUBST(ENABLE_STATIC)
  242. # When building release static library, there might be some optimization flags we can use
  243. if test "$ENABLE_STATIC" = "YES"; then
  244. if test "$ENABLE_SHARED" != "YES"; then
  245. if test "$ENABLE_RELEASE" = 1; then
  246. AC_MSG_CHECKING([whether we can use static library optimization option])
  247. CHECK_STATIC_OPT_FLAG=no
  248. OLD_CPPFLAGS="${CPPFLAGS}"
  249. OLD_LDFLAGS="${LDFLAGS}"
  250. case "${host}" in
  251. *-linux*|i*86-*-*bsd*|i*86-pc-gnu)
  252. if test "$GCC" = yes; then
  253. CPPFLAGS="${CPPFLAGS} -ffunction-sections -fdata-sections"
  254. LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
  255. fi
  256. ;;
  257. *)
  258. ;;
  259. esac
  260. AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [CHECK_STATIC_OPT_FLAG=yes], [CHECK_STATIC_OPT_FLAG=no])
  261. AC_MSG_RESULT($CHECK_STATIC_OPT_FLAG)
  262. if test "$CHECK_STATIC_OPT_FLAG" = no; then
  263. CPPFLAGS="${OLD_CPPFLAGS}"
  264. LDFLAGS="${OLD_LDFLAGS}"
  265. fi
  266. fi
  267. fi
  268. fi
  269. # Check whether to enable auto cleanup of libraries
  270. AC_MSG_CHECKING([whether to enable auto cleanup of libraries])
  271. enabled=no
  272. UCLN_NO_AUTO_CLEANUP=1
  273. AC_ARG_ENABLE(auto-cleanup,
  274. [ --enable-auto-cleanup enable auto cleanup of libraries [default=no]],
  275. [ case "${enableval}" in
  276. yes) enabled=yes;
  277. CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DUCLN_NO_AUTO_CLEANUP=0";
  278. UCLN_NO_AUTO_CLEANUP=0
  279. ;;
  280. *) ;;
  281. esac],
  282. )
  283. AC_MSG_RESULT($enabled)
  284. AC_SUBST(UCLN_NO_AUTO_CLEANUP)
  285. # MSVC floating-point option
  286. MSVC_RELEASE_FLAG=""
  287. if test $enabled = yes
  288. then
  289. if test $icu_cv_host_frag = mh-cygwin-msvc -o $icu_cv_host_frag = mh-msys-msvc
  290. then
  291. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  292. #if defined _MSC_VER && _MSC_VER >= 1400
  293. #else
  294. Microsoft Visual C++ < 2005
  295. #endif
  296. ]], [[]])],[MSVC_RELEASE_FLAG="/fp:precise"],[MSVC_RELEASE_FLAG="/Op"])
  297. CFLAGS="${CFLAGS} ${MSVC_RELEASE_FLAG}"
  298. CXXFLAGS="${CXXFLAGS} ${MSVC_RELEASE_FLAG}"
  299. fi
  300. fi
  301. # Check whether to enabled draft APIs
  302. AC_MSG_CHECKING([whether to enable draft APIs])
  303. enabled=yes
  304. U_DEFAULT_SHOW_DRAFT=1
  305. AC_ARG_ENABLE(draft,
  306. [ --enable-draft enable draft APIs (and internal APIs) [default=yes]],
  307. [ case "${enableval}" in
  308. no) enabled=no; U_DEFAULT_SHOW_DRAFT=0;
  309. CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_DEFAULT_SHOW_DRAFT=0"
  310. ;;
  311. *) ;;
  312. esac],
  313. )
  314. AC_MSG_RESULT($enabled)
  315. # Make sure that we can use draft API in ICU.
  316. if test "$U_DEFAULT_SHOW_DRAFT" = 0; then
  317. CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_SHOW_DRAFT_API"
  318. fi
  319. AC_SUBST(U_DEFAULT_SHOW_DRAFT)
  320. AC_PROG_RANLIB
  321. # look for 'ar' the proper way
  322. AC_CHECK_TOOL(AR, ar, false)
  323. AC_MSG_CHECKING([whether to enable renaming of symbols])
  324. enabled=yes
  325. U_DISABLE_RENAMING=0
  326. AC_ARG_ENABLE(renaming,
  327. [ --enable-renaming add a version suffix to symbols [default=yes]],
  328. [ case "${enableval}" in
  329. yes|"") enabled=yes ;;
  330. no) enabled=no; U_DISABLE_RENAMING=1;
  331. UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_DISABLE_RENAMING=1"
  332. ;;
  333. *) ;;
  334. esac],
  335. )
  336. AC_MSG_RESULT($enabled)
  337. AC_SUBST(U_DISABLE_RENAMING)
  338. AC_MSG_CHECKING([whether to enable function and data tracing])
  339. enabled=no
  340. U_ENABLE_TRACING=0
  341. AC_ARG_ENABLE(tracing,
  342. [ --enable-tracing enable function and data tracing [default=no]],
  343. [ case "${enableval}" in
  344. yes|"") enabled=yes;
  345. CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_TRACING=1";
  346. U_ENABLE_TRACING=1 ;;
  347. no) enabled=no; U_ENABLE_TRACING=0 ;;
  348. *) ;;
  349. esac],
  350. )
  351. AC_MSG_RESULT($enabled)
  352. AC_SUBST(U_ENABLE_TRACING)
  353. # check if elf.h is present.
  354. AC_CHECK_HEADERS([elf.h])
  355. if test "x$ac_cv_header_elf_h" = "xyes"; then
  356. CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_HAVE_ELF_H=1";
  357. fi
  358. # Enable/disable plugins
  359. AC_ARG_ENABLE(plugins,
  360. [ --enable-plugins enable plugins [default=no]],
  361. [case "${enableval}" in
  362. yes) plugins=true ;;
  363. no) plugins=false ;;
  364. *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugins) ;;
  365. esac],
  366. plugins=false)
  367. ICU_CONDITIONAL(PLUGINS, test "$plugins" = true)
  368. if test "x$plugins" = "xtrue"; then
  369. UCONFIG_CPPFLAGS="$UCONFIG_CPPFLAGS -DUCONFIG_ENABLE_PLUGINS=1"
  370. fi
  371. U_ENABLE_DYLOAD=1
  372. enable=yes
  373. AC_MSG_CHECKING([whether to enable dynamic loading of plugins. Ignored if plugins disabled.])
  374. AC_ARG_ENABLE(dyload,
  375. [ --disable-dyload disable dynamic loading [default=no]],
  376. [ case "${enableval}" in
  377. yes|"")
  378. U_ENABLE_DYLOAD=1
  379. enable=yes
  380. ;;
  381. no)
  382. U_ENABLE_DYLOAD=0;
  383. enable=no;
  384. CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DU_ENABLE_DYLOAD=0";
  385. ;;
  386. *) ;;
  387. esac],
  388. )
  389. AC_MSG_RESULT($enable)
  390. AC_SUBST(U_ENABLE_DYLOAD)
  391. if test "$enable" = "yes"; then
  392. AC_CHECK_HEADERS([dlfcn.h])
  393. #AC_MSG_RESULT($enabled)
  394. AC_SEARCH_LIBS([dlopen], [dl])
  395. AC_CHECK_FUNCS([dlopen])
  396. if test "x$ac_cv_func_dlopen" != xyes; then
  397. CONFIG_CPPFLAGS="$CONFIG_CPPFLAGS -DHAVE_DLOPEN=0"
  398. fi
  399. fi
  400. # Check for miscellanous functions.
  401. # So, use for putil / tools only.
  402. # Note that this will generate HAVE_GETTIMEOFDAY, not U_HAVE_GETTIMEOFDAY
  403. AC_CHECK_FUNCS([gettimeofday])
  404. # Check whether to use the evil rpath or not
  405. AC_ARG_ENABLE(rpath,
  406. [ --enable-rpath use rpath when linking [default is only if necessary]],
  407. [ case "${enableval}" in
  408. yes|"") ENABLE_RPATH=YES ;;
  409. no) ;;
  410. *) ;;
  411. esac],
  412. [ENABLE_RPATH=NO]
  413. )
  414. AC_SUBST(ENABLE_RPATH)
  415. AC_LANG_PUSH([C++])
  416. AC_MSG_CHECKING([[if we have a C++ compiler]])
  417. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx_okay=yes],[cxx_okay=no])
  418. if test $cxx_okay = yes
  419. then
  420. AC_MSG_RESULT([[Good]])
  421. else
  422. AC_MSG_RESULT([[no]])
  423. AC_MSG_ERROR([[C++ compiler $CXX does not work or no compiler found]])
  424. fi
  425. if [[ "$GXX" = yes ]]; then
  426. # if CXXFLAGS does not have a "-std=" setting, set it now to -std=c++0x,
  427. # and check that the compiler still works.
  428. if ! echo "$CXXFLAGS" | grep '\-std=' >/dev/null 2>&1; then
  429. OLD_CXXFLAGS="${CXXFLAGS}"
  430. CXXFLAGS="$CXXFLAGS --std=c++0x"
  431. AC_MSG_CHECKING([[if we have a C++11 compiler]])
  432. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[cxx11_okay=yes],[cxx11_okay=no])
  433. AC_MSG_RESULT($cxx11_okay)
  434. if [[ $cxx11_okay = yes ]]; then
  435. AC_MSG_NOTICE([Adding CXXFLAGS option --std=c++0x])
  436. UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} --std=c++0x"
  437. else
  438. CXXFLAGS="$OLD_CXXFLAGS"
  439. fi
  440. case "${host}" in
  441. *-*-solaris*)
  442. CXXFLAGS="$OLD_CXXFLAGS"
  443. ;;
  444. esac
  445. fi
  446. fi
  447. AC_MSG_CHECKING([[if #include <string> works]])
  448. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string>]], [[]])], [ac_cv_header_stdstring=yes], [ac_cv_header_stdstring=no])
  449. AC_MSG_RESULT($ac_cv_header_stdstring)
  450. if test $ac_cv_header_stdstring = yes
  451. then
  452. U_HAVE_STD_STRING=1
  453. else
  454. U_HAVE_STD_STRING=0
  455. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STD_STRING=0"
  456. fi
  457. AC_SUBST(U_HAVE_STD_STRING)
  458. AC_MSG_CHECKING([[if #include <atomic> works]])
  459. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no])
  460. AC_MSG_RESULT($ac_cv_header_atomic)
  461. if test $ac_cv_header_atomic = yes
  462. then
  463. U_HAVE_ATOMIC=1
  464. else
  465. U_HAVE_ATOMIC=0
  466. fi
  467. # Make this available via CPPFLAGS
  468. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=${U_HAVE_ATOMIC}"
  469. AC_SUBST(U_HAVE_ATOMIC)
  470. AC_LANG_POP([C++])
  471. # Always build ICU with multi-threading support.
  472. OLD_LIBS=${LIBS}
  473. # For Compaq Tru64 (OSF1), we must look for pthread_attr_init
  474. # and must do this before seaching for pthread_mutex_destroy, or
  475. # we will pick up libpthreads.so not libpthread.so
  476. # If this fails, then we must test for HPUX specials, before
  477. # moving on to a more generic test
  478. AC_CHECK_LIB(pthread, pthread_attr_init)
  479. if test $ac_cv_lib_pthread_pthread_attr_init = yes; then
  480. :
  481. else
  482. # Locate the right library for POSIX threads. We look for the
  483. # symbols in the libraries first, because on Solaris libc provides
  484. # pthread_create but libpthread has the real code :(
  485. # AIX uses libpthreads instead of libpthread, and HP/UX uses libpthread
  486. # FreeBSD users may need libpthread if they do not have libc_r.
  487. AC_SEARCH_LIBS_FIRST(pthread_mutex_destroy, pthread pthreads c_r )
  488. if test "$ac_cv_search_pthread_mutex_destroy" != no; then
  489. :
  490. else
  491. # For HP 11
  492. AC_CHECK_LIB(pthread, pthread_mutex_init)
  493. if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then
  494. :
  495. fi
  496. fi
  497. AC_CHECK_FUNC(pthread_mutex_lock)
  498. if test $ac_cv_func_pthread_mutex_lock = yes; then
  499. :
  500. fi
  501. fi
  502. # Check to see if we are using CygWin with MSVC
  503. case "${host}" in
  504. *-pc-cygwin*|*-pc-mingw*)
  505. # For gcc, the thread options are set by mh-mingw/mh-cygwin
  506. # For msvc, the thread options are set by runConfigureICU
  507. :
  508. ;;
  509. *-*-hpux*)
  510. # Add -mt because it does several nice things on newer compilers.
  511. case "${icu_cv_host_frag}" in
  512. mh-hpux-acc)
  513. OLD_CXXFLAGS="${CXXFLAGS}"
  514. CXXFLAGS="${CXXFLAGS} -mt"
  515. if test x"`${CXX} ${CXXFLAGS} 2>&1`" != x""; then
  516. CXXFLAGS="${OLD_CXXFLAGS}"
  517. else
  518. UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -mt"
  519. fi
  520. ;;
  521. esac
  522. ;;
  523. *-*-solaris*)
  524. case "${icu_cv_host_frag}" in
  525. mh-solaris)
  526. LIBS="${LIBS} -mt"
  527. ;;
  528. esac
  529. ;;
  530. esac
  531. AC_ARG_ENABLE(weak-threads,
  532. [ --enable-weak-threads weakly reference the threading library [default=no]],
  533. [case "${enableval}" in
  534. yes)
  535. LIB_THREAD="${LIBS%${OLD_LIBS}}"
  536. LIBS=${OLD_LIBS}
  537. ;;
  538. no) ;;
  539. *) AC_MSG_ERROR(bad value ${enableval} for --enable-weak-threads) ;;
  540. esac])
  541. AC_SUBST(LIB_THREAD)
  542. # Check for mmap()
  543. # The AC_FUNC_MMAP macro doesn't work properly. It seems to be too specific.
  544. # Do this check instead.
  545. HAVE_MMAP=0
  546. AC_MSG_CHECKING([for mmap])
  547. AC_CACHE_VAL(ac_cv_func_mmap_ok,
  548. [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
  549. #include <sys/mman.h>
  550. #include <sys/stat.h>
  551. #include <fcntl.h>], [mmap((void *)0, 0, PROT_READ, 0, 0, 0);])],[ac_cv_func_mmap_ok=yes],[ac_cv_func_mmap_ok=no])] )
  552. AC_MSG_RESULT($ac_cv_func_mmap_ok)
  553. if test $ac_cv_func_mmap_ok = yes
  554. then
  555. HAVE_MMAP=1
  556. else
  557. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_MMAP=0"
  558. fi
  559. AC_SUBST(HAVE_MMAP)
  560. AC_MSG_CHECKING([for genccode assembly])
  561. # Check to see if genccode can generate simple assembly.
  562. GENCCODE_ASSEMBLY=
  563. case "${host}" in
  564. *-linux*|*-kfreebsd*-gnu*|i*86-*-*bsd*|i*86-pc-gnu)
  565. if test "$GCC" = yes; then
  566. # We're using gcc, and the simple -a gcc command line works for genccode
  567. GENCCODE_ASSEMBLY="-a gcc"
  568. fi ;;
  569. i*86-*-solaris*)
  570. if test "$GCC" = yes; then
  571. # When using gcc, look if we're also using GNU as.
  572. # When using GNU as, the simple -a gcc command line works for genccode.
  573. asv=`"${CC}" -print-prog-name=as 2>/dev/null`
  574. asv=`"${asv}" --version 2>/dev/null`
  575. case "X${asv}" in
  576. X*GNU*) GENCCODE_ASSEMBLY="-a gcc" ;;
  577. X*) GENCCODE_ASSEMBLY="-a sun-x86" ;;
  578. esac
  579. unset asv
  580. else
  581. GENCCODE_ASSEMBLY="-a sun-x86"
  582. fi ;;
  583. sparc-*-solaris*)
  584. GENCCODE_ASSEMBLY="-a sun"
  585. ;;
  586. ia64-*-hpux*)
  587. # There has been some issues with building ICU data on HPUX ia64 aCC
  588. # when using the assemble code setting below. For now, build without
  589. # assemble code for this platform. This will increase the build time.
  590. # GENCCODE_ASSEMBLY="-a aCC-ia64"
  591. ;;
  592. esac
  593. AC_SUBST(GENCCODE_ASSEMBLY)
  594. AC_MSG_RESULT($GENCCODE_ASSEMBLY)
  595. # Checks for header files
  596. AC_CHECK_HEADERS(inttypes.h)
  597. if test $ac_cv_header_inttypes_h = no; then
  598. U_HAVE_INTTYPES_H=0
  599. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
  600. else
  601. U_HAVE_INTTYPES_H=1
  602. fi
  603. if test "$CC" = ccc; then
  604. AC_MSG_RESULT("C compiler set to CCC ${CC}" )
  605. case "${host}" in
  606. alpha*-*-*) U_HAVE_INTTYPES_H=0;
  607. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INTTYPES_H=0"
  608. esac
  609. fi
  610. AC_SUBST(U_HAVE_INTTYPES_H)
  611. AC_CHECK_HEADERS(dirent.h)
  612. if test $ac_cv_header_dirent_h = no; then
  613. U_HAVE_DIRENT_H=0
  614. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_DIRENT_H=0"
  615. else
  616. U_HAVE_DIRENT_H=1
  617. fi
  618. AC_SUBST(U_HAVE_DIRENT_H)
  619. # Check for endianness
  620. AC_C_BIGENDIAN()
  621. if test $ac_cv_c_bigendian = no; then
  622. U_IS_BIG_ENDIAN=0
  623. U_ENDIAN_CHAR="l"
  624. else
  625. U_IS_BIG_ENDIAN=1
  626. U_ENDIAN_CHAR="b"
  627. fi
  628. AC_SUBST(U_IS_BIG_ENDIAN)
  629. # Do various POSIX related checks
  630. U_HAVE_NL_LANGINFO_CODESET=0
  631. U_NL_LANGINFO_CODESET=-1
  632. AC_CHECK_FUNC(nl_langinfo,[U_HAVE_NL_LANGINFO=1],[U_HAVE_NL_LANGINFO=0])
  633. dnl AC_SUBST(U_HAVE_NL_LANGINFO)
  634. if test $U_HAVE_NL_LANGINFO -eq 1; then
  635. AC_CACHE_CHECK([for nl_langinfo's argument to obtain the codeset],
  636. ac_cv_nl_langinfo_codeset,
  637. [ac_cv_nl_langinfo_codeset="unknown"
  638. for a in CODESET _NL_CTYPE_CODESET_NAME; do
  639. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo($a);]])],[ac_cv_nl_langinfo_codeset="$a"; break],[])]
  640. done)
  641. if test x$ac_cv_nl_langinfo_codeset != xunknown
  642. then
  643. U_HAVE_NL_LANGINFO_CODESET=1
  644. U_NL_LANGINFO_CODESET=$ac_cv_nl_langinfo_codeset
  645. if test "x${ac_cv_nl_langinfo_codeset}" != "xCODESET"
  646. then
  647. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DNL_LANGINFO_CODESET=${ac_cv_nl_langinfo_codeset}"
  648. fi
  649. else
  650. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_NL_LANGINFO_CODESET=0"
  651. fi
  652. fi
  653. AC_SUBST(U_HAVE_NL_LANGINFO_CODESET)
  654. AC_SUBST(U_NL_LANGINFO_CODESET)
  655. # Namespace support checks
  656. AC_LANG(C++)
  657. AC_MSG_CHECKING([for namespace support])
  658. AC_CACHE_VAL(ac_cv_namespace_ok,
  659. [AC_LINK_IFELSE([AC_LANG_PROGRAM([namespace x_version {void f(){}}
  660. namespace x = x_version;
  661. using namespace x_version;
  662. ], [f();])],[ac_cv_namespace_ok=yes],[ac_cv_namespace_ok=no])] )
  663. AC_MSG_RESULT($ac_cv_namespace_ok)
  664. if test $ac_cv_namespace_ok = no
  665. then
  666. AC_MSG_ERROR(Namespace support is required to build ICU.)
  667. fi
  668. AC_MSG_CHECKING([for properly overriding new and delete])
  669. U_OVERRIDE_CXX_ALLOCATION=0
  670. U_HAVE_PLACEMENT_NEW=0
  671. AC_CACHE_VAL(ac_cv_override_cxx_allocation_ok,
  672. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
  673. class UMemory {
  674. public:
  675. void *operator new(size_t size) {return malloc(size);}
  676. void *operator new[](size_t size) {return malloc(size);}
  677. void operator delete(void *p) {free(p);}
  678. void operator delete[](void *p) {free(p);}
  679. };
  680. ]], [])],[ac_cv_override_cxx_allocation_ok=yes],[ac_cv_override_cxx_allocation_ok=no])] )
  681. AC_MSG_RESULT($ac_cv_override_cxx_allocation_ok)
  682. if test $ac_cv_override_cxx_allocation_ok = yes
  683. then
  684. U_OVERRIDE_CXX_ALLOCATION=1
  685. AC_MSG_CHECKING([for placement new and delete])
  686. AC_CACHE_VAL(ac_cv_override_placement_new_ok,
  687. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
  688. class UMemory {
  689. public:
  690. void *operator new(size_t size) {return malloc(size);}
  691. void *operator new[](size_t size) {return malloc(size);}
  692. void operator delete(void *p) {free(p);}
  693. void operator delete[](void *p) {free(p);}
  694. void * operator new(size_t, void *ptr) { return ptr; }
  695. void operator delete(void *, void *) {}
  696. };
  697. ]], [])],[ac_cv_override_placement_new_ok=yes],[ac_cv_override_placement_new_ok=no])] )
  698. AC_MSG_RESULT($ac_cv_override_placement_new_ok)
  699. if test $ac_cv_override_placement_new_ok = yes
  700. then
  701. U_HAVE_PLACEMENT_NEW=1
  702. else
  703. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_PLACEMENT_NEW=0"
  704. fi
  705. else
  706. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_OVERRIDE_CXX_ALLOCATION=0"
  707. fi
  708. AC_SUBST(U_OVERRIDE_CXX_ALLOCATION)
  709. AC_SUBST(U_HAVE_PLACEMENT_NEW)
  710. AC_LANG(C)
  711. AC_CHECK_FUNC(popen)
  712. if test x$ac_cv_func_popen = xyes
  713. then
  714. U_HAVE_POPEN=1
  715. else
  716. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_POPEN=0"
  717. U_HAVE_POPEN=0
  718. fi
  719. AC_SUBST(U_HAVE_POPEN)
  720. AC_CHECK_FUNC(tzset)
  721. U_HAVE_TZSET=0
  722. if test x$ac_cv_func_tzset = xyes
  723. then
  724. U_TZSET=tzset
  725. U_HAVE_TZSET=1
  726. else
  727. AC_CHECK_FUNC(_tzset)
  728. if test x$ac_cv_func__tzset = xyes
  729. then
  730. U_TZSET=_tzset
  731. U_HAVE_TZSET=1
  732. else
  733. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZSET=0"
  734. fi
  735. fi
  736. AC_SUBST(U_HAVE_TZSET)
  737. AC_SUBST(U_TZSET)
  738. U_HAVE_TZNAME=0
  739. AC_CACHE_CHECK(for tzname,ac_cv_var_tzname,
  740. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifndef _XOPEN_SOURCE
  741. #define _XOPEN_SOURCE
  742. #endif
  743. #include <stdlib.h>
  744. #include <time.h>
  745. #ifndef tzname /* For SGI. */
  746. extern char *tzname[]; /* RS6000 and others reject char **tzname. */
  747. #endif]], [atoi(*tzname);])],[ac_cv_var_tzname=yes],[ac_cv_var_tzname=no])])
  748. if test $ac_cv_var_tzname = yes; then
  749. U_TZNAME=tzname
  750. U_HAVE_TZNAME=1
  751. else
  752. AC_CACHE_CHECK(for _tzname,ac_cv_var__tzname,
  753. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
  754. #include <time.h>
  755. extern char *_tzname[];]], [atoi(*_tzname);])],[ac_cv_var__tzname=yes],[ac_cv_var__tzname=no])])
  756. if test $ac_cv_var__tzname = yes; then
  757. U_TZNAME=_tzname
  758. U_HAVE_TZNAME=1
  759. else
  760. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TZNAME=0"
  761. fi
  762. fi
  763. AC_SUBST(U_HAVE_TZNAME)
  764. AC_SUBST(U_TZNAME)
  765. AC_CACHE_CHECK(for timezone,ac_cv_var_timezone,
  766. [AC_LINK_IFELSE([AC_LANG_PROGRAM([#ifndef _XOPEN_SOURCE
  767. #define _XOPEN_SOURCE
  768. #endif
  769. #include <time.h>
  770. ], [[timezone = 1;]])],[ac_cv_var_timezone=yes],[ac_cv_var_timezone=no])])
  771. U_HAVE_TIMEZONE=0
  772. if test $ac_cv_var_timezone = yes; then
  773. U_TIMEZONE=timezone
  774. U_HAVE_TIMEZONE=1
  775. else
  776. AC_CACHE_CHECK(for __timezone,ac_cv_var___timezone,
  777. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[__timezone = 1;]])],[ac_cv_var___timezone=yes],[ac_cv_var___timezone=no])])
  778. if test $ac_cv_var___timezone = yes; then
  779. U_TIMEZONE=__timezone
  780. U_HAVE_TIMEZONE=1
  781. else
  782. AC_CACHE_CHECK(for _timezone,ac_cv_var__timezone,
  783. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[_timezone = 1;]])],[ac_cv_var__timezone=yes],[ac_cv_var__timezone=no])])
  784. if test $ac_cv_var__timezone = yes; then
  785. U_TIMEZONE=_timezone
  786. U_HAVE_TIMEZONE=1
  787. else
  788. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_TIMEZONE=0"
  789. fi
  790. fi
  791. fi
  792. AC_SUBST(U_HAVE_TIMEZONE)
  793. AC_SUBST(U_TIMEZONE)
  794. AC_CHECK_FUNC(strtod_l)
  795. if test x$ac_cv_func_strtod_l = xyes
  796. then
  797. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=1"
  798. U_HAVE_STRTOD_L=1
  799. else
  800. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_STRTOD_L=0"
  801. U_HAVE_STRTOD_L=0
  802. fi
  803. AC_SUBST(U_HAVE_STRTOD_L)
  804. # Checks for typedefs
  805. AC_CHECK_TYPE(int8_t,signed char)
  806. AC_CHECK_TYPE(uint8_t,unsigned char)
  807. AC_CHECK_TYPE(int16_t,signed short)
  808. AC_CHECK_TYPE(uint16_t,unsigned short)
  809. AC_CHECK_TYPE(int32_t,signed long)
  810. AC_CHECK_TYPE(uint32_t,unsigned long)
  811. AC_CHECK_TYPE(int64_t,signed long long)
  812. AC_CHECK_TYPE(uint64_t,unsigned long long)
  813. if test $ac_cv_type_int8_t = no; then
  814. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT8_T=0"
  815. fi
  816. if test $ac_cv_type_uint8_t = no; then
  817. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT8_T=0"
  818. fi
  819. if test $ac_cv_type_int16_t = no; then
  820. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT16_T=0"
  821. fi
  822. if test $ac_cv_type_uint16_t = no; then
  823. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT16_T=0"
  824. fi
  825. if test $ac_cv_type_int32_t = no; then
  826. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT32_T=0"
  827. fi
  828. if test $ac_cv_type_uint32_t = no; then
  829. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT32_T=0"
  830. fi
  831. if test $ac_cv_type_int64_t = no; then
  832. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_INT64_T=0"
  833. fi
  834. if test $ac_cv_type_uint64_t = no; then
  835. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_UINT64_T=0"
  836. fi
  837. # Do various wchar_t related checks
  838. AC_CHECK_HEADER(wchar.h)
  839. if test "$ac_cv_header_wchar_h" = no
  840. then
  841. U_HAVE_WCHAR_H=0
  842. U_HAVE_WCSCPY=0
  843. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCHAR_H=0 -DU_HAVE_WCSCPY=0"
  844. else
  845. AC_DEFINE([HAVE_WCHAR_H], [1], [wchar.h was found.])
  846. U_HAVE_WCHAR_H=1
  847. # Some broken systems have wchar.h but not some of its functions...
  848. AC_SEARCH_LIBS(wcscpy, wcs w)
  849. if test "$ac_cv_search_wcscpy" != no; then
  850. U_HAVE_WCSCPY=1
  851. else
  852. U_HAVE_WCSCPY=0
  853. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_WCSCPY=0"
  854. fi
  855. fi
  856. AC_SUBST(U_HAVE_WCHAR_H)
  857. AC_SUBST(U_HAVE_WCSCPY)
  858. AC_CHECK_SIZEOF([wchar_t], 0, [
  859. #if STDC_HEADERS
  860. #include <stddef.h>
  861. #endif
  862. #include <stdlib.h>
  863. #if HAVE_WCHAR_H
  864. #include <string.h>
  865. #include <wchar.h>
  866. #endif])
  867. U_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
  868. # We do this check to verify that everything is okay.
  869. if test $U_SIZEOF_WCHAR_T = 0; then
  870. if test $U_HAVE_WCHAR_H=1; then
  871. AC_MSG_ERROR(There is wchar.h but the size of wchar_t is 0)
  872. fi
  873. fi
  874. AC_MSG_CHECKING([for UTF-16 string literal support])
  875. U_CHECK_UTF16_STRING=1
  876. CHECK_UTF16_STRING_RESULT="unknown"
  877. case "${host}" in
  878. *-*-aix*|powerpc64-*-linux*)
  879. if test "$GCC" = no; then
  880. OLD_CFLAGS="${CFLAGS}"
  881. OLD_CXXFLAGS="${CXXFLAGS}"
  882. CFLAGS="${CFLAGS} -qutf"
  883. CXXFLAGS="${CXXFLAGS} -qutf"
  884. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = u"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
  885. if test "$U_CHECK_UTF16_STRING" = 0; then
  886. CFLAGS="${OLD_CFLAGS}"
  887. CXXFLAGS="${OLD_CXXFLAGS}"
  888. else
  889. UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -qutf"
  890. CHECK_UTF16_STRING_RESULT="-qutf"
  891. fi
  892. fi
  893. ;;
  894. *-*-solaris*)
  895. if test "$GCC" = no; then
  896. OLD_CFLAGS="${CFLAGS}"
  897. OLD_CXXFLAGS="${CXXFLAGS}"
  898. CFLAGS="${CFLAGS} -xustr=ascii_utf16_ushort"
  899. CXXFLAGS="${CXXFLAGS} -xustr=ascii_utf16_ushort"
  900. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[const unsigned short hello[] = U"hello";]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])
  901. if test "$U_CHECK_UTF16_STRING" = 0; then
  902. CFLAGS="${OLD_CFLAGS}"
  903. CXXFLAGS="${OLD_CXXFLAGS}"
  904. else
  905. CHECK_UTF16_STRING_RESULT="-xustr=ascii_utf16_ushort"
  906. UCONFIG_CXXFLAGS="${UCONFIG_CXXFLAGS} -xustr=ascii_utf16_ushort"
  907. UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -xustr=ascii_utf16_ushort"
  908. # Since we can't detect the availability of this UTF-16 syntax at compile time,
  909. # we depend on configure telling us that we can use it.
  910. # Since we can't ensure ICU users use -xustr=ascii_utf16_ushort,
  911. # we only use this macro within ICU.
  912. # If an ICU user uses icu-config, this feature will be enabled.
  913. CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_CHECK_UTF16_STRING=1"
  914. U_CHECK_UTF16_STRING=0
  915. fi
  916. fi
  917. ;;
  918. *-*-hpux*)
  919. if test "$GCC" = no; then
  920. # The option will be detected at compile time without additional compiler options.
  921. CHECK_UTF16_STRING_RESULT="available"
  922. fi
  923. ;;
  924. *-*-cygwin)
  925. # wchar_t can be used
  926. CHECK_UTF16_STRING_RESULT="available"
  927. ;;
  928. *)
  929. ;;
  930. esac
  931. # GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future.
  932. if test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
  933. if test "$GCC" = yes; then
  934. OLD_CFLAGS="${CFLAGS}"
  935. CFLAGS="${CFLAGS} -std=gnu99"
  936. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  937. static const char16_t test[] = u"This is a UTF16 literal string.";
  938. ]], [[]])],[CC_UTF16_STRING=1],[CC_UTF16_STRING=0])
  939. if test "$CC_UTF16_STRING" = 1; then
  940. UCONFIG_CFLAGS="${UCONFIG_CFLAGS} -std=gnu99"
  941. CHECK_UTF16_STRING_RESULT="C only";
  942. else
  943. CFLAGS="${OLD_CFLAGS}"
  944. fi
  945. fi
  946. if test "$GXX" = yes; then
  947. # -Wno-return-type-c-linkage is desired so that stable ICU API is not warned about.
  948. AC_LANG_PUSH([C++])
  949. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  950. static const char16_t test[] = u"This is a UTF16 literal string.";
  951. ]], [[]])],[CXX_UTF16_STRING=1],[CXX_UTF16_STRING=0])
  952. AC_LANG_POP([C++])
  953. if test "$CXX_UTF16_STRING" = 1; then
  954. if test "$CC_UTF16_STRING" = 1; then
  955. CHECK_UTF16_STRING_RESULT="available";
  956. else
  957. CHECK_UTF16_STRING_RESULT="C++ only";
  958. fi
  959. fi
  960. fi
  961. fi
  962. AC_MSG_RESULT($CHECK_UTF16_STRING_RESULT)
  963. # Enable/disable extras
  964. AC_ARG_ENABLE(extras,
  965. [ --enable-extras build ICU extras [default=yes]],
  966. [case "${enableval}" in
  967. yes) extras=true ;;
  968. no) extras=false ;;
  969. *) AC_MSG_ERROR(bad value ${enableval} for --enable-extras) ;;
  970. esac],
  971. extras=true)
  972. ICU_CONDITIONAL(EXTRAS, test "$extras" = true)
  973. AC_ARG_ENABLE(icuio,
  974. [ --enable-icuio build ICU's icuio library [default=yes]],
  975. [case "${enableval}" in
  976. yes) icuio=true ;;
  977. no) icuio=false ;;
  978. *) AC_MSG_ERROR(bad value ${enableval} for --enable-icuio) ;;
  979. esac],
  980. icuio=true)
  981. ICU_CONDITIONAL(ICUIO, test "$icuio" = true)
  982. # Enable/disable layoutex
  983. AC_ARG_ENABLE(layoutex,
  984. [ --enable-layoutex build ICU's Paragraph Layout library [default=yes].
  985. icu-le-hb must be installed via pkg-config. See http://harfbuzz.org],
  986. [case "${enableval}" in
  987. yes) layoutex=$have_icu_le_hb ;;
  988. no) layoutex=false ;;
  989. *) AC_MSG_ERROR(bad value ${enableval} for --enable-layoutex) ;;
  990. esac],
  991. layoutex=$have_icu_le_hb)
  992. ICU_CONDITIONAL(LAYOUTEX, test "$layoutex" = true)
  993. # Enable/disable layout
  994. AC_ARG_ENABLE(layout,
  995. [],
  996. [case "${enableval}" in
  997. yes) AC_MSG_ERROR(The ICU Layout Engine has been removed.) ;;
  998. no) ;;
  999. *) ;;
  1000. esac],
  1001. )
  1002. # Enable/disable tools
  1003. AC_ARG_ENABLE(tools,
  1004. [ --enable-tools build ICU's tools [default=yes]],
  1005. [case "${enableval}" in
  1006. yes) tools=true ;;
  1007. no) tools=false ;;
  1008. *) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
  1009. esac],
  1010. tools=true)
  1011. ICU_CONDITIONAL(TOOLS, test "$tools" = true)
  1012. AC_ARG_WITH(data-packaging,
  1013. [ --with-data-packaging specify how to package ICU data. Possible values:
  1014. files raw files (.res, etc)
  1015. archive build a single icudtXX.dat file
  1016. library shared library (.dll/.so/etc.)
  1017. static static library (.a/.lib/etc.)
  1018. auto build shared if possible (default)
  1019. See http://userguide.icu-project.org/icudata for more info.],
  1020. [case "${withval}" in
  1021. files|archive|library) datapackaging=$withval ;;
  1022. auto) datapackaging=$withval ;;
  1023. common) datapackaging=archive ;;
  1024. dll) datapackaging=library ;;
  1025. static) datapackaging=static ;;
  1026. *) AC_MSG_ERROR(bad value ${withval} for --with-data-packaging) ;;
  1027. esac],
  1028. [datapackaging=])
  1029. # Note: 'thesysconfdir' is an evaluated version, for Man pages, so also for thedatadir, thelibdir, etc..
  1030. # thesysconfdir=`eval echo $sysconfdir`
  1031. dnl# AC_SUBST(thesysconfdir)
  1032. dnl# thelibdir=`test "x$exec_prefix" = xNONE && exec_prefix="$prefix"; eval echo $libdir`
  1033. dnl# AC_SUBST(thelibdir)
  1034. thedatadir=`eval echo $datadir`
  1035. dnl# AC_SUBST(thedatadir)
  1036. # 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}.
  1037. pkgicudatadir=$datadir
  1038. thepkgicudatadir=$thedatadir
  1039. AC_SUBST(pkgicudatadir)
  1040. AC_SUBST(thepkgicudatadir)
  1041. dnl# Shouldn't need the AC_SUBST
  1042. if test x"$datapackaging" = x -o x"$datapackaging" = xauto; then
  1043. # default to library
  1044. datapackaging=library
  1045. if test "$ENABLE_STATIC" = "YES"; then
  1046. if test "$ENABLE_SHARED" != "YES"; then
  1047. datapackaging=static
  1048. fi
  1049. fi
  1050. fi
  1051. datapackaging_dir=`eval echo $thedatadir`"/icu/${VERSION}"
  1052. datapackaging_msg="(No explaination for mode $datapackaging.)"
  1053. 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."
  1054. 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."
  1055. datapackaging_howfound="(unknown)"
  1056. case "$datapackaging" in
  1057. files)
  1058. DATA_PACKAGING_MODE=files
  1059. datapackaging_msg="ICU data will be stored in individual files."
  1060. datapackaging_howfound="$datapackaging_msg_path"
  1061. ;;
  1062. archive)
  1063. DATA_PACKAGING_MODE=common
  1064. datapackaging_msg="ICU data will be stored in a single .dat file."
  1065. datapackaging_howfound="$datapackaging_msg_path"
  1066. ;;
  1067. library)
  1068. DATA_PACKAGING_MODE=dll
  1069. datapackaging_msg="ICU data will be linked with ICU."
  1070. if test "$ENABLE_STATIC" = "YES"; then
  1071. datapackaging_msg="$datapackaging_msg A static data library will be built. "
  1072. fi
  1073. if test "$ENABLE_SHARED" = "YES"; then
  1074. datapackaging_msg="$datapackaging_msg A shared data library will be built. "
  1075. fi
  1076. datapackaging_howfound="$datapackaging_msg_set"
  1077. ;;
  1078. static)
  1079. DATA_PACKAGING_MODE=static
  1080. datapackaging_msg="ICU data will be stored in a static library."
  1081. datapackaging_howfound="$datapackaging_msg_set"
  1082. ;;
  1083. esac
  1084. AC_SUBST(DATA_PACKAGING_MODE)
  1085. # Sets a library suffix
  1086. AC_MSG_CHECKING([for a library suffix to use])
  1087. AC_ARG_WITH(library-suffix,
  1088. [ --with-library-suffix=suffix tag a suffix to the library names [default=]],
  1089. [ICULIBSUFFIX="${withval}"],
  1090. [ICULIBSUFFIX=])
  1091. msg=$ICULIBSUFFIX
  1092. if test "$msg" = ""; then
  1093. msg=none
  1094. fi
  1095. AC_MSG_RESULT($msg)
  1096. AC_SUBST(ICULIBSUFFIX)
  1097. if test "$ICULIBSUFFIX" != ""
  1098. then
  1099. U_HAVE_LIB_SUFFIX=1
  1100. ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/[^A-Za-z0-9_]/_/g'`
  1101. UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} "
  1102. else
  1103. U_HAVE_LIB_SUFFIX=0
  1104. fi
  1105. AC_SUBST(U_HAVE_LIB_SUFFIX)
  1106. AC_SUBST(ICULIBSUFFIXCNAME)
  1107. # Enable/disable tests
  1108. AC_ARG_ENABLE(tests,
  1109. [ --enable-tests build ICU tests [default=yes]],
  1110. [case "${enableval}" in
  1111. yes) tests=true ;;
  1112. no) tests=false ;;
  1113. *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
  1114. esac],
  1115. tests=true)
  1116. ICU_CONDITIONAL(TESTS, test "$tests" = true)
  1117. # Enable/disable samples
  1118. AC_ARG_ENABLE(samples,
  1119. [ --enable-samples build ICU samples [default=yes]
  1120. Additionally, the variable FORCE_LIBS may be set before calling configure.
  1121. If set, it will REPLACE any automatic list of libraries.],
  1122. [case "${enableval}" in
  1123. yes) samples=true ;;
  1124. no) samples=false ;;
  1125. *) AC_MSG_ERROR(bad value ${enableval} for --enable-samples) ;;
  1126. esac],
  1127. samples=true)
  1128. ICU_CONDITIONAL(SAMPLES, test "$samples" = true)
  1129. ICUDATA_CHAR=$U_ENDIAN_CHAR
  1130. # Platform-specific Makefile setup
  1131. # set ICUDATA_CHAR to 'e' for any EBCDIC (which should be big endian) platform.
  1132. case "${host}" in
  1133. *-*-solaris*) platform=U_SOLARIS ;;
  1134. *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) platform=U_LINUX ;;
  1135. *-*-*bsd*|*-*-dragonfly*) platform=U_BSD ;;
  1136. *-*-aix*) platform=U_AIX ;;
  1137. *-*-hpux*) platform=U_HPUX ;;
  1138. *-apple-darwin*|*-apple-rhapsody*) platform=U_DARWIN ;;
  1139. *-*-cygwin*) platform=U_CYGWIN ;;
  1140. *-*-mingw*) platform=U_MINGW ;;
  1141. *-*ibm-openedition*|*-*-os390*) platform=OS390
  1142. if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
  1143. ICUDATA_CHAR="e"
  1144. fi ;;
  1145. *-*-os400*) platform=OS400
  1146. if test "${ICU_ENABLE_ASCII_STRINGS}" != "1"; then
  1147. ICUDATA_CHAR="e"
  1148. fi ;;
  1149. *-*-nto*) platform=U_QNX ;;
  1150. *-dec-osf*) platform=U_OSF ;;
  1151. *-*-beos) platform=U_BEOS ;;
  1152. *-*-irix*) platform=U_IRIX ;;
  1153. *-ncr-*) platform=U_MPRAS ;;
  1154. *) platform=U_UNKNOWN_PLATFORM ;;
  1155. esac
  1156. AC_SUBST(ICUDATA_CHAR)
  1157. AC_SUBST(platform)
  1158. platform_make_fragment_name="$icu_cv_host_frag"
  1159. platform_make_fragment='$(top_srcdir)/config/'"$platform_make_fragment_name"
  1160. AC_SUBST(platform_make_fragment_name)
  1161. AC_SUBST(platform_make_fragment)
  1162. if test "${FORCE_LIBS}" != ""; then
  1163. echo " *** Overriding automatically chosen [LIBS=$LIBS], using instead [FORCE_LIBS=${FORCE_LIBS}]" 1>&6
  1164. LIBS=${FORCE_LIBS}
  1165. fi
  1166. # Now that we're done using CPPFLAGS etc. for tests, we can change it
  1167. # for build.
  1168. if test "${CC}" == "clang"; then
  1169. CLANGCFLAGS="-Qunused-arguments -Wno-parentheses-equality"
  1170. else
  1171. CLANGCFLAGS=""
  1172. fi
  1173. if test "${CXX}" == "clang++"; then
  1174. CLANGCXXFLAGS="-Qunused-arguments -Wno-parentheses-equality"
  1175. else
  1176. CLANGCXXFLAGS=""
  1177. fi
  1178. CPPFLAGS="$CPPFLAGS \$(THREADSCPPFLAGS)"
  1179. CFLAGS="$CFLAGS \$(THREADSCFLAGS) $CLANGCFLAGS"
  1180. CXXFLAGS="$CXXFLAGS \$(THREADSCXXFLAGS) $CLANGCXXFLAGS"
  1181. AC_SUBST(LIBCFLAGS)
  1182. AC_SUBST(LIBCXXFLAGS)
  1183. # append all config cppflags
  1184. CPPFLAGS="$CPPFLAGS $CONFIG_CPPFLAGS $UCONFIG_CPPFLAGS"
  1185. echo "CPPFLAGS=$CPPFLAGS"
  1186. echo "CFLAGS=$CFLAGS"
  1187. echo "CXXFLAGS=$CXXFLAGS"
  1188. # output the Makefiles
  1189. AC_CONFIG_FILES([icudefs.mk \
  1190. Makefile \
  1191. data/pkgdataMakefile \
  1192. config/Makefile.inc \
  1193. config/icu.pc \
  1194. config/pkgdataMakefile \
  1195. data/Makefile \
  1196. stubdata/Makefile \
  1197. common/Makefile \
  1198. i18n/Makefile \
  1199. layoutex/Makefile \
  1200. io/Makefile \
  1201. extra/Makefile \
  1202. extra/uconv/Makefile \
  1203. extra/uconv/pkgdataMakefile \
  1204. extra/scrptrun/Makefile \
  1205. tools/Makefile \
  1206. tools/ctestfw/Makefile \
  1207. tools/toolutil/Makefile \
  1208. tools/makeconv/Makefile \
  1209. tools/genrb/Makefile \
  1210. tools/genccode/Makefile \
  1211. tools/gencmn/Makefile \
  1212. tools/gencnval/Makefile \
  1213. tools/gendict/Makefile \
  1214. tools/gentest/Makefile \
  1215. tools/gennorm2/Makefile \
  1216. tools/genbrk/Makefile \
  1217. tools/gensprep/Makefile \
  1218. tools/icuinfo/Makefile \
  1219. tools/icupkg/Makefile \
  1220. tools/icuswap/Makefile \
  1221. tools/pkgdata/Makefile \
  1222. tools/tzcode/Makefile \
  1223. tools/gencfu/Makefile \
  1224. test/Makefile \
  1225. test/compat/Makefile \
  1226. test/testdata/Makefile \
  1227. test/testdata/pkgdataMakefile \
  1228. test/hdrtst/Makefile \
  1229. test/intltest/Makefile \
  1230. test/cintltst/Makefile \
  1231. test/iotest/Makefile \
  1232. test/letest/Makefile \
  1233. test/perf/Makefile \
  1234. test/perf/collationperf/Makefile \
  1235. test/perf/collperf/Makefile \
  1236. test/perf/collperf2/Makefile \
  1237. test/perf/dicttrieperf/Makefile \
  1238. test/perf/ubrkperf/Makefile \
  1239. test/perf/charperf/Makefile \
  1240. test/perf/convperf/Makefile \
  1241. test/perf/normperf/Makefile \
  1242. test/perf/DateFmtPerf/Makefile \
  1243. test/perf/howExpensiveIs/Makefile \
  1244. test/perf/strsrchperf/Makefile \
  1245. test/perf/unisetperf/Makefile \
  1246. test/perf/usetperf/Makefile \
  1247. test/perf/ustrperf/Makefile \
  1248. test/perf/utfperf/Makefile \
  1249. test/perf/utrie2perf/Makefile \
  1250. test/perf/leperf/Makefile \
  1251. samples/Makefile samples/date/Makefile \
  1252. samples/cal/Makefile samples/layout/Makefile])
  1253. AC_OUTPUT
  1254. echo
  1255. echo "ICU for C/C++ $VERSION is ready to be built."
  1256. echo "=== Important Notes: ==="
  1257. echo "Data Packaging: $datapackaging"
  1258. echo " This means: $datapackaging_msg"
  1259. echo " To locate data: $datapackaging_howfound"
  1260. if test -n "`$U_MAKE -v 2>&1 | grep '^GNU Make'`"; then
  1261. echo "Building ICU: Use a GNU make such as $U_MAKE to build ICU."
  1262. else
  1263. echo "** WARNING: $U_MAKE may not be GNU make."
  1264. echo "This may cause ICU to fail to build. Please make sure that GNU make"
  1265. echo "is in your PATH so that the configure script can detect its location."
  1266. fi
  1267. if test "x$AR" = "xfalse"; then
  1268. echo "*** WARNING: Archiver ar not found. Set AR= or fix PATH. Some builds (such as static) may fail."
  1269. fi
  1270. AC_MSG_CHECKING([the version of "$U_MAKE"])
  1271. if "$U_MAKE" -f "$srcdir/config/gmakever.mk" PLATFORM="$platform"; then
  1272. AC_MSG_RESULT([ok])
  1273. else
  1274. AC_MSG_RESULT([too old or test failed - try upgrading GNU Make])
  1275. fi
  1276. AC_SUBST(UCONFIG_CPPFLAGS)
  1277. if test -n "$UCONFIG_CPPFLAGS"; then
  1278. HDRFILE="uconfig.h.prepend"
  1279. echo "*** WARNING: You must set the following flags before code compiled against this ICU will function properly:"
  1280. echo
  1281. echo " ${UCONFIG_CPPFLAGS}"
  1282. echo
  1283. 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.'
  1284. echo "Creating the file ${HDRFILE}"
  1285. echo
  1286. echo '--------------- ' "${HDRFILE}"
  1287. echo > "${HDRFILE}"
  1288. echo '/* ICU customizations: put these lines at the top of uconfig.h */' >> "${HDRFILE}"
  1289. echo >> "${HDRFILE}"
  1290. for flag in ${UCONFIG_CPPFLAGS};
  1291. do
  1292. echo " /* $flag */" >> "${HDRFILE}"
  1293. case "${flag}" in
  1294. -D*=*)
  1295. [ \echo "${flag}" | sed -n 's%-D\([^=]*\)=%#define \1 %p' >> "${HDRFILE}" ]
  1296. \echo >> "${HDRFILE}"
  1297. ;;
  1298. -D*)
  1299. [ \echo "${flag}" | sed -n 's%-D\([^=]*\)%#define \1 %p' >> "${HDRFILE}" ]
  1300. \echo >> "${HDRFILE}"
  1301. ;;
  1302. *)
  1303. \echo "/* Not sure how to handle this argument: ${flag} */" >> "${HDRFILE}"
  1304. \echo >> "${HDRFILE}"
  1305. ;;
  1306. esac
  1307. done
  1308. cat "${HDRFILE}"
  1309. \echo "/* End of ${HDRFILE} ------------ */" >> "${HDRFILE}"
  1310. echo >> "${HDRFILE}"
  1311. echo '--------------- end ' "${HDRFILE}"
  1312. fi
  1313. AC_SUBST(UCONFIG_CFLAGS)
  1314. if test -n "$UCONFIG_CFLAGS"; then
  1315. echo "C apps may want to build with CFLAGS = ${UCONFIG_CFLAGS}"
  1316. fi
  1317. AC_SUBST(UCONFIG_CXXFLAGS)
  1318. if test -n "$UCONFIG_CXXFLAGS"; then
  1319. echo "C++ apps may want to build with CXXFLAGS = ${UCONFIG_CXXFLAGS}"
  1320. fi
  1321. if test "$tools" = false;
  1322. then
  1323. echo "## Note: you have disabled ICU's tools. This ICU cannot build its own data or tests."
  1324. echo "## Expect build failures in the 'data', 'test', and other directories."
  1325. fi
  1326. $as_unset _CXX_CXXSUFFIX