1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

Fix build on 10.0 and 8.X.

Reported by:	Lars Eggert, pkg-fallout
This commit is contained in:
Hiroki Sato 2013-09-04 06:12:09 +00:00
parent f2af6ec9a8
commit b59b0bed4e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=326250
3 changed files with 41 additions and 8 deletions

View File

@ -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

View File

@ -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"

View File

@ -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
};