Skip to contentSkip to conversation

fix buildroot sed handling on Mac OS X

PATCH New Heikki Lindholm 2 participants 6 messages Feb 25, 2007 – Mar 9, 2007

lore
Share & tools
lore
#1 lore raw

PATCH 2/3 fix buildroot sed handling on Mac OS X

Quoted 29 lines · Heikki Lindholm

Include a patch for GNU sed that allows building it on Mac OS X and remove a spurious --prefix from sed.mk.

-- Heikki Lindholm

diff -Nru buildroot/package/sed/configure.patch buildroot-devel/package/sed/configure.patch

package/sed/configure.patch +19 -0
@@ -0,0 +1,29 @@
+diff -Nru sed-4.1.5.orig/configure sed-4.1.5/configure
+--- sed-4.1.5.orig/configure	2006-02-03 11:24:40.000000000 +0200
++++ sed-4.1.5/configure	2007-02-23 14:03:55.000000000 +0200
+@@ -10147,8 +10147,6 @@
+     LINGUAS="${LINGUAS-%UNSET%}"
+ 
+ 
+-  install_sh="$install_sh"
+-
+ _ACEOF
+ 
+ 
+@@ -11265,14 +11263,10 @@
+       esac
+     done ;;
+     gettext-fix )
+-  sed -e '/^mkinstalldirs *=/a\' \
+-      -e "install_sh=$install_sh" \
+-      -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \

package/sed/configure.patch line 29

Quoted 10 lines
package/sed/configure.patch +10 -0
++  sed -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
+       intl/Makefile > intl/Makefile.tmp
+   mv intl/Makefile.tmp intl/Makefile
+-  sed -e '/^mkinstalldirs *=/a\' \
+-      -e "install_sh=$install_sh" \
+-      -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
++  sed -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
+       po/Makefile > po/Makefile.tmp
+   mv po/Makefile.tmp po/Makefile ;;
+   esac

It is not immediately apparent to me why you need this patch. Please elaborate.

Quoted 30 lines

diff -Nru buildroot/package/sed/sed.mk buildroot-devel/package/sed/sed.mk

package/sed/sed.mk +0 -0
@@ -18,6 +18,7 @@
 HOST_SED_DIR:=$(TOOL_BUILD_DIR)

SED:=$(HOST_SED_DIR)/bin/sed -i -e HOST_SED_TARGET=$(shell package/sed/sedcheck.sh) +HOST_SED_IF_ANY=$(shell toolchain/dependencies/check-host-sed.sh)

$(DL_DIR)/$(SED_SOURCE):

	mkdir -p $(DL_DIR)
package/sed/sed.mk +1 -0
@@ -35,13 +36,13 @@
 	mkdir -p $(TOOL_BUILD_DIR)
 	mkdir -p $(HOST_SED_DIR)/bin;
 	$(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+	toolchain/patch-kernel.sh $(SED_DIR1) package/sed/ configure.patch
 	touch $(SED_DIR1)/.unpacked
 

$(SED_DIR1)/.configured: $(SED_DIR1)/.unpacked

	(cd $(SED_DIR1); rm -rf config.cache; \
		./configure \
		--prefix=$(HOST_SED_DIR) \
package/sed/sed.mk +0 -1
-		--prefix=/usr \
	);
	touch $(SED_DIR1)/.configured
package/sed/sed.mk +0 -0
@@ -62,17 +63,10 @@
 		    $(HOST_SED_DIR)/usr/man $(HOST_SED_DIR)/usr/share/doc; fi
 

use-sed-host-binary:

package/sed/sed.mk

Quoted 9 lines
package/sed/sed.mk +1 -8
-	@if [ -x /usr/bin/sed ] ; then \
-		SED="/usr/bin/sed" ; \
-	else \
-		if [ -x /bin/sed ] ; then \
-			SED="/bin/sed" ; \
-		fi \
-	fi ; \
-	if [ ! -e "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)" ] ; then \
+	@if [ ! -e "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)" ] ; then \

Please do not hide away these commands.

Quoted 7 lines
		mkdir -p "$(HOST_SED_DIR)/bin"; \
		rm -f "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)"; \
package/sed/sed.mk +1 -1
-		ln -sf "$$SED" "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)"; \
+		ln -sf "$(HOST_SED_IF_ANY)" "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)"; \

fi

host-sed: $(HOST_SED_TARGET)

#2 lore raw

PATCH 2/3 fix buildroot sed handling on Mac OS X

Bernhard Fischer kirjoitti:

Quoted 38 lines · Heikki Lindholm
Quoted 37 lines

Include a patch for GNU sed that allows building it on Mac OS X and remove a spurious --prefix from sed.mk.

-- Heikki Lindholm

diff -Nru buildroot/package/sed/configure.patch buildroot-devel/package/sed/configure.patch

package/sed/configure.patch +25 -0
@@ -0,0 +1,29 @@
+diff -Nru sed-4.1.5.orig/configure sed-4.1.5/configure
+--- sed-4.1.5.orig/configure	2006-02-03 11:24:40.000000000 +0200
++++ sed-4.1.5/configure	2007-02-23 14:03:55.000000000 +0200
+@@ -10147,8 +10147,6 @@
+     LINGUAS="${LINGUAS-%UNSET%}"
+ 
+ 
+-  install_sh="$install_sh"
+-
+ _ACEOF
+ 
+ 
+@@ -11265,14 +11263,10 @@
+       esac
+     done ;;
+     gettext-fix )
+-  sed -e '/^mkinstalldirs *=/a\' \
+-      -e "install_sh=$install_sh" \
+-      -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
++  sed -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
+       intl/Makefile > intl/Makefile.tmp
+   mv intl/Makefile.tmp intl/Makefile
+-  sed -e '/^mkinstalldirs *=/a\' \
+-      -e "install_sh=$install_sh" \
+-      -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
Quoted 8 lines

package/sed/configure.patch line 29

Quoted 4 lines
package/sed/configure.patch +4 -0
++  sed -e 's/^mkinstalldirs *=.*/mkinstalldirs=$(MKINSTALLDIRS)/' \
+       po/Makefile > po/Makefile.tmp
+   mv po/Makefile.tmp po/Makefile ;;
+   esac

It is not immediately apparent to me why you need this patch. Please elaborate.

Nor to me. But it seems to fix a sed incompatibility - it's funny, but building GNU sed does seem to require GNU sed. If I try to build sed-4.1.5 on OS X without this patch, ./configure fails with
sed: 1: "install_sh=/tmp/sed-4.1 ...": command i expects \ followed by text
sed: 1: "install_sh=/tmp/sed-4.1 ...": command i expects \ followed by text The patch itself is just copied from Darwinports (macports these days.)

Quoted 29 lines
Quoted 29 lines

diff -Nru buildroot/package/sed/sed.mk buildroot-devel/package/sed/sed.mk

package/sed/sed.mk +0 -0
@@ -18,6 +18,7 @@
 HOST_SED_DIR:=$(TOOL_BUILD_DIR)

SED:=$(HOST_SED_DIR)/bin/sed -i -e HOST_SED_TARGET=$(shell package/sed/sedcheck.sh) +HOST_SED_IF_ANY=$(shell toolchain/dependencies/check-host-sed.sh)

$(DL_DIR)/$(SED_SOURCE):

	mkdir -p $(DL_DIR)
package/sed/sed.mk +1 -0
@@ -35,13 +36,13 @@
 	mkdir -p $(TOOL_BUILD_DIR)
 	mkdir -p $(HOST_SED_DIR)/bin;
 	$(SED_CAT) $(DL_DIR)/$(SED_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+	toolchain/patch-kernel.sh $(SED_DIR1) package/sed/ configure.patch
 	touch $(SED_DIR1)/.unpacked
 

$(SED_DIR1)/.configured: $(SED_DIR1)/.unpacked

	(cd $(SED_DIR1); rm -rf config.cache; \
		./configure \
		--prefix=$(HOST_SED_DIR) \
package/sed/sed.mk +0 -1
-		--prefix=/usr \
	);
	touch $(SED_DIR1)/.configured
package/sed/sed.mk +0 -0
@@ -62,17 +63,10 @@
 		    $(HOST_SED_DIR)/usr/man $(HOST_SED_DIR)/usr/share/doc; fi
 
Quoted 13 lines

package/sed/sed.mk

Quoted 10 lines

use-sed-host-binary:

package/sed/sed.mk +1 -8
-	@if [ -x /usr/bin/sed ] ; then \
-		SED="/usr/bin/sed" ; \
-	else \
-		if [ -x /bin/sed ] ; then \
-			SED="/bin/sed" ; \
-		fi \
-	fi ; \
-	if [ ! -e "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)" ] ; then \
+	@if [ ! -e "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)" ] ; then \

Please do not hide away these commands.

Uhm. What do you mean? sed checking is already done for HOST_SED_IF_ANY by the same check-sed script.

Quoted 7 lines
Quoted 7 lines
		mkdir -p "$(HOST_SED_DIR)/bin"; \
		rm -f "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)"; \
package/sed/sed.mk +1 -1
-		ln -sf "$$SED" "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)"; \
+		ln -sf "$(HOST_SED_IF_ANY)" "$(HOST_SED_DIR)/$(SED_TARGET_BINARY)"; \

fi

host-sed: $(HOST_SED_TARGET)

#3 lore raw

PATCH 2/3 fix buildroot sed handling on Mac OS X

Quoted 9 lines · Heikki Lindholm

Bernhard Fischer kirjoitti:

Quoted 7 lines · Heikki Lindholm
Quoted 3 lines

Include a patch for GNU sed that allows building it on Mac OS X and remove a spurious --prefix from sed.mk.

It is not immediately apparent to me why you need this patch. Please elaborate.

Quoted 6 lines

Nor to me. But it seems to fix a sed incompatibility - it's funny, but building GNU sed does seem to require GNU sed. If I try to build sed-4.1.5 on OS X without this patch, ./configure fails with
sed: 1: "install_sh=/tmp/sed-4.1 ...": command i expects \ followed by text
sed: 1: "install_sh=/tmp/sed-4.1 ...": command i expects \ followed by text The patch itself is just copied from Darwinports (macports these days.)

applied, thanks.

#4 lore raw

PATCH 2/3 fix buildroot sed handling on Mac OS X

Bernhard Fischer kirjoitti:

Quoted 22 lines · Heikki Lindholm
Quoted 13 lines

Bernhard Fischer kirjoitti:

Quoted 9 lines · Heikki Lindholm
Quoted 4 lines

Include a patch for GNU sed that allows building it on Mac OS X and remove a spurious --prefix from sed.mk.

It is not immediately apparent to me why you need this patch. Please elaborate.

Quoted 6 lines

Nor to me. But it seems to fix a sed incompatibility - it's funny, but building GNU sed does seem to require GNU sed. If I try to build sed-4.1.5 on OS X without this patch, ./configure fails with
sed: 1: "install_sh=/tmp/sed-4.1 ...": command i expects \ followed by text
sed: 1: "install_sh=/tmp/sed-4.1 ...": command i expects \ followed by text The patch itself is just copied from Darwinports (macports these days.)

Quoted 1 line

applied, thanks.

Dammit. There was still one bug left:

The sed.mk makefile uses both absolute install prefix and DESTDIR pointing to the same dir. Fix by removing DESTDIR.

-- Heikki Lindholm

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: buildroot-070309-sed-hostinstall.patch
Url: http://busybox.net/lists/buildroot/attachments/20070309/eb600d9b/attachment.asc

#5 lore raw

PATCH 2/3 fix buildroot sed handling on Mac OS X

Heikki Lindholm kirjoitti:

Quoted 29 lines

Bernhard Fischer kirjoitti:

Quoted 27 lines · Heikki Lindholm
Quoted 23 lines

Bernhard Fischer kirjoitti:

Quoted 10 lines · Heikki Lindholm
Quoted 4 lines

Include a patch for GNU sed that allows building it on Mac OS X and remove a spurious --prefix from sed.mk.

It is not immediately apparent to me why you need this patch. Please elaborate.

Nor to me. But it seems to fix a sed incompatibility - it's funny, but building GNU sed does seem to require GNU sed. If I try to build sed-4.1.5 on OS X without this patch, ./configure fails with
sed: 1: "install_sh=/tmp/sed-4.1 ...": command i expects \ followed by text
sed: 1: "install_sh=/tmp/sed-4.1 ...": command i expects \ followed by text
The patch itself is just copied from Darwinports (macports these days.)

Quoted 7 lines
Quoted 1 line

applied, thanks.

Dammit. There was still one bug left:

The sed.mk makefile uses both absolute install prefix and DESTDIR pointing to the same dir. Fix by removing DESTDIR.

... which is of course the wrong way to fix it. Here's a better one.

-
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: buildroot-070309-sed-hostinstall.patch
Url: http://busybox.net/lists/buildroot/attachments/20070309/2b1f9f08/attachment.pot