Makefile 15 KB

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