Makefile 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a))
  231. LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map))
  232. LIBGCC_SO=$(lastword $(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. LD_MUSL_NAME = $(notdir $(firstword $(wildcard $(TOOLCHAIN_DIR)/lib/ld-musl-*.so*)))
  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. $(if $(findstring -sf.so,$(LD_MUSL_NAME)),ln -s $(LD_MUSL_NAME) $(1)/lib/$(subst -sf.so,.so,$(LD_MUSL_NAME)))
  367. endef
  368. define Package/libc/install
  369. $(call Package/$(LIBC)/install,$1)
  370. endef
  371. define Package/libc/install_lib
  372. $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
  373. $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
  374. $(if $(LIBGCC_MAP), \
  375. $(CP) $(LIBGCC_A) $(1)/lib/libgcc_s_pic.a; \
  376. $(CP) $(LIBGCC_MAP) $(1)/lib/libgcc_s_pic.map \
  377. )
  378. endef
  379. define Package/libpthread/install
  380. $(INSTALL_DIR) $(1)/lib
  381. ifneq ($(CONFIG_USE_MUSL),y)
  382. $(CP) \
  383. $(TOOLCHAIN_DIR)/lib/libpthread.so.* \
  384. $(if $(BUILD_LIBGCC),\
  385. $(PKG_BUILD_DIR)/libpthread-$(LIBC_SO_VERSION).so, \
  386. $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \
  387. ) \
  388. $(1)/lib/
  389. endif
  390. endef
  391. define Package/libthread-db/install
  392. $(INSTALL_DIR) $(1)/lib
  393. $(CP) \
  394. $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib
  395. ifeq ($(USE_UCLIBC),y)
  396. $(CP) \
  397. $(TOOLCHAIN_DIR)/lib/libthread_db-$(LIBC_SO_VERSION).so \
  398. $(1)/lib/
  399. endif
  400. endef
  401. define Package/libpthread/install_lib
  402. $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
  403. endef
  404. define Package/librt/install
  405. $(INSTALL_DIR) $(1)/lib
  406. ifneq ($(CONFIG_USE_MUSL),y)
  407. $(CP) \
  408. $(TOOLCHAIN_DIR)/lib/librt.so.* \
  409. $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \
  410. $(1)/lib/
  411. endif
  412. endef
  413. define Package/ldd/install
  414. $(INSTALL_DIR) $(1)/usr/bin/
  415. $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
  416. endef
  417. define Package/ldconfig/install
  418. $(INSTALL_DIR) $(1)/sbin/
  419. $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
  420. endef
  421. else
  422. define Package/libgcc/install
  423. for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
  424. dir=`dirname $$$$file` ; \
  425. $(INSTALL_DIR) $(1)/$$$$dir ; \
  426. $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  427. done ; \
  428. exit 0
  429. endef
  430. define Package/libgfortran/install
  431. for file in $(call qstrip,$(CONFIG_LIBGFORTRAN_FILE_SPEC)); do \
  432. dir=`dirname $$$$file` ; \
  433. $(INSTALL_DIR) $(1)/$$$$dir ; \
  434. $(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  435. done
  436. endef
  437. define Package/libssp/install
  438. for file in $(call qstrip,$(CONFIG_LIBSSP_FILE_SPEC)); do \
  439. dir=`dirname $$$$file` ; \
  440. $(INSTALL_DIR) $(1)/$$$$dir ; \
  441. $(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  442. done ; \
  443. exit 0
  444. endef
  445. define Package/libstdcpp/install
  446. for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
  447. dir=`dirname $$$$file` ; \
  448. $(INSTALL_DIR) $(1)/$$$$dir ; \
  449. $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  450. done ; \
  451. exit 0
  452. endef
  453. define Package/libc/install
  454. for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
  455. dir=`dirname $$$$file` ; \
  456. $(INSTALL_DIR) $(1)/$$$$dir ; \
  457. $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  458. done ; \
  459. exit 0
  460. endef
  461. define Package/libpthread/install
  462. for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
  463. dir=`dirname $$$$file` ; \
  464. $(INSTALL_DIR) $(1)/$$$$dir ; \
  465. $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  466. done ; \
  467. exit 0
  468. endef
  469. define Package/librt/install
  470. for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
  471. dir=`dirname $$$$file` ; \
  472. $(INSTALL_DIR) $(1)/$$$$dir ; \
  473. $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  474. done ; \
  475. exit 0
  476. endef
  477. define Package/ldd/install
  478. for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \
  479. dir=`dirname $$$$file` ; \
  480. $(INSTALL_DIR) $(1)/$$$$dir ; \
  481. $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  482. done ; \
  483. exit 0
  484. endef
  485. define Package/ldconfig/install
  486. for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \
  487. dir=`dirname $$$$file` ; \
  488. $(INSTALL_DIR) $(1)/$$$$dir ; \
  489. $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  490. done ; \
  491. exit 0
  492. endef
  493. endif
  494. $(eval $(call BuildPackage,libc))
  495. $(eval $(call BuildPackage,libgcc))
  496. $(eval $(call BuildPackage,libssp))
  497. $(eval $(call BuildPackage,libstdcpp))
  498. $(eval $(call BuildPackage,libpthread))
  499. $(eval $(call BuildPackage,libthread-db))
  500. $(eval $(call BuildPackage,librt))
  501. $(eval $(call BuildPackage,libgfortran))
  502. $(eval $(call BuildPackage,ldd))
  503. $(eval $(call BuildPackage,ldconfig))