Blame sofort/pkgconf.sh

f901ee
#!/bin/sh
f901ee
f901ee
# prefix, exec_prefix
f901ee
if [ "$PKGCONF_PREFIX" = "$PKGCONF_EXEC_PREFIX" ]; then
f901ee
	echo 'prefix='${PKGCONF_PREFIX}
f901ee
	echo 'exec_prefix=${prefix}'
f901ee
else
f901ee
	echo 'prefix='${PKGCONF_PREFIX}
f901ee
	echo 'exec_prefix='${PKGCONF_EXEC_PREFIX}
f901ee
fi
f901ee
f901ee
f901ee
# (relative) includedir
f901ee
prefix=`dirname "$PKGCONF_INCLUDEDIR"`
f901ee
base=`basename "$PKGCONF_INCLUDEDIR"`
f901ee
f901ee
if [ "$prefix/$base" = "$PKGCONF_PREFIX/$base" ]; then
f901ee
	echo 'includedir=${prefix}/'${base}
f901ee
else
f901ee
	echo 'includedir='${PKGCONF_INCLUDEDIR}
f901ee
fi
f901ee
f901ee
if [ "$prefix/$base" = "$PKGCONF_PREFIX/include" ]; then
f901ee
	CFLAGS=
f901ee
else
f901ee
	CFLAGS='-I{includedir}'
f901ee
fi
f901ee
f901ee
f901ee
# (relative) libdir
f901ee
prefix=`dirname "$PKGCONF_LIBDIR"`
f901ee
base=`basename "$PKGCONF_LIBDIR"`
f901ee
f901ee
if [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/$base" ]; then
f901ee
	echo 'libdir=${prefix}/'${base}
f901ee
else
f901ee
	echo 'libdir='${PKGCONF_LIBDIR}
f901ee
fi
f901ee
f901ee
if [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/lib" ]; then
f901ee
	LDFLAGS='-l'${PKGCONF_NAME}
f901ee
elif [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/lib64" ]; then
f901ee
	LDFLAGS='-l'${PKGCONF_NAME}
f901ee
else
f901ee
	LDFLAGS='-L'${PKGCONF_LIBDIR} '-l'${PKGCONF_NAME}
f901ee
fi
f901ee
f901ee
f901ee
# name, description, url, version
f901ee
echo
f901ee
echo 'Name:        '${PKGCONF_NAME}
f901ee
echo 'Description: '${PKGCONF_DESC}
f901ee
echo 'URL:         '${PKGCONF_USRC}
f901ee
echo 'Version:     '${PKGCONF_VERSION}
f901ee
f901ee
f901ee
# repo (optional)
f901ee
if ! [ -z "$PKGCONF_REPO" ]; then
f901ee
	echo 'Repo:        '${PKGCONF_REPO}
f901ee
fi
f901ee
f901ee
f901ee
# patches (optional)
f901ee
if ! [ -z "$PKGCONF_PSRC" ]; then
f901ee
	echo 'Patches:      '${PKGCONF_PSRC}
f901ee
fi
f901ee
f901ee
f901ee
# disto (optional)
f901ee
if ! [ -z "$PKGCONF_DURL" ]; then
f901ee
	echo 'Distro:       '${PKGCONF_DURL}
f901ee
fi
f901ee
f901ee
f901ee
# Cflags
f901ee
if [ -z "$PKGCONF_DEFS" ] && [ -z "$CFLAGS" ]; then
f901ee
	echo 'Cflags:'
f901ee
elif [ -z "$PKGCONF_DEFS" ]; then
f901ee
	echo 'Cflags:      '${CFLAGS}
f901ee
elif [ -z "$CFLAGS" ]; then
f901ee
	echo 'Cflags:      '${PKGCONF_DEFS}
f901ee
else
f901ee
	echo 'Cflags:      '${PKGCONF_DEFS} ${CFLAGS}
f901ee
fi
f901ee
f901ee
f901ee
# Libs
f901ee
if [ -z "$PKGCONF_LIBS" ]; then
f901ee
	echo 'Libs:        '${LDFLAGS}
f901ee
else
f901ee
	echo 'Libs:        '${PKGCONF_LIBS} ${LDFLAGS}
f901ee
fi