2 # Copyright (C) 2006-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=uClibc
++-$(PKG_VERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=http
://cxx.uclibc.org
/src
/
16 PKG_MD5SUM
:=fd71a433ce1de85885d658f47885ab30
18 PKG_BUILD_DIR
:=$(BUILD_DIR
)/uClibc
++-$(PKG_VERSION
)
23 include $(INCLUDE_DIR
)/package.mk
25 define Package
/uclibcxx
29 TITLE
:=C
++ library for embedded systems
30 URL
:=http
://cxx.uclibc.org
/src
/
33 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
35 -e
's/sparc.*/sparc/' \
37 -e
's/ppc/powerpc/g' \
38 -e
's/v850.*/v850/g' \
40 -e
's/sh[234].*/sh/' \
42 -e
's/mipsel.*/mips/' \
46 TARGET_CFLAGS
+= $(FPIC
)
49 TOPDIR
="$(PKG_BUILD_DIR)/" \
50 $(TARGET_CONFIGURE_OPTS
) \
51 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
52 CROSS
="$(TARGET_CROSS)" \
54 GEN_LIBS
="-lc $(LIBGCC_S)" \
57 # check_as_needed overrides dependency on libgcc_s
59 define Build
/Configure
60 if
[ -f .
/files
/config.
$(UCLIBC_TARGET_ARCH
) ]; then \
61 cp .
/files
/config.
$(UCLIBC_TARGET_ARCH
) $(PKG_BUILD_DIR
)/.config
; \
63 cp .
/files
/config.default
$(PKG_BUILD_DIR
)/.config
; \
67 define Build
/InstallDev
68 $(INSTALL_DIR
) $(2)/bin
$(1)/usr
/include/uClibc
++ $(1)/usr
/lib
69 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/bin
/g
++-uc
$(2)/bin
/
70 $(CP
) $(PKG_INSTALL_DIR
)/include/* $(1)/usr
/include/uClibc
++/
71 $(CP
) $(PKG_INSTALL_DIR
)/lib
/libuClibc
++*.
{a
,so
}* $(1)/usr
/lib
/
72 $(SED
) 's|-I/include/|-I$(STAGING_DIR)/usr/include/uClibc++/|g' $(2)/bin
/g
++-uc
73 $(SED
) 's|-L/lib/|-L$(STAGING_DIR)/usr/lib/|g' $(2)/bin
/g
++-uc
74 # add another wrapper which links against both uClibc++ and libstdc++
75 $(INSTALL_BIN
) $(2)/bin
/g
++-uc
$(2)/bin
/g
++-uc
+std
76 $(SED
) 's|^WRAPPER_INCLUDEDIR=.*||g' $(2)/bin
/g
++-uc
+std
77 $(SED
) 's|-luClibc++|-Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic|g' $(2)/bin
/g
++-uc
+std
78 $(SED
) 's|-nostdinc++||g' $(2)/bin
/g
++-uc
+std
81 define Package
/uclibcxx
/install
82 $(INSTALL_DIR
) $(1)/usr
/lib
83 $(CP
) $(PKG_INSTALL_DIR
)/lib
/libuClibc
++.so.
* $(1)/usr
/lib
/
84 $(CP
) $(PKG_INSTALL_DIR
)/lib
/libuClibc
++-*.so
$(1)/usr
/lib
/
87 $(eval
$(call BuildPackage
,uclibcxx
))