Blame sofort/pkgconf.sh

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