1
2ICU-CONFIG(1) ICU 3.6 Manual ICU-CONFIG(1)
3
4
5
7 icu-config - output ICU build options
8
10 icu-config [ --bindir ] [ --cc ] [ --cflags ] [ --cppflags ] [
11 --cppflags-searchpath ] [ --cxx ] [ --cxxflags ] [ --detect-prefix ] [
12 --exec-prefix ] [ --exists ] [ --help, -?, --usage ] [ --icudata ] [
13 --icudata-installdir ] [ --icudata-mode ] [ --icudatadir ] [ --invoke ]
14 [ --invoke=prog ] [ --ldflags ] [ --ldflags-layout ] [ --ldflags-lib‐
15 sonly ] [ --ldflags-searchpath ] [ --ldflags-system ] [ --ldflags-icuio
16 ] [ --mandir ] [ --prefix ] [ --prefix=prefix ] [ --sbindir ] [
17 --shared-datadir ] [ --sysconfdir ] [ --unicode-version ] [ --version ]
18 [ --incfile ]
19
20
21
22
24 icu-config simplifies the task of building and linking against ICU as
25 compared to manually configuring user makefiles or equivalent. Because
26 icu-config is an executable script, it also solves the problem of
27 locating the ICU libraries and headers, by allowing the system PATH to
28 locate it.
29
31 icu-config can be used without a makefile. The command line below is
32 sufficient for building a single-file c++ program against ICU. (For
33 example, icu/source/samples/props/props.cpp)
34
35 `icu-config --cxx --cxxflags --cppflags --ldflags` -o props
36 props.cpp
37
38 More commonly, icu-config will be called from within a makefile, and
39 used to set up variables. The following example also builds the props
40 example.
41
42 CC=$(shell icu-config --cc)
43
44 CXX=$(shell icu-config --cxx)
45
46 CPPFLAGS=$(shell icu-config --cppflags)
47
48 CXXFLAGS=$(shell icu-config --cxxflags)
49
50 LDFLAGS =$(shell icu-config --ldflags)
51
52 all: props
53
54 props.o: props.cpp
55
56 make(1) will automatically use the above variables.
57
59 --bindir
60 Prints the binary (executable) directory path. Normally equiva‐
61 lent to 'bin'. ICU user-executable applications and scripts are
62 found here.
63
64 --cc Print the C compiler used. Equivalent to the $(CC) Makefile
65 variable.
66
67 --cflags
68 Print the C compiler flags. Equivalent to the $(CFLAGS) Makefile
69 variable. Does NOT include preprocessor directives such as
70 include path or defined symbols. Examples include debugging (-g)
71 and optimization flags
72
73 --cppflags
74 Print the C preprocessor flags. Equivalent to the $(CPPFLAGS)
75 Makefile variable. Examples are -I include paths and -D define
76 directives.
77
78 --cppflags-searchpath
79 Print the C preprocessor flags, as above but only -I search
80 paths.
81
82 --cxx Print the C++ compiler. Equivalent to the $(CXX) Makefile vari‐
83 able.
84
85 --cxxflags
86 Print the C++ compiler flags. Equivalent to the $(CXXFLAGS)
87 Makefile variable.
88
89 --detect-prefix
90 If ICU has been moved from its installed location, prepending
91 this flag to other icu-config calls will attempt to locate ICU
92 relative to where the icu-config script has been located. Can be
93 used as a last-chance effort if the ICU install has been dam‐
94 aged.
95
96 --exec-prefix
97 Print the prefix used for executable program directories (such
98 as bin, sbin, etc). Normally the same as the prefix.
99
100 --exists
101 Script will return with a successful (0) status if ICU seems to
102 be installed and located correctly, otherwise an error message
103 and nonzero status will be displayed.
104
105 --help, -?,--usage
106 Print a help and usage message.
107
108 --icudata
109 Print the shortname of the ICU data file. This does not include
110 any suffix such as .dat, .dll, .so, .lib, .a, etc nor does it
111 include prefixes such as 'lib'. It may be in the form
112 libicudt21b
113
114 --icudata-installdir
115 Print the directory where ICU packaged data should be installed.
116 Can use as pkgdata(1)'s --install option.
117
118 --icudata-mode
119 Print the default ICU pkgdata mode, such as dll or common. Can
120 use as pkgdata(1)'s --mode option.
121
122 --icudatadir
123 Print the path to packaged archive data. (should be where
124 $ICU_DATA or equivalent default path points.) Will NOT point to
125 the libdir.
126
127 --invoke
128 If ICU is not installed in a location where the operating system
129 will locate its shared libraries, this option will print out
130 commands so as to set the appropriate environment variables to
131 load ICU's shared libraries. For example, on many systems a
132 variable named LD_LIBRARY_PATH or equivalent must be set.
133
134 --invoke=prog
135 Same as the --invoke option, except includes options for invok‐
136 ing a program named prog. If prog is the name of an ICU tool,
137 such as genrb(1), then icu-config will also include the full
138 path to that tool.
139
140 --ldflags
141 Print any flags which should be passed to the linker. These may
142 include -L for library search paths, and -l for including ICU
143 libraries. By default, this option will attempt to link in the
144 "common" (libicuuc) and "i18n" (libicui18n) libraries, as well
145 as the data library. If additional libraries are required, any
146 of the following two flags may be added in conjunction with this
147 one, for example "--ldflags --ldflags-icuio" if the icuio
148 library is required in addition to the standard ICU libraries.
149 Equivalent to the $(LDFLAGS) Makefile variable.
150
151 --ldflags-layout
152 Prints the link option for the ICU layout library.
153
154 --ldflags-icuio
155 Prints the link option to add the ICU I/O package
156
157 --ldflags-libsonly
158 Similar to --ldflags but only includes the -l options.
159
160 --ldflags-searchpath
161 Similar to --ldflags but only includes the -L search path
162 options.
163
164 --ldflags-system
165 Similar to --ldflags but only includes system libraries (such as
166 pthreads) --mandir Prints the location of the installed ICU man
167 pages. Normally (man)
168
169 --prefix
170 Prints the prefix (base directory) under which the installed ICU
171 resides.
172
173 --prefix=prefix
174 Sets the ICU prefix to prefix for the remainder of this command
175 line. Does test whether the new prefix is valid.
176
177 --sbindir
178 Prints the location of ICU system binaries, normally (sbin)
179
180 --shared-datadir
181 Prints the location of ICU shared data, normally (share)
182
183 --sysconfdir
184 Prints the location of ICU system configuration data, normally
185 (etc)
186
187 --unicode-version
188 Prints the Version of the Unicode Standard which the current ICU
189 uses.
190
191 --version
192 Prints the current version of ICU.
193
194 --incfile
195 Prints the 'Makefile.inc' path, suitable for use with pkg‐
196 data(1)'s -O option.
197
199 Steven Loomis
200
202 3.6
203
205 Copyright (C) 2002-2004 IBM, Inc. and others.
206
207
208
209
210ICU MANPAGE 17 May 2004 ICU-CONFIG(1)