Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #
  2. # Copyright (C) 2006-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:=uclibc++
  9. PKG_VERSION:=0.2.4
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=uClibc++-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=http://cxx.uclibc.org/src/
  13. PKG_MD5SUM:=394c119363dd8b469fb898442a6764b8
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/uClibc++-$(PKG_VERSION)
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_USE_MIPS16:=0
  17. PKG_LICENSE:=LGPL-2.1+
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/uclibcxx
  21. NAME:=uclibc++
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. TITLE:=C++ library for embedded systems
  25. URL:=http://cxx.uclibc.org/src/
  26. endef
  27. UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
  28. -e 's/i.86/i386/' \
  29. -e 's/sparc.*/sparc/' \
  30. -e 's/m68k.*/m68k/' \
  31. -e 's/ppc/powerpc/g' \
  32. -e 's/v850.*/v850/g' \
  33. -e 's/sh64/sh/' \
  34. -e 's/sh[234].*/sh/' \
  35. -e 's/mips.*/mips/' \
  36. -e 's/mipsel.*/mips/' \
  37. )
  38. TARGET_CFLAGS += $(FPIC)
  39. ifneq ($(CONFIG_CCACHE),)
  40. TARGET_CXX=$(TARGET_CXX_NOCACHE)
  41. endif
  42. MAKE_FLAGS:= \
  43. TOPDIR="$(PKG_BUILD_DIR)/" \
  44. $(TARGET_CONFIGURE_OPTS) \
  45. CPU_CFLAGS="$(TARGET_CFLAGS)" \
  46. CROSS="$(TARGET_CROSS)" \
  47. CP="$(CP)" \
  48. GEN_LIBS="-lc $(LIBGCC_S)" \
  49. check_as_needed=
  50. # check_as_needed overrides dependency on libgcc_s
  51. define Build/Configure
  52. if [ -f ./files/config.$(UCLIBC_TARGET_ARCH) ]; then \
  53. cp ./files/config.$(UCLIBC_TARGET_ARCH) $(PKG_BUILD_DIR)/.config; \
  54. else \
  55. cp ./files/config.default $(PKG_BUILD_DIR)/.config; \
  56. fi
  57. endef
  58. define Build/InstallDev
  59. $(INSTALL_DIR) $(2)/bin $(1)/usr/include/uClibc++ $(1)/usr/lib
  60. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/g++-uc $(TOOLCHAIN_DIR)/bin/
  61. $(CP) $(PKG_INSTALL_DIR)/include/* $(1)/usr/include/uClibc++/
  62. $(CP) $(PKG_INSTALL_DIR)/lib/libuClibc++*.{a,so}* $(1)/usr/lib/
  63. $(SED) 's!\(^\|[[:space:]]\)-[IL]$(TOOLCHAIN_DIR)/[^[:space:]]*!!g' $(TOOLCHAIN_DIR)/bin/g++-uc
  64. $(SED) 's|-I/include/|-I$$$${STAGING_DIR:-$(STAGING_DIR)}/usr/include/uClibc++/|g' $(TOOLCHAIN_DIR)/bin/g++-uc
  65. $(SED) 's|-L/lib/|-L$$$${STAGING_DIR:-$(STAGING_DIR)}/lib/|g' $(TOOLCHAIN_DIR)/bin/g++-uc
  66. # add another wrapper which links against both uClibc++ and libstdc++
  67. $(INSTALL_BIN) $(TOOLCHAIN_DIR)/bin/g++-uc $(TOOLCHAIN_DIR)/bin/g++-uc+std
  68. $(SED) 's|^WRAPPER_INCLUDEDIR=.*||g' $(TOOLCHAIN_DIR)/bin/g++-uc+std
  69. $(SED) 's|-luClibc++|-Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic|g' $(TOOLCHAIN_DIR)/bin/g++-uc+std
  70. $(SED) 's|-nostdinc++||g' $(TOOLCHAIN_DIR)/bin/g++-uc+std
  71. endef
  72. define Package/uclibcxx/install
  73. $(INSTALL_DIR) $(1)/usr/lib
  74. $(CP) $(PKG_INSTALL_DIR)/lib/libuClibc++.so.* $(1)/usr/lib/
  75. $(CP) $(PKG_INSTALL_DIR)/lib/libuClibc++-*.so $(1)/usr/lib/
  76. endef
  77. $(eval $(call BuildPackage,uclibcxx))