From 83af822f7b28169b096d592027e97c55cc83eb27 Mon Sep 17 00:00:00 2001 From: Martin Banky Date: Sat, 9 Oct 2010 12:52:49 +0200 Subject: Added the ability to patch ltmain.sh based on version There are two versions of ltmain.sh in use in the buildroot system, 1.5.x and 2.2.x. buildroot-libtool.patch would only patch 1.5.x, which meant that for 2.2.x, a separate patch for the affected package had to be maintained. Modified Makefile.autotools.in to check the version of ltmain.sh and apply the correct patch. Signed-off-by: Martin Banky Signed-off-by: Thomas Petazzoni --- package/Makefile.autotools.in | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'package/Makefile.autotools.in') diff --git a/package/Makefile.autotools.in b/package/Makefile.autotools.in index 589079b6a..87c309269 100644 --- a/package/Makefile.autotools.in +++ b/package/Makefile.autotools.in @@ -139,10 +139,16 @@ $(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK # define LIBTOOL_PATCH_HOOK @$(call MESSAGE,"Patching libtool") - $(Q)if test "$$($$(PKG)_LIBTOOL_PATCH)" = "YES" -a \ - "$$($$(PKG)_AUTORECONF)" != "YES"; then \ - for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \ - toolchain/patch-kernel.sh $$$${i%/*} package buildroot-libtool.patch; \ + $(Q)if test "$$($$(PKG)_LIBTOOL_PATCH)" = "YES" \ + -a "$$($$(PKG)_AUTORECONF)" != "YES"; then \ + for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \ + ltmain_version=`sed -n '/^[ ]*VERSION=/{s/^[ ]*VERSION=//;p;q;}' $$$$i | \ + sed -e 's/\([0-9].[0-9]*\).*/\1/' -e 's/\"//'`; \ + if test $$$${ltmain_version} = '1.5'; then \ + toolchain/patch-kernel.sh $$$${i%/*} package buildroot-libtool-v1.5.patch; \ + elif test $$$${ltmain_version} = "2.2"; then\ + toolchain/patch-kernel.sh $$$${i%/*} package buildroot-libtool-v2.2.patch; \ + fi \ done \ fi endef @@ -158,9 +164,14 @@ endif define AUTORECONF_HOOK @$(call MESSAGE,"Autoreconfiguring") $(Q)cd $$($$(PKG)_SRCDIR) && $(AUTORECONF) $$($$(PKG)_AUTORECONF_OPT) - $(Q)if test "$($$(PKG)_LIBTOOL_PATCH)" = "YES"; then \ + $(Q)if test "$$($$(PKG)_LIBTOOL_PATCH)" = "YES"; then \ for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \ - toolchain/patch-kernel.sh $${i%/*} package buildroot-libtool.patch; \ + ltmain_version=`sed -n '/^[ ]*VERSION=/{s/^[ ]*VERSION=//;p;q;}' $$$$i | sed 's/\([0-9].[0-9]*\).*/\1/'`; \ + if test $$$${ltmain_version} = "1.5"; then \ + toolchain/patch-kernel.sh $$$${i%/*} package buildroot-libtool-v1.5.patch; \ + elif test $$$${ltmain_version} = "2.2"; then\ + toolchain/patch-kernel.sh $$$${i%/*} package buildroot-libtool-v2.2.patch; \ + fi \ done \ fi endef -- cgit v1.2.3