Subject: Re: libtool -export-symbols-regex
To: None <tech-pkg@NetBSD.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-pkg
Date: 03/21/2004 16:03:31
--YZ5djTAD1cGYuMQK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Mar 21, 2004 at 01:25:50PM +0100, Manuel Bouyer wrote:
>[...] 
> Looking closed, the "-Wl,-M -Wl,.libs/libgdk_pixbuf-2.0.so.200.4.exp" is
> changed to "-Wl,-M -Wl,.libs-L -lgdk_pixbuf-2.0exp" within .buildlink/bin/gcc.
> The problem seems to be in .buildlink/bin/.cache-trans:
> -Wl,.libs/libgdk_pixbuf-2.0.so.200.4.exp)       # /local/funk1/pkgbuild/x11/gtk2
> /work.funk/.buildlink/bin/gcc
>         cachearg="-Wl,.libs-L -lgdk_pixbuf-2.0exp"
> 	arg="$cachearg"; cachehit=yes
> 	;;
> These lines also appear in .cache-add-trans
> 
> And this is where I'm lost: I didn't find how these lines where added to
> .cache-add-trans

OK, it's not in the Makefiles, it's bin/.logic*
I tracked it down to this part:
-*|/*)
        arg=`$echo "X$qarg" | $Xsed -f /local/funk1/pkgbuild/x11/gtk2/work.funk/.buildlink/bin/.transform.sed`
	addtocache=yes
	;;

The problem seems to be in .transform.sed.
In bin/.gen-transform, I see:
#       p:path                  translates "path/*/libfoo.so" into
#                                       "-Lpath/* -lfoo"

This looks like the culprit to me, this is what happens here.
We need to find a way to tell sed to ignore it if there's something after
the libfoo.so, libfoo.so.x, or libfoo.so.x.y
I adding a '$' in the sed regexp fixes this, but I don't know yet if this has
bad side effects.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--YZ5djTAD1cGYuMQK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: buildlink3/gen-transform.sh
===================================================================
RCS file: /cvsroot/pkgsrc/mk/buildlink3/gen-transform.sh,v
retrieving revision 1.26
diff -u -r1.26 gen-transform.sh
--- buildlink3/gen-transform.sh	13 Mar 2004 03:41:13 -0000	1.26
+++ buildlink3/gen-transform.sh	21 Mar 2004 14:16:06 -0000
@@ -226,16 +226,16 @@
 		case "$action" in
 		transform|untransform)
 			@CAT@ >> $sedfile << EOF
-s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.so\.[0-9]*\.[0-9]*\.[0-9]*|-L\1 -l\2|g
-s|\($2\)/lib\([^/$_sep]*\)\.so\.[0-9]*\.[0-9]*\.[0-9]*|-L\1 -l\2|g
-s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.so\.[0-9]*\.[0-9]*|-L\1 -l\2|g
-s|\($2\)/lib\([^/$_sep]*\)\.so\.[0-9]*\.[0-9]*|-L\1 -l\2|g
-s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.so\.[0-9]*|-L\1 -l\2|g
-s|\($2\)/lib\([^/$_sep]*\)\.so\.[0-9]*|-L\1 -l\2|g
-s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.so|-L\1 -l\2|g
-s|\($2\)/lib\([^/$_sep]*\)\.so|-L\1 -l\2|g
-s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.dylib|-L\1 -l\2|g
-s|\($2\)/lib\([^/$_sep]*\)\.dylib|-L\1 -l\2|g
+s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.so\.[0-9]*\.[0-9]*\.[0-9]*$|-L\1 -l\2|g
+s|\($2\)/lib\([^/$_sep]*\)\.so\.[0-9]*\.[0-9]*\.[0-9]*$|-L\1 -l\2|g
+s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.so\.[0-9]*\.[0-9]*$|-L\1 -l\2|g
+s|\($2\)/lib\([^/$_sep]*\)\.so\.[0-9]*\.[0-9]*$|-L\1 -l\2|g
+s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.so\.[0-9]*$|-L\1 -l\2|g
+s|\($2\)/lib\([^/$_sep]*\)\.so\.[0-9]*$|-L\1 -l\2|g
+s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.so$|-L\1 -l\2|g
+s|\($2\)/lib\([^/$_sep]*\)\.so$|-L\1 -l\2|g
+s|\($2/[^$_sep]*\)/lib\([^/$_sep]*\)\.dylib$|-L\1 -l\2|g
+s|\($2\)/lib\([^/$_sep]*\)\.dylib$|-L\1 -l\2|g
 EOF
 			;;
 		esac

--YZ5djTAD1cGYuMQK--