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