lua-rs232: fix compilation with GCC13
[feed/packages.git] / utils / mksh / Makefile
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:=59c
13 PKG_RELEASE:=3
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_HASH:=77ae1665a337f1c48c61d6b961db3e52119b38e58884d1c89684af31f87bc506
22
23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/mksh
28 SECTION:=utils
29 CATEGORY:=Utilities
30 SUBMENU:=Shells
31 TITLE:=MirBSD Korn Shell
32 DEPENDS:=$(DEP)
33 URL:=http://mirbsd.de/mksh
34 endef
35
36 define Package/mksh/description
37 mksh is the MirBSD enhanced version of the Public Domain Korn
38 shell (pdksh), a Bourne-compatible shell which is largely si-
39 milar to the original AT&T Korn shell; mksh is the only pdksh
40 derivate currently being actively developed. It includes bug
41 fixes and feature improvements, in order to produce a modern,
42 robust shell good for interactive and especially script use.
43 mksh has UTF-8 support (in substring operations and the Emacs
44 editing mode) and - while R59 corresponds to OpenBSD 5.7-cur-
45 rent ksh (without GNU bash-like PS1 and fancy character clas-
46 ses) - adheres to SUSv4 and is much more robust. The code has
47 been cleaned up and simplified, bugs fixed, standards compli-
48 ance added, and several enhancements (for extended compatibi-
49 lity to other modern shells - as well as a couple of its own)
50 are available. It has sensible defaults as usual with BSD.
51 endef
52
53 define Build/Compile
54 # -DMKSH_SMALL=1 ⇒ reduce functionality quite a lot
55 # -DMKSH_ASSUME_UTF8=0 ⇒ never automatically enable
56 # UTF-8 mode, neither use setlocale/nl_langinfo
57 # nor look at $LC_* and $LANG (not recommended)
58 # -DMKSH_BINSHPOSIX ⇒ enable POSIX mode if called as sh
59 #XXX maybe change to -DMKSH_ASSUME_UTF8=1 now (which
60 #XXX is always assume UTF-8 mode)
61 # HAVE_CAN_FSTACKPROTECTORALL=0 ⇒ nuke libssp dependency
62 # HAVE_CAN_FSTACKPROTECTORSTRONG=0 ⇒ same, for gcc 4.9+
63 cd $(PKG_BUILD_DIR); \
64 CC="$(TARGET_CC)" \
65 TARGET_OS="$(shell uname -s)" \
66 CFLAGS="$(TARGET_CFLAGS)" \
67 CPPFLAGS="$(TARGET_CPPFLAGS) -DMKSH_SMALL=1 -DMKSH_ASSUME_UTF8=0 -DMKSH_BINSHPOSIX -DMKSHRC_PATH=\\\"/etc/mkshrc\\\"" \
68 HAVE_CAN_FSTACKPROTECTORALL=0 \
69 HAVE_CAN_FSTACKPROTECTORSTRONG=0 \
70 LDFLAGS="$(TARGET_LDFLAGS)" \
71 $(BASH) Build.sh -Q -r
72 endef
73
74 define Package/mksh/postinst
75 #!/bin/sh
76 grep mksh $${IPKG_INSTROOT}/etc/shells || \
77 echo "/bin/mksh" >> $${IPKG_INSTROOT}/etc/shells
78 endef
79
80 define Package/mksh/install
81 $(INSTALL_DIR) $(1)/etc
82 $(INSTALL_DATA) $(PKG_BUILD_DIR)/dot.mkshrc $(1)/etc/mkshrc
83 $(INSTALL_DIR) $(1)/bin
84 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mksh $(1)/bin/
85 endef
86
87 define Package/mksh/conffiles
88 /etc/mkshrc
89 endef
90
91 $(eval $(call BuildPackage,mksh))