update uclibc++ to latest upstream version (0.2.1), add portability fixes
[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: Makefile 3843 2006-05-30 18:55:52Z florian $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=uclibc++
12 PKG_VERSION:=0.2.1
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/uClibc++-$(PKG_VERSION)
16 PKG_SOURCE:=uClibc++-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://cxx.uclibc.org/src/
18 PKG_MD5SUM:=6e6032c49916b199ffe6a585552fd46b
19 PKG_CAT:=bzcat
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 DESCRIPTION:=A standard C++ library for embedded systems
29 URL:=http://cxx.uclibc.org/src/
30 endef
31
32 UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \
33 -e 's/i.86/i386/' \
34 -e 's/sparc.*/sparc/' \
35 -e 's/m68k.*/m68k/' \
36 -e 's/ppc/powerpc/g' \
37 -e 's/v850.*/v850/g' \
38 -e 's/sh64/sh/' \
39 -e 's/sh[234].*/sh/' \
40 -e 's/mips.*/mips/' \
41 -e 's/mipsel.*/mips/' \
42 -e 's/cris.*/cris/' \
43 )
44
45 define Build/Configure
46 cp ./files/config.$(UCLIBC_TARGET_ARCH) $(PKG_BUILD_DIR)/.config
47 endef
48
49 define Build/Compile
50 $(MAKE) -C $(PKG_BUILD_DIR) \
51 TOPDIR="$(PKG_BUILD_DIR)/" \
52 $(TARGET_CONFIGURE_OPTS) \
53 ARCH_CFLAGS="$(TARGET_CFLAGS)" \
54 CROSS="$(TARGET_CROSS)" \
55 CP="$(CP)" \
56 all
57 endef
58
59 define Package/uclibcxx/install
60 install -m0755 -d $(1)/lib
61 $(CP) $(PKG_BUILD_DIR)/src/libuClibc++*.so.* $(1)/lib/
62 $(CP) $(PKG_BUILD_DIR)/src/libuClibc++-*.so $(1)/lib/
63 endef
64
65 define Build/InstallDev
66 mkdir -p $(STAGING_DIR)/usr/include
67 $(MAKE) -C $(PKG_BUILD_DIR) \
68 TOPDIR="$(PKG_BUILD_DIR)/" \
69 $(TARGET_CONFIGURE_OPTS) \
70 ARCH_CFLAGS="$(TARGET_CFLAGS)" \
71 CROSS="$(TARGET_CROSS)" \
72 DESTDIR="$(STAGING_DIR)" \
73 install
74 endef
75
76 define Build/UninstallDev
77 rm -rf $(STAGING_DIR)/lib/libuClibc++*.{a,so*}
78 endef
79
80 $(eval $(call BuildPackage,uclibcxx))