Makefile 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  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:=4
  10. PKG_MAINTAINER:=Felix Fietkau <[email protected]>
  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/libstdcpp
  70. $(call Package/gcc/Default)
  71. NAME:=libstdc++
  72. TITLE:=GNU Standard C++ Library v3
  73. ABI_VERSION:=6
  74. endef
  75. define Package/libstdcpp/config
  76. menu "Configuration"
  77. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
  78. config LIBSTDCPP_ROOT_DIR
  79. string
  80. prompt "libstdcpp shared library base directory"
  81. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
  82. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  83. default "/" if NATIVE_TOOLCHAIN
  84. config LIBSTDCPP_FILE_SPEC
  85. string
  86. prompt "libstdc++ shared library files (use wildcards)"
  87. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp
  88. default "./lib/libstdc++.so.*"
  89. endmenu
  90. endef
  91. define Package/libasan
  92. $(call Package/gcc/Default)
  93. NAME:=libasan
  94. TITLE:=Runtime library for AddressSanitizer in GCC
  95. DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc
  96. ABI_VERSION:=5
  97. endef
  98. define Package/libasan/config
  99. menu "Configuration"
  100. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libasan
  101. config LIBASAN_ROOT_DIR
  102. string
  103. prompt "libasan shared library base directory"
  104. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libasan
  105. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  106. default "/" if NATIVE_TOOLCHAIN
  107. config LIBASAN_FILE_SPEC
  108. string
  109. prompt "libasan shared library files (use wildcards)"
  110. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libasan
  111. default "./lib/libasan.so.*"
  112. endmenu
  113. endef
  114. define Package/libtsan
  115. $(call Package/gcc/Default)
  116. NAME:=libtsan
  117. TITLE:=Runtime library for ThreadSanitizer in GCC
  118. DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips @!mipsel @!mips64 @!mips64el @!arc
  119. ABI_VERSION:=0
  120. endef
  121. define Package/libtsan/config
  122. menu "Configuration"
  123. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libtsan
  124. config LIBTSAN_ROOT_DIR
  125. string
  126. prompt "libtsan shared library base directory"
  127. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libtsan
  128. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  129. default "/" if NATIVE_TOOLCHAIN
  130. config LIBTSAN_FILE_SPEC
  131. string
  132. prompt "libtsan shared library files (use wildcards)"
  133. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libtsan
  134. default "./lib/libtsan.so.*"
  135. endmenu
  136. endef
  137. define Package/liblsan
  138. $(call Package/gcc/Default)
  139. NAME:=liblsan
  140. TITLE:=Runtime library for LeakSanitizer in GCC
  141. DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips @!mipsel @!mips64 @!mips64el @!arc
  142. ABI_VERSION:=0
  143. endef
  144. define Package/liblsan/config
  145. menu "Configuration"
  146. depends on EXTERNAL_TOOLCHAIN && PACKAGE_liblsan
  147. config LIBLSAN_ROOT_DIR
  148. string
  149. prompt "liblsan shared library base directory"
  150. depends on EXTERNAL_TOOLCHAIN && PACKAGE_liblsan
  151. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  152. default "/" if NATIVE_TOOLCHAIN
  153. config LIBLSAN_FILE_SPEC
  154. string
  155. prompt "liblsan shared library files (use wildcards)"
  156. depends on EXTERNAL_TOOLCHAIN && PACKAGE_liblsan
  157. default "./lib/liblsan.so.*"
  158. endmenu
  159. endef
  160. define Package/libubsan
  161. $(call Package/gcc/Default)
  162. NAME:=libubsan
  163. TITLE:=Runtime library for UndefinedBehaviorSanitizer in GCC
  164. DEPENDS:=@USE_GLIBC +librt +libstdcpp @!mips64 @!mips64el @!arc
  165. ABI_VERSION:=1
  166. endef
  167. define Package/libubsan/config
  168. menu "Configuration"
  169. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libubsan
  170. config LIBUBSAN_ROOT_DIR
  171. string
  172. prompt "libubsan shared library base directory"
  173. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libubsan
  174. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  175. default "/" if NATIVE_TOOLCHAIN
  176. config LIBUBSAN_FILE_SPEC
  177. string
  178. prompt "libubsan shared library files (use wildcards)"
  179. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libubsan
  180. default "./lib/libubsan.so.*"
  181. endmenu
  182. endef
  183. define Package/libc/Default
  184. SECTION:=libs
  185. CATEGORY:=Base system
  186. VERSION:=$(LIBC_VERSION)-$(PKG_RELEASE)
  187. DEPENDS:=+libgcc
  188. URL:=$(LIBC_URL)
  189. endef
  190. define Package/libc
  191. $(call Package/libc/Default)
  192. TITLE:=C library
  193. endef
  194. define Package/libc/config
  195. menu "Configuration"
  196. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
  197. config LIBC_ROOT_DIR
  198. string
  199. prompt "libc shared library base directory"
  200. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
  201. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  202. default "/" if NATIVE_TOOLCHAIN
  203. config LIBC_FILE_SPEC
  204. string
  205. prompt "libc shared library files (use wildcards)"
  206. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libc
  207. default "./lib/ld{*.so*,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*,.so}"
  208. endmenu
  209. endef
  210. define Package/libpthread
  211. $(call Package/libc/Default)
  212. TITLE:=POSIX thread library
  213. endef
  214. define Package/libpthread/config
  215. menu "Configuration"
  216. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
  217. config LIBPTHREAD_ROOT_DIR
  218. string
  219. prompt "libpthread shared library base directory"
  220. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
  221. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  222. default "/" if NATIVE_TOOLCHAIN
  223. config LIBPTHREAD_FILE_SPEC
  224. string
  225. prompt "libpthread shared library files (use wildcards)"
  226. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libpthread
  227. default "./lib/libpthread{-*.so,.so.*}"
  228. endmenu
  229. endef
  230. define Package/libthread-db
  231. $(call Package/libc/Default)
  232. DEPENDS:=@!USE_MUSL
  233. TITLE:=POSIX thread library debugging support
  234. endef
  235. define Package/libthread-db/config
  236. menu "Configuration"
  237. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
  238. config LIBTHREAD_DB_ROOT_DIR
  239. string
  240. prompt "POSIX thread debugging shared library base directory"
  241. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
  242. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  243. default "/" if NATIVE_TOOLCHAIN
  244. config LIBTHREAD_DB_FILE_SPEC
  245. string
  246. prompt "POSIX thread debugging shared library files (use wildcards)"
  247. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libthread-db
  248. default "./lib/libthread_db{-*.so,.so.*}"
  249. endmenu
  250. endef
  251. define Package/librt
  252. $(call Package/libc/Default)
  253. TITLE:=POSIX.1b RealTime extension library
  254. DEPENDS:=+libpthread
  255. endef
  256. define Package/librt/config
  257. menu "Configuration"
  258. depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
  259. config LIBRT_ROOT_DIR
  260. string
  261. prompt "librt shared library base directory"
  262. depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
  263. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  264. default "/" if NATIVE_TOOLCHAIN
  265. config LIBRT_FILE_SPEC
  266. string
  267. prompt "librt shared library files (use wildcards)"
  268. depends on EXTERNAL_TOOLCHAIN && PACKAGE_librt
  269. default "./lib/librt{-*.so,.so.*}"
  270. endmenu
  271. endef
  272. define Package/libgfortran
  273. $(call Package/gcc/Default)
  274. TITLE:=GFortran support library
  275. DEPENDS+=@INSTALL_GFORTRAN
  276. endef
  277. define Package/libgfortran/config
  278. menu "Configuration"
  279. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
  280. config LIBGFORTRAN_ROOT_DIR
  281. string
  282. prompt "libgfortran shared library base directory"
  283. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
  284. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  285. default "/" if NATIVE_TOOLCHAIN
  286. config LIBGFORTRAN_FILE_SPEC
  287. string
  288. prompt "libgfortran shared library files (use wildcards)"
  289. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
  290. default "./usr/lib/libgfortran.so.*"
  291. endmenu
  292. endef
  293. define Package/libgomp
  294. $(call Package/gcc/Default)
  295. TITLE:=OpenMP support library
  296. endef
  297. define Package/libgomp/config
  298. menu "Configuration"
  299. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
  300. config LIBGOMP_ROOT_DIR
  301. string
  302. prompt "libgomp shared library base directory"
  303. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
  304. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  305. default "/" if NATIVE_TOOLCHAIN
  306. config LIBGOMP_FILE_SPEC
  307. string
  308. prompt "libgomp shared library files (use wildcards)"
  309. depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp
  310. default "./lib/libgomp.so*"
  311. endmenu
  312. endef
  313. define Package/ldd
  314. $(call Package/libc/Default)
  315. DEPENDS:=@!USE_MUSL
  316. SECTION:=utils
  317. CATEGORY:=Utilities
  318. TITLE:=LDD trace utility
  319. endef
  320. define Package/ldd/config
  321. menu "Configuration"
  322. depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
  323. config LDD_ROOT_DIR
  324. string
  325. prompt "ldd trace utility base directory"
  326. depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
  327. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  328. default "/" if NATIVE_TOOLCHAIN
  329. config LDD_FILE_SPEC
  330. string
  331. prompt "ldd trace utility file"
  332. depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldd
  333. default "./usr/bin/ldd"
  334. endmenu
  335. endef
  336. define Package/ldconfig
  337. $(call Package/libc/Default)
  338. DEPENDS:=@!USE_MUSL
  339. SECTION:=utils
  340. CATEGORY:=Utilities
  341. TITLE:=Shared library path configuration
  342. endef
  343. define Package/ldconfig/config
  344. menu "Configuration"
  345. depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
  346. config LDCONFIG_ROOT_DIR
  347. string
  348. prompt "ldconfig base directory"
  349. depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
  350. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  351. default "/" if NATIVE_TOOLCHAIN
  352. config LDCONFIG_FILE_SPEC
  353. string
  354. prompt "ldconfig file"
  355. depends on EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
  356. default "./sbin/ldconfig"
  357. endmenu
  358. endef
  359. define Build/Prepare
  360. mkdir -p $(PKG_BUILD_DIR)
  361. endef
  362. define Build/Quilt
  363. endef
  364. LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a))
  365. LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map))
  366. LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*))
  367. ifneq ($(LIBGCC_SO),)
  368. define Build/Compile/libgcc
  369. $(CP) $(LIBGCC_SO) $(PKG_BUILD_DIR)/
  370. endef
  371. endif
  372. define Build/Compile/Default
  373. $(call Build/Compile/libgcc)
  374. $(call Build/Compile/$(LIBC))
  375. endef
  376. Build/Compile = $(Build/Compile/Default)
  377. ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
  378. define Package/libgcc/install
  379. $(INSTALL_DIR) $(1)/lib
  380. $(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/
  381. endef
  382. define Package/libatomic/install
  383. $(INSTALL_DIR) $(1)/lib
  384. $(CP) $(TOOLCHAIN_DIR)/lib/libatomic.so.* $(1)/lib/
  385. endef
  386. define Package/libgfortran/install
  387. $(INSTALL_DIR) $(1)/usr/lib
  388. $(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/
  389. endef
  390. define Package/libstdcpp/install
  391. $(INSTALL_DIR) $(1)/usr/lib
  392. $(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/
  393. rm -rf $(1)/usr/lib/*-gdb.py
  394. endef
  395. define Package/libasan/install
  396. $(INSTALL_DIR) $(1)/lib
  397. $(CP) $(TOOLCHAIN_DIR)/lib/libasan.so.* $(1)/lib/
  398. endef
  399. define Package/libtsan/install
  400. $(INSTALL_DIR) $(1)/lib
  401. $(CP) $(TOOLCHAIN_DIR)/lib/libtsan.so.* $(1)/lib/
  402. endef
  403. define Package/liblsan/install
  404. $(INSTALL_DIR) $(1)/lib
  405. $(CP) $(TOOLCHAIN_DIR)/lib/liblsan.so.* $(1)/lib/
  406. endef
  407. define Package/libubsan/install
  408. $(INSTALL_DIR) $(1)/lib
  409. $(CP) $(TOOLCHAIN_DIR)/lib/libubsan.so.* $(1)/lib/
  410. endef
  411. define Package/glibc/install
  412. $(CP) ./glibc-files/* $(1)/
  413. rm -f $(1)/etc/localtime
  414. $(LN) /tmp/localtime $(1)/etc/localtime
  415. $(INSTALL_DIR) $(1)/lib
  416. $(CP) \
  417. $(TOOLCHAIN_DIR)/lib/ld*.so.* \
  418. $(1)/lib/
  419. for file in libanl libc libcidn libcrypt libdl libm libnsl libnss_dns libnss_files libresolv libutil; do \
  420. for file in $(TOOLCHAIN_DIR)/lib/$$$$file.so.*; do \
  421. if [ -e "$$$$file" ]; then \
  422. $(CP) $$$$file $(1)/lib/; \
  423. fi; \
  424. done; \
  425. done
  426. endef
  427. LD_MUSL_NAME = $(notdir $(firstword $(wildcard $(TOOLCHAIN_DIR)/lib/libc.so*)))
  428. define Package/musl/install
  429. $(INSTALL_DIR) $(1)/lib $(1)/usr/bin
  430. $(CP) \
  431. $(TOOLCHAIN_DIR)/lib/ld-musl-*.so* \
  432. $(1)/lib/
  433. $(CP) \
  434. $(TOOLCHAIN_DIR)/lib/libc.so* \
  435. $(1)/lib/
  436. $(LN) ../../lib/$(LD_MUSL_NAME) $(1)/usr/bin/ldd
  437. endef
  438. define Package/libc/install
  439. $(call Package/$(LIBC)/install,$1)
  440. endef
  441. define Package/libc/install_lib
  442. $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
  443. $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
  444. $(if $(LIBGCC_MAP), \
  445. $(CP) $(LIBGCC_A) $(1)/lib/libgcc_s_pic.a; \
  446. $(CP) $(LIBGCC_MAP) $(1)/lib/libgcc_s_pic.map \
  447. )
  448. endef
  449. define Package/libpthread/install
  450. $(INSTALL_DIR) $(1)/lib
  451. ifneq ($(CONFIG_USE_MUSL),y)
  452. $(CP) \
  453. $(TOOLCHAIN_DIR)/lib/libpthread.so.* \
  454. $(1)/lib/
  455. endif
  456. endef
  457. define Package/libthread-db/install
  458. $(INSTALL_DIR) $(1)/lib
  459. $(CP) \
  460. $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib
  461. endef
  462. define Package/libpthread/install_lib
  463. $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
  464. endef
  465. define Package/librt/install
  466. $(INSTALL_DIR) $(1)/lib
  467. ifneq ($(CONFIG_USE_MUSL),y)
  468. $(CP) \
  469. $(TOOLCHAIN_DIR)/lib/librt.so.* \
  470. $(1)/lib/
  471. endif
  472. endef
  473. define Package/ldd/install
  474. $(INSTALL_DIR) $(1)/usr/bin/
  475. $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
  476. sed -i 's,^#!.*,#!/bin/sh,' $(1)/usr/bin/ldd
  477. endef
  478. define Package/ldconfig/install
  479. $(INSTALL_DIR) $(1)/sbin/
  480. $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
  481. endef
  482. else
  483. define Package/libgcc/install
  484. for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
  485. $(INSTALL_DIR) $(1)/lib ; \
  486. $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  487. done ; \
  488. exit 0
  489. endef
  490. define Package/libgfortran/install
  491. for file in $(call qstrip,$(CONFIG_LIBGFORTRAN_FILE_SPEC)); do \
  492. $(INSTALL_DIR) $(1)/lib ; \
  493. $(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  494. done
  495. endef
  496. define Package/libstdcpp/install
  497. for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
  498. $(INSTALL_DIR) $(1)/lib ; \
  499. $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  500. done ; \
  501. exit 0
  502. endef
  503. define Package/libasan/install
  504. for file in $(call qstrip,$(CONFIG_LIBASAN_FILE_SPEC)); do \
  505. $(INSTALL_DIR) $(1)/lib ; \
  506. $(CP) $(call qstrip,$(CONFIG_LIBASAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  507. done ; \
  508. exit 0
  509. endef
  510. define Package/libtsan/install
  511. for file in $(call qstrip,$(CONFIG_LIBTSAN_FILE_SPEC)); do \
  512. $(INSTALL_DIR) $(1)/lib ; \
  513. $(CP) $(call qstrip,$(CONFIG_LIBTSAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  514. done ; \
  515. exit 0
  516. endef
  517. define Package/liblsan/install
  518. for file in $(call qstrip,$(CONFIG_LIBLSAN_FILE_SPEC)); do \
  519. $(INSTALL_DIR) $(1)/lib ; \
  520. $(CP) $(call qstrip,$(CONFIG_LIBLSAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  521. done ; \
  522. exit 0
  523. endef
  524. define Package/libubsan/install
  525. for file in $(call qstrip,$(CONFIG_LIBUBSAN_FILE_SPEC)); do \
  526. $(INSTALL_DIR) $(1)/lib ; \
  527. $(CP) $(call qstrip,$(CONFIG_LIBUBSAN_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  528. done ; \
  529. exit 0
  530. endef
  531. define Package/libc/install
  532. for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
  533. $(INSTALL_DIR) $(1)/lib ; \
  534. $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  535. done ; \
  536. exit 0
  537. endef
  538. define Package/libpthread/install
  539. for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
  540. $(INSTALL_DIR) $(1)/lib ; \
  541. $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  542. done ; \
  543. exit 0
  544. endef
  545. define Package/libthread-db/install
  546. for file in $(call qstrip,$(CONFIG_LIBTHREAD_DB_FILE_SPEC)); do \
  547. $(INSTALL_DIR) $(1)/lib ; \
  548. $(CP) $(call qstrip,$(CONFIG_LIBTHREAD_DB_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  549. done ; \
  550. exit 0
  551. endef
  552. define Package/librt/install
  553. for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
  554. $(INSTALL_DIR) $(1)/lib ; \
  555. $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  556. done ; \
  557. exit 0
  558. endef
  559. define Package/libatomic/install
  560. for file in $(call qstrip,$(CONFIG_LIBATOMIC_FILE_SPEC)); do \
  561. $(INSTALL_DIR) $(1)/lib ; \
  562. $(CP) $(call qstrip,$(CONFIG_LIBATOMIC_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  563. done ; \
  564. exit 0
  565. endef
  566. define Package/libgomp/install
  567. for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \
  568. $(INSTALL_DIR) $(1)/lib ; \
  569. $(CP) $(call qstrip,$(CONFIG_LIBGOMP_ROOT_DIR))/$$$$file $(1)/lib/ ; \
  570. done ; \
  571. exit 0
  572. endef
  573. define Package/ldd/install
  574. for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \
  575. dir=`dirname $$$$file` ; \
  576. $(INSTALL_DIR) $(1)/$$$$dir ; \
  577. $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  578. done ; \
  579. exit 0
  580. endef
  581. define Package/ldconfig/install
  582. for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \
  583. dir=`dirname $$$$file` ; \
  584. $(INSTALL_DIR) $(1)/$$$$dir ; \
  585. $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  586. done ; \
  587. exit 0
  588. endef
  589. endif
  590. $(eval $(call BuildPackage,libc))
  591. $(eval $(call BuildPackage,libgcc))
  592. $(eval $(call BuildPackage,libatomic))
  593. $(eval $(call BuildPackage,libstdcpp))
  594. $(eval $(call BuildPackage,libasan))
  595. $(eval $(call BuildPackage,libtsan))
  596. $(eval $(call BuildPackage,liblsan))
  597. $(eval $(call BuildPackage,libubsan))
  598. $(eval $(call BuildPackage,libpthread))
  599. $(eval $(call BuildPackage,libthread-db))
  600. $(eval $(call BuildPackage,librt))
  601. $(eval $(call BuildPackage,libgfortran))
  602. $(eval $(call BuildPackage,libgomp))
  603. $(eval $(call BuildPackage,ldd))
  604. $(eval $(call BuildPackage,ldconfig))