add wxBase framework library
[openwrt/svn-archive/archive.git] / utils / mksh / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=mksh
4 PKG_VERSION:=R31b
5 PKG_RELEASE:=1
6
7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).cpio.gz
8 PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh
9 PKG_MD5SUM:=819feed2336274f939c67547c5a3ddbd
10
11 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
12
13 include $(INCLUDE_DIR)/package.mk
14
15 # This program seems to depend on libssp, but only for GCC 4
16 GCCVER:=$(if $(DUMP),4,$(word 1,$(subst ., ,$(subst ",,$(CONFIG_GCC_VERSION)))))
17 #"))))
18 ifeq ($(GCCVER),4)
19 DEP:=+libssp
20 else
21 DEP:=
22 endif
23
24 define Package/mksh
25 SECTION:=shells
26 CATEGORY:=Base system
27 TITLE:=mksh
28 DEPENDS:=$(DEP)
29 DESCRIPTION:=MirBSD version of ksh
30 endef
31
32 define Build/Compile
33 cd $(PKG_BUILD_DIR); \
34 CC="$(TARGET_CC)" \
35 TARGET_OS="$(shell uname -s)" \
36 CFLAGS="$(TARGET_CFLAGS)" \
37 CPPFLAGS="-DMKSH_SMALL=1" \
38 LDFLAGS="$(TARGET_LDFLAGS)" \
39 $(BASH) Build.sh -Q -r
40 endef
41
42 define Package/mksh/postinst
43 #!/bin/sh
44 grep mksh $${IPKG_INSTROOT}/etc/shells || \
45 echo "/bin/mksh" >> $${IPKG_INSTROOT}/etc/shells
46 endef
47
48 define Package/mksh/install
49 $(INSTALL_DIR) $(1)/etc
50 $(INSTALL_DATA) $(PKG_BUILD_DIR)/dot.mkshrc $(1)/etc/mkshrc
51 $(INSTALL_DIR) $(1)/bin
52 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mksh $(1)/bin/
53 endef
54
55 $(eval $(call BuildPackage,mksh))