Blame sofort/pkgconf.sh

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