From 057b7babf499325cfdc6a5594bc3f65f96afde9e Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 31 Jul 2012 23:56:04 +0000 Subject: [PATCH] Updated the pkgconfig.sh sample script --- doc/scripts/pkgconfig.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/scripts/pkgconfig.sh b/doc/scripts/pkgconfig.sh index 01f2ce7..cafa6ac 100755 --- a/doc/scripts/pkgconfig.sh +++ b/doc/scripts/pkgconfig.sh @@ -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