Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  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. 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 EXTERNAL_TOOLCHAIN && PACKAGE_librt
  147. config LIBRT_ROOT_DIR
  148. string
  149. prompt "librt shared library base directory"
  150. depends 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 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 EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
  168. config LIBGFORTRAN_ROOT_DIR
  169. string
  170. prompt "libgfortran shared library base directory"
  171. depends 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 EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran
  178. default "./usr/lib/libgfortran.so.*"
  179. endmenu
  180. endef
  181. define Package/ldd
  182. $(call Package/libc/Default)
  183. SECTION:=utils
  184. CATEGORY:=Utilities
  185. TITLE:=LDD trace utility
  186. endef
  187. define Package/ldd/config
  188. menu "Configuration"
  189. depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd
  190. config LDD_ROOT_DIR
  191. string
  192. prompt "ldd trace utility base directory"
  193. depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd
  194. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  195. default "/" if NATIVE_TOOLCHAIN
  196. config LDD_FILE_SPEC
  197. string
  198. prompt "ldd trace utility file"
  199. depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd
  200. default "./usr/bin/ldd"
  201. endmenu
  202. endef
  203. define Package/ldconfig
  204. $(call Package/libc/Default)
  205. SECTION:=utils
  206. CATEGORY:=Utilities
  207. TITLE:=Shared library path configuration
  208. endef
  209. define Package/ldconfig/config
  210. menu "Configuration"
  211. depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
  212. config LDCONFIG_ROOT_DIR
  213. string
  214. prompt "ldconfig base directory"
  215. depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
  216. default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
  217. default "/" if NATIVE_TOOLCHAIN
  218. config LDCONFIG_FILE_SPEC
  219. string
  220. prompt "ldconfig file"
  221. depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig
  222. default "./sbin/ldconfig"
  223. endmenu
  224. endef
  225. define Build/Prepare
  226. mkdir -p $(PKG_BUILD_DIR)
  227. endef
  228. LIBGCC_A=$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a)
  229. LIBGCC_MAP=$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map)
  230. LIBGCC_SO=$(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)
  231. ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
  232. ifneq ($(if $(CONFIG_USE_UCLIBC),$(CONFIG_GCC_VERSION_LINARO)),)
  233. BUILD_LIBGCC:=$(if $(CONFIG_avr32)$(CONFIG_m68k)$(CONFIG_powerpc),,$(PKG_BUILD_DIR)/libgcc_s.so.*)
  234. endif
  235. endif
  236. ifneq ($(BUILD_LIBGCC),)
  237. define Build/Compile/uClibc
  238. $(SCRIPT_DIR)/relink-lib.sh \
  239. "$(TARGET_CROSS)" \
  240. "$(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a)" \
  241. "$(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a)" \
  242. "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libuClibc-*.so))" \
  243. -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 \
  244. $(BUILD_LIBGCC)
  245. $(SCRIPT_DIR)/relink-lib.sh \
  246. "$(TARGET_CROSS)" \
  247. "$(wildcard $(TOOLCHAIN_DIR)/lib/libcrypt-*.so)" \
  248. "$(wildcard $(TOOLCHAIN_DIR)/lib/libcrypt_pic.a)" \
  249. "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libcrypt-*.so))" \
  250. $(BUILD_LIBGCC) \
  251. -Wl,-soname=libcrypt.so.0
  252. $(SCRIPT_DIR)/relink-lib.sh \
  253. "$(TARGET_CROSS)" \
  254. "$(wildcard $(TOOLCHAIN_DIR)/lib/libm-*.so)" \
  255. "$(wildcard $(TOOLCHAIN_DIR)/lib/libm_pic.a)" \
  256. "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libm-*.so))" \
  257. $(BUILD_LIBGCC) \
  258. -Wl,-soname=libm.so.0
  259. $(SCRIPT_DIR)/relink-lib.sh \
  260. "$(TARGET_CROSS)" \
  261. "$(wildcard $(TOOLCHAIN_DIR)/lib/libpthread-*.so)" \
  262. "$(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a)" \
  263. "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libpthread-*.so))" \
  264. -Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal \
  265. -ldl -lc $(BUILD_LIBGCC) \
  266. -Wl,-soname=libpthread.so.0
  267. endef
  268. define Build/Compile/libgcc
  269. $(SCRIPT_DIR)/relink-lib.sh \
  270. "$(TARGET_CROSS)" \
  271. "$(LIBGCC_SO)" \
  272. "$(LIBGCC_A)" \
  273. "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(LIBGCC_SO))" \
  274. -Wl,--version-script=$(LIBGCC_MAP) -Wl,-soname=libgcc_s.so.1
  275. endef
  276. else
  277. define Build/Compile/uClibc
  278. $(CP) \
  279. $(TOOLCHAIN_DIR)/lib/libuClibc-*.so \
  280. $(TOOLCHAIN_DIR)/lib/libcrypt-*.so \
  281. $(TOOLCHAIN_DIR)/lib/libm-*.so \
  282. $(TOOLCHAIN_DIR)/lib/libpthread-*.so \
  283. $(PKG_BUILD_DIR)/
  284. endef
  285. ifneq ($(LIBGCC_SO),)
  286. define Build/Compile/libgcc
  287. $(CP) $(LIBGCC_SO) $(PKG_BUILD_DIR)/
  288. endef
  289. endif
  290. endif
  291. define Build/Compile/Default
  292. $(call Build/Compile/libgcc)
  293. $(call Build/Compile/$(LIBC))
  294. endef
  295. Build/Compile = $(Build/Compile/Default)
  296. ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
  297. define Package/libgcc/install
  298. $(INSTALL_DIR) $(1)/lib
  299. $(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/)
  300. endef
  301. define Package/libgfortran/install
  302. $(INSTALL_DIR) $(1)/usr/lib
  303. $(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/)
  304. endef
  305. define Package/libssp/install
  306. $(INSTALL_DIR) $(1)/lib
  307. $(CP) $(TOOLCHAIN_DIR)/lib/libssp.so.* $(1)/lib/
  308. endef
  309. define Package/libstdcpp/install
  310. $(INSTALL_DIR) $(1)/usr/lib
  311. $(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/
  312. endef
  313. use_libutil=$(if $(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),libutil)
  314. use_libnsl=$(if $(CONFIG_EGLIBC_OPTION_EGLIBC_NIS),libnsl)
  315. use_nsswitch=$(if $(CONFIG_EGLIBC_OPTION_EGLIBC_NSSWITCH),libnss_dns libnss_files)
  316. define Package/eglibc/install
  317. $(CP) ./eglibc-files/* $(1)/
  318. rm -f $(1)/etc/localtime
  319. ln -sf /tmp/localtime $(1)/etc/localtime
  320. $(INSTALL_DIR) $(1)/lib
  321. $(CP) \
  322. $(TOOLCHAIN_DIR)/lib/ld*.so.* \
  323. $(TOOLCHAIN_DIR)/lib/ld-$(LIBC_SO_VERSION).so \
  324. $(1)/lib/
  325. for file in libanl libc libcidn libcrypt libdl libm $(use_libnsl) $(use_nsswitch) libresolv $(use_libutil); do \
  326. for file in $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so; do \
  327. if [ -e "$$$$file" ]; then \
  328. $(CP) $$$$file $(1)/lib/; \
  329. fi; \
  330. done; \
  331. done
  332. endef
  333. define Package/uClibc/install
  334. $(INSTALL_DIR) $(1)/lib
  335. $(CP) \
  336. $(TOOLCHAIN_DIR)/lib/ld*-uClibc.so.* \
  337. $(TOOLCHAIN_DIR)/lib/ld*-uClibc-$(LIBC_SO_VERSION).so \
  338. $(1)/lib/
  339. $(CP) \
  340. $(TOOLCHAIN_DIR)/lib/libc.so.* \
  341. $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \
  342. $(1)/lib/
  343. for file in libcrypt libdl libm libutil; do \
  344. $(CP) \
  345. $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \
  346. $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \
  347. $(1)/lib/; \
  348. done
  349. $(CP) \
  350. $(PKG_BUILD_DIR)/libuClibc-* \
  351. $(PKG_BUILD_DIR)/libm-* \
  352. $(PKG_BUILD_DIR)/libcrypt-* \
  353. $(1)/lib/
  354. endef
  355. define Package/libc/install
  356. $(call Package/$(LIBC)/install,$1)
  357. endef
  358. define Package/libc/install_lib
  359. $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
  360. $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
  361. $(if $(LIBGCC_MAP), \
  362. $(CP) $(LIBGCC_A) $(1)/lib/libgcc_s_pic.a; \
  363. $(CP) $(LIBGCC_MAP) $(1)/lib/libgcc_s_pic.map \
  364. )
  365. endef
  366. define Package/libpthread/install
  367. $(INSTALL_DIR) $(1)/lib
  368. $(CP) \
  369. $(TOOLCHAIN_DIR)/lib/libpthread.so.* \
  370. $(if $(BUILD_LIBGCC),\
  371. $(PKG_BUILD_DIR)/libpthread-$(LIBC_SO_VERSION).so, \
  372. $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \
  373. ) \
  374. $(1)/lib/
  375. endef
  376. define Package/libthread-db/install
  377. $(INSTALL_DIR) $(1)/lib
  378. $(CP) \
  379. $(TOOLCHAIN_DIR)/lib/libthread_db.so.* $(1)/lib
  380. ifeq ($(USE_UCLIBC),y)
  381. $(CP) \
  382. $(TOOLCHAIN_DIR)/lib/libthread_db-$(LIBC_SO_VERSION).so \
  383. $(1)/lib/
  384. endif
  385. endef
  386. define Package/libpthread/install_lib
  387. $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
  388. endef
  389. define Package/librt/install
  390. $(INSTALL_DIR) $(1)/lib
  391. $(CP) \
  392. $(TOOLCHAIN_DIR)/lib/librt.so.* \
  393. $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \
  394. $(1)/lib/
  395. endef
  396. define Package/ldd/install
  397. $(INSTALL_DIR) $(1)/usr/bin/
  398. $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
  399. endef
  400. define Package/ldconfig/install
  401. $(INSTALL_DIR) $(1)/sbin/
  402. $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/
  403. endef
  404. else
  405. define Package/libgcc/install
  406. for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \
  407. dir=`dirname $$$$file` ; \
  408. $(INSTALL_DIR) $(1)/$$$$dir ; \
  409. $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  410. done ; \
  411. exit 0
  412. endef
  413. define Package/libgfortran/install
  414. for file in $(call qstrip,$(CONFIG_LIBGFORTRAN_FILE_SPEC)); do \
  415. dir=`dirname $$$$file` ; \
  416. $(INSTALL_DIR) $(1)/$$$$dir ; \
  417. $(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  418. done
  419. endef
  420. define Package/libssp/install
  421. for file in $(call qstrip,$(CONFIG_LIBSSP_FILE_SPEC)); do \
  422. dir=`dirname $$$$file` ; \
  423. $(INSTALL_DIR) $(1)/$$$$dir ; \
  424. $(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  425. done ; \
  426. exit 0
  427. endef
  428. define Package/libstdcpp/install
  429. for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \
  430. dir=`dirname $$$$file` ; \
  431. $(INSTALL_DIR) $(1)/$$$$dir ; \
  432. $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  433. done ; \
  434. exit 0
  435. endef
  436. define Package/libc/install
  437. for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \
  438. dir=`dirname $$$$file` ; \
  439. $(INSTALL_DIR) $(1)/$$$$dir ; \
  440. $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  441. done ; \
  442. exit 0
  443. endef
  444. define Package/libpthread/install
  445. for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \
  446. dir=`dirname $$$$file` ; \
  447. $(INSTALL_DIR) $(1)/$$$$dir ; \
  448. $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  449. done ; \
  450. exit 0
  451. endef
  452. define Package/librt/install
  453. for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \
  454. dir=`dirname $$$$file` ; \
  455. $(INSTALL_DIR) $(1)/$$$$dir ; \
  456. $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  457. done ; \
  458. exit 0
  459. endef
  460. define Package/ldd/install
  461. for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \
  462. dir=`dirname $$$$file` ; \
  463. $(INSTALL_DIR) $(1)/$$$$dir ; \
  464. $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  465. done ; \
  466. exit 0
  467. endef
  468. define Package/ldconfig/install
  469. for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \
  470. dir=`dirname $$$$file` ; \
  471. $(INSTALL_DIR) $(1)/$$$$dir ; \
  472. $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \
  473. done ; \
  474. exit 0
  475. endef
  476. endif
  477. $(eval $(call BuildPackage,libc))
  478. $(eval $(call BuildPackage,libgcc))
  479. $(eval $(call BuildPackage,libssp))
  480. $(eval $(call BuildPackage,libstdcpp))
  481. $(eval $(call BuildPackage,libpthread))
  482. $(eval $(call BuildPackage,libthread-db))
  483. $(eval $(call BuildPackage,librt))
  484. $(eval $(call BuildPackage,libgfortran))
  485. $(eval $(call BuildPackage,ldd))
  486. $(eval $(call BuildPackage,ldconfig))