1082f364d16312ff2956d71bb03897d5114fca3b
[openwrt/svn-archive/archive.git] / utils / coreutils / Makefile
1 #
2 # Copyright (C) 2008-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=coreutils
11 PKG_VERSION:=8.16
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@GNU/coreutils
16 PKG_MD5SUM:=89b06f91634208dceba7b36ad1f9e8b9
17 PKG_BUILD_DEPENDS:=libpthread
18
19 PKG_BUILD_PARALLEL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 COREUTILS_APPLETS := \
24 base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit \
25 cut date dd dir dircolors dirname du echo env expand expr factor \
26 false fmt fold groups head hostid id install join kill link ln logname \
27 ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od paste \
28 pathchk pinky pr printenv printf ptx pwd readlink realpath rm rmdir \
29 runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred \
30 shuf sleep sort split stat stdbuf stty sum sync tac tail tee test \
31 timeout touch tr true truncate tsort tty uname unexpand uniq unlink \
32 uptime users vdir wc who whoami yes
33
34 DEPENDS_sort = +libpthread
35 DEPENDS_timeout = +librt
36 DEPENDS_uptime = +libelf
37
38 define Package/coreutils/Default
39 SECTION:=utils
40 CATEGORY:=Utilities
41 TITLE:=The GNU core utilities
42 URL:=http://www.gnu.org/software/coreutils/
43 endef
44
45 define Package/coreutils
46 $(call Package/coreutils/Default)
47 TITLE:=The GNU core utilities
48 MENU:=1
49 endef
50
51 define Package/coreutils/description
52 Full versions of standard GNU utilities. Normally, you would not use this
53 package, since the functionality in BusyBox is more than sufficient and
54 smaller.
55 endef
56
57 define GenPlugin
58 define Package/$(1)
59 $(call Package/coreutils/Default)
60 DEPENDS:=coreutils $(DEPENDS_$(2))
61 TITLE:=Utility $(2) from the GNU core utilities
62 endef
63
64 define Package/$(1)/description
65 Full version of standard GNU $(2) utility. Normally, you would not use this
66 package, since the functionality in BusyBox is more than sufficient.
67 endef
68 endef
69
70 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a))))
71
72 CONFIGURE_VARS += \
73 gl_cv_func_mbrtowc_incomplete_state=yes \
74 gl_cv_func_mbrtowc_retval=yes \
75 gl_cv_func_wcrtomb_retval=yes
76
77 ifneq ($(CONFIG_USE_UCLIBC),)
78 CONFIGURE_VARS += \
79 ac_cv_type_pthread_spinlock_t=$(if $(filter 0.9.30% 0.9.2% 0.9.31%,$(call qstrip,$(CONFIG_UCLIBC_VERSION))),no,yes)
80 endif
81
82 CONFIGURE_ARGS += \
83 --enable-install-program=su
84
85 define Build/Compile
86 $(MAKE) -C $(PKG_BUILD_DIR) \
87 DESTDIR="$(PKG_INSTALL_DIR)" \
88 SHELL="/bin/bash" \
89 all install install-root
90 endef
91
92 define Package/coreutils/install
93 true
94 endef
95
96 define BuildPlugin
97 define Package/$(1)/install
98 $(INSTALL_DIR) $$(1)/usr/bin
99 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
100 endef
101
102 $$(eval $$(call BuildPackage,$(1)))
103 endef
104
105 $(eval $(call BuildPackage,coreutils))
106
107 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a))))