Blame sofort/pkgconf.sh

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