source: trunk/package/base-files/Makefile @ 6584

Last change on this file since 6584 was 6584, checked in by nbd, 9 years ago

package libssp for apps that need it (only enabled for gcc4)

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1#
2# Copyright (C) 2006 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7# $Id$
8
9include $(TOPDIR)/rules.mk
10include $(INCLUDE_DIR)/kernel.mk
11
12PKG_NAME:=base-files
13PKG_RELEASE:=8
14
15PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)
16PKG_FILE_DEPEND:=$(PLATFORM_DIR)
17
18REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
19ifeq ($(REV),)
20  REV:=0
21endif
22include $(INCLUDE_DIR)/package.mk
23
24ifneq ($(DUMP),1)
25  TARGET:=-$(BOARD)-$(KERNEL)
26  UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version 2>/dev/null}
27  LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version 2>/dev/null}
28else
29  UCLIBC_VERSION:=<UCLIBC_VERSION>
30  LIBGCC_VERSION:=<LIBGCC_VERSION>
31endif
32
33CONFIG_PACKAGE_base-files$(TARGET):=$(CONFIG_PACKAGE_base-files)
34
35define Package/base-files$(TARGET)
36  SECTION:=base
37  CATEGORY:=Base system
38  TITLE:=Base filesystem for OpenWrt
39  DESCRIPTION:=\
40        This package contains a base filesystem and system scripts for OpenWrt.
41  URL:=http://openwrt.org/
42  VERSION:=$(PKG_RELEASE)-$(REV)
43  $(call Config,network.lan.proto,string,static,LAN Protocol)
44  $(call Config,network.lan.ipaddr,ip,192.168.1.1,LAN IP Address)
45  $(call Config,network.lan.netmask,netmask,255.255.0.0,LAN Network Mask)
46  $(call Config,network.lan.gateway,ip,,LAN Gateway)
47  $(call Config,network.lan.dns,ip,,LAN DNS server)
48endef
49
50define Package/base-files$(TARGET)/conffiles
51/etc/banner
52/etc/hosts
53/etc/inittab
54/etc/group
55/etc/passwd
56/etc/profile
57/etc/shells
58/etc/ipkg.conf
59/etc/sysctl.conf
60$(call $(TARGET)/conffiles)
61endef
62
63define Package/libgcc
64  SECTION:=libs
65  CATEGORY:=Base system
66  DEPENDS:=@!NATIVE_TOOLCHAIN
67  TITLE:=GCC support library
68  URL:=http://gcc.gnu.org/
69  VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
70endef
71
72define Package/libssp
73  SECTION:=libs
74  CATEGORY:=Base system
75  DEPENDS:=@!NATIVE_TOOLCHAIN
76  DEFAULT:=m
77  TITLE:=GCC support library
78  URL:=http://gcc.gnu.org/
79  VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
80endef
81
82define Package/libpthread
83  SECTION:=libs
84  CATEGORY:=Libraries
85  DEPENDS:=@!NATIVE_TOOLCHAIN
86  TITLE:=POSIX thread library
87  URL:=http://uclibc.org/
88  VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
89endef
90
91define Package/uclibc
92  SECTION:=libs
93  CATEGORY:=Base system
94  DEPENDS:=@!NATIVE_TOOLCHAIN
95  TITLE:=C library embedded systems
96  URL:=http://uclibc.org/
97  VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
98endef
99
100define Build/Prepare
101        mkdir -p $(PKG_BUILD_DIR)
102endef
103
104define Build/Compile/Default
105endef
106
107define Build/Compile
108        $(call Build/Compile/Default)
109endef
110
111define Package/base-files$(TARGET)/install
112        $(CP) ./files/* $(1)/
113        if [ -d $(PLATFORM_DIR)/base-files/default/. ]; then \
114                $(CP) $(PLATFORM_DIR)/base-files/default/* $(1)/; \
115        fi
116        if [ "$(PROFILE)" != "Default" ]; then \
117                if [ -d $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/. ]; then \
118                        $(CP) $(PLATFORM_DIR)/base-files/profile-$(PROFILE)/* $(1)/; \
119                fi; \
120        fi
121        $(SED) 's,$$$$R,r$(REV),g' $(1)/etc/banner
122        $(SED) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc/ipkg.conf
123        mkdir -p $(1)/dev
124        mkdir -p $(1)/etc/crontabs
125        mkdir -p $(1)/jffs
126        mkdir -p $(1)/lib
127        mkdir -p $(1)/mnt
128        mkdir -p $(1)/proc
129        mkdir -p $(1)/tmp
130        mkdir -p $(1)/usr/lib
131        mkdir -p $(1)/usr/bin
132        mkdir -p $(1)/sys
133        mkdir -p $(1)/www
134        ln -sf /proc/mounts $(1)/etc/mtab
135        rm -f $(1)/var
136        ln -sf /tmp $(1)/var
137        mkdir -p $(1)/etc
138        ln -sf /tmp/resolv.conf $(1)/etc/resolv.conf
139        $(call Package/base-files/install-target,$(1))
140        for conffile in $(1)/etc/config/*; do \
141                if [ -f "$$$$conffile" ]; then \
142                        grep "$$$$conffile" $(1)/CONTROL/conffiles || \
143                                echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
144                fi \
145        done
146endef
147
148define Package/libgcc/install
149        $(INSTALL_DIR) $(1)/lib
150        $(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(1)/lib/
151endef
152
153ifeq ($(word 1,$(subst ., ,$(LIBGCC_VERSION))),4)
154  define Package/libssp/install
155        $(INSTALL_DIR) $(1)/lib
156        $(CP) $(STAGING_DIR)/lib/libssp.so.* $(1)/lib/
157  endef
158endif
159
160define Package/libpthread/install
161        $(INSTALL_DIR) $(1)/lib
162        $(CP) $(STAGING_DIR)/lib/libpthread.so.* $(1)/lib/
163        $(CP) $(STAGING_DIR)/lib/libpthread-$(UCLIBC_VERSION).so $(1)/lib/
164endef
165
166define Package/uclibc/install
167        $(INSTALL_DIR) $(1)/lib
168        for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
169                $(CP) $(STAGING_DIR)/lib/$$$$file.so.* $(1)/lib/; \
170                $(CP) $(STAGING_DIR)/lib/$$$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
171        done
172endef
173
174ifneq ($(DUMP),1)
175  -include $(PLATFORM_DIR)/base-files.mk
176endif
177
178$(eval $(call BuildPackage,base-files$(TARGET)))
179$(eval $(call BuildPackage,libgcc))
180$(eval $(call BuildPackage,libssp))
181$(eval $(call BuildPackage,libpthread))
182$(eval $(call BuildPackage,uclibc))
183
Note: See TracBrowser for help on using the repository browser.