Blame sofort/pkgconf.sh

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