php: phpize: Modify ltmain.sh to support sysroot path in .la files

PHP's phpize is based on a very old libtool to generate build files for
its extensions. This libtool does not support .la files with '=' to
support sysroot.

In order to support more PHP extension cross compilation this modifies
ltmain.sh to support such path. This is a bit hackish has it only get
sysroot from the used toolchain; the proper way to fix that is to have
PHP developpers to update the autotools file used to build there
extensions.
This commit is contained in:
Remi Pommarel 2021-09-09 16:36:50 +02:00 committed by Érico Nogueira Rolim
parent 2984425c32
commit 7e8a27b013
2 changed files with 40 additions and 1 deletions

View file

@ -0,0 +1,39 @@
--- a/build/ltmain.sh 2021-09-09 15:19:14.822208365 +0200
+++ b/build/ltmain.sh 2021-09-09 15:47:55.397011151 +0200
@@ -2375,6 +2375,13 @@ EOF
*) . ./$lib ;;
esac
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ deplib=$(echo "$deplib" | sed "s#^=\(.*\)#$(${CC} --print-sysroot)\1#")
+ newdependency_libs="$newdependency_libs $deplib"
+ done
+ dependency_libs=${newdependency_libs}
+
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
@@ -5750,6 +5757,13 @@ fi\
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
+
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ deplib=$(echo "$deplib" | sed "s#^$(${CC} --print-sysroot)#=#")
+ newdependency_libs="$newdependency_libs $deplib"
+ done
+
$echo > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
@@ -5767,7 +5781,7 @@ library_names='$library_names'
old_library='$old_library'
# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
+dependency_libs='$newdependency_libs'
# Version information for $libname.
current=$current

View file

@ -1,7 +1,7 @@
# Template file for 'php'
pkgname=php
version=7.4.14
revision=5
revision=6
hostmakedepends="bison pkg-config apache-devel"
makedepends="apache-devel enchant-devel freetds-devel freetype-devel gdbm-devel
gmp-devel libcurl-devel libjpeg-turbo-devel libmariadbclient-devel