Rebased from upstream / out of band repository.
[librecmc/librecmc.git] / package / libs / toolchain / Makefile
1 #
2 # Copyright (C) 2007-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 PKG_NAME:=toolchain
10 PKG_RELEASE:=1
11
12 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
13 PKG_LICENSE:=GPL-3.0-with-GCC-exception
14
15 PKG_FLAGS:=hold essential nonshared
16
17 include $(INCLUDE_DIR)/package.mk
18
19 ifneq ($(DUMP),1)
20   LIBGCC_VERSION:=$(GCC_VERSION)
21 else
22   LIBC_VERSION:=<LIBC_VERSION>
23   LIBGCC_VERSION:=<LIBGCC_VERSION>
24 endif
25
26 define Package/gcc/Default
27   SECTION:=libs
28   CATEGORY:=Base system
29   URL:=http://gcc.gnu.org/
30   VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
31 endef
32
33 define Package/libgcc
34 $(call Package/gcc/Default)
35   TITLE:=GCC support library
36 endef
37
38 define Package/libgcc/config
39         menu "Configuration"
40                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
41
42         config LIBGCC_ROOT_DIR
43                 string
44                 prompt "libgcc shared library base directory"
45                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
46                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
47                 default "/"  if NATIVE_TOOLCHAIN
48
49         config LIBGCC_FILE_SPEC
50                 string
51                 prompt "libgcc shared library files (use wildcards)"
52                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
53                 default "./lib/libgcc_s.so.*"
54
55         endmenu
56 endef
57
58 define Package/libatomic
59 $(call Package/gcc/Default)
60   DEPENDS:=+libgcc
61   TITLE:=Atomic support library
62 endef
63
64 define Package/libatomic/config
65         menu "Configuration"
66                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
67
68         config LIBATOMIC_ROOT_DIR
69                 string
70                 prompt "libatomic shared library base directory"
71                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
72                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
73                 default "/"  if NATIVE_TOOLCHAIN
74
75         config LIBATOMIC_FILE_SPEC
76                 string
77                 prompt "libatomic shared library files (use wildcards)"
78                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
79                 default "./lib/libatomic.so.*"
80
81         endmenu
82 endef
83
84 define Package/libssp
85 $(call Package/gcc/Default)
86   DEPENDS+=@GCC_LIBSSP
87   TITLE:=GCC support library
88 endef
89
90 define Package/libssp/config
91         menu "Configuration"
92                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libssp
93
94         config LIBSSP_ROOT_DIR
95                 string
96                 prompt "libssp shared library base directory"
97                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libssp
98                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
99                 default "/"  if NATIVE_TOOLCHAIN
100
101         config LIBSSP_FILE_SPEC
102                 string
103                 prompt "libssp shared library files (use wildcards)"
104                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libssp
105                 default "./lib/libssp.so.*"
106
107         endmenu
108 endef
109
110
111 define Package/libstdcpp
112 $(call Package/gcc/Default)
113   NAME:=libstdc++
114   TITLE:=GNU Standard C++ Library v3
115 endef
116
117 define Package/libstdcpp/config
118         menu "Configuration"
119         depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
120
121         config LIBSTDCPP_ROOT_DIR
122                 string
123                 prompt "libstdcpp shared library base directory"
124                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
125                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
126                 default "/"  if NATIVE_TOOLCHAIN
127
128         config LIBSTDCPP_FILE_SPEC
129                 string
130                 prompt "libstdc++ shared library files (use wildcards)"
131                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
132                 default "./lib/libstdc++.so.*"
133
134         endmenu
135 endef
136
137
138 define Package/libc/Default
139   SECTION:=libs
140   CATEGORY:=Base system
141   VERSION:=$(LIBC_VERSION)-$(PKG_RELEASE)
142   DEPENDS:=+libgcc
143   URL:=$(LIBC_URL)
144 endef
145
146
147 define Package/libc
148 $(call Package/libc/Default)
149   TITLE:=C library
150 endef
151
152 define Package/libc/config
153         menu "Configuration"
154         depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
155
156         config LIBC_ROOT_DIR
157                 string
158                 prompt "libc shared library base directory"
159                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
160                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
161                 default "/"  if NATIVE_TOOLCHAIN
162
163         config LIBC_FILE_SPEC
164                 string
165                 prompt "libc shared library files (use wildcards)"
166                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
167                 default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*,.so}"
168
169         endmenu
170 endef
171
172
173 define Package/libpthread
174 $(call Package/libc/Default)
175   TITLE:=POSIX thread library
176 endef
177
178 define Package/libpthread/config
179         menu "Configuration"
180         depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
181
182         config LIBPTHREAD_ROOT_DIR
183                 string
184                 prompt "libpthread shared library base directory"
185                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
186                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
187                 default "/"  if NATIVE_TOOLCHAIN
188
189         config LIBPTHREAD_FILE_SPEC
190                 string
191                 prompt "libpthread shared library files (use wildcards)"
192                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
193                 default "./lib/libpthread{-*.so,.so.*}"
194
195         endmenu
196 endef
197
198
199 define Package/libthread-db
200 $(call Package/libc/Default)
201   DEPENDS:=@!USE_MUSL
202   TITLE:=POSIX thread library debugging support
203 endef
204
205 define Package/libthread-db/config
206         menu "Configuration"
207         depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
208
209         config LIBTHREAD_DB_ROOT_DIR
210                 string
211                 prompt "POSIX thread debugging shared library base directory"
212                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
213                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
214                 default "/"  if NATIVE_TOOLCHAIN
215
216         config LIBTHREAD_DB_FILE_SPEC
217                 string
218                 prompt "POSIX thread debugging shared library files (use wildcards)"
219                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
220                 default "./lib/libthread_db{-*.so,.so.*}"
221
222         endmenu
223 endef
224
225 define Package/librt
226 $(call Package/libc/Default)
227   TITLE:=POSIX.1b RealTime extension library
228   DEPENDS:=+libpthread
229 endef
230
231 define Package/librt/config
232         menu "Configuration"
233         depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
234
235         config LIBRT_ROOT_DIR
236                 string
237                 prompt "librt shared library base directory"
238                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
239                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
240                 default "/"  if NATIVE_TOOLCHAIN
241
242         config LIBRT_FILE_SPEC
243                 string
244                 prompt "librt shared library files (use wildcards)"
245                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
246                 default "./lib/librt{-*.so,.so.*}"
247
248         endmenu
249 endef
250
251
252 define Package/libgfortran
253 $(call Package/gcc/Default)
254   TITLE:=GFortran support library
255   DEPENDS+=@INSTALL_GFORTRAN
256 endef
257
258 define Package/libgfortran/config
259         menu "Configuration"
260                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
261
262         config LIBGFORTRAN_ROOT_DIR
263                 string
264                 prompt "libgfortran shared library base directory"
265                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
266                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
267                 default "/"  if NATIVE_TOOLCHAIN
268
269         config LIBGFORTRAN_FILE_SPEC
270                 string
271                 prompt "libgfortran shared library files (use wildcards)"
272                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
273                 default "./usr/lib/libgfortran.so.*"
274
275         endmenu
276 endef
277
278 define Package/libgomp
279 $(call Package/gcc/Default)
280   TITLE:=OpenMP support library
281 endef
282
283 define Package/libgomp/config
284         menu "Configuration"
285                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
286
287         config LIBGOMP_ROOT_DIR
288                 string
289                 prompt "libgomp shared library base directory"
290                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
291                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
292                 default "/"  if NATIVE_TOOLCHAIN
293
294         config LIBGOMP_FILE_SPEC
295                 string
296                 prompt "libgomp shared library files (use wildcards)"
297                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
298                 default "./lib/libgomp.so*"
299
300         endmenu
301 endef
302
303
304 define Package/ldd
305 $(call Package/libc/Default)
306   DEPENDS:=@!USE_MUSL
307   SECTION:=utils
308   CATEGORY:=Utilities
309   TITLE:=LDD trace utility
310 endef
311
312 define Package/ldd/config
313         menu "Configuration"
314                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
315
316         config LDD_ROOT_DIR
317                 string
318                 prompt "ldd trace utility base directory"
319                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
320                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
321                 default "/"  if NATIVE_TOOLCHAIN
322
323         config LDD_FILE_SPEC
324                 string
325                 prompt "ldd trace utility file"
326                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
327                 default "./usr/bin/ldd"
328
329         endmenu
330 endef
331
332
333 define Package/ldconfig
334 $(call Package/libc/Default)
335   DEPENDS:=@!USE_MUSL
336   SECTION:=utils
337   CATEGORY:=Utilities
338   TITLE:=Shared library path configuration
339 endef
340
341 define Package/ldconfig/config
342         menu "Configuration"
343                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
344
345         config LDCONFIG_ROOT_DIR
346                 string
347                 prompt "ldconfig base directory"
348                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
349                 default TOOLCHAIN_ROOT  if !NATIVE_TOOLCHAIN
350                 default "/"  if NATIVE_TOOLCHAIN
351
352         config LDCONFIG_FILE_SPEC
353                 string
354                 prompt "ldconfig file"
355                 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
356                 default "./sbin/ldconfig"
357
358         endmenu
359 endef
360
361 define Build/Prepare
362         mkdir -p $(PKG_BUILD_DIR)
363 endef
364
365 LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a))
366 LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map))
367 LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*))
368
369 define Build/Compile/uClibc
370         $(CP) \
371                 $(TOOLCHAIN_DIR)/lib/libuClibc-*.so \
372                 $(PKG_BUILD_DIR)/
373 endef
374 ifneq ($(LIBGCC_SO),)
375     define Build/Compile/libgcc
376         $(CP) $(LIBGCC_SO) $(PKG_BUILD_DIR)/
377     endef
378 endif
379
380 define Build/Compile/Default
381         $(call Build/Compile/libgcc)
382         $(call Build/Compile/$(LIBC))
383 endef
384 Build/Compile = $(Build/Compile/Default)
385
386 ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
387
388   define Package/libgcc/install
389         $(INSTALL_DIR) $(1)/lib
390         $(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/
391   endef
392
393   define Package/libatomic/install
394         $(INSTALL_DIR) $(1)/lib
395         $(CP) $(TOOLCHAIN_DIR)/lib/libatomic.so.* $(1)/lib/
396   endef
397
398   define Package/libgfortran/install
399         $(INSTALL_DIR) $(1)/usr/lib
400         $(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/
401   endef
402
403   define Package/libssp/install
404         $(INSTALL_DIR) $(1)/lib
405         $(CP) $(TOOLCHAIN_DIR)/lib/libssp.so.* $(1)/lib/
406   endef
407
408   define Package/libstdcpp/install
409         $(INSTALL_DIR) $(1)/usr/lib
410         $(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/
411   endef
412
413   define Package/glibc/install
414         $(CP) ./glibc-files/* $(1)/
415         rm -f $(1)/etc/localtime
416         $(LN) /tmp/localtime $(1)/etc/localtime
417         $(INSTALL_DIR) $(1)/lib
418         $(CP) \
419                 $(TOOLCHAIN_DIR)/lib/ld*.so.* \
420                 $(TOOLCHAIN_DIR)/lib/ld-$(LIBC_SO_VERSION).so \
421                 $(1)/lib/
422         for file in libanl libc libcidn libcrypt libdl libm libnsl libnss_dns libnss_files libresolv libutil; do \
423                 for file in $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so; do \
424                         if [ -e "$$$$file" ]; then \
425                                 $(CP) $$$$file $(1)/lib/; \
426                         fi; \
427                 done; \
428         done
429   endef
430
431   define Package/uClibc/install
432         $(INSTALL_DIR) $(1)/lib
433         $(CP) \
434                 $(TOOLCHAIN_DIR)/lib/ld*-uClibc.so.* \
435                 $(TOOLCHAIN_DIR)/lib/ld*-uClibc-$(LIBC_SO_VERSION).so \
436                 $(1)/lib/
437         $(CP) \
438                 $(TOOLCHAIN_DIR)/lib/libc.so.* \
439                 $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \
440                 $(1)/lib/
441         $(CP) \
442                 $(PKG_BUILD_DIR)/libuClibc-* \
443                 $(1)/lib/
444   endef
445
446   LD_MUSL_NAME = $(notdir $(firstword $(wildcard $(TOOLCHAIN_DIR)/lib/libc.so*)))
447
448   define Package/musl/install
449         $(INSTALL_DIR) $(1)/lib $(1)/usr/bin
450         $(CP) \
451                 $(TOOLCHAIN_DIR)/lib/ld-musl-*.so* \
452                 $(1)/lib/
453         $(CP) \
454                 $(TOOLCHAIN_DIR)/lib/libc.so* \
455                 $(1)/lib/
456         $(LN) ../../lib/$(LD_MUSL_NAME) $(1)/usr/bin/ldd
457   endef
458
459   define Package/libc/install
460     $(call Package/$(LIBC)/install,$1)
461   endef
462
463   define Package/libc/install_lib
464         $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
465         $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
466         $(if $(LIBGCC_MAP), \
467                 $(CP) $(LIBGCC_A) $(1)/lib/libgcc_s_pic.a; \
468                 $(CP) $(LIBGCC_MAP) $(1)/lib/libgcc_s_pic.map \
469         )
470   endef
471
472   define Package/libpthread/install
473         $(INSTALL_DIR) $(1)/lib
474   ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y)
475         $(CP) \
476                 $(TOOLCHAIN_DIR)/lib/libpthread.so.* \
477                 $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \
478                 $(1)/lib/
479   endif
480   endef
481
482   define Package/libthread-db/install
483         $(INSTALL_DIR) $(1)/lib
484         $(CP) \
485                 $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib
486   ifeq ($(CONFIG_USE_UCLIBC),y)
487         $(CP) \
488                 $(TOOLCHAIN_DIR)/lib/libthread_db-$(LIBC_SO_VERSION).so \
489                 $(1)/lib/
490   endif
491   endef
492
493   define Package/libpthread/install_lib
494         $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
495   endef
496
497   define Package/librt/install
498         $(INSTALL_DIR) $(1)/lib
499   ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y)
500         $(CP) \
501                 $(TOOLCHAIN_DIR)/lib/librt.so.* \
502                 $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \
503                 $(1)/lib/
504   endif
505   endef
506
507   define Package/ldd/install
508         $(INSTALL_DIR) $(1)/usr/bin/
509         $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
510   endef
511
512   define Package/ldconfig/install
513         $(INSTALL_DIR) $(1)/sbin/
514         $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
515   endef
516
517 else
518
519   define Package/libgcc/install
520         for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
521                 $(INSTALL_DIR) $(1)/lib ; \
522                 $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
523         done ; \
524         exit 0
525   endef
526
527   define Package/libgfortran/install
528         for file in $(call qstrip,$(CONFIG_LIBGFORTRAN_FILE_SPEC)); do \
529                 $(INSTALL_DIR) $(1)/lib ; \
530                 $(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
531         done
532   endef
533
534   define Package/libssp/install
535         for file in $(call qstrip,$(CONFIG_LIBSSP_FILE_SPEC)); do \
536                 $(INSTALL_DIR) $(1)/lib ; \
537                 $(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
538         done ; \
539         exit 0
540   endef
541
542   define Package/libstdcpp/install
543         for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
544                 $(INSTALL_DIR) $(1)/lib ; \
545                 $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
546         done ; \
547         exit 0
548   endef
549
550   define Package/libc/install
551         for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
552                 $(INSTALL_DIR) $(1)/lib ; \
553                 $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
554         done ; \
555         exit 0
556   endef
557
558   define Package/libpthread/install
559         for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
560                 $(INSTALL_DIR) $(1)/lib ; \
561                 $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/lib/ ; \
562         done ; \
563         exit 0
564   endef
565
566   define Package/libthread-db/install
567         for file in $(call qstrip,$(CONFIG_LIBTHREAD_DB_FILE_SPEC)); do \
568                 $(INSTALL_DIR) $(1)/lib ; \
569                 $(CP) $(call qstrip,$(CONFIG_LIBTHREAD_DB_ROOT_DIR))/$$$$file $(1)/lib/ ; \
570         done ; \
571         exit 0
572   endef
573
574   define Package/librt/install
575         for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
576                 $(INSTALL_DIR) $(1)/lib ; \
577                 $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/lib/ ; \
578         done ; \
579         exit 0
580   endef
581
582   define Package/libatomic/install
583         for file in $(call qstrip,$(CONFIG_LIBATOMIC_FILE_SPEC)); do \
584                 $(INSTALL_DIR) $(1)/lib ; \
585                 $(CP) $(call qstrip,$(CONFIG_LIBATOMIC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
586         done ; \
587         exit 0
588   endef
589
590   define Package/libgomp/install
591         for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \
592                 $(INSTALL_DIR) $(1)/lib ; \
593                 $(CP) $(call qstrip,$(CONFIG_LIBGOMP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
594         done ; \
595         exit 0
596   endef
597
598   define Package/ldd/install
599         for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \
600                 dir=`dirname $$$$file` ; \
601                 $(INSTALL_DIR) $(1)/$$$$dir ; \
602                 $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
603         done ; \
604         exit 0
605   endef
606
607   define Package/ldconfig/install
608         for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \
609                 dir=`dirname $$$$file` ; \
610                 $(INSTALL_DIR) $(1)/$$$$dir ; \
611                 $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
612         done ; \
613         exit 0
614   endef
615
616 endif
617
618 $(eval $(call BuildPackage,libc))
619 $(eval $(call BuildPackage,libgcc))
620 $(eval $(call BuildPackage,libatomic))
621 $(eval $(call BuildPackage,libssp))
622 $(eval $(call BuildPackage,libstdcpp))
623 $(eval $(call BuildPackage,libpthread))
624 $(eval $(call BuildPackage,libthread-db))
625 $(eval $(call BuildPackage,librt))
626 $(eval $(call BuildPackage,libgfortran))
627 $(eval $(call BuildPackage,libgomp))
628 $(eval $(call BuildPackage,ldd))
629 $(eval $(call BuildPackage,ldconfig))