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