Makefile 15 KB

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