tools/coreutils: update to 9.4
[openwrt/staging/blocktrron.git] / tools / coreutils / Makefile
1 #
2 # Copyright (C) 2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=coreutils
10 PKG_CPE_ID:=cpe:/a:gnu:coreutils
11 PKG_VERSION:=9.4
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=@GNU/coreutils
15 PKG_HASH:=5f600d9093973b0afe25393d9bc18c44f2232657f4ca0d95ea31c702eb66b739
16
17 HOST_BUILD_PARALLEL := 1
18
19 PKG_PROGRAMS:=date readlink touch ln chown ginstall
20
21 include $(INCLUDE_DIR)/host-build.mk
22
23 export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
24
25 HOST_GNULIB_SKIP := \
26 lib/math.in.h \
27 lib/stdlib.in.h \
28 lib/string.in.h \
29 lib/uchar.in.h \
30 lib/unistd.in.h \
31 lib/wchar.in.h \
32 lib/wctype.in.h
33
34 HOST_CONFIGURE_ARGS += \
35 --disable-year2038 \
36 --enable-install-program=$(subst $(space),$(comma),$(strip $(PKG_PROGRAMS)))
37
38 HOST_MAKE_FLAGS += \
39 $(AM_TOOL_PATHS_FAKE) \
40 PROGRAMS="$(patsubst %,src/%,$(PKG_PROGRAMS))" \
41 LIBRARIES= MANS= SUBDIRS=.
42
43 define Host/Bootstrap
44 ( \
45 cd $(HOST_BUILD_DIR); \
46 $(AM_TOOL_PATHS_FAKE) \
47 ./bootstrap \
48 --bootstrap-sync \
49 --force \
50 --no-git \
51 --skip-po \
52 --gnulib-srcdir=$(GNULIB_SRCDIR) \
53 )
54 endef
55
56 define Host/Prepare
57 $(call Host/Prepare/Default)
58 $(if $(QUILT),,$(call Host/Bootstrap))
59 endef
60
61 define Host/Configure
62 $(if $(QUILT),$(call Host/Bootstrap))
63 $(foreach src,$(HOST_GNULIB_SKIP),mv -f $(HOST_BUILD_DIR)/$(src)~ $(HOST_BUILD_DIR)/$(src) || true; )
64 $(call Host/Configure/Default)
65 endef
66
67 define Host/Install
68 $(INSTALL_DIR) $(1)/bin
69 $(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/src/%,$(PKG_PROGRAMS)) $(1)/bin/
70 ln -sf ginstall $(1)/bin/install
71 endef
72
73 define Host/Uninstall
74 rm -f $(STAGING_DIR_HOST)/bin/install
75 -$(call Host/Compile/Default,uninstall)
76 endef
77
78 $(eval $(call HostBuild))