\hypertarget{pkgconfig_pkgconfig_intro}{}\doxysection{Introduction}\label{pkgconfig_pkgconfig_intro}
pkg-\/config (\href{http://pkgconfig.freedesktop.org/wiki/}{\texttt{ http\+://pkgconfig.\+freedesktop.\+org/wiki/}}) is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line based on installed software, instead of hard-\/coded values.\hypertarget{pkgconfig_pkgconfig_usage}{}\doxysection{Usage}\label{pkgconfig_pkgconfig_usage}
Using pkg-\/config it is as simple as\+: \begin{DoxyVerb}# compile:
gcc -c -o main.o main.c `pkg-config --cflags PKGNAME`

# link:
gcc -o my_application main.o `pkg-config --libs PKGNAME`

# compile + link in a single step:
gcc -o my_application main.c `pkg-config --cflags --libs PKGNAME`
\end{DoxyVerb}


Where {\bfseries{P\+K\+G\+N\+A\+ME}} is your module, such as eina, eet, evas, ecore, ecore-\/x, eio and so on.

One can do some queries such as the module version, other variables\+: \begin{DoxyVerb}pkg-config --modversion PKGNAME
pkg-config --variable=prefix PKGNAME
\end{DoxyVerb}
\hypertarget{pkgconfig_pkgconfig_troubleshooting}{}\doxysection{Troubleshooting}\label{pkgconfig_pkgconfig_troubleshooting}
Make sure {\ttfamily pkg-\/config} command is in your {\ttfamily \$\+P\+A\+TH}, otherwise you\textquotesingle{}ll end with\+:

\begin{DoxyVerb}pkg-config: command not found
\end{DoxyVerb}


The {\bfseries{P\+K\+G\+N\+A\+ME}} it searched using pkg-\/config\textquotesingle{}s build location, usually {\ttfamily /usr/lib/pkgconfig}. This can be overwritten with {\ttfamily \$\+P\+K\+G\+\_\+\+C\+O\+N\+F\+I\+G\+\_\+\+L\+I\+B\+D\+IR} (usually for cross compile) or extended with {\ttfamily \$\+P\+K\+G\+\_\+\+C\+O\+N\+F\+I\+G\+\_\+\+P\+A\+TH}. If you installed E\+FL to {\ttfamily /opt/efl}, then use\+:

\begin{DoxyVerb}export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/efl/lib/pkgconfig"
pkg-config --cflags --libs PKGNAME
\end{DoxyVerb}


Otherwise you\textquotesingle{}ll end with\+: \begin{DoxyVerb}Package PKGNAME was not found in the pkg-config search path.
Perhaps you should add the directory containing `PKGNAME.pc'
to the PKG_CONFIG_PATH environment variable
No package 'PKGNAME' found
\end{DoxyVerb}
 