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