Makefile (2910B)
1 # 2 # Copyright (C) 2007-2011 OpenWrt.org 3 # Copyright (c) 2009-2014 Thorsten Glaser <tg@mirbsd.org> 4 # 5 # This is free software, licensed under the GNU General Public License v2. 6 # See /LICENSE for more information. 7 # 8 9 include $(TOPDIR)/rules.mk 10 11 PKG_NAME:=mksh 12 PKG_VERSION:=54 13 PKG_RELEASE:=1 14 15 PKG_MAINTAINER:=Thorsten Glaser <tg@mirbsd.org> 16 PKG_LICENSE:=MirOS 17 18 PKG_SOURCE:=$(PKG_NAME)-R$(PKG_VERSION).tgz 19 PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh \ 20 http://pub.allbsd.org/MirOS/dist/mir/mksh/ 21 PKG_MD5SUM:=be0a6fb93b4a5f927bcc1893bb6692f8 22 23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) 24 25 include $(INCLUDE_DIR)/package.mk 26 27 define Package/mksh 28 SECTION:=shells 29 CATEGORY:=Base system 30 TITLE:=MirBSD Korn Shell 31 DEPENDS:=$(DEP) 32 URL:=http://mirbsd.de/mksh 33 endef 34 35 define Package/mksh/description 36 mksh is the MirBSD enhanced version of the Public Domain Korn 37 shell (pdksh), a Bourne-compatible shell which is largely si- 38 milar to the original AT&T Korn shell; mksh is the only pdksh 39 derivate currently being actively developed. It includes bug 40 fixes and feature improvements, in order to produce a modern, 41 robust shell good for interactive and especially script use. 42 mksh has UTF-8 support (in substring operations and the Emacs 43 editing mode) and - while R50 corresponds to OpenBSD 5.5-cur- 44 rent ksh (without GNU bash-like PS1 and fancy character clas- 45 ses) - adheres to SUSv4 and is much more robust. The code has 46 been cleaned up and simplified, bugs fixed, standards compli- 47 ance added, and several enhancements (for extended compatibi- 48 lity to other modern shells - as well as a couple of its own) 49 are available. It has sensible defaults as usual with BSD. 50 endef 51 52 define Build/Compile 53 # -DMKSH_SMALL=1 ⇒ reduce functionality quite a lot 54 # -DMKSH_ASSUME_UTF8=0 ⇒ never automatically enable 55 # UTF-8 mode, neither use setlocale/nl_langinfo 56 # nor look at $LC_* and $LANG (not recommended) 57 # -DMKSH_BINSHPOSIX ⇒ enable POSIX mode if called as sh 58 #XXX maybe change to -DMKSH_ASSUME_UTF8=1 now (which 59 #XXX is always assume UTF-8 mode) 60 # HAVE_CAN_FSTACKPROTECTORALL=0 ⇒ nuke libssp dependency 61 # HAVE_CAN_FSTACKPROTECTORSTRONG=0 ⇒ same, for gcc 4.9+ 62 cd $(PKG_BUILD_DIR); \ 63 CC="$(TARGET_CC)" \ 64 TARGET_OS="$(shell uname -s)" \ 65 CFLAGS="$(TARGET_CFLAGS)" \ 66 CPPFLAGS="-DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0 -DMKSH_BINSHPOSIX" \ 67 HAVE_CAN_FSTACKPROTECTORALL=0 \ 68 HAVE_CAN_FSTACKPROTECTORSTRONG=0 \ 69 LDFLAGS="$(TARGET_LDFLAGS)" \ 70 $(BASH) Build.sh -Q -r -c lto 71 endef 72 73 define Package/mksh/postinst 74 #!/bin/sh 75 grep mksh $${IPKG_INSTROOT}/etc/shells || \ 76 echo "/bin/mksh" >> $${IPKG_INSTROOT}/etc/shells 77 endef 78 79 define Package/mksh/install 80 $(INSTALL_DIR) $(1)/etc 81 $(INSTALL_DATA) $(PKG_BUILD_DIR)/dot.mkshrc $(1)/etc/mkshrc 82 $(INSTALL_DIR) $(1)/bin 83 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mksh $(1)/bin/ 84 endef 85 86 define Package/mksh/conffiles 87 /etc/mkshrc 88 endef 89 90 $(eval $(call BuildPackage,mksh))