intl/icu/source/config/icu-config-bottom

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 ## -*-sh-*-
michael@0 2 ## BEGIN of icu-config-bottom.
michael@0 3 ## Copyright (c) 2002-2013, International Business Machines Corporation and
michael@0 4 ## others. All Rights Reserved.
michael@0 5
michael@0 6 ICUUC_FILE="${libdir}/${ICULIBS_COMMON_LIB_NAME}"
michael@0 7 ICUUC_FILE_A="${libdir}/${ICULIBS_COMMON_LIB_NAME_A}"
michael@0 8
michael@0 9 # echo ENABLE RPATH $ENABLE_RPATH and RPATHLDFLAGS=${RPATH_LDFLAGS}
michael@0 10 if [ "x$PKGDATA_MODE" = "x" ]; then
michael@0 11 PKGDATA_MODE=dll
michael@0 12 fi
michael@0 13
michael@0 14 }
michael@0 15
michael@0 16 ## The actual code of icu-config goes here.
michael@0 17
michael@0 18 ME=`basename "$0"`
michael@0 19
michael@0 20 allflags()
michael@0 21 {
michael@0 22 echo " --noverify Don't verify that ICU is actually installed."
michael@0 23 echo " --bindir Print binary directory path (bin)"
michael@0 24 echo " --cc Print C compiler used [CC]"
michael@0 25 echo " --cflags Print C compiler flags [CFLAGS]"
michael@0 26 echo " --cflags-dynamic Print additional C flags for"
michael@0 27 echo " building shared libraries."
michael@0 28 echo " --cppflags Print C Preprocessor flags [CPPFLAGS]"
michael@0 29 echo " --cppflags-dynamic Print additional C Preprocessor flags for"
michael@0 30 echo " building shared libraries."
michael@0 31 echo " --cppflags-searchpath Print only -I include directives (-Iinclude)"
michael@0 32 echo " --cxx Print C++ compiler used [CXX]"
michael@0 33 echo " --cxxflags Print C++ compiler flags [CXXFLAGS]"
michael@0 34 echo " --cxxflags-dynamic Print additional C++ flags for"
michael@0 35 echo " building shared libraries."
michael@0 36 echo " --detect-prefix Attempt to detect prefix based on PATH"
michael@0 37 echo " --exec-prefix Print prefix for executables (/bin)"
michael@0 38 echo " --exists Return with 0 status if ICU exists else fail"
michael@0 39 echo " --help, -?, --usage Print this message"
michael@0 40 echo " --icudata Print shortname of ICU data file (icudt21l)"
michael@0 41 echo " --icudata-install-dir Print path to install data to - use as --install option to pkgdata(1)"
michael@0 42 echo " --icudata-mode Print default ICU pkgdata mode (dll) - use as --mode option to pkgdata(1)."
michael@0 43 echo " --icudatadir Print path to packaged archive data. Can set as [ICU_DATA]"
michael@0 44 echo " --invoke Print commands to invoke an ICU program"
michael@0 45 echo " --invoke=<prog> Print commands to invoke an ICU program named <prog> (ex: genrb)"
michael@0 46 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. "
michael@0 47 echo " --ldflags-layout Print ICU layout engine link directive. Use in addition to --ldflags"
michael@0 48 echo " --ldflags-libsonly Same as --ldflags, but only the -l directives"
michael@0 49 echo " --ldflags-searchpath Print only -L (search path) directive"
michael@0 50 echo " --ldflags-system Print only system libs ICU links with (-lpthread, -lm)"
michael@0 51 echo " --ldflags-icuio Print ICU icuio link directive. Use in addition to --ldflags "
michael@0 52 echo " --ldflags-obsolete Print ICU obsolete link directive. Use in addition to --ldflags. (requires icuapps/obsolete to be built and installed.) "
michael@0 53 echo " --mandir Print manpage (man) path"
michael@0 54 echo " --prefix Print PREFIX to icu install (/usr/local)"
michael@0 55 echo " --prefix=XXX Set prefix to XXX for remainder of command"
michael@0 56 echo " --sbindir Print system binary path (sbin) "
michael@0 57 echo " --shared-datadir Print shared data (share) path. This is NOT the ICU data dir."
michael@0 58 echo " --shlib-c Print the command to compile and build C shared libraries with ICU"
michael@0 59 echo " --shlib-cc Print the command to compile and build C++ shared libraries with ICU"
michael@0 60 echo " --sysconfdir Print system config (etc) path"
michael@0 61 echo " --unicode-version Print version of Unicode data used in ICU ($UNICODE_VERSION)"
michael@0 62 echo " --version Print ICU version ($VERSION)"
michael@0 63 echo " --incfile Print path to Makefile.inc"
michael@0 64 echo " --incpkgdatafile Print path to pkgdata.inc (for -O option of pkgdata)"
michael@0 65 echo " --install Print path to install-sh"
michael@0 66 echo " --mkinstalldirs Print path to mkinstalldirs"
michael@0 67 }
michael@0 68
michael@0 69 ## Print the normal usage message
michael@0 70 shortusage()
michael@0 71 {
michael@0 72 echo "usage: ${ME} " `allflags | cut -c-25 | sed -e 's%.*%[ & ]%'`
michael@0 73 }
michael@0 74
michael@0 75
michael@0 76 usage()
michael@0 77 {
michael@0 78 echo "${ME}: icu-config: ICU configuration helper script"
michael@0 79 echo
michael@0 80 echo "The most commonly used options will be --cflags, --cxxflags, --cppflags, and --ldflags."
michael@0 81 echo 'Example (in make): CPFLAGS=$(shell icu-config --cppflags)'
michael@0 82 echo ' LDFLAGS=$(shell icu-config --ldflags)'
michael@0 83 echo " (etc).."
michael@0 84 echo
michael@0 85 echo "Usage:"
michael@0 86 allflags
michael@0 87
michael@0 88 echo
michael@0 89 echo " [Brackets] show MAKE variable equivalents, (parenthesis) show example output"
michael@0 90 echo
michael@0 91 echo "Copyright (c) 2002-2013, International Business Machines Corporation and others. All Rights Reserved."
michael@0 92 echo
michael@0 93 echo "NOTE: Please consider using the pkg-config (.pc) files instead of icu-config."
michael@0 94 echo " See: <http://userguide.icu-project.org/howtouseicu#TOC-pkg-config> "
michael@0 95 }
michael@0 96
michael@0 97 ## Check the sanity of current variables
michael@0 98 sanity()
michael@0 99 {
michael@0 100 if [ ! -f "${ICUUC_FILE}" -a ! -f "${ICUUC_FILE_A}" ] && [ ${IGNORE_ICUUC_FILE_CHECK} = "no" ] && [ ${SANITY} = "sane" ];
michael@0 101 then
michael@0 102 echo "### $ME: Can't find ${ICUUC_FILE} - ICU prefix is wrong." 1>&2
michael@0 103 echo "### Try the --prefix= option " 1>&2
michael@0 104 echo "### or --detect-prefix" 1>&2
michael@0 105 echo "### (If you want to disable this check, use the --noverify option)" 1>&2
michael@0 106 echo "### $ME: Exitting." 1>&2
michael@0 107 exit 2
michael@0 108 fi
michael@0 109 }
michael@0 110
michael@0 111 ## Main starts here.
michael@0 112
michael@0 113 if [ $# -lt 1 ]; then
michael@0 114 shortusage
michael@0 115 exit 1
michael@0 116 fi
michael@0 117
michael@0 118 # For certain options (e.g. --detect-prefix) don't check for icuuc library file.
michael@0 119
michael@0 120 IGNORE_ICUUC_FILE_CHECK="no";
michael@0 121
michael@0 122 SANITY="sane"
michael@0 123
michael@0 124 case "$1" in
michael@0 125 --noverify)
michael@0 126 SANITY="nosanity"
michael@0 127 shift
michael@0 128 ;;
michael@0 129 esac
michael@0 130
michael@0 131 case "$1" in
michael@0 132 *prefix*)
michael@0 133 IGNORE_ICUUC_FILE_CHECK="yes"
michael@0 134 ;;
michael@0 135 esac
michael@0 136
michael@0 137 # Load our variables from autoconf
michael@0 138 # ALWAYS load twice because of dependencies
michael@0 139 loaddefs
michael@0 140 loaddefs
michael@0 141
michael@0 142 if [ $# -gt 0 -a $1 = "--selfcheck" ];
michael@0 143 then
michael@0 144 echo "passed"
michael@0 145 exit
michael@0 146 # EXIT for self check
michael@0 147 fi
michael@0 148
michael@0 149 sanity
michael@0 150
michael@0 151 while [ $# -gt 0 ];
michael@0 152 do
michael@0 153 arg="$1"
michael@0 154 var=`echo $arg | sed -e 's/^[^=]*=//'`
michael@0 155 # echo "### processing $arg" 1>&2
michael@0 156 case "$arg" in
michael@0 157
michael@0 158 # undocumented.
michael@0 159 --debug)
michael@0 160 set -x
michael@0 161 ;;
michael@0 162
michael@0 163 --noverify)
michael@0 164 echo "### $ME: Error: --noverify must be the first argument." 1>&2
michael@0 165 exit 1
michael@0 166 ;;
michael@0 167
michael@0 168 --so)
michael@0 169 echo $SO
michael@0 170 ;;
michael@0 171
michael@0 172 --bindir)
michael@0 173 echo $bindir
michael@0 174 ;;
michael@0 175
michael@0 176 --libdir)
michael@0 177 echo $libdir
michael@0 178 ;;
michael@0 179
michael@0 180 --exists)
michael@0 181 sanity
michael@0 182 ;;
michael@0 183
michael@0 184 --sbindir)
michael@0 185 echo $sbindir
michael@0 186 ;;
michael@0 187
michael@0 188 --mkinstalldirs)
michael@0 189 echo ${MKINSTALLDIRS}
michael@0 190 ;;
michael@0 191
michael@0 192 --install)
michael@0 193 echo ${INSTALL}
michael@0 194 ;;
michael@0 195
michael@0 196 --invoke=*)
michael@0 197 QUOT="\""
michael@0 198 CMD="${var}"
michael@0 199
michael@0 200 # If it's not a locally executable command (1st choice) then
michael@0 201 # search for it in the ICU directories.
michael@0 202 if [ ! -x ${CMD} ]; then
michael@0 203 if [ -x ${bindir}/${var} ]; then
michael@0 204 CMD="${bindir}/${var}"
michael@0 205 fi
michael@0 206 if [ -x ${sbindir}/${var} ]; then
michael@0 207 CMD="${sbindir}/${var}"
michael@0 208 fi
michael@0 209 fi
michael@0 210
michael@0 211 echo "env ${QUOT}${LDLIBRARYPATH_ENVVAR}=${libdir}:"'${'"${LDLIBRARYPATH_ENVVAR}"'}'${QUOT} ${CMD}
michael@0 212 ;;
michael@0 213
michael@0 214 --invoke)
michael@0 215 QUOT="\""
michael@0 216 echo "env ${QUOT}${LDLIBRARYPATH_ENVVAR}=${libdir}:"'${'"${LDLIBRARYPATH_ENVVAR}"'}'${QUOT}
michael@0 217 ;;
michael@0 218
michael@0 219 --cflags)
michael@0 220 echo $ECHO_N "${CFLAGS} ${ECHO_C}"
michael@0 221 ;;
michael@0 222
michael@0 223 --cc)
michael@0 224 echo $ECHO_N "${CC} ${ECHO_C}"
michael@0 225 ;;
michael@0 226
michael@0 227 --cxx)
michael@0 228 echo $ECHO_N "${CXX} ${ECHO_C}"
michael@0 229 ;;
michael@0 230
michael@0 231 --cxxflags)
michael@0 232 echo $ECHO_N "${CXXFLAGS} ${ECHO_C}"
michael@0 233 ;;
michael@0 234
michael@0 235 --cppflags)
michael@0 236 # Don't echo the -I. - it's unneeded.
michael@0 237 echo $ECHO_N "${CPPFLAGS} ${ECHO_C}" | sed -e 's/-I. //'
michael@0 238 ;;
michael@0 239
michael@0 240 --cppflags-searchpath)
michael@0 241 echo $ECHO_N "-I${prefix}/include ${ECHO_C}"
michael@0 242 ;;
michael@0 243
michael@0 244 --cppflags-dynamic)
michael@0 245 echo $ECHO_N "${SHAREDLIBCPPFLAGS} ${ECHO_C}"
michael@0 246 ;;
michael@0 247
michael@0 248 --cxxflags-dynamic)
michael@0 249 echo $ECHO_N "${SHAREDLIBCXXFLAGS} ${ECHO_C}"
michael@0 250 ;;
michael@0 251
michael@0 252 --cflags-dynamic)
michael@0 253 echo $ECHO_N "${SHAREDLIBCFLAGS} ${ECHO_C}"
michael@0 254 ;;
michael@0 255
michael@0 256 --ldflags-system)
michael@0 257 echo $ECHO_N "${LIBS} ${ECHO_C}"
michael@0 258 ;;
michael@0 259
michael@0 260 --ldflags)
michael@0 261 echo $ECHO_N "${LDFLAGS} ${ICULIBS} ${LIBS} ${ECHO_C}"
michael@0 262 # $RPATH_LDFLAGS
michael@0 263 ;;
michael@0 264
michael@0 265 --ldflags-libsonly)
michael@0 266 echo $ECHO_N "${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA} ${ECHO_C}"
michael@0 267 ;;
michael@0 268
michael@0 269 --ldflags-icuio)
michael@0 270 echo $ECHO_N " ${ICULIBS_ICUIO} ${ECHO_C}"
michael@0 271 ;;
michael@0 272
michael@0 273 --ldflags-obsolete)
michael@0 274 echo $ECHO_N "${ICULIBS_OBSOLETE} ${ECHO_C}"
michael@0 275 ;;
michael@0 276
michael@0 277 --ldflags-toolutil)
michael@0 278 echo $ECHO_N " ${ICULIBS_TOOLUTIL} ${ECHO_C}"
michael@0 279 ;;
michael@0 280
michael@0 281 --ldflags-layout)
michael@0 282 echo $ECHO_N "${ICULIBS_LAYOUT} ${ICULIBS_LAYOUTEX} ${ECHO_C}"
michael@0 283 ;;
michael@0 284
michael@0 285 --ldflags-searchpath)
michael@0 286 echo $ECHO_N "-L${libdir} ${ECHO_C}"
michael@0 287 ;;
michael@0 288
michael@0 289 --detect-prefix)
michael@0 290 HERE=`echo $0 | sed -e "s/$ME//g"`
michael@0 291 if [ -f "${HERE}/../lib/${ICULIBS_COMMON_LIB_NAME}" -o -f "${HERE}/../lib/${ICULIBS_COMMON_LIB_NAME_A}" ]; then
michael@0 292 prefix="${HERE}/.."
michael@0 293 echo "## Using --prefix=${prefix}" 1>&2
michael@0 294 fi
michael@0 295 loaddefs
michael@0 296 loaddefs
michael@0 297 ;;
michael@0 298
michael@0 299 --exec-prefix)
michael@0 300 echo $exec_prefix
michael@0 301 ;;
michael@0 302
michael@0 303 --prefix)
michael@0 304 echo $prefix
michael@0 305 ;;
michael@0 306
michael@0 307 --prefix=*)
michael@0 308 prefix=$var
michael@0 309 loaddefs
michael@0 310 loaddefs
michael@0 311 ;;
michael@0 312
michael@0 313 --sysconfdir)
michael@0 314 echo $sysconfdir
michael@0 315 ;;
michael@0 316
michael@0 317 --mandir)
michael@0 318 echo $mandir
michael@0 319 ;;
michael@0 320
michael@0 321 --shared-datadir)
michael@0 322 echo $ECHO_N "${datadir} ${ECHO_C}"
michael@0 323 ;;
michael@0 324
michael@0 325 --incfile)
michael@0 326 echo $ECHO_N "${pkglibdir}/Makefile.inc ${ECHO_C}"
michael@0 327 ;;
michael@0 328
michael@0 329 --incpkgdatafile)
michael@0 330 echo $ECHO_N "${pkglibdir}/pkgdata.inc ${ECHO_C}"
michael@0 331 ;;
michael@0 332
michael@0 333 --icudata)
michael@0 334 echo $ECHO_N "${ICUDATA_NAME} ${ECHO_C}"
michael@0 335 ;;
michael@0 336
michael@0 337 --icudata-mode)
michael@0 338 echo $ECHO_N "${PKGDATA_MODE} ${ECHO_C}"
michael@0 339 ;;
michael@0 340
michael@0 341 --icudata-install-dir)
michael@0 342 echo $ECHO_N "${ICUPKGDATA_DIR} ${ECHO_C}"
michael@0 343 ;;
michael@0 344
michael@0 345 --icudatadir)
michael@0 346 echo $ECHO_N "${ICUDATA_DIR} ${ECHO_C}"
michael@0 347 ;;
michael@0 348
michael@0 349 --shlib-c)
michael@0 350 echo $ECHO_N "${SHLIB_c} ${ECHO_C}"
michael@0 351 ;;
michael@0 352
michael@0 353 --shlib-cc)
michael@0 354 echo $ECHO_N "${SHLIB_cc} ${ECHO_C}"
michael@0 355 ;;
michael@0 356
michael@0 357 --version)
michael@0 358 echo $ECHO_N $VERSION
michael@0 359 ;;
michael@0 360
michael@0 361 --unicode-version)
michael@0 362 echo $ECHO_N $UNICODE_VERSION
michael@0 363 ;;
michael@0 364
michael@0 365 --host)
michael@0 366 echo $host
michael@0 367 exit 0
michael@0 368 ;;
michael@0 369
michael@0 370 --help)
michael@0 371 usage
michael@0 372 exit 0
michael@0 373 ;;
michael@0 374
michael@0 375 --usage)
michael@0 376 usage
michael@0 377 exit 0
michael@0 378 ;;
michael@0 379
michael@0 380 # --enable-rpath=*)
michael@0 381 # ENABLE_RPATH=$var
michael@0 382 # loaddefs
michael@0 383 # ;;
michael@0 384
michael@0 385 -?)
michael@0 386 usage
michael@0 387 exit 0
michael@0 388 ;;
michael@0 389
michael@0 390 *)
michael@0 391 echo ${ME}: ERROR Unknown Option $arg 1>&2
michael@0 392 echo 1>&2
michael@0 393 shortusage 1>&2
michael@0 394 echo "### $ME: Exitting." 1>&2
michael@0 395 exit 1;
michael@0 396 ;;
michael@0 397 esac
michael@0 398 shift
michael@0 399
michael@0 400 # Reset the ignore icuuc file check flag
michael@0 401 if [ $IGNORE_ICUUC_FILE_CHECK = "yes" ]; then
michael@0 402 IGNORE_ICUUC_FILE_CHECK="no"
michael@0 403 sanity
michael@0 404 fi
michael@0 405 done
michael@0 406 echo
michael@0 407 # Check once before we quit (will check last used prefix)
michael@0 408 sanity
michael@0 409 ## END of icu-config-bottom
michael@0 410
michael@0 411 exit 0

mercurial