[package] base-files: mark /etc/shadow as conffile
[openwrt.git] / package / base-files / Makefile
1 #
2 # Copyright (C) 2007-2010 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:=60
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/banner
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 $(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 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   DEPENDS:= +librt
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 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_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 define Build/Compile/Default
328 endef
329
330 define Build/Compile
331         $(call Build/Compile/Default)
332 endef
333
334 define Package/base-files/install
335         $(CP) ./files/* $(1)/
336         if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \
337                 $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \
338         fi
339         if [ -d $(PLATFORM_DIR)/base-files/. ]; then \
340                 $(CP) $(PLATFORM_DIR)/base-files/* $(1)/; \
341         fi
342         if [ -d $(PLATFORM_DIR)/base-files-$(PROFILE)/. ]; then \
343                 $(CP) $(PLATFORM_DIR)/base-files-$(PROFILE)/* $(1)/; \
344         fi
345         if [ -d $(PLATFORM_DIR)/$(PROFILE)/base-files/. ]; then \
346                 $(CP) $(PLATFORM_DIR)/$(PROFILE)/base-files/* $(1)/; \
347         fi
348         $(if $(filter-out $(PLATFORM_DIR),$(PLATFORM_SUBDIR)), \
349                 if [ -d $(PLATFORM_SUBDIR)/base-files/. ]; then \
350                         $(CP) $(PLATFORM_SUBDIR)/base-files/* $(1)/; \
351                 fi; \
352                 if [ -d $(PLATFORM_SUBDIR)/base-files-$(PROFILE)/. ]; then \
353                         $(CP) $(PLATFORM_SUBDIR)/base-files-$(PROFILE)/* $(1)/; \
354                 fi; \
355                 if [ -d $(PLATFORM_SUBDIR)/$(PROFILE)/base-files/. ]; then \
356                         $(CP) $(PLATFORM_SUBDIR)/$(PROFILE)/base-files/* $(1)/; \
357                 fi \
358         )
359 # Form valid /etc/shadow entries, by copying the user:pw pairs
360 # from /etc/passwd, and adding on pw change data
361         $(if $(CONFIG_BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS), \
362                 cut -d ':' -f 1-2 $(1)/etc/passwd > $(1)/etc/shadow; \
363                 $(SED) 's/$$$$/:13848:0:99999:7:::/' $(1)/etc/shadow \
364         )
365         $(SED) 's,$$$$R,$(REVISION),g' $(1)/etc/banner
366         mkdir -p $(1)/CONTROL
367         mkdir -p $(1)/dev
368         mkdir -p $(1)/etc/crontabs
369         mkdir -p $(1)/etc/rc.d
370         mkdir -p $(1)/overlay
371         mkdir -p $(1)/lib/firmware
372         $(if $(LIB_SUFFIX),-ln -s lib $(1)/lib$(LIB_SUFFIX))
373         mkdir -p $(1)/mnt
374         mkdir -p $(1)/proc
375         mkdir -p $(1)/tmp
376         mkdir -p $(1)/usr/lib
377         $(if $(LIB_SUFFIX),-ln -s lib $(1)/usr/lib$(LIB_SUFFIX))
378         mkdir -p $(1)/usr/bin
379         mkdir -p $(1)/sys
380         mkdir -p $(1)/www
381         mkdir -p $(1)/root
382         ln -sf /proc/mounts $(1)/etc/mtab
383         rm -f $(1)/var
384         ln -sf /tmp $(1)/var
385         mkdir -p $(1)/etc
386         ln -sf /tmp/resolv.conf /tmp/fstab /tmp/TZ $(1)/etc/
387         $(call ImageConfigOptions,$(1))
388         $(call Package/base-files/install-target,$(1))
389         for conffile in $(1)/etc/config/*; do \
390                 if [ -f "$$$$conffile" ]; then \
391                         grep "$$$${conffile##$(1)}" $(1)/CONTROL/conffiles || \
392                                 echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \
393                 fi \
394         done
395 endef
396
397 ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
398
399   define Package/libgcc/install
400         $(INSTALL_DIR) $(1)/lib
401         $(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/
402   endef
403
404   define Package/libssp/install
405         $(INSTALL_DIR) $(1)/lib
406         $(CP) $(TOOLCHAIN_DIR)/lib/libssp.so.* $(1)/lib/
407   endef
408
409   define Package/libstdcpp/install
410         $(INSTALL_DIR) $(1)/usr/lib
411         $(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/
412   endef
413
414   use_libutil=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),libutil)
415   use_libnsl=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_NIS),libnsl)
416   use_nsswitch=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_NSSWITCH),libnss_dns libnss_files)
417
418   define Package/glibc/install
419         $(INSTALL_DIR) $(1)/lib
420         $(CP) \
421                 $(TOOLCHAIN_DIR)/lib/ld*.so.* \
422                 $(TOOLCHAIN_DIR)/lib/ld-$(LIBC_SO_VERSION).so \
423                 $(1)/lib/
424         for file in libanl libc libcidn libcrypt libdl libm $(use_libnsl) $(use_nsswitch) libresolv $(use_libutil); do \
425                 $(CP) \
426                         $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \
427                         $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \
428                         $(1)/lib/; \
429         done
430   endef
431
432   define Package/eglibc/install
433     $(call Package/glibc/install,$1)
434   endef
435
436   define Package/uClibc/install
437         $(INSTALL_DIR) $(1)/lib
438         $(CP) \
439                 $(TOOLCHAIN_DIR)/lib/ld*-uClibc.so.* \
440                 $(TOOLCHAIN_DIR)/lib/ld*-uClibc-$(LIBC_SO_VERSION).so \
441                 $(1)/lib/
442         $(CP) \
443                 $(TOOLCHAIN_DIR)/lib/libc.so.* \
444                 $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \
445                 $(1)/lib/
446         for file in libcrypt libdl libm libnsl libresolv libutil; do \
447                 $(CP) \
448                         $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \
449                         $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \
450                         $(1)/lib/; \
451         done
452   endef
453
454   define Package/libc/install
455     $(call Package/$(LIBC)/install,$1)
456   endef
457
458   define Package/libc/install_lib
459         $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
460         $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
461         $(if $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map), \
462                 $(CP) $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a $(1)/lib/libgcc_s_pic.a; \
463                 $(CP) $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map $(1)/lib/libgcc_s_pic.map \
464         )
465   endef
466
467   define Package/libpthread/install
468         $(INSTALL_DIR) $(1)/lib
469         $(CP) \
470                 $(TOOLCHAIN_DIR)/lib/libpthread.so.* \
471                 $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \
472                 $(1)/lib/
473   endef
474
475   define Package/libpthread/install_lib
476         $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
477   endef
478
479   define Package/librt/install
480         $(INSTALL_DIR) $(1)/lib
481         $(CP) \
482                 $(TOOLCHAIN_DIR)/lib/librt.so.* \
483                 $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \
484                 $(1)/lib/
485   endef
486
487   define Package/ldd/install
488         $(INSTALL_DIR) $(1)/usr/bin/
489         $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
490   endef
491
492   define Package/ldconfig/install
493         $(INSTALL_DIR) $(1)/sbin/
494         $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
495   endef
496
497 else
498
499   define Package/libgcc/install
500         for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
501                 dir=`dirname $$$$file` ; \
502                 $(INSTALL_DIR) $(1)/$$$$dir ; \
503                 $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
504         done
505   endef
506
507   define Package/libssp/install
508         for file in $(call qstrip,$(CONFIG_LIBSSP_FILE_SPEC)); do \
509                 dir=`dirname $$$$file` ; \
510                 $(INSTALL_DIR) $(1)/$$$$dir ; \
511                 $(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
512         done
513   endef
514
515   define Package/libstdcpp/install
516         for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
517                 dir=`dirname $$$$file` ; \
518                 $(INSTALL_DIR) $(1)/$$$$dir ; \
519                 $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
520         done
521   endef
522
523   define Package/libc/install
524         for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
525                 dir=`dirname $$$$file` ; \
526                 $(INSTALL_DIR) $(1)/$$$$dir ; \
527                 $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
528         done
529   endef
530
531   define Package/libpthread/install
532         for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
533                 dir=`dirname $$$$file` ; \
534                 $(INSTALL_DIR) $(1)/$$$$dir ; \
535                 $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
536         done
537   endef
538
539   define Package/librt/install
540         for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
541                 dir=`dirname $$$$file` ; \
542                 $(INSTALL_DIR) $(1)/$$$$dir ; \
543                 $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
544         done
545   endef
546
547   define Package/ldd/install
548         for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \
549                 dir=`dirname $$$$file` ; \
550                 $(INSTALL_DIR) $(1)/$$$$dir ; \
551                 $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
552         done
553   endef
554
555   define Package/ldconfig/install
556         for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \
557                 dir=`dirname $$$$file` ; \
558                 $(INSTALL_DIR) $(1)/$$$$dir ; \
559                 $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
560         done
561   endef
562
563 endif
564
565 ifneq ($(DUMP),1)
566   -include $(PLATFORM_DIR)/base-files.mk
567 endif
568
569 $(eval $(call BuildPackage,base-files))
570 $(eval $(call BuildPackage,libc))
571 $(eval $(call BuildPackage,libgcc))
572 $(eval $(call BuildPackage,libssp))
573 $(eval $(call BuildPackage,libstdcpp))
574 $(eval $(call BuildPackage,libpthread))
575 $(eval $(call BuildPackage,librt))
576 $(eval $(call BuildPackage,ldd))
577 $(eval $(call BuildPackage,ldconfig))