2 ## BEGIN of icu-config-bottom. $Revision: 1.1.1.2 $
3 ## Copyright (c) 2002-2003, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ICUUC_FILE=${libdir}/${ICULIBS_COMMON_LIB_NAME}
8 # echo ENABLE RPATH $ENABLE_RPATH and RPATHLDFLAGS=${RPATH_LDFLAGS}
9 if [ "x$PKGDATA_MODE" = "x" ]; then
15 ## The actual code of icu-config goes here.
21 echo " --bindir Print binary directory path (bin)"
22 echo " --cc Print C compiler used [CC]"
23 echo " --cflags Print C compiler flags [CFLAGS]"
24 echo " --cflags-dynamic Print additional C flags for"
25 echo " building shared libraries."
26 echo " --cppflags Print C Preprocessor flags [CPPFLAGS]"
27 echo " --cppflags-dynamic Print additional C Preprocessor flags for"
28 echo " building shared libraries."
29 echo " --cppflags-searchpath Print only -I include directives (-Iinclude)"
30 echo " --cxx Print C++ compiler used [CXX]"
31 echo " --cxxflags Print C++ compiler flags [CXXFLAGS]"
32 echo " --cxxflags-dynamic Print additional C++ flags for"
33 echo " building shared libraries."
34 echo " --detect-prefix Attempt to detect prefix based on PATH"
35 echo " --exec-prefix Print prefix for executables (/bin)"
36 echo " --exists Return with 0 status if ICU exists else fail"
37 echo " --help, -?, --usage Print this message"
38 echo " --icudata Print shortname of ICU data file (icudt21l)"
39 echo " --icudata-install-dir Print path to install data to - use as --install option to pkgdata(1)"
40 echo " --icudata-mode Print default ICU pkgdata mode (dll) - use as --mode option to pkgdata(1)."
41 echo " --icudatadir Print path to packaged archive data. Can set as [ICU_DATA]"
42 echo " --invoke Print commands to invoke an ICU program"
43 echo " --invoke=<prog> Print commands to invoke an ICU program named <prog> (ex: genrb)"
44 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. "
45 echo " --ldflags-layout Print ICU layout engine link directive. Use in addition to --ldflags"
46 echo " --ldflags-libsonly Same as --ldflags, but only the -l directives"
47 echo " --ldflags-searchpath Print only -L (search path) directive"
48 echo " --ldflags-system Print only system libs ICU links with (-lpthread, -lm)"
49 echo " --ldflags-ustdio Print ICU ustdio link directive. Use in addition to --ldflags "
50 echo " --ldflags-obsolete Print ICU obsolete link directive. Use in addition to --ldflags. (requires icuapps/obsolete to be built and installed.) "
51 echo " --mandir Print manpage (man) path"
52 echo " --prefix Print PREFIX to icu install (/usr/local)"
53 echo " --prefix=XXX Set prefix to XXX for remainder of command"
54 echo " --sbindir Print system binary path (sbin) "
55 echo " --shared-datadir Print shared data (share) path. This is NOT the ICU data dir."
56 echo " --shlib-c Print the command to compile and build C shared libraries with ICU"
57 echo " --shlib-cc Print the command to compile and build C++ shared libraries with ICU"
58 echo " --sysconfdir Print system config (etc) path"
59 echo " --unicode-version Print version of Unicode data used in ICU ($UNICODE_VERSION)"
60 echo " --version Print ICU version ($VERSION)"
61 echo " --incfile Print path to Makefile.inc (for -O option of pkgdata)"
64 ## Print the normal usage message
67 echo "usage: ${ME} " `allflags | cut -c-25 | sed -e 's%.*%[ & ]%'`
73 echo "${ME}: icu-config: ICU configuration helper script"
75 echo "The most commonly used options will be --cflags, --cxxflags, --cppflags, and --ldflags."
76 echo 'Example (in make): CPFLAGS=$(shell icu-config --cppflags)'
77 echo ' LDFLAGS=$(shell icu-config --ldflags)'
84 echo " [Brackets] show MAKE variable equivalents, (parenthesis) show example output"
86 echo "Copyright (c) 2002, International Business Machines Corporation and others. All Rights Reserved."
89 ## Check the sanity of current variables
92 if [ ! -f ${ICUUC_FILE} ];
94 echo "### $ME: Can't find ${ICUUC_FILE} - ICU prefix is wrong." 1>&2
95 echo "### Try the --prefix= or --exec-prefix= options " 1>&2
96 echo "### or --detect-prefix"
97 echo "### $ME: Exitting." 1>&2
104 if [ $# -lt 1 ]; then
110 # Load our variables from autoconf
111 # ALWAYS load twice because of dependencies
119 var=`echo $arg | sed -e 's/^[^=]*=//'`
120 # echo "### processing $arg" 1>&2
152 # If it's not a locally executable command (1st choice) then
153 # search for it in the ICU directories.
154 if [ ! -x ${CMD} ]; then
155 if [ -x ${bindir}/${var} ]; then
156 CMD="${bindir}/${var}"
158 if [ -x ${sbindir}/${var} ]; then
159 CMD="${sbindir}/${var}"
163 echo "env ${QUOT}${LDLIBRARYPATH_ENVVAR}=${libdir}:"'${'"${LDLIBRARYPATH_ENVVAR}"'}'${QUOT} ${CMD}
168 echo "env ${QUOT}${LDLIBRARYPATH_ENVVAR}=${libdir}:"'${'"${LDLIBRARYPATH_ENVVAR}"'}'${QUOT}
188 # Don't echo the -I. - it's unneeded.
189 echo $CPPFLAGS | sed -e 's/-I. //'
192 --cppflags-searchpath)
193 echo -I${prefix}/include
197 echo $SHAREDLIBCPPFLAGS
201 echo $SHAREDLIBCXXFLAGS
205 echo $SHAREDLIBCFLAGS
213 echo $LDFLAGS $ICULIBS $LIBS
218 echo $ICULIBS_I18N $ICULIBS_COMMON $ICULIBS_DATA
226 echo $ICULIBS_OBSOLETE
230 echo $ICULIBS_TOOLUTIL
234 echo $ICULIBS_LAYOUT $ICULIBS_LAYOUTEX
237 --ldflags-searchpath)
242 HERE=`echo $0 | sed -e "s/$ME//g"`
243 if [ -f $HERE/../lib/${ICULIBS_COMMON_LIB_NAME} ]; then
245 echo "## Using --prefix=${prefix}" 1>&2
280 echo $pkglibdir/Makefile.inc
291 --icudata-install-dir)
292 case "$PKGDATA_MODE" in
303 echo "## ${ME} Unknown pkgdata mode $PKGDATA_MODE" 1>&2
326 echo $UNICODE_VERSION
350 echo ${ME}: ERROR Unknown Option $arg 1>&2
353 echo "### $ME: Exitting." 1>&2
360 # Check once before we quit (will check last used prefix)
362 ## END of icu-config-bottom