diff options
author | hrs <hrs@FreeBSD.org> | 2013-09-04 14:12:09 +0800 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2013-09-04 14:12:09 +0800 |
commit | 527c438444bb3b04872cccbcd0aa48dce31d9f4f (patch) | |
tree | eff58704c5a28f767ec02c6ce841710bc4ce9fe7 /net/packetdrill | |
parent | fbb642874cd14a12b370ea1ae7dac263d886aaa6 (diff) | |
download | freebsd-ports-gnome-527c438444bb3b04872cccbcd0aa48dce31d9f4f.tar.gz freebsd-ports-gnome-527c438444bb3b04872cccbcd0aa48dce31d9f4f.tar.zst freebsd-ports-gnome-527c438444bb3b04872cccbcd0aa48dce31d9f4f.zip |
Fix build on 10.0 and 8.X.
Reported by: Lars Eggert, pkg-fallout
Diffstat (limited to 'net/packetdrill')
-rw-r--r-- | net/packetdrill/Makefile | 11 | ||||
-rw-r--r-- | net/packetdrill/files/patch-platforms.h | 16 | ||||
-rw-r--r-- | net/packetdrill/files/patch-symbols_freebsd.c | 22 |
3 files changed, 41 insertions, 8 deletions
diff --git a/net/packetdrill/Makefile b/net/packetdrill/Makefile index 7eac570f5eed..898f7a48523e 100644 --- a/net/packetdrill/Makefile +++ b/net/packetdrill/Makefile @@ -22,6 +22,17 @@ OPTIONS_DEFAULT=DOCS EXAMPLES .include <bsd.port.options.mk> +do-configure: + ${PRINTF} "%s\n" "#include <stdio.h>" "int main(void) {" \ + "char *p = fmemopen; char *q = open_memstream; return 0; }" \ + > ${WRKDIR}/configure.c + ${TOUCH} ${WRKSRC}/ports_config.h + cd ${WRKDIR} && \ + if ${CC} -o /dev/null configure.c > /dev/null 2>&1; then \ + ${PRINTF} "%s\n" "#define HAVE_FMEMOPEN 1" \ + "#define HAVE_OPEN_MEMSTREAM 1" > ${WRKSRC}/ports_config.h; \ + fi + pre-build: ${INSTALL_DATA} ${FILESDIR}/Makefile ${FILESDIR}/Makefile.inc ${WRKSRC} .for F in libpd packetdrill checksum_test packet_parser_test packet_to_string_test diff --git a/net/packetdrill/files/patch-platforms.h b/net/packetdrill/files/patch-platforms.h index e924d68d8b25..e1fc32610e39 100644 --- a/net/packetdrill/files/patch-platforms.h +++ b/net/packetdrill/files/patch-platforms.h @@ -1,18 +1,18 @@ ---- platforms.h.orig 2013-07-24 19:55:39.000000000 +0900 -+++ platforms.h 2013-07-24 19:56:36.000000000 +0900 -@@ -43,11 +43,15 @@ +--- platforms.h.orig 2013-07-21 04:53:41.000000000 +0900 ++++ platforms.h 2013-09-04 10:34:56.000000000 +0900 +@@ -43,12 +43,14 @@ #if defined(__FreeBSD__) -+#include <sys/param.h> ++#include <paths.h> #define USE_LIBPCAP 1 - #define TUN_PATH "/dev/tun0" +-#define TUN_PATH "/dev/tun0" ++#define TUN_PATH _PATH_DEV "tun0" #define TUN_DEV "tun0" #define HAVE_TCP_INFO 1 -+#if __FreeBSD_version > 1000028 -+#define HAVE_FMEMOPEN 1 -+#endif ++#include "ports_config.h" #include "open_memstream.h" #include "fmemopen.h" + diff --git a/net/packetdrill/files/patch-symbols_freebsd.c b/net/packetdrill/files/patch-symbols_freebsd.c new file mode 100644 index 000000000000..1226df3840e1 --- /dev/null +++ b/net/packetdrill/files/patch-symbols_freebsd.c @@ -0,0 +1,22 @@ +--- symbols_freebsd.c.orig 2013-09-04 15:08:25.000000000 +0900 ++++ symbols_freebsd.c 2013-09-04 15:08:28.000000000 +0900 +@@ -76,7 +76,9 @@ + { SO_LISTENQLEN, "SO_LISTENQLEN" }, + { SO_LISTENINCQLEN, "SO_LISTENINCQLEN" }, + { SO_SETFIB, "SO_SETFIB" }, ++#ifdef SO_USER_COOKIE + { SO_USER_COOKIE, "SO_USER_COOKIE" }, ++#endif + + /* /usr/include/netinet/tcp.h */ + { TCP_NODELAY, "TCP_NODELAY" }, +@@ -296,7 +298,9 @@ + { ENOLINK, "ENOLINK" }, + { EPROTO, "EPROTO" }, + { ENOTCAPABLE, "ENOTCAPABLE" }, ++#ifdef ECAPMODE + { ECAPMODE, "ECAPMODE" }, ++#endif + + }; + |