[package] comgt: move ifup invocation back into background subshell to prevent hotplu...
[openwrt.git] / package / base-files / Makefile
1 #
2 # Copyright (C) 2007-2011 OpenWrt.org
3 # Copyright (C) 2010 Vertical Communications
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=base-files
13 PKG_RELEASE:=68
14
15 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
16 PKG_BUILD_DEPENDS:=opkg/host
17
18 include $(INCLUDE_DIR)/package.mk
19
20 ifneq ($(DUMP),1)
21 TARGET:=-$(BOARD)
22 ifneq ($(wildcard $(PLATFORM_DIR)/base-files-$(PROFILE) $(PLATFORM_SUBDIR)/base-files-$(PROFILE)),)
23 TARGET:=$(TARGET)-$(PROFILE)
24 endif
25 LIBGCC_VERSION:=$(GCC_VERSION)
26 ifneq ($(findstring $(ARCH) , mips64 x86_64 ),)
27 LIB_SUFFIX:=64
28 endif
29 else
30 LIBC_VERSION:=<LIBC_VERSION>
31 LIBGCC_VERSION:=<LIBGCC_VERSION>
32 endif
33
34 define Package/base-files
35 SECTION:=base
36 CATEGORY:=Base system
37 TITLE:=Base filesystem for OpenWrt
38 URL:=http://openwrt.org/
39 VERSION:=$(PKG_RELEASE)-$(REVISION)
40 $(call Config,network.lan.proto,string,static,LAN Protocol)
41 $(call Config,network.lan.ipaddr,ip,192.168.1.1,LAN IP Address)
42 $(call Config,network.lan.netmask,netmask,255.255.255.0,LAN Network Mask)
43 $(call Config,network.lan.gateway,ip,,LAN Gateway)
44 $(call Config,network.lan.dns,ip,,LAN DNS server)
45 endef
46
47 define Package/base-files/conffiles
48 /etc/hosts
49 /etc/inittab
50 /etc/group
51 /etc/passwd
52 /etc/shadow
53 /etc/profile
54 /etc/shells
55 /etc/sysctl.conf
56 /etc/rc.local
57 /etc/sysupgrade.conf
58 /etc/config/
59 /etc/dropbear/
60 $(call $(TARGET)/conffiles)
61 endef
62
63 define Package/base-files/description
64 This package contains a base filesystem and system scripts for OpenWrt.
65 endef
66
67
68 define Package/gcc/Default
69 SECTION:=libs
70 CATEGORY:=Base system
71 URL:=http://gcc.gnu.org/
72 VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
73 endef
74
75
76 define Package/libgcc
77 $(call Package/gcc/Default)
78 TITLE:=GCC support library
79 DEPENDS+=@!(TARGET_avr32||TARGET_coldfire)
80 endef
81
82 define Package/libgcc/config
83 menu "Configuration"
84 depends EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
85
86 config LIBGCC_ROOT_DIR
87 string
88 prompt "libgcc shared library base directory"
89 depends EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
90 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
91 default "/" if NATIVE_TOOLCHAIN
92
93 config LIBGCC_FILE_SPEC
94 string
95 prompt "libgcc shared library files (use wildcards)"
96 depends EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
97 default "./lib/libgcc_s.so.*"
98
99 endmenu
100 endef
101
102
103 define Package/libssp
104 $(call Package/gcc/Default)
105 DEPENDS+=@SSP_SUPPORT
106 TITLE:=GCC support library
107 endef
108
109 define Package/libssp/config
110 menu "Configuration"
111 depends EXTERNAL_TOOLCHAIN && PACKAGE_libssp
112
113 config LIBSPP_ROOT_DIR
114 string
115 prompt "libssp shared library base directory"
116 depends EXTERNAL_TOOLCHAIN && PACKAGE_libssp
117 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
118 default "/" if NATIVE_TOOLCHAIN
119
120 config LIBSSP_FILE_SPEC
121 string
122 prompt "libssp shared library files (use wildcards)"
123 depends EXTERNAL_TOOLCHAIN && PACKAGE_libssp
124 default "./lib/libssp.so.*"
125
126 endmenu
127 endef
128
129
130 define Package/libstdcpp
131 $(call Package/gcc/Default)
132 NAME:=libstdc++
133 TITLE:=GNU Standard C++ Library v3
134 DEPENDS+=@INSTALL_LIBSTDCPP
135 endef
136
137 define Package/libstdcpp/config
138 menu "Configuration"
139 depends EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
140
141 config LIBSTDCPP_ROOT_DIR
142 string
143 prompt "libstdcpp shared library base directory"
144 depends EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
145 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
146 default "/" if NATIVE_TOOLCHAIN
147
148 config LIBSTDCPP_FILE_SPEC
149 string
150 prompt "libstdc++ shared library files (use wildcards)"
151 depends EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
152 default "./lib/libstdc++.so.*"
153
154 endmenu
155 endef
156
157
158 define Package/libc/Default
159 SECTION:=libs
160 CATEGORY:=Base system
161 VERSION:=$(LIBC_VERSION)-$(PKG_RELEASE)
162 ifneq ($(TARGET_avr32)$(TARGET_coldfire),)
163 DEPENDS:=+libgcc
164 endif
165 URL:=$(LIBC_URL)
166 PKG_FLAGS:=hold essential
167 endef
168
169
170 define Package/libc
171 $(call Package/libc/Default)
172 TITLE:=C library
173 endef
174
175 define Package/libc/config
176 menu "Configuration"
177 depends EXTERNAL_TOOLCHAIN && PACKAGE_libc
178
179 config LIBC_ROOT_DIR
180 string
181 prompt "libc shared library base directory"
182 depends EXTERNAL_TOOLCHAIN && PACKAGE_libc
183 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
184 default "/" if NATIVE_TOOLCHAIN
185
186 config LIBC_FILE_SPEC
187 string
188 prompt "libc shared library files (use wildcards)"
189 depends EXTERNAL_TOOLCHAIN && PACKAGE_libc
190 default "./lib/ld{-*.so,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}"
191
192 endmenu
193 endef
194
195
196 define Package/libpthread
197 $(call Package/libc/Default)
198 TITLE:=POSIX thread library
199 endef
200
201 define Package/libpthread/config
202 menu "Configuration"
203 depends EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
204
205 config LIBPTHREAD_ROOT_DIR
206 string
207 prompt "libpthread shared library base directory"
208 depends EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
209 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
210 default "/" if NATIVE_TOOLCHAIN
211
212 config LIBPTHREAD_FILE_SPEC
213 string
214 prompt "libpthread shared library files (use wildcards)"
215 depends EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
216 default "./lib/libpthread{-*.so,.so.*}"
217
218 endmenu
219 endef
220
221
222 define Package/librt
223 $(call Package/libc/Default)
224 TITLE:=POSIX.1b RealTime extension library
225 DEPENDS:=+libpthread
226 endef
227
228 define Package/librt/config
229 menu "Configuration"
230 depends EXTERNAL_TOOLCHAIN && PACKAGE_librt
231
232 config LIBRT_ROOT_DIR
233 string
234 prompt "librt shared library base directory"
235 depends EXTERNAL_TOOLCHAIN && PACKAGE_librt
236 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
237 default "/" if NATIVE_TOOLCHAIN
238
239 config LIBRT_FILE_SPEC
240 string
241 prompt "librt shared library files (use wildcards)"
242 depends EXTERNAL_TOOLCHAIN && PACKAGE_librt
243 default "./lib/librt{-*.so,.so.*}"
244
245 endmenu
246 endef
247
248
249 define Package/ldd
250 $(call Package/libc/Default)
251 SECTION:=utils
252 CATEGORY:=Utilities
253 TITLE:=LDD trace utility
254 endef
255
256 define Package/ldd/config
257 menu "Configuration"
258 depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd
259
260 config LDD_ROOT_DIR
261 string
262 prompt "ldd trace utility base directory"
263 depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd
264 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
265 default "/" if NATIVE_TOOLCHAIN
266
267 config LDD_FILE_SPEC
268 string
269 prompt "ldd trace utility file"
270 depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd
271 default "./usr/bin/ldd"
272
273 endmenu
274 endef
275
276
277 define Package/ldconfig
278 $(call Package/libc/Default)
279 SECTION:=utils
280 CATEGORY:=Utilities
281 TITLE:=Shared library path configuration
282 endef
283
284 define Package/ldconfig/config
285 menu "Configuration"
286 depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
287
288 config LDCONFIG_ROOT_DIR
289 string
290 prompt "ldconfig base directory"
291 depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
292 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
293 default "/" if NATIVE_TOOLCHAIN
294
295 config LDCONFIG_FILE_SPEC
296 string
297 prompt "ldconfig file"
298 depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
299 default "./sbin/ldconfig"
300
301 endmenu
302 endef
303
304
305 ifneq ($(CONFIG_PREINITOPT),)
306 define ImageConfigOptions
307 mkdir -p $(1)/lib/preinit
308 echo 'pi_suppress_stderr="$(CONFIG_TARGET_PREINIT_SUPPRESS_STDERR)"' >$(1)/lib/preinit/00_preinit.conf
309 echo 'fs_failsafe_wait_timeout=$(if $(CONFIG_TARGET_PREINIT_TIMEOUT),$(CONFIG_TARGET_PREINIT_TIMEOUT),2)' >>$(1)/lib/preinit/00_preinit.conf
310 echo 'pi_init_path=$(if $(CONFIG_TARGET_INIT_PATH),$(CONFIG_TARGET_INIT_PATH),"/bin:/sbin:/usr/bin:/usr/sbin")' >>$(1)/lib/preinit/00_preinit.conf
311 echo 'pi_init_env=$(if $(CONFIG_TARGET_INIT_ENV),$(CONFIG_TARGET_INIT_ENV),"")' >>$(1)/lib/preinit/00_preinit.conf
312 echo 'pi_init_cmd=$(if $(CONFIG_TARGET_INIT_CMD),$(CONFIG_TARGET_INIT_CMD),"/sbin/init")' >>$(1)/lib/preinit/00_preinit.conf
313 echo 'pi_init_suppress_stderr="$(CONFIG_TARGET_INIT_SUPPRESS_STDERR)"' >>$(1)/lib/preinit/00_preinit.conf
314 echo 'pi_ifname=$(if $(CONFIG_TARGET_PREINIT_IFNAME),$(CONFIG_TARGET_PREINIT_IFNAME),"")' >>$(1)/lib/preinit/00_preinit.conf
315 echo 'pi_ip=$(if $(CONFIG_TARGET_PREINIT_IP),$(CONFIG_TARGET_PREINIT_IP),"192.168.1.1")' >>$(1)/lib/preinit/00_preinit.conf
316 echo 'pi_netmask=$(if $(CONFIG_TARGET_PREINIT_NETMASK),$(CONFIG_TARGET_PREINIT_NETMASK),"255.255.255.0")' >>$(1)/lib/preinit/00_preinit.conf
317 echo 'pi_broadcast=$(if $(CONFIG_TARGET_PREINIT_BROADCAST),$(CONFIG_TARGET_PREINIT_BROADCAST),"192.168.1.255")' >>$(1)/lib/preinit/00_preinit.conf
318 echo 'pi_preinit_net_messages="$(CONFIG_TARGET_PREINIT_SHOW_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf
319 echo 'pi_preinit_no_failsafe_netmsg="$(CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf
320 endef
321 endif
322
323 define Build/Prepare
324 mkdir -p $(PKG_BUILD_DIR)
325 endef
326
327 LIBGCC_A=$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a)
328 LIBGCC_MAP=$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map)
329 LIBGCC_SO=$(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)
330 ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
331 ifneq ($(if $(CONFIG_USE_UCLIBC),$(CONFIG_GCC_VERSION_LINARO)),)
332 BUILD_LIBGCC:=$(if $(CONFIG_avr32)$(CONFIG_m68k)$(CONFIG_powerpc),,$(PKG_BUILD_DIR)/libgcc_s.so.*)
333 endif
334 endif
335
336 ifneq ($(BUILD_LIBGCC),)
337 define Build/Compile/uClibc
338 $(SCRIPT_DIR)/relink-lib.sh \
339 "$(TARGET_CROSS)" \
340 "$(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a)" \
341 "$(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a)" \
342 "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libuClibc-*.so))" \
343 -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 \
344 $(BUILD_LIBGCC)
345 $(SCRIPT_DIR)/relink-lib.sh \
346 "$(TARGET_CROSS)" \
347 "$(wildcard $(TOOLCHAIN_DIR)/lib/libcrypt-*.so)" \
348 "$(wildcard $(TOOLCHAIN_DIR)/lib/libcrypt_pic.a)" \
349 "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libcrypt-*.so))" \
350 $(BUILD_LIBGCC) \
351 -Wl,-soname=libcrypt.so.0
352 $(SCRIPT_DIR)/relink-lib.sh \
353 "$(TARGET_CROSS)" \
354 "$(wildcard $(TOOLCHAIN_DIR)/lib/libm-*.so)" \
355 "$(wildcard $(TOOLCHAIN_DIR)/lib/libm_pic.a)" \
356 "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libm-*.so))" \
357 $(BUILD_LIBGCC) \
358 -Wl,-soname=libm.so.0
359 $(SCRIPT_DIR)/relink-lib.sh \
360 "$(TARGET_CROSS)" \
361 "$(wildcard $(TOOLCHAIN_DIR)/lib/libpthread-*.so)" \
362 "$(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a)" \
363 "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libpthread-*.so))" \
364 -Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal \
365 -ldl -lc $(BUILD_LIBGCC) \
366 -Wl,-soname=libpthread.so.0
367 endef
368 define Build/Compile/libgcc
369 $(SCRIPT_DIR)/relink-lib.sh \
370 "$(TARGET_CROSS)" \
371 "$(LIBGCC_SO)" \
372 "$(LIBGCC_A)" \
373 "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(LIBGCC_SO))" \
374 -Wl,--version-script=$(LIBGCC_MAP) -Wl,-soname=libgcc_s.so.1
375 endef
376 else
377 define Build/Compile/uClibc
378 $(CP) \
379 $(TOOLCHAIN_DIR)/lib/libuClibc-*.so \
380 $(TOOLCHAIN_DIR)/lib/libcrypt-*.so \
381 $(TOOLCHAIN_DIR)/lib/libm-*.so \
382 $(TOOLCHAIN_DIR)/lib/libpthread-*.so \
383 $(PKG_BUILD_DIR)/
384 endef
385 ifneq ($(LIBGCC_SO),)
386 define Build/Compile/libgcc
387 $(CP) $(LIBGCC_SO) $(PKG_BUILD_DIR)/
388 endef
389 endif
390 endif
391
392 define Build/Compile/Default
393 $(call Build/Compile/libgcc)
394 $(call Build/Compile/$(LIBC))
395 endef
396 Build/Compile = $(Build/Compile/Default)
397
398 define Package/base-files/install
399 $(CP) ./files/* $(1)/
400 if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
401 $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
402 fi
403 if [ -d $(PLATFORM_DIR)/base-files/. ]; then \
404 $(CP) $(PLATFORM_DIR)/base-files/* $(1)/; \
405 fi
406 if [ -d $(PLATFORM_DIR)/base-files-$(PROFILE)/. ]; then \
407 $(CP) $(PLATFORM_DIR)/base-files-$(PROFILE)/* $(1)/; \
408 fi
409 if [ -d $(PLATFORM_DIR)/$(PROFILE)/base-files/. ]; then \
410 $(CP) $(PLATFORM_DIR)/$(PROFILE)/base-files/* $(1)/; \
411 fi
412 $(if $(filter-out $(PLATFORM_DIR),$(PLATFORM_SUBDIR)), \
413 if [ -d $(PLATFORM_SUBDIR)/base-files/. ]; then \
414 $(CP) $(PLATFORM_SUBDIR)/base-files/* $(1)/; \
415 fi; \
416 if [ -d $(PLATFORM_SUBDIR)/base-files-$(PROFILE)/. ]; then \
417 $(CP) $(PLATFORM_SUBDIR)/base-files-$(PROFILE)/* $(1)/; \
418 fi; \
419 if [ -d $(PLATFORM_SUBDIR)/$(PROFILE)/base-files/. ]; then \
420 $(CP) $(PLATFORM_SUBDIR)/$(PROFILE)/base-files/* $(1)/; \
421 fi \
422 )
423 # Form valid /etc/shadow entries, by copying the user:pw pairs
424 # from /etc/passwd, and adding on pw change data
425 $(if $(CONFIG_BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS), \
426 cut -d ':' -f 1-2 $(1)/etc/passwd > $(1)/etc/shadow; \
427 $(SED) 's/$$$$/:13848:0:99999:7:::/' $(1)/etc/shadow \
428 )
429 $(SED) 's,$$$$R,$(REVISION),g' $(1)/etc/banner
430 mkdir -p $(1)/CONTROL
431 mkdir -p $(1)/dev
432 mkdir -p $(1)/etc/crontabs
433 mkdir -p $(1)/etc/rc.d
434 mkdir -p $(1)/overlay
435 mkdir -p $(1)/lib/firmware
436 $(if $(LIB_SUFFIX),-ln -s lib $(1)/lib$(LIB_SUFFIX))
437 mkdir -p $(1)/mnt
438 mkdir -p $(1)/proc
439 mkdir -p $(1)/tmp
440 mkdir -p $(1)/usr/lib
441 $(if $(LIB_SUFFIX),-ln -s lib $(1)/usr/lib$(LIB_SUFFIX))
442 mkdir -p $(1)/usr/bin
443 mkdir -p $(1)/sys
444 mkdir -p $(1)/www
445 mkdir -p $(1)/root
446 ln -sf /proc/mounts $(1)/etc/mtab
447 rm -f $(1)/var
448 ln -sf /tmp $(1)/var
449 mkdir -p $(1)/etc
450 ln -sf /tmp/resolv.conf /tmp/fstab /tmp/TZ $(1)/etc/
451 $(call ImageConfigOptions,$(1))
452 $(call Package/base-files/install-target,$(1))
453 for conffile in $(1)/etc/config/*; do \
454 if [ -f "$$$$conffile" ]; then \
455 grep "$$$${conffile##$(1)}" $(1)/CONTROL/conffiles || \
456 echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
457 fi \
458 done
459 endef
460
461 ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
462
463 define Package/libgcc/install
464 $(INSTALL_DIR) $(1)/lib
465 $(CP) $(PKG_BUILD_DIR)/libgcc_s.so.* $(1)/lib/
466 endef
467
468 define Package/libssp/install
469 $(INSTALL_DIR) $(1)/lib
470 $(CP) $(TOOLCHAIN_DIR)/lib/libssp.so.* $(1)/lib/
471 endef
472
473 define Package/libstdcpp/install
474 $(INSTALL_DIR) $(1)/usr/lib
475 $(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/
476 endef
477
478 use_libutil=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),libutil)
479 use_libnsl=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_NIS),libnsl)
480 use_nsswitch=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_NSSWITCH),libnss_dns libnss_files)
481
482 define Package/glibc/install
483 $(CP) ./glibc-files/* $(1)/
484 $(INSTALL_DIR) $(1)/lib
485 $(CP) \
486 $(TOOLCHAIN_DIR)/lib/ld*.so.* \
487 $(TOOLCHAIN_DIR)/lib/ld-$(LIBC_SO_VERSION).so \
488 $(1)/lib/
489 for file in libanl libc libcidn libcrypt libdl libm $(use_libnsl) $(use_nsswitch) libresolv $(use_libutil); do \
490 for file in $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so; do \
491 if [ -e "$$$$file" ]; then \
492 $(CP) $$$$file $(1)/lib/; \
493 fi; \
494 done; \
495 done
496 endef
497
498 define Package/eglibc/install
499 $(call Package/glibc/install,$1)
500 endef
501
502 define Package/uClibc/install
503 $(INSTALL_DIR) $(1)/lib
504 $(CP) \
505 $(TOOLCHAIN_DIR)/lib/ld*-uClibc.so.* \
506 $(TOOLCHAIN_DIR)/lib/ld*-uClibc-$(LIBC_SO_VERSION).so \
507 $(1)/lib/
508 $(CP) \
509 $(TOOLCHAIN_DIR)/lib/libc.so.* \
510 $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \
511 $(1)/lib/
512 for file in libcrypt libdl libm libutil; do \
513 $(CP) \
514 $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \
515 $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \
516 $(1)/lib/; \
517 done
518
519 $(CP) \
520 $(PKG_BUILD_DIR)/libuClibc-* \
521 $(PKG_BUILD_DIR)/libm-* \
522 $(PKG_BUILD_DIR)/libcrypt-* \
523 $(1)/lib/
524 endef
525
526 define Package/libc/install
527 $(call Package/$(LIBC)/install,$1)
528 endef
529
530 define Package/libc/install_lib
531 $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
532 $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
533 $(if $(LIBGCC_MAP), \
534 $(CP) $(LIBGCC_A) $(1)/lib/libgcc_s_pic.a; \
535 $(CP) $(LIBGCC_MAP) $(1)/lib/libgcc_s_pic.map \
536 )
537 endef
538
539 define Package/libpthread/install
540 $(INSTALL_DIR) $(1)/lib
541 $(CP) \
542 $(TOOLCHAIN_DIR)/lib/libpthread.so.* \
543 $(if $(BUILD_LIBGCC),\
544 $(PKG_BUILD_DIR)/libpthread-$(LIBC_SO_VERSION).so, \
545 $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \
546 ) \
547 $(1)/lib/
548 endef
549
550 define Package/libpthread/install_lib
551 $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
552 endef
553
554 define Package/librt/install
555 $(INSTALL_DIR) $(1)/lib
556 $(CP) \
557 $(TOOLCHAIN_DIR)/lib/librt.so.* \
558 $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \
559 $(1)/lib/
560 endef
561
562 define Package/ldd/install
563 $(INSTALL_DIR) $(1)/usr/bin/
564 $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
565 endef
566
567 define Package/ldconfig/install
568 $(INSTALL_DIR) $(1)/sbin/
569 $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
570 endef
571
572 else
573
574 define Package/libgcc/install
575 for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
576 dir=`dirname $$$$file` ; \
577 $(INSTALL_DIR) $(1)/$$$$dir ; \
578 $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
579 done ; \
580 exit 0
581 endef
582
583 define Package/libssp/install
584 for file in $(call qstrip,$(CONFIG_LIBSSP_FILE_SPEC)); do \
585 dir=`dirname $$$$file` ; \
586 $(INSTALL_DIR) $(1)/$$$$dir ; \
587 $(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
588 done ; \
589 exit 0
590 endef
591
592 define Package/libstdcpp/install
593 for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
594 dir=`dirname $$$$file` ; \
595 $(INSTALL_DIR) $(1)/$$$$dir ; \
596 $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
597 done ; \
598 exit 0
599 endef
600
601 define Package/libc/install
602 for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
603 dir=`dirname $$$$file` ; \
604 $(INSTALL_DIR) $(1)/$$$$dir ; \
605 $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
606 done ; \
607 exit 0
608 endef
609
610 define Package/libpthread/install
611 for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
612 dir=`dirname $$$$file` ; \
613 $(INSTALL_DIR) $(1)/$$$$dir ; \
614 $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
615 done ; \
616 exit 0
617 endef
618
619 define Package/librt/install
620 for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
621 dir=`dirname $$$$file` ; \
622 $(INSTALL_DIR) $(1)/$$$$dir ; \
623 $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
624 done ; \
625 exit 0
626 endef
627
628 define Package/ldd/install
629 for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \
630 dir=`dirname $$$$file` ; \
631 $(INSTALL_DIR) $(1)/$$$$dir ; \
632 $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
633 done ; \
634 exit 0
635 endef
636
637 define Package/ldconfig/install
638 for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \
639 dir=`dirname $$$$file` ; \
640 $(INSTALL_DIR) $(1)/$$$$dir ; \
641 $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
642 done ; \
643 exit 0
644 endef
645
646 endif
647
648 ifneq ($(DUMP),1)
649 -include $(PLATFORM_DIR)/base-files.mk
650 endif
651
652 $(eval $(call BuildPackage,base-files))
653 $(eval $(call BuildPackage,libc))
654 $(eval $(call BuildPackage,libgcc))
655 $(eval $(call BuildPackage,libssp))
656 $(eval $(call BuildPackage,libstdcpp))
657 $(eval $(call BuildPackage,libpthread))
658 $(eval $(call BuildPackage,librt))
659 $(eval $(call BuildPackage,ldd))
660 $(eval $(call BuildPackage,ldconfig))
This page took 0.100296 seconds and 5 git commands to generate.