source: trunk/package/busybox/Makefile @ 26430

Last change on this file since 26430 was 26430, checked in by nbd, 6 years ago

busybox: simplify conditional dependency on librpc

  • 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-2010 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.17.3
12PKG_RELEASE:=2
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:=a2ce1a951571da8c6e0eaf75b1acef60
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
75define Build/Compile
76        $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
77                CC="$(TARGET_CC)" \
78                CROSS_COMPILE="$(TARGET_CROSS)" \
79                KBUILD_HAVE_NLS=no \
80                EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
81                ARCH="$(ARCH)" \
82                SKIP_STRIP=y \
83                LDLIBS="$(LDLIBS)" \
84                all
85        rm -rf $(PKG_INSTALL_DIR)
86        $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
87        $(MAKE) -C $(PKG_BUILD_DIR) \
88                CC="$(TARGET_CC)" \
89                CROSS_COMPILE="$(TARGET_CROSS)" \
90                EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
91                ARCH="$(ARCH)" \
92                CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
93                LDLIBS="$(LDLIBS)" \
94                install
95endef
96
97define Package/busybox/install
98        $(INSTALL_DIR) $(1)/etc/init.d
99        $(CP) $(PKG_INSTALL_DIR)/* $(1)/
100        for tmp in $(init-y); do \
101                $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
102        done
103        -rm -rf $(1)/lib64
104endef
105
106$(eval $(call BuildPackage,busybox))
Note: See TracBrowser for help on using the repository browser.