2 # Copyright (C) 2006 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
:=1ceef3209cca88be8f1bd9de99735954
18 PKG_BUILD_DIR
:=$(BUILD_DIR
)/uClibc
++-$(PKG_VERSION
)
20 include $(INCLUDE_DIR
)/package.mk
22 define Package
/uclibcxx
26 TITLE
:=C
++ library for embedded systems
27 URL
:=http
://cxx.uclibc.org
/src
/
30 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
32 -e
's/sparc.*/sparc/' \
34 -e
's/ppc/powerpc/g' \
35 -e
's/v850.*/v850/g' \
37 -e
's/sh[234].*/sh/' \
39 -e
's/mipsel.*/mips/' \
43 TARGET_CFLAGS
+= $(FPIC
)
46 TOPDIR
="$(PKG_BUILD_DIR)/" \
47 $(TARGET_CONFIGURE_OPTS
) \
48 ARCH_CFLAGS
="$(TARGET_CFLAGS)" \
49 CROSS
="$(TARGET_CROSS)" \
51 $(if
$(CONFIG_TARGET_avr32
),check_as_needed
=)
53 # check_as_needed overrides dependency on libgcc_s
55 define Build
/Configure
56 if
[ -f .
/files
/config.
$(UCLIBC_TARGET_ARCH
) ]; then \
57 cp .
/files
/config.
$(UCLIBC_TARGET_ARCH
) $(PKG_BUILD_DIR
)/.config
; \
59 cp .
/files
/config.default
$(PKG_BUILD_DIR
)/.config
; \
64 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
66 DESTDIR
="$(PKG_INSTALL_DIR)/usr" \
70 define Build
/InstallDev
71 $(INSTALL_DIR
) $(2)/bin
$(1)/usr
/include/uClibc
++ $(1)/usr
/lib
72 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/g
++-uc
$(2)/bin
/
73 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/uClibc
++/
74 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libuClibc
++*.
{a
,so
*} $(1)/usr
/lib
/
75 $(SED
) 's|-I/include/|-I$(STAGING_DIR)/usr/include/uClibc++/|g' $(2)/bin
/g
++-uc
76 $(SED
) 's|-L/lib/|-L$(STAGING_DIR)/usr/lib/|g' $(2)/bin
/g
++-uc
77 # add another wrapper which links against both uClibc++ and libstdc++
78 $(INSTALL_BIN
) $(2)/bin
/g
++-uc
$(2)/bin
/g
++-uc
+std
79 $(SED
) 's|^WRAPPER_INCLUDEDIR=.*||g' $(2)/bin
/g
++-uc
+std
80 $(SED
) 's|-luClibc++|-Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic|g' $(2)/bin
/g
++-uc
+std
81 $(SED
) 's|-nostdinc++||g' $(2)/bin
/g
++-uc
+std
84 define Package
/uclibcxx
/install
85 $(INSTALL_DIR
) $(1)/usr
/lib
86 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libuClibc
++.so.
* $(1)/usr
/lib
/
87 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libuClibc
++-*.so
$(1)/usr
/lib
/
90 $(eval
$(call BuildPackage
,uclibcxx
))