icu-config 22 KB

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