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