1
0

Makefile 16 KB

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