2 ## BEGIN of icu-config-bottom.
3 ## Copyright (C) 2016 and later: Unicode, Inc. and others.
4 ## License & terms of use: http://www.unicode.org/copyright.html
5 ## Copyright (c) 2002-2013, International Business Machines Corporation and
6 ## others. All Rights Reserved.
8 ICUUC_FILE="${libdir}/${ICULIBS_COMMON_LIB_NAME}"
9 ICUUC_FILE_A="${libdir}/${ICULIBS_COMMON_LIB_NAME_A}"
11 # echo ENABLE RPATH $ENABLE_RPATH and RPATHLDFLAGS=${RPATH_LDFLAGS}
12 if [ "x$PKGDATA_MODE" = "x" ]; then
18 ## The actual code of icu-config goes here.
24 echo " --noverify Don't verify that ICU is actually installed."
25 echo " --bindir Print binary directory path (bin)"
26 echo " --cc Print C compiler used [CC]"
27 echo " --cflags Print C compiler flags [CFLAGS]"
28 echo " --cflags-dynamic Print additional C flags for"
29 echo " building shared libraries."
30 echo " --cppflags Print C Preprocessor flags [CPPFLAGS]"
31 echo " --cppflags-dynamic Print additional C Preprocessor flags for"
32 echo " building shared libraries."
33 echo " --cppflags-searchpath Print only -I include directives (-Iinclude)"
34 echo " --cxx Print C++ compiler used [CXX]"
35 echo " --cxxflags Print C++ compiler flags [CXXFLAGS]"
36 echo " --cxxflags-dynamic Print additional C++ flags for"
37 echo " building shared libraries."
38 echo " --detect-prefix Attempt to detect prefix based on PATH"
39 echo " --exec-prefix Print prefix for executables (/bin)"
40 echo " --exists Return with 0 status if ICU exists else fail"
41 echo " --help, -?, --usage Print this message"
42 echo " --icudata Print shortname of ICU data file (icudt21l)"
43 echo " --icudata-install-dir Print path to install data to - use as --install option to pkgdata(1)"
44 echo " --icudata-mode Print default ICU pkgdata mode (dll) - use as --mode option to pkgdata(1)."
45 echo " --icudatadir Print path to packaged archive data. Can set as [ICU_DATA]"
46 echo " --invoke Print commands to invoke an ICU program"
47 echo " --invoke=<prog> Print commands to invoke an ICU program named <prog> (ex: genrb)"
48 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. "
49 echo " --ldflags-libsonly Same as --ldflags, but only the -l directives"
50 echo " --ldflags-searchpath Print only -L (search path) directive"
51 echo " --ldflags-system Print only system libs ICU links with (-lpthread, -lm)"
52 echo " --ldflags-icuio Print ICU icuio link directive. Use in addition to --ldflags "
53 echo " --ldflags-obsolete Print ICU obsolete link directive. Use in addition to --ldflags. (requires icuapps/obsolete to be built and installed.) "
54 echo " --mandir Print manpage (man) path"
55 echo " --prefix Print PREFIX to icu install (/usr/local)"
56 echo " --prefix=XXX Set prefix to XXX for remainder of command"
57 echo " --sbindir Print system binary path (sbin) "
58 echo " --shared-datadir Print shared data (share) path. This is NOT the ICU data dir."
59 echo " --shlib-c Print the command to compile and build C shared libraries with ICU"
60 echo " --shlib-cc Print the command to compile and build C++ shared libraries with ICU"
61 echo " --sysconfdir Print system config (etc) path"
62 echo " --unicode-version Print version of Unicode data used in ICU ($UNICODE_VERSION)"
63 echo " --version Print ICU version ($VERSION)"
64 echo " --incfile Print path to Makefile.inc"
65 echo " --incpkgdatafile Print path to pkgdata.inc (for -O option of pkgdata)"
66 echo " --install Print path to install-sh"
67 echo " --mkinstalldirs Print path to mkinstalldirs"
70 ## Print the normal usage message
73 echo "usage: ${ME} " `allflags | cut -c-25 | sed -e 's%.*%[ & ]%'`
79 echo "${ME}: icu-config: ICU configuration helper script"
81 echo "The most commonly used options will be --cflags, --cxxflags, --cppflags, and --ldflags."
82 echo 'Example (in make): CPFLAGS=$(shell icu-config --cppflags)'
83 echo ' LDFLAGS=$(shell icu-config --ldflags)'
90 echo " [Brackets] show MAKE variable equivalents, (parenthesis) show example output"
92 echo "Copyright (c) 2002-2013, International Business Machines Corporation and others. All Rights Reserved."
94 echo "NOTE: Please consider using the pkg-config (.pc) files instead of icu-config."
95 echo " See: <http://userguide.icu-project.org/howtouseicu#TOC-pkg-config> "
98 ## Check the sanity of current variables
101 if [ ! -f "${ICUUC_FILE}" -a ! -f "${ICUUC_FILE_A}" ] && [ ${IGNORE_ICUUC_FILE_CHECK} = "no" ] && [ ${SANITY} = "sane" ];
103 echo "### $ME: Can't find ${ICUUC_FILE} - ICU prefix is wrong." 1>&2
104 echo "### Try the --prefix= option " 1>&2
105 echo "### or --detect-prefix" 1>&2
106 echo "### (If you want to disable this check, use the --noverify option)" 1>&2
107 echo "### $ME: Exitting." 1>&2
114 if [ $# -lt 1 ]; then
119 # For certain options (e.g. --detect-prefix) don't check for icuuc library file.
121 IGNORE_ICUUC_FILE_CHECK="no";
134 IGNORE_ICUUC_FILE_CHECK="yes"
138 # Load our variables from autoconf
139 # ALWAYS load twice because of dependencies
143 if [ $# -gt 0 -a $1 = "--selfcheck" ];
147 # EXIT for self check
155 var=`echo $arg | sed -e 's/^[^=]*=//'`
156 # echo "### processing $arg" 1>&2
165 echo "### $ME: Error: --noverify must be the first argument." 1>&2
190 echo ${MKINSTALLDIRS}
201 # If it's not a locally executable command (1st choice) then
202 # search for it in the ICU directories.
203 if [ ! -x ${CMD} ]; then
204 if [ -x ${bindir}/${var} ]; then
205 CMD="${bindir}/${var}"
207 if [ -x ${sbindir}/${var} ]; then
208 CMD="${sbindir}/${var}"
212 echo "env ${QUOT}${LDLIBRARYPATH_ENVVAR}=${libdir}:"'${'"${LDLIBRARYPATH_ENVVAR}"'}'${QUOT} ${CMD}
217 echo "env ${QUOT}${LDLIBRARYPATH_ENVVAR}=${libdir}:"'${'"${LDLIBRARYPATH_ENVVAR}"'}'${QUOT}
221 echo $ECHO_N "${CFLAGS} ${ECHO_C}"
225 echo $ECHO_N "${CC} ${ECHO_C}"
229 echo $ECHO_N "${CXX} ${ECHO_C}"
233 echo $ECHO_N "${CXXFLAGS} ${ECHO_C}"
237 # Don't echo the -I. - it's unneeded.
238 echo $ECHO_N "${CPPFLAGS} ${ECHO_C}" | sed -e 's/-I. //'
241 --cppflags-searchpath)
242 echo $ECHO_N "-I${prefix}/include ${ECHO_C}"
246 echo $ECHO_N "${SHAREDLIBCPPFLAGS} ${ECHO_C}"
250 echo $ECHO_N "${SHAREDLIBCXXFLAGS} ${ECHO_C}"
254 echo $ECHO_N "${SHAREDLIBCFLAGS} ${ECHO_C}"
258 echo $ECHO_N "${LIBS} ${ECHO_C}"
262 echo $ECHO_N "${LDFLAGS} ${ICULIBS} ${ECHO_C}"
267 echo $ECHO_N "${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA} ${ECHO_C}"
271 echo $ECHO_N " ${ICULIBS_ICUIO} ${ECHO_C}"
275 echo $ECHO_N "${ICULIBS_OBSOLETE} ${ECHO_C}"
279 echo $ECHO_N " ${ICULIBS_TOOLUTIL} ${ECHO_C}"
283 echo ${ME}: ERROR: the old layout engine has been removed. use HarfBuzz.
287 --ldflags-searchpath)
288 echo $ECHO_N "-L${libdir} ${ECHO_C}"
292 HERE=`echo $0 | sed -e "s/$ME//g"`
293 if [ -f "${HERE}/../lib/${ICULIBS_COMMON_LIB_NAME}" -o -f "${HERE}/../lib/${ICULIBS_COMMON_LIB_NAME_A}" ]; then
295 echo "## Using --prefix=${prefix}" 1>&2
324 echo $ECHO_N "${datadir} ${ECHO_C}"
328 echo $ECHO_N "${pkglibdir}/Makefile.inc ${ECHO_C}"
332 echo $ECHO_N "${pkglibdir}/pkgdata.inc ${ECHO_C}"
336 echo $ECHO_N "${ICUDATA_NAME} ${ECHO_C}"
340 echo $ECHO_N "${PKGDATA_MODE} ${ECHO_C}"
343 --icudata-install-dir)
344 echo $ECHO_N "${ICUPKGDATA_DIR} ${ECHO_C}"
348 echo $ECHO_N "${ICUDATA_DIR} ${ECHO_C}"
352 echo $ECHO_N "${SHLIB_c} ${ECHO_C}"
356 echo $ECHO_N "${SHLIB_cc} ${ECHO_C}"
360 echo $ECHO_N $VERSION
364 echo $ECHO_N $UNICODE_VERSION
393 echo ${ME}: ERROR Unknown Option $arg 1>&2
396 echo "### $ME: Exitting." 1>&2
402 # Reset the ignore icuuc file check flag
403 if [ $IGNORE_ICUUC_FILE_CHECK = "yes" ]; then
404 IGNORE_ICUUC_FILE_CHECK="no"
409 # Check once before we quit (will check last used prefix)
411 ## END of icu-config-bottom