More portable generation of pkg-config definition files

This commit is contained in:
Pierre Pronchery 2012-07-31 23:54:54 +00:00
parent c93f0eb376
commit af0f83daa3
2 changed files with 14 additions and 5 deletions

View File

@ -8,4 +8,4 @@ Description: DeforaOS Development code pre-processor
Version: @VERSION@
Requires: libSystem
Cflags: -I${includedir}
Libs: -Wl,-R${libdir} -L${libdir} -lcpp
Libs: -L${libdir} @RPATH@ -lcpp

View File

@ -40,8 +40,8 @@ SED="sed"
#debug
_debug()
{
echo $@ 1>&2
$@
echo "$@" 1>&2
"$@"
}
@ -99,9 +99,18 @@ while [ $# -gt 0 ]; do
continue
fi
#portability
RPATH="-Wl,-rpath-link,\${libdir} -Wl,-rpath,\${libdir}"
case $(uname -s) in
Darwin)
RPATH=
;;
esac
#create
$DEBUG $SED -e "s,@PREFIX@,$PREFIX," \
-e "s,@VERSION@,$VERSION," "$target.in" > "$target"
$DEBUG $SED -e "s:@PREFIX@:$PREFIX:" \
-e "s:@VERSION@:$VERSION:" \
-e "s:@RPATH@:$RPATH:" -- "$target.in" > "$target"
if [ $? -ne 0 ]; then
$DEBUG $RM -- "$target"
exit 2