Blame sofort/pkgconf.sh

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