Blame sofort/pkgconf.sh

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