Blame sofort/pkgconf.sh

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