build: disable the PKG_CHECK_FORMAT_SECURITY check for the failing packages
[openwrt.git] / package / utils / busybox / Makefile
1
2 # Copyright (C) 2006-2014 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:=busybox
11 PKG_VERSION:=1.22.1
12 PKG_RELEASE:=2
13 PKG_FLAGS:=essential
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://www.busybox.net/downloads \
17                 http://distfiles.gentoo.org/distfiles/
18 PKG_MD5SUM:=337d1a15ab1cb1d4ed423168b1eb7d7e
19
20 PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc
21 PKG_BUILD_PARALLEL:=1
22 PKG_CHECK_FORMAT_SECURITY:=0
23
24 PKG_LICENSE:=GPLv2 BSD-4c
25 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE
26
27 include $(INCLUDE_DIR)/package.mk
28
29 ifeq ($(DUMP),)
30   STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
31 endif
32
33 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
34   BB_MAKE_VERBOSE := V=1
35 else
36   BB_MAKE_VERBOSE :=
37 endif
38
39 define Package/busybox
40   SECTION:=base
41   CATEGORY:=Base system
42   MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
43   TITLE:=Core utilities for embedded Linux
44   URL:=http://busybox.net/
45   DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc
46   MENU:=1
47 endef
48
49 define Package/busybox/description
50  The Swiss Army Knife of embedded Linux.
51  It slices, it dices, it makes Julian Fries.
52 endef
53
54 define Package/busybox/config
55         source "$(SOURCE)/Config.in"
56 endef
57
58 BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT)
59
60 define Build/Configure
61         rm -f $(PKG_BUILD_DIR)/.configured*
62         grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config
63         yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \
64                 CC="$(TARGET_CC)" \
65                 CROSS_COMPILE="$(TARGET_CROSS)" \
66                 KBUILD_HAVE_NLS=no \
67                 ARCH="$(ARCH)" \
68                 $(BB_MAKE_VERBOSE) \
69                 oldconfig
70 endef
71
72 ifdef CONFIG_GCC_VERSION_LLVM
73   TARGET_CFLAGS += -fnested-functions
74 endif
75
76 LDLIBS:=m crypt
77 ifdef CONFIG_BUSYBOX_USE_LIBRPC
78   TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
79   export LDFLAGS=$(TARGET_LDFLAGS)
80   LDLIBS += rpc
81 endif
82
83 define Build/Compile
84         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
85                 CC="$(TARGET_CC)" \
86                 CROSS_COMPILE="$(TARGET_CROSS)" \
87                 KBUILD_HAVE_NLS=no \
88                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
89                 ARCH="$(ARCH)" \
90                 SKIP_STRIP=y \
91                 LDLIBS="$(LDLIBS)" \
92                 $(BB_MAKE_VERBOSE) \
93                 all
94         rm -rf $(PKG_INSTALL_DIR)
95         $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
96         $(MAKE) -C $(PKG_BUILD_DIR) \
97                 CC="$(TARGET_CC)" \
98                 CROSS_COMPILE="$(TARGET_CROSS)" \
99                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
100                 ARCH="$(ARCH)" \
101                 CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
102                 LDLIBS="$(LDLIBS)" \
103                 $(BB_MAKE_VERBOSE) \
104                 install
105 endef
106
107 define Package/busybox/install
108         $(INSTALL_DIR) $(1)/etc/init.d
109         $(CP) $(PKG_INSTALL_DIR)/* $(1)/
110         $(INSTALL_BIN) ./files/cron $(1)/etc/init.d/cron
111         $(INSTALL_BIN) ./files/telnet $(1)/etc/init.d/telnet
112         $(INSTALL_BIN) ./files/sysntpd $(1)/etc/init.d/sysntpd
113         -rm -rf $(1)/lib64
114 endef
115
116 $(eval $(call BuildPackage,busybox))