add libtool fixes, tweak sed-ifications for pkgconfig file and build-time config...
[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 # add dependency on 2.6 since recent dibbler needs <linux/ip_mp_alg.h>
25 define Package/dibbler/Default
26 SECTION:=ipv6
27 CATEGORY:=IPv6
28 DEPENDS:=+uclibcxx @LINUX_2_6
29 TITLE:=Dibbler, a portable DHCPv6 implementation
30 URL:=http://klub.com.pl/dhcpv6/
31 endef
32
33 define Package/dibbler-client
34 $(call Package/dibbler/Default)
35 TITLE+= (client)
36 endef
37
38 define Package/dibbler-relay
39 $(call Package/dibbler/Default)
40 TITLE+= (relay)
41 endef
42
43 define Package/dibbler-server
44 $(call Package/dibbler/Default)
45 TITLE+= (server)
46 endef
47
48 define Build/Configure
49 (cd $(PKG_BUILD_DIR)/poslib; \
50 $(TARGET_CONFIGURE_OPTS) \
51 CFLAGS="$(TARGET_CFLAGS)" \
52 CPPFLAGS="$(TARGET_CPPFLAGS)" \
53 LDFLAGS="$(TARGET_LDFLAGS)" \
54 ./configure \
55 --target=$(GNU_TARGET_NAME) \
56 --host=$(GNU_TARGET_NAME) \
57 --build=$(GNU_HOST_NAME) \
58 --program-prefix="" \
59 --program-suffix="" \
60 --prefix=/usr \
61 --exec-prefix=/usr \
62 --bindir=/usr/bin \
63 --datadir=/usr/share \
64 --includedir=/usr/include \
65 --infodir=/usr/share/info \
66 --libdir=/usr/lib \
67 --libexecdir=/usr/lib \
68 --localstatedir=/var \
69 --mandir=/usr/share/man \
70 --sbindir=/usr/sbin \
71 --sysconfdir=/etc \
72 $(DISABLE_NLS) \
73 $(DISABLE_LARGEFILE) \
74 );
75 endef
76
77 # link stuff missing from uClibc++ but present in stdc++ statically
78 CXX_LIBS:= -nodefaultlibs -luClibc++ -Wl,-Bstatic,-lstdc++,-Bdynamic -lm
79
80 define Build/Compile
81 $(MAKE) -C $(PKG_BUILD_DIR) \
82 $(TARGET_CONFIGURE_OPTS) \
83 PORT_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -fno-builtin -fno-rtti" \
84 PORT_LDFLAGS="$(TARGET_LDFLAGS)" \
85 DEBUGINFO= \
86 CXXLD="$(TARGET_CC)" \
87 CLNT_LIBS="$(CXX_LIBS)" \
88 SRV_LIBS="$(CXX_LIBS)" \
89 server client relay
90 endef
91
92 define Package/dibbler-client/install
93 $(INSTALL_DIR) $(1)/usr/sbin
94 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-client $(1)/usr/sbin/
95 endef
96
97 define Package/dibbler-relay/install
98 $(INSTALL_DIR) $(1)/usr/sbin
99 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-relay $(1)/usr/sbin/
100 endef
101
102 define Package/dibbler-server/install
103 $(INSTALL_DIR) $(1)/usr/sbin
104 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dibbler-server $(1)/usr/sbin/
105 endef
106
107 $(eval $(call BuildPackage,dibbler-client))
108 $(eval $(call BuildPackage,dibbler-relay))
109 $(eval $(call BuildPackage,dibbler-server))