Obviously, things in the C world are a little different because you don't need a source at runtime. The general way of working with GNU / Linux (and many other * ix) is that some configuration step is performed using a script or program configuration. The most common of these is the famous configurescript generated by GNU autoconf. Autotools generates many cache files and copies many helper scripts to the source tree, so be sure to install it .gitignoreor you will lose your mind.
pkg-config $prefix/lib/pkgconfig $prefix/share/pkgconfig. pkg-config . , /usr/lib/pkgconfig, , .
autoconf configure.ac configure, m4 ( autoconf). , pkg-config, . configure.ac
:
# Checks for libraries.
PKG_CHECK_MODULES([GLib], [glib-2.0])
, pkg-config , , glib-2.0, Checking for GLib... . GLib_CFLAGS GLib_LIBS , AC_CONFIG_FILES (, Makefile, from Makefile.in). glib, configure . /usr/share/aclocal/pkg.m4, PKG_CHECK_MODULES, . pkg-config(1).
pkg-config, autoconf. , SDL AM_PATH_SDL, pkg-config.
, autoconf. autoconf Debian GNU/Linux MacPorts (, , ), , .m4 .
, , - AC_CHECK_HEADER , - AC_CHECK_LIB.