packages: depend on libelf1 instead of libelf
[packages.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 = +libelf1
37 DEPENDS_expr = +libgmp
38 DEPENDS_factor = +libgmp
39
40 define Package/coreutils/Default
41   SECTION:=utils
42   CATEGORY:=Utilities
43   TITLE:=The GNU core utilities
44   URL:=http://www.gnu.org/software/coreutils/
45 endef
46
47 define Package/coreutils
48   $(call Package/coreutils/Default)
49   TITLE:=The GNU core utilities
50   MENU:=1
51 endef
52
53 define Package/coreutils/description
54  Full versions of standard GNU utilities. Normally, you would not use this
55  package, since the functionality in BusyBox is more than sufficient and
56  smaller.
57 endef
58
59 define GenPlugin
60  define Package/$(1)
61    $(call Package/coreutils/Default)
62    DEPENDS:=coreutils $(DEPENDS_$(2))
63    TITLE:=Utility $(2) from the GNU core utilities
64  endef
65
66  define Package/$(1)/description
67   Full version of standard GNU $(2) utility. Normally, you would not use this
68   package, since the functionality in BusyBox is more than sufficient.
69  endef
70 endef
71
72 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a))))
73
74 CONFIGURE_VARS += \
75         gl_cv_func_mbrtowc_incomplete_state=yes \
76         gl_cv_func_mbrtowc_retval=yes \
77         gl_cv_func_wcrtomb_retval=yes
78
79 ifneq ($(CONFIG_USE_UCLIBC),)
80   CONFIGURE_VARS += \
81         ac_cv_type_pthread_spinlock_t=$(if $(filter 0.9.30% 0.9.2% 0.9.31%,$(call qstrip,$(CONFIG_UCLIBC_VERSION))),no,yes)
82 endif
83
84 CONFIGURE_ARGS += \
85         --enable-install-program=su
86
87 define Build/Compile
88         $(MAKE) -C $(PKG_BUILD_DIR) \
89                 DESTDIR="$(PKG_INSTALL_DIR)" \
90                 SHELL="/bin/bash" \
91                 all install install-root
92 endef
93
94 define Package/coreutils/install
95         true
96 endef
97
98 define BuildPlugin
99   define Package/$(1)/install
100         $(INSTALL_DIR) $$(1)/usr/bin
101         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/
102   endef
103
104   $$(eval $$(call BuildPackage,$(1)))
105 endef
106
107 $(eval $(call BuildPackage,coreutils))
108
109 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a))))