source: trunk/package/busybox/Makefile @ 29156

Last change on this file since 29156 was 29156, checked in by jow, 5 years ago

[package] busybox: fix hexdump segmentation fault with an empty leading format unit

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
File size: 2.6 KB
Line 
1#
2# Copyright (C) 2006-2011 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=busybox
11PKG_VERSION:=1.19.3
12PKG_RELEASE:=6
13PKG_FLAGS:=essential
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16PKG_SOURCE_URL:=http://www.busybox.net/downloads \
17                http://distfiles.gentoo.org/distfiles/
18PKG_MD5SUM:=c3938e1ac59602387009bbf1dd1af7f6
19
20PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc
21PKG_BUILD_PARALLEL:=1
22
23include $(INCLUDE_DIR)/package.mk
24
25ifeq ($(DUMP),)
26  STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
27endif
28
29init-y :=
30init-$(CONFIG_BUSYBOX_CONFIG_HTTPD) += httpd
31init-$(CONFIG_BUSYBOX_CONFIG_CROND) += cron
32init-$(CONFIG_BUSYBOX_CONFIG_TELNETD) += telnet
33
34define Package/busybox
35  SECTION:=base
36  CATEGORY:=Base system
37  MAINTAINER:=Nicolas Thill <nico@openwrt.org>
38  TITLE:=Core utilities for embedded Linux
39  URL:=http://busybox.net/
40  DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc
41  MENU:=1
42endef
43
44define Package/busybox/description
45 The Swiss Army Knife of embedded Linux.
46 It slices, it dices, it makes Julian Fries.
47endef
48
49define Package/busybox/config
50        source "$(SOURCE)/Config.in"
51endef
52
53define Build/Configure
54        rm -f $(PKG_BUILD_DIR)/.configured*
55        grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
56        yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
57                CC="$(TARGET_CC)" \
58                CROSS_COMPILE="$(TARGET_CROSS)" \
59                KBUILD_HAVE_NLS=no \
60                ARCH="$(ARCH)" \
61                oldconfig
62endef
63
64ifdef CONFIG_GCC_VERSION_LLVM
65  TARGET_CFLAGS += -fnested-functions
66endif
67
68LDLIBS:=m crypt
69ifdef CONFIG_BUSYBOX_USE_LIBRPC
70  TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
71  export LDFLAGS=$(TARGET_LDFLAGS)
72  LDLIBS += rpc
73endif
74
75TARGET_CFLAGS += -ggdb3
76
77define Build/Compile
78        $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
79                CC="$(TARGET_CC)" \
80                CROSS_COMPILE="$(TARGET_CROSS)" \
81                KBUILD_HAVE_NLS=no \
82                EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
83                ARCH="$(ARCH)" \
84                SKIP_STRIP=y \
85                LDLIBS="$(LDLIBS)" \
86                all
87        rm -rf $(PKG_INSTALL_DIR)
88        $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
89        $(MAKE) -C $(PKG_BUILD_DIR) \
90                CC="$(TARGET_CC)" \
91                CROSS_COMPILE="$(TARGET_CROSS)" \
92                EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
93                ARCH="$(ARCH)" \
94                CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
95                LDLIBS="$(LDLIBS)" \
96                install
97endef
98
99define Package/busybox/install
100        $(INSTALL_DIR) $(1)/etc/init.d
101        $(CP) $(PKG_INSTALL_DIR)/* $(1)/
102        for tmp in $(init-y); do \
103                $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
104        done
105        -rm -rf $(1)/lib64
106endef
107
108$(eval $(call BuildPackage,busybox))
Note: See TracBrowser for help on using the repository browser.