summaryrefslogtreecommitdiff
path: root/package/Makefile.autotools.in
diff options
context:
space:
mode:
authorMartin Banky <martin.banky@gmail.com>2010-10-09 12:52:49 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-10-14 07:27:07 -0400
commit83af822f7b28169b096d592027e97c55cc83eb27 (patch)
treee830ad597f9e462f03a7b8e1a342ac3979d28051 /package/Makefile.autotools.in
parentfda95b5b10be51cb8d73448fc0f2208921e6d07e (diff)
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 <Martin.Banky@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/Makefile.autotools.in')
-rw-r--r--package/Makefile.autotools.in23
1 files changed, 17 insertions, 6 deletions
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