Browse Source

use mksh in tools, too

Waldemar Brodkorb 10 years ago
parent
commit
5101b72fac
4 changed files with 34 additions and 15 deletions
  1. 2 0
      package/mksh/Makefile
  2. 1 14
      scripts/create.sh
  3. 1 1
      tools/Makefile
  4. 30 0
      tools/mksh/Makefile

+ 2 - 0
package/mksh/Makefile

@@ -12,6 +12,8 @@ PKG_SECTION:=		shells
 PKG_URL:=		http://www.mirbsd.org/
 PKG_SITES:=		${MASTER_SITE_MIRBSD:distfiles/=dist/mir/mksh/}
 
+PKG_DFLT_MKSH:=		y if !ADK_TOOLCHAIN_ONLY
+
 DISTFILES=		${PKG_NAME}-R${PKG_VERSION}.tgz
 WRKDIST=		${WRKDIR}/${PKG_NAME}
 

+ 1 - 14
scripts/create.sh

@@ -2,7 +2,7 @@
 #-
 # Copyright © 2010, 2011, 2012
 #	Thorsten Glaser <tg@mirbsd.org>
-# Copyright © 2010, 2011
+# Copyright © 2010-2014
 #	Waldemar Brodkorb <wbx@openadk.org>
 #
 # Provided that these terms and disclaimer and all copyright notices
@@ -36,19 +36,6 @@ case :$PATH: in
 (*) export PATH=$PATH:$TOPDIR/host_$HOST/usr/bin ;;
 esac
 
-test -n "$KSH_VERSION" || if ! which mksh >/dev/null 2>&1; then
-	make package=mksh fetch || exit 1
-	df=mksh-R48b.tgz
-	rm -rf build_mksh
-	mkdir -p build_mksh
-	gzip -dc dl/"$df" | (cd build_mksh; cpio -mid)
-	cd build_mksh/mksh
-	bash Build.sh -r -c lto || bash Build.sh -r || exit 1
-	cp mksh "$TOPDIR"/host_$HOST/usr/bin
-	cd "$TOPDIR"
-	rm -rf build_mksh
-fi
-
 test -n "$KSH_VERSION" || exec mksh "$me" "$@"
 if test -z "$KSH_VERSION"; then
 	echo >&2 Fatal error: could not run myself with mksh!

+ 1 - 1
tools/Makefile

@@ -3,7 +3,7 @@
 
 include $(TOPDIR)/rules.mk
 
-TARGETS:=adk mkcrypt cpio m4 flex bc bzip2 xz
+TARGETS:=adk mksh mkcrypt cpio m4 flex bc bzip2 xz
 
 ifeq ($(ADK_HOST_NEED_GENEXT2FS),y)
 TARGETS+=genext2fs

+ 30 - 0
tools/mksh/Makefile

@@ -0,0 +1,30 @@
+# 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:=		mksh
+PKG_VERSION:=		49
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		e8c205cac72c3dc8540bbc3897421422
+PKG_SITES:=		${MASTER_SITE_MIRBSD:distfiles/=dist/mir/mksh/}
+
+DISTFILES=		${PKG_NAME}-R${PKG_VERSION}.tgz
+WRKDIST=		${WRKDIR}/${PKG_NAME}
+
+include ../rules.mk
+
+install: ${STAGING_HOST_DIR}/usr/bin/mksh
+
+$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
+	cd ${WRKBUILD} && CC='${TARGET_CC}' CFLAGS='${TARGET_CFLAGS}' \
+	    CPPFLAGS='${TARGET_CPPFLAGS}' LDFLAGS='${TARGET_LDFLAGS}' \
+	    HAVE_CAN_FSTACKPROTECTORALL=0 \
+	    TARGET_OS=Linux ${BASH} ${WRKSRC}/Build.sh -Q -r -c lto
+	touch $@
+
+${STAGING_HOST_DIR}/usr/bin/mksh: $(WRKBUILD)/.compiled
+	${INSTALL_BIN} ${WRKBUILD}/mksh \
+		${STAGING_HOST_DIR}/usr/bin
+
+include $(TOPDIR)/mk/tools.mk