Skip to contentSkip to conversation

Updated and cleaned up patch

PATCH New Martin Banky 1 participant 2 messages Oct 8, 2010 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [PATCH 2/7] Added the ability to patch ltmain.sh based on version

A message that is not in the archive (sent off-list or not yet received): [PATCH 2/7] Added the ability to patch ltmain.sh based on version

#2 lore raw

cover Updated and cleaned up patch

Sorry to do this, but here is a cleaned-up and updated patch for this.

Martin

[PATCH 1/1] Added the ability to patch ltmain.sh based on version

#3 lore raw

PATCH 1/1 Added the ability to patch ltmain.sh based on version

In reply to a message not in the archive

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.

---
 package/Makefile.autotools.in        |   23 ++++++++---
 package/buildroot-libtool-v1.5.patch |   69 ++++++++++++++++++++++++++++++++++
 package/buildroot-libtool-v2.2.patch |   64 +++++++++++++++++++++++++++++++
 package/buildroot-libtool.patch      |   69 ----------------------------------
 4 files changed, 150 insertions(+), 75 deletions(-)
 create mode 100644 package/buildroot-libtool-v1.5.patch
 create mode 100644 package/buildroot-libtool-v2.2.patch
 delete mode 100644 package/buildroot-libtool.patch
package/Makefile.autotools.in +17 -6
index 589079b..87c3092 100644
@@ -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
package/buildroot-libtool-v1.5.patch new file +69 -0

69 lines not on this page · raw message

package/buildroot-libtool-v2.2.patch new file +64 -0

64 lines not on this page · raw message

package/buildroot-libtool.patch deleted +0 -69

69 lines not on this page · raw message

Signature · 1 line
1.7.3.1