don't use gcc_s on avr32 - fixes uclibc++ compile
[openwrt/svn-archive/archive.git] / libs / uclibc++ / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=uclibc++
12 PKG_VERSION:=0.2.2
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=uClibc++-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://cxx.uclibc.org/src/
17 PKG_MD5SUM:=1ceef3209cca88be8f1bd9de99735954
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/uClibc++-$(PKG_VERSION)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/uclibcxx
24 NAME:=uclibc++
25 SECTION:=libs
26 CATEGORY:=Libraries
27 TITLE:=C++ library for embedded systems
28 URL:=http://cxx.uclibc.org/src/
29 endef
30
31 UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
32 -e 's/i.86/i386/' \
33 -e 's/sparc.*/sparc/' \
34 -e 's/m68k.*/m68k/' \
35 -e 's/ppc/powerpc/g' \
36 -e 's/v850.*/v850/g' \
37 -e 's/sh64/sh/' \
38 -e 's/sh[234].*/sh/' \
39 -e 's/mips.*/mips/' \
40 -e 's/mipsel.*/mips/' \
41 -e 's/cris.*/cris/' \
42 )
43
44 MAKE_FLAGS:= \
45 TOPDIR="$(PKG_BUILD_DIR)/" \
46 $(TARGET_CONFIGURE_OPTS) \
47 ARCH_CFLAGS="$(TARGET_CFLAGS)" \
48 CROSS="$(TARGET_CROSS)" \
49 CP="$(CP)" \
50 $(if $(CONFIG_TARGET_avr32),check_as_needed=)
51
52 # check_as_needed overrides dependency on libgcc_s
53
54 define Build/Configure
55 if [ -f ./files/config.$(UCLIBC_TARGET_ARCH) ]; then \
56 cp ./files/config.$(UCLIBC_TARGET_ARCH) $(PKG_BUILD_DIR)/.config; \
57 else \
58 cp ./files/config.default $(PKG_BUILD_DIR)/.config; \
59 fi
60 endef
61
62 define Build/Compile
63 $(MAKE) -C $(PKG_BUILD_DIR) \
64 $(MAKE_FLAGS) \
65 DESTDIR="$(PKG_INSTALL_DIR)/usr" \
66 all install
67 endef
68
69 define Build/InstallDev
70 $(INSTALL_DIR) $(2)/bin $(1)/usr/include/uClibc++ $(1)/usr/lib
71 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/g++-uc $(2)/bin/
72 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/uClibc++/
73 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuClibc++*.{a,so*} $(1)/usr/lib/
74 $(SED) 's|-I/include/|-I$(STAGING_DIR)/usr/include/uClibc++/|g' $(2)/bin/g++-uc
75 $(SED) 's|-L/lib/|-L$(STAGING_DIR)/usr/lib/|g' $(2)/bin/g++-uc
76 # add another wrapper which links against both uClibc++ and libstdc++
77 $(INSTALL_BIN) $(2)/bin/g++-uc $(2)/bin/g++-uc+std
78 $(SED) 's|^WRAPPER_INCLUDEDIR=.*||g' $(2)/bin/g++-uc+std
79 $(SED) 's|-luClibc++|-Wl,-Bdynamic,-luClibc++,-Bstatic,-lstdc++,-Bdynamic|g' $(2)/bin/g++-uc+std
80 $(SED) 's|-nostdinc++||g' $(2)/bin/g++-uc+std
81 endef
82
83 define Package/uclibcxx/install
84 $(INSTALL_DIR) $(1)/usr/lib
85 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuClibc++.so.* $(1)/usr/lib/
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libuClibc++-*.so $(1)/usr/lib/
87 endef
88
89 $(eval $(call BuildPackage,uclibcxx))