compile fix for bsd
[openwrt/svn-archive/archive.git] / libs / libdnet / 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:=libdnet
12 PKG_VERSION:=1.10
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/libdnet-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
18 PKG_MD5SUM:=416b765e9d9961501ac85e9a366fd219
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libdnet
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=Low-level network library
29 DESCRIPTION:=Low-level network library.\\\
30 libdnet is a library of simplified, portable interface to several \\\
31 low-level networking routines.
32 URL:=http://sourceforge.net/projects/libdnet/
33 endef
34
35 define Build/Configure
36 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
37 touch configure.in; \
38 touch include.m4; \
39 touch aclocal.m4; \
40 touch Makefile.in; \
41 touch configure; \
42 $(TARGET_CONFIGURE_OPTS) \
43 CFLAGS="$(TARGET_CFLAGS)" \
44 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
45 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
46 ac_cv_dnet_bsd_bpf=no \
47 ./configure \
48 --target=$(GNU_TARGET_NAME) \
49 --host=$(GNU_TARGET_NAME) \
50 --build=$(GNU_HOST_NAME) \
51 --program-prefix="" \
52 --program-suffix="" \
53 --prefix=/usr \
54 --exec-prefix=/usr \
55 --bindir=/usr/bin \
56 --datadir=/usr/share \
57 --includedir=/usr/include \
58 --infodir=/usr/share/info \
59 --libdir=/usr/lib \
60 --libexecdir=/usr/lib \
61 --localstatedir=/var/run \
62 --mandir=/usr/share/man \
63 --sbindir=/usr/sbin \
64 --sysconfdir=/etc \
65 $(DISABLE_NLS) \
66 $(DISABLE_LARGEFILE) \
67 --enable-shared \
68 --enable-static \
69 );
70 endef
71
72 define Build/Compile
73 rm -rf $(PKG_INSTALL_DIR)
74 mkdir -p $(PKG_INSTALL_DIR)
75 $(MAKE) -C $(PKG_BUILD_DIR) \
76 $(TARGET_CONFIGURE_OPTS) \
77 CFLAGS="$(TARGET_CFLAGS)" \
78 DESTDIR="$(PKG_INSTALL_DIR)" \
79 all install
80 endef
81
82 define Package/libdnet/install
83 install -m0755 -d $(1)/usr/lib
84 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnet.so.* $(1)/usr/lib/
85 install -m0755 -d $(1)/usr/sbin
86 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnet $(1)/usr/sbin/
87 endef
88
89 define Build/InstallDev
90 mkdir -p $(STAGING_DIR)/usr/bin
91 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dnet-config $(STAGING_DIR)/usr/bin/
92 mkdir -p $(STAGING_DIR)/usr/include
93 $(CP) $(PKG_INSTALL_DIR)/usr/include/dnet.h $(STAGING_DIR)/usr/include/
94 $(CP) $(PKG_INSTALL_DIR)/usr/include/dnet $(STAGING_DIR)/usr/include/
95 mkdir -p $(STAGING_DIR)/usr/lib
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdnet.{a,so*} $(STAGING_DIR)/usr/lib/
97 endef
98
99 define Build/UninstallDev
100 rm -rf \
101 $(STAGING_DIR)/usr/bin/dnet-config \
102 $(STAGING_DIR)/usr/include/dnet.h \
103 $(STAGING_DIR)/usr/include/dnet \
104 $(STAGING_DIR)/usr/lib/libdnet.{a,so*}
105 endef
106
107 $(eval $(call BuildPackage,libdnet))