Reicher82 / python / sbpython3

Forked from python/sbpython3 3 years ago
Clone

Blame sofort/pkgconf.sh

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