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.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=uClibc
++-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=http
://cxx.uclibc.org
/src
/
17 PKG_MD5SUM
:=1ceef3209cca88be8f1bd9de99735954
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/uClibc
++-$(PKG_VERSION
)
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/uclibcxx
27 TITLE
:=C
++ library for embedded systems
28 URL
:=http
://cxx.uclibc.org
/src
/
31 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
33 -e
's/sparc.*/sparc/' \
35 -e
's/ppc/powerpc/g' \
36 -e
's/v850.*/v850/g' \
38 -e
's/sh[234].*/sh/' \
40 -e
's/mipsel.*/mips/' \
44 TARGET_CFLAGS
+= $(FPIC
)
47 TOPDIR
="$(PKG_BUILD_DIR)/" \
48 $(TARGET_CONFIGURE_OPTS
) \
49 ARCH_CFLAGS
="$(TARGET_CFLAGS)" \
50 CROSS
="$(TARGET_CROSS)" \
52 $(if
$(CONFIG_TARGET_avr32
),check_as_needed
=)
54 # check_as_needed overrides dependency on libgcc_s
56 define Build
/Configure
57 if
[ -f .
/files
/config.
$(UCLIBC_TARGET_ARCH
) ]; then \
58 cp .
/files
/config.
$(UCLIBC_TARGET_ARCH
) $(PKG_BUILD_DIR
)/.config
; \
60 cp .
/files
/config.default
$(PKG_BUILD_DIR
)/.config
; \
65 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
67 DESTDIR
="$(PKG_INSTALL_DIR)/usr" \
71 define Build
/InstallDev
72 $(INSTALL_DIR
) $(2)/bin
$(1)/usr
/include/uClibc
++ $(1)/usr
/lib
73 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/g
++-uc
$(2)/bin
/
74 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/uClibc
++/
75 $(CP
) $(PKG_INSTALL_DIR
)/usr
/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
)/usr
/lib
/libuClibc
++.so.
* $(1)/usr
/lib
/
88 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libuClibc
++-*.so
$(1)/usr
/lib
/
91 $(eval
$(call BuildPackage
,uclibcxx
))