Blame sofort/pkgconf.sh

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