1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00

Update unfuck_libtool function

We tell the autoconf configure script that we are going to install stuff
to prefix "/" with libdir being set to "/lib", so the script ends up writing
"libdir='/lib'" to the libtool *.la scripts.

This is all fine and dandy until we do a 'make install' with DESTDIR set to
our actual package deploy directory. Libtool goes "OMG WTF we aren't
instaling to / afterall" and thinks it needs to do a relinking phase.

During relinking, it passes "-L$libdir" to gcc, which ends up as "-L/lib".
Now, gcc tries to link against local system libraries. Best case, the build
breaks and we know something stupid happened. It really bites us if we try
to cross compile from e.g. x86 to x86.

Until now, it worked to simply patch the *.la scripts before 'make install',
like other distros do, but recent versions of util-linux now ship with a
newer version of the libtool script which simply regenerates the *.la files.

This commit adds an extension to the patch script that patches the actuall
libtool script itself.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2019-01-17 19:55:32 +01:00
parent 98bbfad989
commit 2fb62ec2f1

View file

@ -44,10 +44,12 @@ unfuck_libtool() {
local libdir="$PKGDEPLOYDIR/$PKGNAME/lib" local libdir="$PKGDEPLOYDIR/$PKGNAME/lib"
local f local f
for f in $(find $PKGBUILDDIR -type f -name '*.la'); do for f in $(find $PKGBUILDDIR -type f -name '*.la' -o -name '*.lai'); do
sed -i "s#libdir='.*'#libdir='$libdir'#g" "$f"; sed -i "s#libdir='.*'#libdir='$libdir'#g" "$f"
done done
sed -i -r "s/(finish_cmds)=.*$/\1=\"\"/" "$PKGBUILDDIR/libtool" sed -i -r "s/(finish_cmds)=.*$/\1=\"\"/" "$PKGBUILDDIR/libtool"
sed -i -r "s/(hardcode_into_libs)=.*$/\1=no/" "$PKGBUILDDIR/libtool" sed -i -r "s/(hardcode_into_libs)=.*$/\1=no/" "$PKGBUILDDIR/libtool"
sed -i "s#libdir='\$install_libdir'#libdir='$libdir'#g" "$PKGBUILDDIR/libtool"
} }