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