e4a78ed5f2d48a19061a9f04eba7010fa27da494
[openwrt/staging/chunkeey.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=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a))
293 LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map))
294 LIBGCC_SO=$(lastword $(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
433 define Package/musl/install
434 $(INSTALL_DIR) $(1)/lib
435 $(CP) \
436 $(TOOLCHAIN_DIR)/lib/ld-musl-*.so* \
437 $(1)/lib/
438 $(CP) \
439 $(TOOLCHAIN_DIR)/lib/libc.so* \
440 $(1)/lib/
441 $(if $(findstring -sf.so,$(LD_MUSL_NAME)),ln -s $(LD_MUSL_NAME) $(1)/lib/$(subst -sf.so,.so,$(LD_MUSL_NAME)))
442 endef
443
444 define Package/libc/install
445 $(call Package/$(LIBC)/install,$1)
446 endef
447
448 define Package/libc/install_lib
449 $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
450 $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
451 $(if $(LIBGCC_MAP), \
452 $(CP) $(LIBGCC_A) $(1)/lib/libgcc_s_pic.a; \
453 $(CP) $(LIBGCC_MAP) $(1)/lib/libgcc_s_pic.map \
454 )
455 endef
456
457 define Package/libpthread/install
458 $(INSTALL_DIR) $(1)/lib
459 ifneq ($(CONFIG_USE_MUSL),y)
460 $(CP) \
461 $(TOOLCHAIN_DIR)/lib/libpthread.so.* \
462 $(if $(BUILD_LIBGCC),\
463 $(PKG_BUILD_DIR)/libpthread-$(LIBC_SO_VERSION).so, \
464 $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \
465 ) \
466 $(1)/lib/
467 endif
468 endef
469
470 define Package/libthread-db/install
471 $(INSTALL_DIR) $(1)/lib
472 $(CP) \
473 $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib
474 ifeq ($(USE_UCLIBC),y)
475 $(CP) \
476 $(TOOLCHAIN_DIR)/lib/libthread_db-$(LIBC_SO_VERSION).so \
477 $(1)/lib/
478 endif
479 endef
480
481 define Package/libpthread/install_lib
482 $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
483 endef
484
485 define Package/librt/install
486 $(INSTALL_DIR) $(1)/lib
487 ifneq ($(CONFIG_USE_MUSL),y)
488 $(CP) \
489 $(TOOLCHAIN_DIR)/lib/librt.so.* \
490 $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \
491 $(1)/lib/
492 endif
493 endef
494
495 define Package/ldd/install
496 $(INSTALL_DIR) $(1)/usr/bin/
497 $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
498 endef
499
500 define Package/ldconfig/install
501 $(INSTALL_DIR) $(1)/sbin/
502 $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
503 endef
504
505 else
506
507 define Package/libgcc/install
508 for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
509 dir=`dirname $$$$file` ; \
510 $(INSTALL_DIR) $(1)/$$$$dir ; \
511 $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
512 done ; \
513 exit 0
514 endef
515
516 define Package/libgfortran/install
517 for file in $(call qstrip,$(CONFIG_LIBGFORTRAN_FILE_SPEC)); do \
518 dir=`dirname $$$$file` ; \
519 $(INSTALL_DIR) $(1)/$$$$dir ; \
520 $(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
521 done
522 endef
523
524 define Package/libssp/install
525 for file in $(call qstrip,$(CONFIG_LIBSSP_FILE_SPEC)); do \
526 dir=`dirname $$$$file` ; \
527 $(INSTALL_DIR) $(1)/$$$$dir ; \
528 $(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
529 done ; \
530 exit 0
531 endef
532
533 define Package/libstdcpp/install
534 for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
535 dir=`dirname $$$$file` ; \
536 $(INSTALL_DIR) $(1)/$$$$dir ; \
537 $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
538 done ; \
539 exit 0
540 endef
541
542 define Package/libc/install
543 for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
544 dir=`dirname $$$$file` ; \
545 $(INSTALL_DIR) $(1)/$$$$dir ; \
546 $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
547 done ; \
548 exit 0
549 endef
550
551 define Package/libpthread/install
552 for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
553 dir=`dirname $$$$file` ; \
554 $(INSTALL_DIR) $(1)/$$$$dir ; \
555 $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
556 done ; \
557 exit 0
558 endef
559
560 define Package/librt/install
561 for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
562 dir=`dirname $$$$file` ; \
563 $(INSTALL_DIR) $(1)/$$$$dir ; \
564 $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
565 done ; \
566 exit 0
567 endef
568
569 define Package/ldd/install
570 for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \
571 dir=`dirname $$$$file` ; \
572 $(INSTALL_DIR) $(1)/$$$$dir ; \
573 $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
574 done ; \
575 exit 0
576 endef
577
578 define Package/ldconfig/install
579 for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \
580 dir=`dirname $$$$file` ; \
581 $(INSTALL_DIR) $(1)/$$$$dir ; \
582 $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
583 done ; \
584 exit 0
585 endef
586
587 endif
588
589 $(eval $(call BuildPackage,libc))
590 $(eval $(call BuildPackage,libgcc))
591 $(eval $(call BuildPackage,libssp))
592 $(eval $(call BuildPackage,libstdcpp))
593 $(eval $(call BuildPackage,libpthread))
594 $(eval $(call BuildPackage,libthread-db))
595 $(eval $(call BuildPackage,librt))
596 $(eval $(call BuildPackage,libgfortran))
597 $(eval $(call BuildPackage,ldd))
598 $(eval $(call BuildPackage,ldconfig))