orbea / cross / slibtool

Forked from cross/slibtool 3 years ago
Clone

Blame sofort/pkgconf.sh

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