mac80211: update to version 6.11
[openwrt/staging/nbd.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:=4
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)-r$(PKG_RELEASE)
31 endef
32
33 define Package/libgcc
34 $(call Package/gcc/Default)
35 TITLE:=GCC support library
36 ABI_VERSION:=1
37 endef
38
39 define Package/libgcc/config
40 menu "Configuration"
41 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
42
43 config LIBGCC_ROOT_DIR
44 string
45 prompt "libgcc shared library base directory"
46 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
47 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
48 default "/" if NATIVE_TOOLCHAIN
49
50 config LIBGCC_FILE_SPEC
51 string
52 prompt "libgcc shared library files (use wildcards)"
53 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgcc
54 default "./lib/libgcc_s.so.*"
55
56 endmenu
57 endef
58
59 define Package/libatomic
60 $(call Package/gcc/Default)
61 DEPENDS:=+libgcc
62 TITLE:=Atomic support library
63 ABI_VERSION:=1
64 endef
65
66 define Package/libatomic/config
67 menu "Configuration"
68 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
69
70 config LIBATOMIC_ROOT_DIR
71 string
72 prompt "libatomic shared library base directory"
73 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
74 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
75 default "/" if NATIVE_TOOLCHAIN
76
77 config LIBATOMIC_FILE_SPEC
78 string
79 prompt "libatomic shared library files (use wildcards)"
80 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic
81 default "./lib/libatomic.so.*"
82
83 endmenu
84 endef
85
86 define Package/libquadmath
87 $(call Package/gcc/Default)
88 DEPENDS:=@TARGET_x86||TARGET_x86_64 +libgcc
89 TITLE:=Quadmath support library
90 ABI_VERSION:=1
91 endef
92
93 define Package/libquadmath/config
94 menu "Configuration"
95 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
96
97 config LIBQUADMATH_ROOT_DIR
98 string
99 prompt "libquadmath shared library base directory"
100 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
101 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
102 default "/" if NATIVE_TOOLCHAIN
103
104 config LIBQUADMATH_FILE_SPEC
105 string
106 prompt "libquadmath shared library files (use wildcards)"
107 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
108 default "./lib/libquadmath.so.*"
109
110 endmenu
111 endef
112
113 define Package/libstdcpp
114 $(call Package/gcc/Default)
115 NAME:=libstdc++
116 TITLE:=GNU Standard C++ Library v3
117 ABI_VERSION:=6
118 endef
119
120 define Package/libstdcpp/config
121 menu "Configuration"
122 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
123
124 config LIBSTDCPP_ROOT_DIR
125 string
126 prompt "libstdcpp shared library base directory"
127 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
128 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
129 default "/" if NATIVE_TOOLCHAIN
130
131 config LIBSTDCPP_FILE_SPEC
132 string
133 prompt "libstdc++ shared library files (use wildcards)"
134 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
135 default "./lib/libstdc++.so.*"
136
137 endmenu
138 endef
139
140
141 define Package/libasan
142 $(call Package/gcc/Default)
143 NAME:=libasan
144 TITLE:=Runtime library for AddressSanitizer in GCC
145 DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc
146 ABI_VERSION:=5
147 endef
148
149 define Package/libasan/config
150 menu "Configuration"
151 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libasan
152
153 config LIBASAN_ROOT_DIR
154 string
155 prompt "libasan shared library base directory"
156 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libasan
157 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
158 default "/" if NATIVE_TOOLCHAIN
159
160 config LIBASAN_FILE_SPEC
161 string
162 prompt "libasan shared library files (use wildcards)"
163 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libasan
164 default "./lib/libasan.so.*"
165
166 endmenu
167 endef
168
169
170 define Package/libtsan
171 $(call Package/gcc/Default)
172 NAME:=libtsan
173 TITLE:=Runtime library for ThreadSanitizer in GCC
174 DEPENDS:=@USE_GLIBC +librt +libstdcpp @!loongarch64 @!mips @!mipsel @!mips64 @!mips64el @!arc
175 ABI_VERSION:=0
176 endef
177
178 define Package/libtsan/config
179 menu "Configuration"
180 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libtsan
181
182 config LIBTSAN_ROOT_DIR
183 string
184 prompt "libtsan shared library base directory"
185 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libtsan
186 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
187 default "/" if NATIVE_TOOLCHAIN
188
189 config LIBTSAN_FILE_SPEC
190 string
191 prompt "libtsan shared library files (use wildcards)"
192 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libtsan
193 default "./lib/libtsan.so.*"
194
195 endmenu
196 endef
197
198
199 define Package/liblsan
200 $(call Package/gcc/Default)
201 NAME:=liblsan
202 TITLE:=Runtime library for LeakSanitizer in GCC
203 DEPENDS:=@USE_GLIBC +librt +libstdcpp @!loongarch64 @!mips @!mipsel @!mips64 @!mips64el @!arc
204 ABI_VERSION:=0
205 endef
206
207 define Package/liblsan/config
208 menu "Configuration"
209 depends on EXTERNAL_TOOLCHAIN && PACKAGE_liblsan
210
211 config LIBLSAN_ROOT_DIR
212 string
213 prompt "liblsan shared library base directory"
214 depends on EXTERNAL_TOOLCHAIN && PACKAGE_liblsan
215 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
216 default "/" if NATIVE_TOOLCHAIN
217
218 config LIBLSAN_FILE_SPEC
219 string
220 prompt "liblsan shared library files (use wildcards)"
221 depends on EXTERNAL_TOOLCHAIN && PACKAGE_liblsan
222 default "./lib/liblsan.so.*"
223
224 endmenu
225 endef
226
227
228 define Package/libubsan
229 $(call Package/gcc/Default)
230 NAME:=libubsan
231 TITLE:=Runtime library for UndefinedBehaviorSanitizer in GCC
232 DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc
233 ABI_VERSION:=1
234 endef
235
236 define Package/libubsan/config
237 menu "Configuration"
238 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libubsan
239
240 config LIBUBSAN_ROOT_DIR
241 string
242 prompt "libubsan shared library base directory"
243 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libubsan
244 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
245 default "/" if NATIVE_TOOLCHAIN
246
247 config LIBUBSAN_FILE_SPEC
248 string
249 prompt "libubsan shared library files (use wildcards)"
250 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libubsan
251 default "./lib/libubsan.so.*"
252
253 endmenu
254 endef
255
256
257 define Package/libc/Default
258 SECTION:=libs
259 CATEGORY:=Base system
260 VERSION:=$(LIBC_VERSION)-r$(PKG_RELEASE)
261 DEPENDS:=+libgcc
262 URL:=$(LIBC_URL)
263 endef
264
265
266 define Package/libc
267 $(call Package/libc/Default)
268 TITLE:=C library
269 endef
270
271 define Package/libc/config
272 menu "Configuration"
273 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
274
275 config LIBC_ROOT_DIR
276 string
277 prompt "libc shared library base directory"
278 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
279 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
280 default "/" if NATIVE_TOOLCHAIN
281
282 config LIBC_FILE_SPEC
283 string
284 prompt "libc shared library files (use wildcards)"
285 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
286 default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*,.so}"
287
288 endmenu
289 endef
290
291
292 define Package/libpthread
293 $(call Package/libc/Default)
294 TITLE:=POSIX thread library
295 endef
296
297 define Package/libpthread/config
298 menu "Configuration"
299 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
300
301 config LIBPTHREAD_ROOT_DIR
302 string
303 prompt "libpthread shared library base directory"
304 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
305 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
306 default "/" if NATIVE_TOOLCHAIN
307
308 config LIBPTHREAD_FILE_SPEC
309 string
310 prompt "libpthread shared library files (use wildcards)"
311 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
312 default "./lib/libpthread{-*.so,.so.*}"
313
314 endmenu
315 endef
316
317
318 define Package/libthread-db
319 $(call Package/libc/Default)
320 DEPENDS:=@!USE_MUSL
321 TITLE:=POSIX thread library debugging support
322 endef
323
324 define Package/libthread-db/config
325 menu "Configuration"
326 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
327
328 config LIBTHREAD_DB_ROOT_DIR
329 string
330 prompt "POSIX thread debugging shared library base directory"
331 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
332 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
333 default "/" if NATIVE_TOOLCHAIN
334
335 config LIBTHREAD_DB_FILE_SPEC
336 string
337 prompt "POSIX thread debugging shared library files (use wildcards)"
338 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
339 default "./lib/libthread_db{-*.so,.so.*}"
340
341 endmenu
342 endef
343
344 define Package/librt
345 $(call Package/libc/Default)
346 TITLE:=POSIX.1b RealTime extension library
347 DEPENDS:=+libpthread
348 endef
349
350 define Package/librt/config
351 menu "Configuration"
352 depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
353
354 config LIBRT_ROOT_DIR
355 string
356 prompt "librt shared library base directory"
357 depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
358 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
359 default "/" if NATIVE_TOOLCHAIN
360
361 config LIBRT_FILE_SPEC
362 string
363 prompt "librt shared library files (use wildcards)"
364 depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
365 default "./lib/librt{-*.so,.so.*}"
366
367 endmenu
368 endef
369
370
371 define Package/libgfortran
372 $(call Package/gcc/Default)
373 TITLE:=GFortran support library
374 DEPENDS+=@INSTALL_GFORTRAN
375 endef
376
377 define Package/libgfortran/config
378 menu "Configuration"
379 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
380
381 config LIBGFORTRAN_ROOT_DIR
382 string
383 prompt "libgfortran shared library base directory"
384 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
385 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
386 default "/" if NATIVE_TOOLCHAIN
387
388 config LIBGFORTRAN_FILE_SPEC
389 string
390 prompt "libgfortran shared library files (use wildcards)"
391 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
392 default "./usr/lib/libgfortran.so.*"
393
394 endmenu
395 endef
396
397 define Package/libgomp
398 $(call Package/gcc/Default)
399 TITLE:=OpenMP support library
400 endef
401
402 define Package/libgomp/config
403 menu "Configuration"
404 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
405
406 config LIBGOMP_ROOT_DIR
407 string
408 prompt "libgomp shared library base directory"
409 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
410 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
411 default "/" if NATIVE_TOOLCHAIN
412
413 config LIBGOMP_FILE_SPEC
414 string
415 prompt "libgomp shared library files (use wildcards)"
416 depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
417 default "./lib/libgomp.so*"
418
419 endmenu
420 endef
421
422
423 define Package/ldd
424 $(call Package/libc/Default)
425 DEPENDS:=@!USE_MUSL
426 SECTION:=utils
427 CATEGORY:=Utilities
428 TITLE:=LDD trace utility
429 endef
430
431 define Package/ldd/config
432 menu "Configuration"
433 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
434
435 config LDD_ROOT_DIR
436 string
437 prompt "ldd trace utility base directory"
438 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
439 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
440 default "/" if NATIVE_TOOLCHAIN
441
442 config LDD_FILE_SPEC
443 string
444 prompt "ldd trace utility file"
445 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
446 default "./usr/bin/ldd"
447
448 endmenu
449 endef
450
451
452 define Package/ldconfig
453 $(call Package/libc/Default)
454 DEPENDS:=@!USE_MUSL
455 SECTION:=utils
456 CATEGORY:=Utilities
457 TITLE:=Shared library path configuration
458 endef
459
460 define Package/ldconfig/config
461 menu "Configuration"
462 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
463
464 config LDCONFIG_ROOT_DIR
465 string
466 prompt "ldconfig base directory"
467 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
468 default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
469 default "/" if NATIVE_TOOLCHAIN
470
471 config LDCONFIG_FILE_SPEC
472 string
473 prompt "ldconfig file"
474 depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
475 default "./sbin/ldconfig"
476
477 endmenu
478 endef
479
480 define Build/Prepare
481 mkdir -p $(PKG_BUILD_DIR)
482 endef
483
484 define Build/Quilt
485 endef
486
487 LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a))
488 LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map))
489 LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*))
490
491 ifneq ($(LIBGCC_SO),)
492 define Build/Compile/libgcc
493 $(CP) $(LIBGCC_SO) $(PKG_BUILD_DIR)/
494 endef
495 endif
496
497 define Build/Compile/Default
498 $(call Build/Compile/libgcc)
499 $(call Build/Compile/$(LIBC))
500 endef
501 Build/Compile = $(Build/Compile/Default)
502
503 ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
504
505 define Package/libgcc/install
506 $(INSTALL_DIR) $(1)/lib
507 $(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/
508 endef
509
510 define Package/libatomic/install
511 $(INSTALL_DIR) $(1)/lib
512 $(CP) $(TOOLCHAIN_DIR)/lib/libatomic.so.* $(1)/lib/
513 endef
514
515 define Package/libquadmath/install
516 $(INSTALL_DIR) $(1)/lib
517 $(CP) $(TOOLCHAIN_DIR)/lib/libquadmath.so.* $(1)/lib/
518 endef
519
520 define Package/libgfortran/install
521 $(INSTALL_DIR) $(1)/usr/lib
522 $(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/
523 endef
524
525 define Package/libstdcpp/install
526 $(INSTALL_DIR) $(1)/usr/lib
527 $(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/
528 rm -rf $(1)/usr/lib/*-gdb.py
529 endef
530
531 define Package/libasan/install
532 $(INSTALL_DIR) $(1)/lib
533 $(CP) $(TOOLCHAIN_DIR)/lib/libasan.so.* $(1)/lib/
534 endef
535
536 define Package/libtsan/install
537 $(INSTALL_DIR) $(1)/lib
538 $(CP) $(TOOLCHAIN_DIR)/lib/libtsan.so.* $(1)/lib/
539 endef
540
541 define Package/liblsan/install
542 $(INSTALL_DIR) $(1)/lib
543 $(CP) $(TOOLCHAIN_DIR)/lib/liblsan.so.* $(1)/lib/
544 endef
545
546 define Package/libubsan/install
547 $(INSTALL_DIR) $(1)/lib
548 $(CP) $(TOOLCHAIN_DIR)/lib/libubsan.so.* $(1)/lib/
549 endef
550
551 define Package/glibc/install
552 $(CP) ./glibc-files/* $(1)/
553 rm -f $(1)/etc/localtime
554 $(INSTALL_DIR) $(1)/lib
555 $(CP) \
556 $(TOOLCHAIN_DIR)/lib/ld*.so.* \
557 $(1)/lib/
558 for file in libanl libc libcidn libcrypt libdl libm libnsl libnss_dns libnss_files libresolv libutil; do \
559 for file in $(TOOLCHAIN_DIR)/lib/$$$$file.so.*; do \
560 if [ -e "$$$$file" ]; then \
561 $(CP) $$$$file $(1)/lib/; \
562 fi; \
563 done; \
564 done
565 endef
566
567 LD_MUSL_NAME = $(notdir $(firstword $(wildcard $(TOOLCHAIN_DIR)/lib/libc.so*)))
568
569 define Package/musl/install
570 $(INSTALL_DIR) $(1)/lib $(1)/usr/bin
571 $(CP) \
572 $(TOOLCHAIN_DIR)/lib/ld-musl-*.so* \
573 $(1)/lib/
574 $(CP) \
575 $(TOOLCHAIN_DIR)/lib/libc.so* \
576 $(1)/lib/
577 $(LN) ../../lib/$(LD_MUSL_NAME) $(1)/usr/bin/ldd
578 endef
579
580 define Package/libc/install
581 $(call Package/$(LIBC)/install,$1)
582 endef
583
584 define Package/libc/install_lib
585 $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
586 $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
587 $(if $(LIBGCC_MAP), \
588 $(CP) $(LIBGCC_A) $(1)/lib/libgcc_s_pic.a; \
589 $(CP) $(LIBGCC_MAP) $(1)/lib/libgcc_s_pic.map \
590 )
591 endef
592
593 define Package/libpthread/install
594 $(INSTALL_DIR) $(1)/lib
595 ifneq ($(CONFIG_USE_MUSL),y)
596 $(CP) \
597 $(TOOLCHAIN_DIR)/lib/libpthread.so.* \
598 $(1)/lib/
599 endif
600 endef
601
602 define Package/libthread-db/install
603 $(INSTALL_DIR) $(1)/lib
604 $(CP) \
605 $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib
606 endef
607
608 define Package/libpthread/install_lib
609 $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
610 endef
611
612 define Package/librt/install
613 $(INSTALL_DIR) $(1)/lib
614 ifneq ($(CONFIG_USE_MUSL),y)
615 $(CP) \
616 $(TOOLCHAIN_DIR)/lib/librt.so.* \
617 $(1)/lib/
618 endif
619 endef
620
621 define Package/ldd/install
622 $(INSTALL_DIR) $(1)/usr/bin/
623 $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
624 sed -i 's,^#!.*,#!/bin/sh,' $(1)/usr/bin/ldd
625 endef
626
627 define Package/ldconfig/install
628 $(INSTALL_DIR) $(1)/sbin/
629 $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
630 endef
631
632 else
633
634 define Package/libgcc/install
635 for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
636 $(INSTALL_DIR) $(1)/lib ; \
637 $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
638 done ; \
639 exit 0
640 endef
641
642 define Package/libgfortran/install
643 for file in $(call qstrip,$(CONFIG_LIBGFORTRAN_FILE_SPEC)); do \
644 $(INSTALL_DIR) $(1)/lib ; \
645 $(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
646 done
647 endef
648
649 define Package/libstdcpp/install
650 for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
651 $(INSTALL_DIR) $(1)/lib ; \
652 $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
653 done ; \
654 exit 0
655 endef
656
657 define Package/libasan/install
658 for file in $(call qstrip,$(CONFIG_LIBASAN_FILE_SPEC)); do \
659 $(INSTALL_DIR) $(1)/lib ; \
660 $(CP) $(call qstrip,$(CONFIG_LIBASAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
661 done ; \
662 exit 0
663 endef
664
665 define Package/libtsan/install
666 for file in $(call qstrip,$(CONFIG_LIBTSAN_FILE_SPEC)); do \
667 $(INSTALL_DIR) $(1)/lib ; \
668 $(CP) $(call qstrip,$(CONFIG_LIBTSAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
669 done ; \
670 exit 0
671 endef
672
673 define Package/liblsan/install
674 for file in $(call qstrip,$(CONFIG_LIBLSAN_FILE_SPEC)); do \
675 $(INSTALL_DIR) $(1)/lib ; \
676 $(CP) $(call qstrip,$(CONFIG_LIBLSAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
677 done ; \
678 exit 0
679 endef
680
681 define Package/libubsan/install
682 for file in $(call qstrip,$(CONFIG_LIBUBSAN_FILE_SPEC)); do \
683 $(INSTALL_DIR) $(1)/lib ; \
684 $(CP) $(call qstrip,$(CONFIG_LIBUBSAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
685 done ; \
686 exit 0
687 endef
688
689 define Package/glibc/install
690 endef
691
692 LD_MUSL_NAME = $(notdir $(firstword $(wildcard $(TOOLCHAIN_ROOT_DIR)/lib/libc.so*)))
693
694 define Package/musl/install
695 $(INSTALL_DIR) $(1)/usr/bin
696 $(LN) ../../lib/$(LD_MUSL_NAME) $(1)/usr/bin/ldd
697 endef
698
699 define Package/libc/install
700 for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
701 $(INSTALL_DIR) $(1)/lib ; \
702 $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
703 done ; \
704 exit 0
705 $(call Package/$(LIBC)/install,$1)
706 endef
707
708 define Package/libpthread/install
709 for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
710 $(INSTALL_DIR) $(1)/lib ; \
711 $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/lib/ ; \
712 done ; \
713 exit 0
714 endef
715
716 define Package/libthread-db/install
717 for file in $(call qstrip,$(CONFIG_LIBTHREAD_DB_FILE_SPEC)); do \
718 $(INSTALL_DIR) $(1)/lib ; \
719 $(CP) $(call qstrip,$(CONFIG_LIBTHREAD_DB_ROOT_DIR))/$$$$file $(1)/lib/ ; \
720 done ; \
721 exit 0
722 endef
723
724 define Package/librt/install
725 for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
726 $(INSTALL_DIR) $(1)/lib ; \
727 $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/lib/ ; \
728 done ; \
729 exit 0
730 endef
731
732 define Package/libatomic/install
733 for file in $(call qstrip,$(CONFIG_LIBATOMIC_FILE_SPEC)); do \
734 $(INSTALL_DIR) $(1)/lib ; \
735 $(CP) $(call qstrip,$(CONFIG_LIBATOMIC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
736 done ; \
737 exit 0
738 endef
739
740 define Package/libquadmath/install
741 for file in $(call qstrip,$(CONFIG_LIBQUADMATH_FILE_SPEC)); do \
742 $(INSTALL_DIR) $(1)/lib ; \
743 $(CP) $(call qstrip,$(CONFIG_LIBQUADMATH_ROOT_DIR))/$$$$file $(1)/lib/ ; \
744 done ; \
745 exit 0
746 endef
747
748 define Package/libgomp/install
749 for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \
750 $(INSTALL_DIR) $(1)/lib ; \
751 $(CP) $(call qstrip,$(CONFIG_LIBGOMP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
752 done ; \
753 exit 0
754 endef
755
756 define Package/ldd/install
757 for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \
758 dir=`dirname $$$$file` ; \
759 $(INSTALL_DIR) $(1)/$$$$dir ; \
760 $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
761 done ; \
762 exit 0
763 endef
764
765 define Package/ldconfig/install
766 for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \
767 dir=`dirname $$$$file` ; \
768 $(INSTALL_DIR) $(1)/$$$$dir ; \
769 $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
770 done ; \
771 exit 0
772 endef
773
774 endif
775
776 $(eval $(call BuildPackage,libc))
777 $(eval $(call BuildPackage,libgcc))
778 $(eval $(call BuildPackage,libatomic))
779 $(eval $(call BuildPackage,libquadmath))
780 $(eval $(call BuildPackage,libstdcpp))
781 $(eval $(call BuildPackage,libasan))
782 $(eval $(call BuildPackage,libtsan))
783 $(eval $(call BuildPackage,liblsan))
784 $(eval $(call BuildPackage,libubsan))
785 $(eval $(call BuildPackage,libpthread))
786 $(eval $(call BuildPackage,libthread-db))
787 $(eval $(call BuildPackage,librt))
788 $(eval $(call BuildPackage,libgfortran))
789 $(eval $(call BuildPackage,libgomp))
790 $(eval $(call BuildPackage,ldd))
791 $(eval $(call BuildPackage,ldconfig))