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
)
48 ifneq ($(CONFIG_CCACHE
),)
49 TARGET_CXX
=$(TARGET_CXX_NOCACHE
)
53 TOPDIR
="$(PKG_BUILD_DIR)/" \
54 $(TARGET_CONFIGURE_OPTS
) \
55 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
56 CROSS
="$(TARGET_CROSS)" \
58 GEN_LIBS
="-lc $(LIBGCC_S)" \
61 # check_as_needed overrides dependency on libgcc_s
63 define Build
/Configure
64 if
[ -f .
/files
/config.
$(UCLIBC_TARGET_ARCH
) ]; then \
65 cp .
/files
/config.
$(UCLIBC_TARGET_ARCH
) $(PKG_BUILD_DIR
)/.config
; \
67 cp .
/files
/config.default
$(PKG_BUILD_DIR
)/.config
; \
71 define Build
/InstallDev
72 $(INSTALL_DIR
) $(2)/bin
$(1)/usr
/include/uClibc
++ $(1)/usr
/lib
73 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/bin
/g
++-uc
$(2)/bin
/
74 $(CP
) $(PKG_INSTALL_DIR
)/include/* $(1)/usr
/include/uClibc
++/
75 $(CP
) $(PKG_INSTALL_DIR
)/lib
/libuClibc
++*.
{a
,so
}* $(1)/usr
/lib
/
76 $(SED
) 's|-I/include/|-I$(STAGING_DIR)/usr/include/uClibc++/|g' $(2)/bin
/g
++-uc
77 $(SED
) 's|-L/lib/|-L$(STAGING_DIR)/usr/lib/|g' $(2)/bin
/g
++-uc
78 # add another wrapper which links against both uClibc++ and libstdc++
79 $(INSTALL_BIN
) $(2)/bin
/g
++-uc
$(2)/bin
/g
++-uc
+std
80 $(SED
) 's|^WRAPPER_INCLUDEDIR=.*||g' $(2)/bin
/g
++-uc
+std
81 $(SED
) 's|-luClibc++|-Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic|g' $(2)/bin
/g
++-uc
+std
82 $(SED
) 's|-nostdinc++||g' $(2)/bin
/g
++-uc
+std
85 define Package
/uclibcxx
/install
86 $(INSTALL_DIR
) $(1)/usr
/lib
87 $(CP
) $(PKG_INSTALL_DIR
)/lib
/libuClibc
++.so.
* $(1)/usr
/lib
/
88 $(CP
) $(PKG_INSTALL_DIR
)/lib
/libuClibc
++-*.so
$(1)/usr
/lib
/
91 $(eval
$(call BuildPackage
,uclibcxx
))