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 -I include paths and -D define directives.
  • --cppflags-searchpath β€” prints the C preprocessor flags, same as above but only the -I search 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 other icu-config calls will attempt to locate ICU relative to wherever the icu-config script 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 (like bin, 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 form icudt21b.
  • --icudata-install-dir β€” prints the directory where ICU packaged data should be installed. you can use this as pkgdata(1)'s --install option.
  • --icudata-mode β€” prints the default ICU pkgdata mode, such as dll or common. you can use this as pkgdata(1)'s --mode option.
  • --icudatadir β€” prints the path to packaged archive data. (should be where $ICU_DATA or 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 named LD_LIBRARY_PATH or equivalent must be set.
  • --invoke=prog β€” same as the --invoke option, except it also includes options for invoking a program named prog. if prog is the name of an ICU tool, such as genrb(1), then icu-config will also include the full path to that tool. ✨
  • --ldflags β€” prints any flags that should be passed to the linker. these may include -L for library search paths and -l for 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 --ldflags but only includes the -l options.
  • --ldflags-searchpath β€” similar to --ldflags but only includes the -L search path options.
  • --ldflags-system β€” similar to --ldflags but 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 with pkgdata(1)'s -O option.

πŸŽ€ AUTHORS πŸŽ€

Steven Loomis


⭐ VERSION ⭐

78.3


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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms