icu-config 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. #!/bin/sh
  2. ## -*-sh-*-
  3. #set -x
  4. # BEGIN of icu-config-top
  5. #******************************************************************************
  6. # Copyright (C) 1999-2013, International Business Machines
  7. # Corporation and others. All Rights Reserved.
  8. #******************************************************************************
  9. # This script is designed to aid configuration of ICU.
  10. # rpath links a library search path right into the binaries.
  11. #
  12. # Note: it's preferred to use the .pc files rather than icu-config.
  13. #
  14. ### END of icu-config-top
  15. ## Zero out prefix.
  16. execprefix=
  17. prefix=
  18. loaddefs()
  19. {
  20. # Following from ../icu/source/config/mh-linux
  21. ## -*-makefile-*-
  22. #******************************************************************************
  23. # Copyright (C) 1999-2014, International Business Machines
  24. # Corporation and others. All Rights Reserved.
  25. #******************************************************************************
  26. # This Makefile.inc is designed to be included into projects which make use
  27. # of the ICU.
  28. # CONTENTS OF THIS FILE
  29. # 1). Base configuration information and linkage
  30. # 2). Variables giving access to ICU tools
  31. # 3). Host information
  32. # 4). Compiler flags and settings
  33. # 5). Data Packaging directives
  34. # 6). Include of platform make fragment (mh-* file)
  35. ##################################################################
  36. #
  37. # *1* base configuration information and linkage
  38. #
  39. ##################################################################
  40. # The PREFIX is the base of where ICU is installed.
  41. # Inside this directory you should find bin, lib, include/unicode,
  42. # etc. If ICU is not installed in this directory, you must change the
  43. # following line. There should exist ${prefix}/include/unicode/utypes.h
  44. # for example.
  45. default_prefix="/usr"
  46. if [ "x${prefix}" = "x" ]; then prefix="$default_prefix"; fi
  47. exec_prefix="/usr"
  48. libdir="/usr/lib"
  49. libexecdir="/usr/libexec"
  50. bindir="/usr/bin"
  51. datarootdir="${prefix}/share"
  52. datadir="/usr/share"
  53. sbindir="/usr/sbin"
  54. # about the ICU version
  55. VERSION="57.1"
  56. UNICODE_VERSION="8.0"
  57. # The prefix for ICU libraries, normally 'icu'
  58. ICUPREFIX="icu"
  59. PACKAGE="icu"
  60. LIBICU="lib${ICUPREFIX}"
  61. # Static library prefix and file extension
  62. STATIC_PREFIX="s"
  63. LIBSICU="lib${STATIC_PREFIX}${ICUPREFIX}"
  64. A="a"
  65. # Suffix at the end of libraries. Usually empty.
  66. ICULIBSUFFIX=""
  67. # ICULIBSUFFIX_VERSION is non-empty if it is to contain a library
  68. # version. For example, if it is 21, it means libraries are named
  69. # libicuuc21.so for example.
  70. # rpath links a library search path right into the binaries.
  71. ## mh-files MUST NOT override RPATHLDFLAGS unless they provide
  72. ## equivalent '#SH#' lines for icu-config fixup
  73. default_ENABLE_RPATH="NO"
  74. if [ "x${ENABLE_RPATH}" = "x" ]; then ENABLE_RPATH="$default_ENABLE_RPATH"; fi
  75. RPATHLDFLAGS="${LD_RPATH}${LD_RPATH_PRE}${libdir}"
  76. # icu-config version of above 'if':
  77. case "x$ENABLE_RPATH" in
  78. x[yY]*)
  79. ENABLE_RPATH=YES
  80. RPATHLDFLAGS="${LD_RPATH}${LD_RPATH_PRE}${libdir}"
  81. ;;
  82. x[nN]*)
  83. ENABLE_RPATH=NO
  84. RPATHLDFLAGS=""
  85. ;;
  86. x)
  87. ENABLE_RPATH=NO
  88. RPATHLDFLAGS=""
  89. ;;
  90. *)
  91. echo $0: Unknown --enable-rpath value ${ENABLE_RPATH} 1>&2
  92. exit 3
  93. ;;
  94. esac
  95. # Name flexibility for the library naming scheme. Any modifications should
  96. # be made in the mh- file for the specific platform.
  97. DATA_STUBNAME="data"
  98. COMMON_STUBNAME="uc"
  99. I18N_STUBNAME="i18n"
  100. LAYOUT_STUBNAME="le"
  101. LAYOUTEX_STUBNAME="lx"
  102. IO_STUBNAME="io"
  103. TOOLUTIL_STUBNAME="tu"
  104. CTESTFW_STUBNAME="test"
  105. ### To link your application with ICU:
  106. # 1. use LDFLAGS, CFLAGS, etc from above
  107. # 2. link with ${ICULIBS}
  108. # 3. optionally, add one or more of:
  109. # - ${ICULIBS_I18N} - i18n library, formatting, etc.
  110. # - ${ICULIBS_LAYOUT} - ICU layout library.
  111. # - ${ICULIBS_ICUIO} - ICU stdio equivalent library
  112. ICULIBS_COMMON="-l${ICUPREFIX}uc${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  113. ICULIBS_DATA="-l${ICUPREFIX}${DATA_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  114. ICULIBS_I18N="-l${ICUPREFIX}${I18N_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  115. ICULIBS_TOOLUTIL="-l${ICUPREFIX}tu${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  116. ICULIBS_CTESTFW="-l${ICUPREFIX}ctestfw${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  117. ICULIBS_ICUIO="-l${ICUPREFIX}io${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  118. ICULIBS_OBSOLETE="-l${ICUPREFIX}obsolete${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  119. ICULIBS_LAYOUT="-l${ICUPREFIX}le${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  120. ICULIBS_LAYOUTEX="-l${ICUPREFIX}lx${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}"
  121. ICULIBS_BASE="-L${libdir}"
  122. # for icu-config to test with
  123. ICULIBS_COMMON_LIB_NAME="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}"
  124. ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}"
  125. # ICULIBS is the set of libraries your application should link
  126. # with usually. Many applications will want to add ${ICULIBS_I18N} as well.
  127. ICULIBS="${ICULIBS_BASE} ${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA} "
  128. # Proper echo newline handling is needed in icu-config
  129. ECHO_N="-n"
  130. ECHO_C=""
  131. # Not currently being used but good to have for proper tab handling
  132. ECHO_T=""
  133. ##################################################################
  134. #
  135. # *2* access to ICU tools
  136. #
  137. ##################################################################
  138. # Environment variable to set a runtime search path
  139. # (Overridden when necessary in -mh files)
  140. LDLIBRARYPATH_ENVVAR="LD_LIBRARY_PATH"
  141. # Versioned target for a shared library
  142. ## FINAL_SO_TARGET = ${SO_TARGET}.${SO_TARGET_VERSION}
  143. ## MIDDLE_SO_TARGET = ${SO_TARGET}.${SO_TARGET_VERSION_MAJOR}
  144. # Access to important ICU tools.
  145. # Use as follows: ${INVOKE} ${GENRB} arguments ..
  146. INVOKE="${LDLIBRARYPATH_ENVVAR}=${libdir}:$$${LDLIBRARYPATH_ENVVAR} ${LEAK_CHECKER}"
  147. GENCCODE="${sbindir}/genccode"
  148. ICUPKG="${sbindir}/icupkg"
  149. GENCMN="${sbindir}/gencmn"
  150. GENRB="${bindir}/genrb"
  151. PKGDATA="${bindir}/pkgdata"
  152. # moved here because of dependencies
  153. pkgdatadir="${datadir}/${PACKAGE}${ICULIBSUFFIX}/${VERSION}"
  154. pkglibdir="${libdir}/${PACKAGE}${ICULIBSUFFIX}/${VERSION}"
  155. ##################################################################
  156. #
  157. # *3* Information about the host
  158. #
  159. ##################################################################
  160. # Information about the host that 'configure' was run on.
  161. host="arm-unknown-linux-gnueabi"
  162. host_alias="arm-linux-gnueabi"
  163. host_cpu="arm"
  164. host_vendor="unknown"
  165. host_os="linux-gnueabi"
  166. # Our platform canonical name (as determined by configure)
  167. # this is a #define value (i.e. U_XXXX or XXXX)
  168. platform="U_LINUX"
  169. ##################################################################
  170. #
  171. # *4* compiler flags and misc. options
  172. #
  173. ##################################################################
  174. AR="arm-linux-gnueabihf-ar"
  175. # initial tab keeps it out of the shell version.
  176. ARFLAGS=" ${ARFLAGS}"
  177. CC="arm-linux-gnueabihf-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm"
  178. CPP="arm-linux-gnueabihf-gcc -E --sysroot=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard"
  179. CFLAGS=""
  180. CPPFLAGS="-I${prefix}/include"
  181. CXXFLAGS="--std=c++0x"
  182. CXX="arm-linux-gnueabihf-g++ -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm"
  183. DEFAULT_MODE="dll"
  184. DEFS="-DPACKAGE_NAME=\"ICU\" -DPACKAGE_TARNAME=\"International\ Components\ for\ Unicode\" -DPACKAGE_VERSION=\"57.1\" -DPACKAGE_STRING=\"ICU\ 57.1\" -DPACKAGE_BUGREPORT=\"http://icu-project.org/bugs\" -DPACKAGE_URL=\"http://icu-project.org\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=4 -DHAVE_LIBM=1 -DHAVE_ELF_H=1 -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_LIBPTHREAD=1 -DHAVE_INTTYPES_H=1 -DHAVE_DIRENT_H=1 -DHAVE_WCHAR_H=1 -DSIZEOF_WCHAR_T=4 "
  185. # use a consistent INSTALL
  186. INSTALL="${SHELL} ${pkgdatadir}/install-sh -c"
  187. INSTALL_DATA="${INSTALL} -m 644"
  188. INSTALL_PROGRAM="${INSTALL}"
  189. INSTALL_SCRIPT="${INSTALL}"
  190. LDFLAGS="${RPATHLDFLAGS}"
  191. LIBS="-lpthread -ldl -lm "
  192. LIB_M=""
  193. LIB_VERSION="57.1"
  194. LIB_VERSION_MAJOR="57"
  195. MKINSTALLDIRS="${SHELL} ${pkgdatadir}/mkinstalldirs"
  196. RANLIB="arm-linux-gnueabihf-ranlib"
  197. RMV="rm -rf"
  198. SHELL="/bin/sh"
  199. SHLIB_c="${CC} ${DEFS} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -shared"
  200. SHLIB_cc="${CXX} ${DEFS} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -shared"
  201. U_IS_BIG_ENDIAN="0"
  202. includedir="/usr/include"
  203. infodir="/usr/share/info"
  204. localstatedir="/var"
  205. mandir="/usr/share/man"
  206. oldincludedir="/usr/include"
  207. program_transform_name="s,x,x,"
  208. sharedstatedir="/com"
  209. sysconfdir="/etc"
  210. INSTALL_L="${INSTALL_DATA}"
  211. # for derivative builds - don't bother with VERBOSE/NONVERBOSE SILENT_COMPILE
  212. ##################################################################
  213. #
  214. # *5* packaging options and directories
  215. #
  216. ##################################################################
  217. # The basename of the ICU data file (i.e. icudt21b )
  218. ICUDATA_CHAR="l"
  219. ICUDATA_NAME="icudt57l"
  220. # Defaults for pkgdata's mode and directories
  221. # The default data dir changes depending on what packaging mode
  222. # is being used
  223. if [ "x$PKGDATA_MODE" = "x" ];
  224. then
  225. PKGDATA_MODE="dll"
  226. fi
  227. case "$PKGDATA_MODE" in
  228. common)
  229. ICUDATA_DIR="${pkgdatadir}"
  230. ICUPKGDATA_DIR="${ICUDATA_DIR}"
  231. ;;
  232. dll)
  233. ICUDATA_DIR="${pkgdatadir}"
  234. ICUPKGDATA_DIR="${libdir}"
  235. ;;
  236. *)
  237. ICUDATA_DIR="${pkgdatadir}"
  238. ICUPKGDATA_DIR="${ICUDATA_DIR}"
  239. ;;
  240. esac
  241. GENCCODE_ASSEMBLY="-a gcc"
  242. ##################################################################
  243. #
  244. # *6* Inclusion of platform make fragment (mh-* file)
  245. #
  246. ##################################################################
  247. # The mh- file ("make fragment") for the platform is included here.
  248. # It may override the above settings.
  249. # It is put last so that the mh-file can override anything.
  250. # The selfcheck is just a sanity check that this makefile is
  251. # parseable. The mh fragment is only included if this does not occur.
  252. ## -*-makefile-*-
  253. ## Linux-specific setup
  254. ## Copyright (c) 1999-2013, International Business Machines Corporation and
  255. ## others. All Rights Reserved.
  256. ## Commands to generate dependency files
  257. GEN_DEPS_c="${CC} -E -MM ${DEFS} ${CPPFLAGS}"
  258. GEN_DEPS_cc="${CXX} -E -MM ${DEFS} ${CPPFLAGS} ${CXXFLAGS}"
  259. ## Flags for position independent code
  260. SHAREDLIBCFLAGS="-fPIC"
  261. SHAREDLIBCXXFLAGS="-fPIC"
  262. SHAREDLIBCPPFLAGS="-DPIC"
  263. ## Additional flags when building libraries and with threads
  264. THREADSCPPFLAGS="-D_REENTRANT"
  265. LIBCPPFLAGS=""
  266. ## Compiler switch to embed a runtime search path
  267. LD_RPATH="-Wl,-zorigin,-rpath,\$\$ORIGIN "
  268. LD_RPATH_PRE="-Wl,-rpath,"
  269. ## These are the library specific LDFLAGS
  270. # LDFLAGSICUDT=-nodefaultlibs -nostdlib
  271. ## Compiler switch to embed a library name
  272. # The initial tab in the next line is to prevent icu-config from reading it.
  273. # We can't depend on MIDDLE_SO_TARGET being set.
  274. LD_SONAME=
  275. ## Shared library options
  276. LD_SOOPTIONS="-Wl,-Bsymbolic"
  277. ## Shared object suffix
  278. SO="so"
  279. ## Non-shared intermediate object suffix
  280. STATIC_O="ao"
  281. ## Compilation rules
  282. ## Dependency rules
  283. ## Versioned libraries rules
  284. ## Bind internal references
  285. # LDflags that pkgdata will use
  286. BIR_LDFLAGS="-Wl,-Bsymbolic"
  287. # Dependencies [i.e. map files] for the final library
  288. BIR_DEPS=""
  289. ## Remove shared library 's'
  290. STATIC_PREFIX_WHEN_USED=""
  291. STATIC_PREFIX=""
  292. ## End Linux-specific setup
  293. ## -*-sh-*-
  294. ## BEGIN of icu-config-bottom.
  295. ## Copyright (c) 2002-2013, International Business Machines Corporation and
  296. ## others. All Rights Reserved.
  297. ICUUC_FILE="${libdir}/${ICULIBS_COMMON_LIB_NAME}"
  298. ICUUC_FILE_A="${libdir}/${ICULIBS_COMMON_LIB_NAME_A}"
  299. # echo ENABLE RPATH $ENABLE_RPATH and RPATHLDFLAGS=${RPATH_LDFLAGS}
  300. if [ "x$PKGDATA_MODE" = "x" ]; then
  301. PKGDATA_MODE=dll
  302. fi
  303. }
  304. ## The actual code of icu-config goes here.
  305. ME=`basename "$0"`
  306. allflags()
  307. {
  308. echo " --noverify Don't verify that ICU is actually installed."
  309. echo " --bindir Print binary directory path (bin)"
  310. echo " --cc Print C compiler used [CC]"
  311. echo " --cflags Print C compiler flags [CFLAGS]"
  312. echo " --cflags-dynamic Print additional C flags for"
  313. echo " building shared libraries."
  314. echo " --cppflags Print C Preprocessor flags [CPPFLAGS]"
  315. echo " --cppflags-dynamic Print additional C Preprocessor flags for"
  316. echo " building shared libraries."
  317. echo " --cppflags-searchpath Print only -I include directives (-Iinclude)"
  318. echo " --cxx Print C++ compiler used [CXX]"
  319. echo " --cxxflags Print C++ compiler flags [CXXFLAGS]"
  320. echo " --cxxflags-dynamic Print additional C++ flags for"
  321. echo " building shared libraries."
  322. echo " --detect-prefix Attempt to detect prefix based on PATH"
  323. echo " --exec-prefix Print prefix for executables (/bin)"
  324. echo " --exists Return with 0 status if ICU exists else fail"
  325. echo " --help, -?, --usage Print this message"
  326. echo " --icudata Print shortname of ICU data file (icudt21l)"
  327. echo " --icudata-install-dir Print path to install data to - use as --install option to pkgdata(1)"
  328. echo " --icudata-mode Print default ICU pkgdata mode (dll) - use as --mode option to pkgdata(1)."
  329. echo " --icudatadir Print path to packaged archive data. Can set as [ICU_DATA]"
  330. echo " --invoke Print commands to invoke an ICU program"
  331. echo " --invoke=<prog> Print commands to invoke an ICU program named <prog> (ex: genrb)"
  332. echo " --ldflags Print -L search path and -l libraries to link with ICU [LDFLAGS]. This is for the data, uc (common), and i18n libraries only. "
  333. echo " --ldflags-layout Print ICU layout engine link directive. Use in addition to --ldflags"
  334. echo " --ldflags-libsonly Same as --ldflags, but only the -l directives"
  335. echo " --ldflags-searchpath Print only -L (search path) directive"
  336. echo " --ldflags-system Print only system libs ICU links with (-lpthread, -lm)"
  337. echo " --ldflags-icuio Print ICU icuio link directive. Use in addition to --ldflags "
  338. echo " --ldflags-obsolete Print ICU obsolete link directive. Use in addition to --ldflags. (requires icuapps/obsolete to be built and installed.) "
  339. echo " --mandir Print manpage (man) path"
  340. echo " --prefix Print PREFIX to icu install (/usr/local)"
  341. echo " --prefix=XXX Set prefix to XXX for remainder of command"
  342. echo " --sbindir Print system binary path (sbin) "
  343. echo " --shared-datadir Print shared data (share) path. This is NOT the ICU data dir."
  344. echo " --shlib-c Print the command to compile and build C shared libraries with ICU"
  345. echo " --shlib-cc Print the command to compile and build C++ shared libraries with ICU"
  346. echo " --sysconfdir Print system config (etc) path"
  347. echo " --unicode-version Print version of Unicode data used in ICU ($UNICODE_VERSION)"
  348. echo " --version Print ICU version ($VERSION)"
  349. echo " --incfile Print path to Makefile.inc"
  350. echo " --incpkgdatafile Print path to pkgdata.inc (for -O option of pkgdata)"
  351. echo " --install Print path to install-sh"
  352. echo " --mkinstalldirs Print path to mkinstalldirs"
  353. }
  354. ## Print the normal usage message
  355. shortusage()
  356. {
  357. echo "usage: ${ME} " `allflags | cut -c-25 | sed -e 's%.*%[ & ]%'`
  358. }
  359. usage()
  360. {
  361. echo "${ME}: icu-config: ICU configuration helper script"
  362. echo
  363. echo "The most commonly used options will be --cflags, --cxxflags, --cppflags, and --ldflags."
  364. echo 'Example (in make): CPFLAGS=$(shell icu-config --cppflags)'
  365. echo ' LDFLAGS=$(shell icu-config --ldflags)'
  366. echo " (etc).."
  367. echo
  368. echo "Usage:"
  369. allflags
  370. echo
  371. echo " [Brackets] show MAKE variable equivalents, (parenthesis) show example output"
  372. echo
  373. echo "Copyright (c) 2002-2013, International Business Machines Corporation and others. All Rights Reserved."
  374. echo
  375. echo "NOTE: Please consider using the pkg-config (.pc) files instead of icu-config."
  376. echo " See: <http://userguide.icu-project.org/howtouseicu#TOC-pkg-config> "
  377. }
  378. ## Check the sanity of current variables
  379. sanity()
  380. {
  381. if [ ! -f "${ICUUC_FILE}" -a ! -f "${ICUUC_FILE_A}" ] && [ ${IGNORE_ICUUC_FILE_CHECK} = "no" ] && [ ${SANITY} = "sane" ];
  382. then
  383. echo "### $ME: Can't find ${ICUUC_FILE} - ICU prefix is wrong." 1>&2
  384. echo "### Try the --prefix= option " 1>&2
  385. echo "### or --detect-prefix" 1>&2
  386. echo "### (If you want to disable this check, use the --noverify option)" 1>&2
  387. echo "### $ME: Exitting." 1>&2
  388. exit 2
  389. fi
  390. }
  391. ## Main starts here.
  392. if [ $# -lt 1 ]; then
  393. shortusage
  394. exit 1
  395. fi
  396. # For certain options (e.g. --detect-prefix) don't check for icuuc library file.
  397. IGNORE_ICUUC_FILE_CHECK="no";
  398. SANITY="sane"
  399. case "$1" in
  400. --noverify)
  401. SANITY="nosanity"
  402. shift
  403. ;;
  404. esac
  405. case "$1" in
  406. *prefix*)
  407. IGNORE_ICUUC_FILE_CHECK="yes"
  408. ;;
  409. esac
  410. # Load our variables from autoconf
  411. # ALWAYS load twice because of dependencies
  412. loaddefs
  413. loaddefs
  414. if [ $# -gt 0 -a $1 = "--selfcheck" ];
  415. then
  416. echo "passed"
  417. exit
  418. # EXIT for self check
  419. fi
  420. sanity
  421. while [ $# -gt 0 ];
  422. do
  423. arg="$1"
  424. var=`echo $arg | sed -e 's/^[^=]*=//'`
  425. # echo "### processing $arg" 1>&2
  426. case "$arg" in
  427. # undocumented.
  428. --debug)
  429. set -x
  430. ;;
  431. --noverify)
  432. echo "### $ME: Error: --noverify must be the first argument." 1>&2
  433. exit 1
  434. ;;
  435. --so)
  436. echo $SO
  437. ;;
  438. --bindir)
  439. echo $bindir
  440. ;;
  441. --libdir)
  442. echo $libdir
  443. ;;
  444. --exists)
  445. sanity
  446. ;;
  447. --sbindir)
  448. echo $sbindir
  449. ;;
  450. --mkinstalldirs)
  451. echo ${MKINSTALLDIRS}
  452. ;;
  453. --install)
  454. echo ${INSTALL}
  455. ;;
  456. --invoke=*)
  457. QUOT="\""
  458. CMD="${var}"
  459. # If it's not a locally executable command (1st choice) then
  460. # search for it in the ICU directories.
  461. if [ ! -x ${CMD} ]; then
  462. if [ -x ${bindir}/${var} ]; then
  463. CMD="${bindir}/${var}"
  464. fi
  465. if [ -x ${sbindir}/${var} ]; then
  466. CMD="${sbindir}/${var}"
  467. fi
  468. fi
  469. echo "env ${QUOT}${LDLIBRARYPATH_ENVVAR}=${libdir}:"'${'"${LDLIBRARYPATH_ENVVAR}"'}'${QUOT} ${CMD}
  470. ;;
  471. --invoke)
  472. QUOT="\""
  473. echo "env ${QUOT}${LDLIBRARYPATH_ENVVAR}=${libdir}:"'${'"${LDLIBRARYPATH_ENVVAR}"'}'${QUOT}
  474. ;;
  475. --cflags)
  476. echo $ECHO_N "${CFLAGS} ${ECHO_C}"
  477. ;;
  478. --cc)
  479. echo $ECHO_N "${CC} ${ECHO_C}"
  480. ;;
  481. --cxx)
  482. echo $ECHO_N "${CXX} ${ECHO_C}"
  483. ;;
  484. --cxxflags)
  485. echo $ECHO_N "${CXXFLAGS} ${ECHO_C}"
  486. ;;
  487. --cppflags)
  488. # Don't echo the -I. - it's unneeded.
  489. echo $ECHO_N "${CPPFLAGS} ${ECHO_C}" | sed -e 's/-I. //'
  490. ;;
  491. --cppflags-searchpath)
  492. echo $ECHO_N "-I${prefix}/include ${ECHO_C}"
  493. ;;
  494. --cppflags-dynamic)
  495. echo $ECHO_N "${SHAREDLIBCPPFLAGS} ${ECHO_C}"
  496. ;;
  497. --cxxflags-dynamic)
  498. echo $ECHO_N "${SHAREDLIBCXXFLAGS} ${ECHO_C}"
  499. ;;
  500. --cflags-dynamic)
  501. echo $ECHO_N "${SHAREDLIBCFLAGS} ${ECHO_C}"
  502. ;;
  503. --ldflags-system)
  504. echo $ECHO_N "${LIBS} ${ECHO_C}"
  505. ;;
  506. --ldflags)
  507. echo $ECHO_N "${LDFLAGS} ${ICULIBS} ${ECHO_C}"
  508. # $RPATH_LDFLAGS
  509. ;;
  510. --ldflags-libsonly)
  511. echo $ECHO_N "${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA} ${ECHO_C}"
  512. ;;
  513. --ldflags-icuio)
  514. echo $ECHO_N " ${ICULIBS_ICUIO} ${ECHO_C}"
  515. ;;
  516. --ldflags-obsolete)
  517. echo $ECHO_N "${ICULIBS_OBSOLETE} ${ECHO_C}"
  518. ;;
  519. --ldflags-toolutil)
  520. echo $ECHO_N " ${ICULIBS_TOOLUTIL} ${ECHO_C}"
  521. ;;
  522. --ldflags-layout)
  523. echo $ECHO_N "${ICULIBS_LAYOUT} ${ICULIBS_LAYOUTEX} ${ECHO_C}"
  524. ;;
  525. --ldflags-searchpath)
  526. echo $ECHO_N "-L${libdir} ${ECHO_C}"
  527. ;;
  528. --detect-prefix)
  529. HERE=`echo $0 | sed -e "s/$ME//g"`
  530. if [ -f "${HERE}/../lib/${ICULIBS_COMMON_LIB_NAME}" -o -f "${HERE}/../lib/${ICULIBS_COMMON_LIB_NAME_A}" ]; then
  531. prefix="${HERE}/.."
  532. echo "## Using --prefix=${prefix}" 1>&2
  533. fi
  534. loaddefs
  535. loaddefs
  536. ;;
  537. --exec-prefix)
  538. echo $exec_prefix
  539. ;;
  540. --prefix)
  541. echo $prefix
  542. ;;
  543. --prefix=*)
  544. prefix=$var
  545. loaddefs
  546. loaddefs
  547. ;;
  548. --sysconfdir)
  549. echo $sysconfdir
  550. ;;
  551. --mandir)
  552. echo $mandir
  553. ;;
  554. --shared-datadir)
  555. echo $ECHO_N "${datadir} ${ECHO_C}"
  556. ;;
  557. --incfile)
  558. echo $ECHO_N "${pkglibdir}/Makefile.inc ${ECHO_C}"
  559. ;;
  560. --incpkgdatafile)
  561. echo $ECHO_N "${pkglibdir}/pkgdata.inc ${ECHO_C}"
  562. ;;
  563. --icudata)
  564. echo $ECHO_N "${ICUDATA_NAME} ${ECHO_C}"
  565. ;;
  566. --icudata-mode)
  567. echo $ECHO_N "${PKGDATA_MODE} ${ECHO_C}"
  568. ;;
  569. --icudata-install-dir)
  570. echo $ECHO_N "${ICUPKGDATA_DIR} ${ECHO_C}"
  571. ;;
  572. --icudatadir)
  573. echo $ECHO_N "${ICUDATA_DIR} ${ECHO_C}"
  574. ;;
  575. --shlib-c)
  576. echo $ECHO_N "${SHLIB_c} ${ECHO_C}"
  577. ;;
  578. --shlib-cc)
  579. echo $ECHO_N "${SHLIB_cc} ${ECHO_C}"
  580. ;;
  581. --version)
  582. echo $ECHO_N $VERSION
  583. ;;
  584. --unicode-version)
  585. echo $ECHO_N $UNICODE_VERSION
  586. ;;
  587. --host)
  588. echo $host
  589. exit 0
  590. ;;
  591. --help)
  592. usage
  593. exit 0
  594. ;;
  595. --usage)
  596. usage
  597. exit 0
  598. ;;
  599. # --enable-rpath=*)
  600. # ENABLE_RPATH=$var
  601. # loaddefs
  602. # ;;
  603. -?)
  604. usage
  605. exit 0
  606. ;;
  607. *)
  608. echo ${ME}: ERROR Unknown Option $arg 1>&2
  609. echo 1>&2
  610. shortusage 1>&2
  611. echo "### $ME: Exitting." 1>&2
  612. exit 1;
  613. ;;
  614. esac
  615. shift
  616. # Reset the ignore icuuc file check flag
  617. if [ $IGNORE_ICUUC_FILE_CHECK = "yes" ]; then
  618. IGNORE_ICUUC_FILE_CHECK="no"
  619. sanity
  620. fi
  621. done
  622. echo
  623. # Check once before we quit (will check last used prefix)
  624. sanity
  625. ## END of icu-config-bottom
  626. exit 0