Blame sofort/pkgconf.sh

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