Makefile 15 KB

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