ICU-CONFIG(1)
π ICU-CONFIG(1) β like, the manual page for icu-config π
okay bestie, gather round, because this is the ICU 78.3 Manual page for icu-config and it is genuinely so useful, no cap π«Ά
β¨ NAME β¨
icu-config β spits out the build options you need for ICU π
πΈ SYNOPSIS πΈ
icu-config [ --bindir ] [ --cc ] [ --cflags ] [ --cppflags ] [
--cppflags-searchpath ] [ --cxx ] [ --cxxflags ] [ --detect-prefix ] [
--exec-prefix ] [ --exists ] [ --help, -?, --usage ] [ --icudata ] [
--icudata-install-dir ] [ --icudata-mode ] [ --icudatadir ] [ --invoke ]
[ --invoke=prog ] [ --ldflags ] [ --ldflags-libsonly ] [
--ldflags-searchpath ] [ --ldflags-system ] [ --ldflags-icuio ] [
--mandir ] [ --prefix ] [ --prefix=prefix ] [ --sbindir ] [
--shared-datadir ] [ --sysconfdir ] [ --unicode-version ] [ --version ]
[ --incfile ]
π¦ DESCRIPTION π¦
So the whole moment here is: icu-config makes building and linking against ICU way easier than hand-configuring your own makefiles or whatever equivalent you were about to suffer through. It's giving main character energy for your build system π
And because icu-config is literally an executable script, it also solves the "where even ARE the ICU libraries and headers" problem β the system PATH can just locate it for you. Iconic behaviour, honestly. β¨
π EXAMPLES π
You can run icu-config with no makefile at all. The command line below is enough to build a single-file c++ program against ICU. (for example, icu/source/samples/props/props.cpp)
`icu-config --cxx --cxxflags --cppflags --ldflags` -o props
props.cpp
More commonly though, icu-config gets called from inside a makefile and used to set up variables. The next example also builds the props example. π
CC=$(shell icu-config --cc)
CXX=$(shell icu-config --cxx)
CPPFLAGS=$(shell icu-config --cppflags)
CXXFLAGS=$(shell icu-config --cxxflags)
LDFLAGS =$(shell icu-config --ldflags)
all: props
props.o: props.cpp
And make(1) will automatically use all of those variables for you. Slay. π
π OPTIONS π
--bindirβ prints the binary (executable) directory path. normally equivalent to'bin'. this is where ICU user-executable applications and scripts live π«Ά--ccβ prints the C compiler being used. equivalent to the$(CC)Makefile variable.--cflagsβ prints the C compiler flags. equivalent to the$(CFLAGS)Makefile variable. it does NOT include preprocessor directives like include paths or defined symbols, bestie. examples include debugging (-g) and optimization flags.--cppflagsβ prints the C preprocessor flags. equivalent to the$(CPPFLAGS)Makefile variable. examples are-Iinclude paths and-Ddefine directives.--cppflags-searchpathβ prints the C preprocessor flags, same as above but only the-Isearch paths.--cxxβ prints the C++ compiler. equivalent to the$(CXX)Makefile variable.--cxxflagsβ prints the C++ compiler flags. equivalent to the$(CXXFLAGS)Makefile variable.--detect-prefixβ if ICU has been moved from its installed location, prepending this flag to othericu-configcalls will attempt to locate ICU relative to wherever theicu-configscript itself has been located. use it as a last-chance effort if the ICU install has been damaged π--exec-prefixβ prints the prefix used for executable program directories (likebin,sbin, etc). normally the same as the prefix.--existsβ the script returns with a successful (0) status if ICU seems to be installed and located correctly. otherwise you get an error message and a nonzero status displayed π--help,-?,--usageβ prints a help and usage message.--icudataβ prints the shortname of the ICU data file. this does not include any suffix such as.dat,.dll,.so,.lib,.a, etc, and it also doesn't include prefixes such as'lib'. it may be in the formicudt21b.--icudata-install-dirβ prints the directory where ICU packaged data should be installed. you can use this aspkgdata(1)'s--installoption.--icudata-modeβ prints the default ICU pkgdata mode, such asdllorcommon. you can use this aspkgdata(1)'s--modeoption.--icudatadirβ prints the path to packaged archive data. (should be where$ICU_DATAor the equivalent default path points.) it will NOT point to the libdir, ok?--invokeβ if ICU isn't installed somewhere the operating system will locate its shared libraries, this option prints out commands that set the appropriate environment variables to load ICU's shared libraries. for example, on many systems a variable namedLD_LIBRARY_PATHor equivalent must be set.--invoke=progβ same as the--invokeoption, except it also includes options for invoking a program named prog. if prog is the name of an ICU tool, such asgenrb(1), thenicu-configwill also include the full path to that tool. β¨--ldflagsβ prints any flags that should be passed to the linker. these may include-Lfor library search paths and-lfor including ICU libraries. by default this option will attempt to link in the"common"(libicuuc) and"i18n"(libicui18n) libraries, as well as the data library. if additional libraries are required, either of the following two flags may be added in conjunction with this one β for example"--ldflags --ldflags-icuio"if the icuio library is required in addition to the standard ICU libraries. equivalent to the$(LDFLAGS)Makefile variable.--ldflags-layoutβ prints the link option for the ICU layout library.--ldflags-icuioβ prints the link option to add the ICU I/O package.--ldflags-libsonlyβ similar to--ldflagsbut only includes the-loptions.--ldflags-searchpathβ similar to--ldflagsbut only includes the-Lsearch path options.--ldflags-systemβ similar to--ldflagsbut only includes system libraries (such as pthreads).--mandirβ prints the location of the installed ICU man pages. normally (man).--prefixβ prints the prefix (base directory) under which the installed ICU resides.--prefix=prefixβ sets the ICU prefix to prefix for the remainder of this command line. does test whether the new prefix is valid.--sbindirβ prints the location of ICU system binaries, normally (sbin).--shared-datadirβ prints the location of ICU shared data, normally (share).--sysconfdirβ prints the location of ICU system configuration data, normally (etc).--unicode-versionβ prints the Version of the Unicode Standard which the current ICU uses. π§--versionβ prints the current version of ICU.--incfileβ prints the'Makefile.inc'path, suitable for use withpkgdata(1)'s-Ooption.
π AUTHORS π
Steven Loomis
β VERSION β
78.3
π COPYRIGHT π
Copyright (C) 2002-2004 IBM, Inc. and others.
and that's the whole page, bestie π this was the ICU MANPAGE for icu-config(1), dated 17 May 2004, shipped with the ICU 78.3 Manual β thanks for reading, you ate that π«Άβ¨
π¦ where this page comes from
- arch rolling: icu 78.3-1 Β· LicenseRef-Unicode-3.0 AND BSD-2-Clause AND BSD-3-Clause AND NAIST-2003
- Copyright (C) 2016 and later: Unicode, Inc. and others
- Copyright (C) 2002-2008 IBM, Inc. and others
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms