OSDN Git Service

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