lw-build-system/scripts/config-printflags.sh

18 lines
544 B
Bash
Executable File

#!/bin/bash
# lw-build-system/scripts/config-printflags.sh
#
# (c)2009, Laurence Withers <l@lwithers.me.uk>.
# Released under the GNU GPLv3. See file COPYING or
# http://www.gnu.org/copyleft/gpl.html for details.
#
# Script to print the flag lines for `config', given a library name.
#
for pkg in $@
do
varname="$(echo "${pkg}" | tr 'a-z-+' 'A-Z__')"
echo '[ -z "${'${varname}'_CFLAGS}" ] && '${varname}'_CFLAGS="$('${pkg}'-config --cflags)"'
echo '[ -z "${'${varname}'_LIBS}" ] && '${varname}'_LIBS="$('${pkg}'-config --libs)"'
done