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