ioquake/ioq3 — pull request #3 by smcv (2013-05-19 20:49:27+00:00)
Title: make external library linking nicer

The first patch in the series adds a USE_INTERNAL_LIBS variable which acts as a default for all the variables of the form USE_INTERNAL_FOO, since most distributors will want to use the embedded code copies for either nearly everything (portable binaries like the official ones from ioquake3.org), or nearly nothing (self-contained systems with strong package dependencies like Debian, Fedora, etc.).

Subsequent patches make all the (potentially-)external libraries work similarly: if the user set FOO_CFLAGS and FOO_LIBS, use those (allowing libraries to be found in non-standard locations via `-I`, `-L` flags). If not, use pkg-config if available (again, allowing for non-standard locations). If *that* fails, assume the library has its usual upstream name and is in the system's default search path (as is done now).

In particular, libopus and libopusfile on Debian are not installed in the default cpp search path, and need `-I` flags to be picked up from pkg-config.

Tested on Debian, works in both USE_INTERNAL_LIBS=0 and USE_INTERNAL_LIBS=1 modes.