Makefile 15 KB

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