diff options
-rw-r--r-- | mk/buildlink2/libtool-fix-la | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/mk/buildlink2/libtool-fix-la b/mk/buildlink2/libtool-fix-la index effec60b81d..dfe5959dad5 100644 --- a/mk/buildlink2/libtool-fix-la +++ b/mk/buildlink2/libtool-fix-la @@ -1,4 +1,4 @@ -# $NetBSD: libtool-fix-la,v 1.10 2002/09/28 23:46:42 jlam Exp $ +# $NetBSD: libtool-fix-la,v 1.11 2002/10/01 09:51:22 jlam Exp $ # # For *.la files, in the "relink_command" line, we make the following # replacements: @@ -30,16 +30,27 @@ if [ -f $lafile ]; then esac ;; *.la) + fixla=0 ltlibsdir=`@DIRNAME@ $i`/.libs case "$ltlibsdir" in - ./*|../*|@WRKSRC@/*) + /*) + # fix if an absolute path in ${WRKSRC} + case "$ltlibsdir" in + @WRKSRC@/*) fixla=1 ;; + esac + ;; + *) + # fix all relative paths + fixla=1 + ;; + esac + if [ $fixla -gt 0 ]; then case "$deps" in *"-L$ltlibsdir "*) ;; *"-L$ltlibsdir") ;; *) deps="$deps -L$ltlibsdir" ;; esac - ;; - esac + fi deps="${deps} $i" ;; *) @@ -64,16 +75,27 @@ if [ -f $lafile ]; then relink="${relink} $i" ;; *.la) + fixla=0 ltlibsdir=`@DIRNAME@ $i`/.libs case "$ltlibsdir" in - ./*|../*|@WRKSRC@/*) + /*) + # fix if an absolute path in ${WRKSRC} + case "$ltlibsdir" in + @WRKSRC@/*) fixla=1 ;; + esac + ;; + *) + # fix all relative paths + fixla=1 + ;; + esac + if [ $fixla -gt 0 ]; then case "$relink" in *"-L$ltlibsdir "*) ;; *"-L$ltlibsdir") ;; *) relink="$relink -L$ltlibsdir" ;; esac - ;; - esac + fi relink="${relink} $i" ;; *) |