4
@section pkgconfig_intro Introduction
6
pkg-config (http://pkgconfig.freedesktop.org/wiki/) is a helper
7
tool used when compiling applications and libraries. It helps you
8
insert the correct compiler options on the command line based on
9
installed software, instead of hard-coded values.
11
@section pkgconfig_usage Usage
13
Using pkg-config it is as simple as:
16
gcc -c -o main.o main.c `pkg-config --cflags PKGNAME`
19
gcc -o my_application main.o `pkg-config --libs PKGNAME`
21
# compile + link in a single step:
22
gcc -o my_application main.c `pkg-config --cflags --libs PKGNAME`
25
Where @b PKGNAME is your module, such as eina, eet, evas, ecore,
26
ecore-x, eio and so on.
28
One can do some queries such as the module version, other variables:
30
pkg-config --modversion PKGNAME
31
pkg-config --variable=prefix PKGNAME
34
@section pkgconfig_troubleshooting Troubleshooting
36
Make sure @c pkg-config command is in your @c $PATH, otherwise
40
pkg-config: command not found
43
The @b PKGNAME it searched using pkg-config's build location,
44
usually @c /usr/lib/pkgconfig. This can be overwritten with @c
45
$PKG_CONFIG_LIBDIR (usually for cross compile) or extended with @c
46
$PKG_CONFIG_PATH. If you installed EFL to @c /opt/efl, then use:
49
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/efl/lib/pkgconfig"
50
pkg-config --cflags --libs PKGNAME
53
Otherwise you'll end with:
55
Package PKGNAME was not found in the pkg-config search path.
56
Perhaps you should add the directory containing `PKGNAME.pc'
57
to the PKG_CONFIG_PATH environment variable
58
No package 'PKGNAME' found