libtool: respect environment variables

The /usr/bin/libtool script used to use cross tool-chains,
when it was cross compiled.
This broke cross-built libtool for native builds and was changed in
653f433927 to native tool-chains.
Setting native tool-chains in libtools causes cross-builds which use
libtool to fail.

Thus, change /usr/bin/libtool to use environment variables when defined
and fall back to the native tool-chain otherwise.
This commit is contained in:
Johannes 2019-10-28 20:33:14 +01:00 committed by Juan RP
parent 66062de198
commit 67f8177462

View file

@ -1,13 +1,13 @@
# Template file for 'libtool' # Template file for 'libtool'
pkgname=libtool pkgname=libtool
version=2.4.6 version=2.4.6
revision=3 revision=4
build_style=gnu-configure build_style=gnu-configure
hostmakedepends="perl automake help2man" hostmakedepends="perl automake help2man"
depends="tar sed" depends="tar sed"
short_desc="Generic library support script" short_desc="Generic library support script"
maintainer="Enno Boland <gottox@voidlinux.org>" maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2" license="GPL-2.0-or-later"
homepage="http://www.gnu.org/software/libtool" homepage="http://www.gnu.org/software/libtool"
distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz" distfiles="${GNU_SITE}/libtool/$pkgname-$version.tar.xz"
checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f checksum=7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f
@ -28,8 +28,8 @@ post_install() {
# things that need to go; the target libtool script is meant to be used # things that need to go; the target libtool script is meant to be used
# in native environments, not in cross environments, so patch the script # in native environments, not in cross environments, so patch the script
if [ "$CROSS_BUILD" ]; then if [ "$CROSS_BUILD" ]; then
# e.g. AR="armv7l-linux-gnueabihf-ar" becomes AR="ar" # e.g. AR="armv7l-linux-gnueabihf-ar" becomes AR="${AR:=ar}"
vsed -i -e "s,=\"${XBPS_CROSS_TRIPLET}\-,=\",g" \ vsed -i -e "s,\([A-Z]\+\)=\"${XBPS_CROSS_TRIPLET}\-\(.*\)\",\1=\$\{\1:=\2\},g" \
${PKGDESTDIR}/usr/bin/libtool ${PKGDESTDIR}/usr/bin/libtool
# clear out any sysroot present # clear out any sysroot present