Browse Source

gnu sed no longer required, will be build as hosttool

Waldemar Brodkorb 10 years ago
parent
commit
4d15e451c9

+ 0 - 1
README

@@ -9,7 +9,6 @@ Before you can start you need to install some tools:
 - g++ or clang++
 - binutils 
 - GNU make
-- GNU sed
 - tar
 - gzip
 - wget

+ 0 - 1
docs/prerequisite.txt

@@ -25,7 +25,6 @@ package names may vary between host systems.
 ** +binutils+
 ** +C compiler (gcc or clang)+ 
 ** `C++ compiler (g++ or clang++)`
-** +GNU sed+
 ** +GNU make+
 ** +gzip+
 ** +perl+

+ 1 - 1
mk/kernel-vars.mk

@@ -15,4 +15,4 @@ else
 KERNEL_MAKE_OPTS+=	HOSTCFLAGS='${CFLAGS_FOR_BUILD}'
 endif
 
-KERNEL_MAKE_ENV+=	PATH="${STAGING_HOST_DIR}/usr/bin:$$PATH"
+KERNEL_MAKE_ENV:=	PATH="${STAGING_HOST_DIR}/usr/bin:$$PATH"

+ 3 - 2
mk/vars.mk

@@ -199,9 +199,10 @@ HOST_CONFIGURE_OPTS=	CC_FOR_BUILD='${CC_FOR_BUILD}' \
 PKG_SUFFIX:=		$(strip $(subst ",, $(ADK_PACKAGE_SUFFIX)))
 
 ifeq ($(ADK_TARGET_PACKAGE_IPKG),y)
-PKG_BUILD:=		PATH='${TARGET_PATH}' \
+PKG_BUILD:=		PATH='${HOST_PATH}' \
 			${BASH} ${SCRIPT_DIR}/ipkg-build
-PKG_INSTALL:=		IPKG_TMP=$(BUILD_DIR)/tmp \
+PKG_INSTALL:=		PATH='${HOST_PATH}' \
+			IPKG_TMP=$(BUILD_DIR)/tmp \
 			IPKG_INSTROOT=$(TARGET_DIR) \
 			IPKG_CONF_DIR=$(STAGING_TARGET_DIR)/etc \
 			IPKG_OFFLINE_ROOT=$(TARGET_DIR) \

+ 3 - 3
package/busybox/Makefile

@@ -52,10 +52,10 @@ do-configure:
 		cp ${WRKBUILD}/.config.tmp ${WRKBUILD}/.config; \
 	done
 	$(SED) 's;@IDIR@;${WRKINST};' ${WRKBUILD}/.config
-	yes '' | $(MAKE) ${BB_MAKE_FLAGS} oldconfig $(MAKE_TRACE)
+	yes '' | PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} oldconfig $(MAKE_TRACE)
 
 do-build:
-	$(MAKE) ${BB_MAKE_FLAGS} busybox
+	PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} busybox
 
 BBDEFS:=(
 define BBDEF
@@ -68,7 +68,7 @@ endef
 $(foreach OPTION,CROND WATCHDOG SYSLOGD INETD NTPD,$(eval $(call BBDEF,$(OPTION))))
 
 do-install:
-	$(MAKE) ${BB_MAKE_FLAGS} install $(MAKE_TRACE)
+	PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} install $(MAKE_TRACE)
 	$(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
 	$(INSTALL_DIR) $(IDIR_BUSYBOX)/etc
 	${BBDEFS} :) >$(IDIR_BUSYBOX)/etc/.bb_defaults

+ 31 - 0
package/sed/Makefile

@@ -0,0 +1,31 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		sed
+PKG_VERSION:=		4.2.2
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		4111de4faa3b9848a0686b2f260c5056
+PKG_DESCR:=		stream editor
+PKG_SECTION:=		editor
+PKG_URL:=		http://www.gnu.org/software/sed/
+PKG_SITES:=		${MASTER_SITE_GNU:=sed/}
+
+DISTFILES:=             ${PKG_NAME}-${PKG_VERSION}.tar.gz
+
+include $(TOPDIR)/mk/host.mk
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call HOST_template,SED,sed,$(PKG_VERSION)-${PKG_RELEASE}))
+$(eval $(call PKG_template,SED,sed,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+HOST_STYLE:=		auto
+
+sed-install:
+	$(INSTALL_DIR) $(IDIR_SED)/usr/bin
+	$(INSTALL_BIN) $(WRKINST)/usr/bin/sed \
+		$(IDIR_SED)/usr/bin
+
+include ${TOPDIR}/mk/host-bottom.mk
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 11 - 14
scripts/scan-tools.sh

@@ -158,20 +158,6 @@ if [[ ! -s /usr/include/ncurses.h ]]; then
 	fi
 fi
 
-if ! which sed >/dev/null 2>&1; then
-	echo You must install GNU sed to continue.
-	echo
-	out=1
-fi
-
-if ! sed --version 2>/dev/null|grep GNU >/dev/null;then
-	if ! which gsed >/dev/null 2>&1; then
-		echo You must install GNU sed to continue.
-		echo
-		out=1
-	fi
-fi
-
 if ! which wget >/dev/null 2>&1; then
 	echo You must install wget to continue.
 	echo
@@ -270,6 +256,16 @@ if ! which gawk >/dev/null 2>&1; then
 	host_build_gawk=1
 fi
 
+host_build_sed=0
+if ! which gsed >/dev/null 2>&1; then
+	if which sed >/dev/null 2>&1; then
+		if ! sed --version 2>/dev/null|grep GNU >/dev/null;then
+			echo "No GNU sed found, will build one."
+			host_build_sed=1
+		fi
+	fi
+fi
+
 host_build_xz=0
 if ! which xz >/dev/null 2>&1; then
 	echo "No xz found, will build one."
@@ -328,6 +324,7 @@ if [ $host_build_mksh -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_MKSH"
 if [ $host_build_patch -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_PATCH" >> $topdir/target/config/Config.in.prereq ;fi
 if [ $host_build_pkgconf -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_PKGCONF" >> $topdir/target/config/Config.in.prereq ;fi
 if [ $host_build_findutils -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_FINDUTILS" >> $topdir/target/config/Config.in.prereq ;fi
+if [ $host_build_sed -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_SED" >> $topdir/target/config/Config.in.prereq ;fi
 if [ $host_build_xz -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_XZ" >> $topdir/target/config/Config.in.prereq ;fi
 # optional
 if [ $host_build_ccache -eq 1 ];then printf "\t%s\n" "select ADK_HOST_BUILD_CCACHE if ADK_HOST_NEED_CCACHE" >> $topdir/target/config/Config.in.prereq ;fi

+ 0 - 9
scripts/sed

@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-# This file is part of the OpenADK project. OpenADK is copyrighted
-# material, please see the LICENCE file in the top-level directory.
-
-if [ -z "$(which gsed 2>/dev/null)" ];then
-	/bin/sed "$@"
-else
-	gsed "$@"
-fi

+ 4 - 0
target/config/Config.in.tools

@@ -53,6 +53,10 @@ config ADK_HOST_BUILD_PKGCONF
 	boolean
 	default n
 
+config ADK_HOST_BUILD_SED
+	boolean
+	default n
+
 config ADK_HOST_BUILD_XZ
 	boolean
 	default n

+ 2 - 2
toolchain/kernel-headers/Makefile

@@ -8,8 +8,8 @@ include ${TOPDIR}/mk/kernel-vars.mk
 include ${TOPDIR}/mk/buildhlp.mk
 
 $(WRKBUILD)/.headers:
-	$(MAKE) -C $(WRKBUILD) ${KERNEL_MAKE_OPTS} headers_check
-	$(MAKE) -C $(WRKBUILD) ${KERNEL_MAKE_OPTS} \
+	${KERNEL_MAKE_ENV} $(MAKE) -C $(WRKBUILD) ${KERNEL_MAKE_OPTS} headers_check
+	${KERNEL_MAKE_ENV} $(MAKE) -C $(WRKBUILD) ${KERNEL_MAKE_OPTS} \
 		INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)/usr \
 		headers_install
 	@-find $(STAGING_TARGET_DIR)/usr/include -name .install -delete