dibbler: fix linking against uClibc++
[openwrt/svn-archive/archive.git] / ipv6 / dibbler / 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:=dibbler
12 PKG_VERSION:=0.6.0-RC1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz
16 PKG_SOURCE_URL:=@SF/dibbler
17 PKG_MD5SUM:=d279efa2b43279f17f6f51cae083d458
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/dibbler/Default
25 SECTION:=ipv6
26 CATEGORY:=IPv6
27 DEPENDS:=+uclibcxx
28 TITLE:=Dibbler, a portable DHCPv6 implementation
29 URL:=http://klub.com.pl/dhcpv6/
30 endef
31
32 define Package/dibbler-client
33 $(call Package/dibbler/Default)
34 TITLE+= (client)
35 endef
36
37 define Package/dibbler-relay
38 $(call Package/dibbler/Default)
39 TITLE+= (relay)
40 endef
41
42 define Package/dibbler-server
43 $(call Package/dibbler/Default)
44 TITLE+= (server)
45 endef
46
47 define Build/Configure
48 (cd $(PKG_BUILD_DIR)/poslib; \
49 $(TARGET_CONFIGURE_OPTS) \
50 CFLAGS="$(TARGET_CFLAGS)" \
51 CPPFLAGS="$(TARGET_CPPFLAGS)" \
52 LDFLAGS="$(TARGET_LDFLAGS)" \
53 ./configure \
54 --target=$(GNU_TARGET_NAME) \
55 --host=$(GNU_TARGET_NAME) \
56 --build=$(GNU_HOST_NAME) \
57 --program-prefix="" \
58 --program-suffix="" \
59 --prefix=/usr \
60 --exec-prefix=/usr \
61 --bindir=/usr/bin \
62 --datadir=/usr/share \
63 --includedir=/usr/include \
64 --infodir=/usr/share/info \
65 --libdir=/usr/lib \
66 --libexecdir=/usr/lib \
67 --localstatedir=/var \
68 --mandir=/usr/share/man \
69 --sbindir=/usr/sbin \
70 --sysconfdir=/etc \
71 $(DISABLE_NLS) \
72 $(DISABLE_LARGEFILE) \
73 );
74 endef
75
76 # link stuff missing from uClibc++ but present in stdc++ statically
77 CXX_LIBS:= -nodefaultlibs -luClibc++ -Wl,-Bstatic,-lstdc++,-Bdynamic -lm
78
79 define Build/Compile
80 $(MAKE) -C $(PKG_BUILD_DIR) \
81 $(TARGET_CONFIGURE_OPTS) \
82 PORT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -fno-builtin -fno-rtti" \
83 PORT_LDFLAGS="$(TARGET_LDFLAGS)" \
84 DEBUGINFO= \
85 CXXLD="$(TARGET_CC)" \
86 CLNT_LIBS="$(CXX_LIBS)" \
87 SRV_LIBS="$(CXX_LIBS)" \
88 server client relay
89 endef
90
91 define Package/dibbler-client/install
92 $(INSTALL_DIR) $(1)/usr/sbin
93 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-client $(1)/usr/sbin/
94 endef
95
96 define Package/dibbler-relay/install
97 $(INSTALL_DIR) $(1)/usr/sbin
98 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-relay $(1)/usr/sbin/
99 endef
100
101 define Package/dibbler-server/install
102 $(INSTALL_DIR) $(1)/usr/sbin
103 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-server $(1)/usr/sbin/
104 endef
105
106 $(eval $(call BuildPackage,dibbler-client))
107 $(eval $(call BuildPackage,dibbler-relay))
108 $(eval $(call BuildPackage,dibbler-server))