On Friday 10 April 2009 23:20:12 Shaddi Hasan wrote:
> I'm trying to get pftop-0.6 to compile from source on a FreeBSD 6.0
> machine. I downloaded pftop-0.6.tar.gz from the author's website,
Okay ... I got a couple of questions about this:
1) Why? There is sysutils/pftop ready for the taking
2) Why 6.0? It's EOL'ed (esp. in the pf department)
3) Why?!?
> extracted the contents to the machine, and ran "make" as root.
> However, the build fails. The output is as follows:
> ----------------
> # make
> cc -O2 -fno-strict-aliasing -pipe -Wall -DOS_LEVEL= -c
There's your problem right there. You need to set the OS_LEVEL in the
Makefile in order to compile successfully. See the aforementioned port's
Makefile for sensible values depending on __FreeBSD_version.
> I got similar output trying to compile pftop-0.7 (the most recent
> version), as well as both packages on a FreeBSD 7.0 machine. Any
> thoughts on why the build fails?
^ ... simply use the port. Be advised, however, that the port fails to build
on recent CURRENT due to the libpcap 1.0 update - workaround patch for that
problem is attached, a proper solution should hit the tree over the weekend.
--
/"\ Best regards, | [email protected]
\ / Max Laier | ICQ #67774661
X http://pf4freebsd.love2party.net/ | mla...@efnet
/ \ ASCII Ribbon Campaign | Against HTML Mail and News
Index: Makefile
===================================================================
RCS file: /usr/store/mlaier/fcvs/ports/sysutils/pftop/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- Makefile 6 Jan 2009 17:59:29 -0000 1.14
+++ Makefile 9 Apr 2009 20:15:41 -0000
@@ -29,6 +29,12 @@
CFLAGS+= -DHAVE_ALTQ=1
.endif
+.if ${OSVERSION} >= 800074
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bpf_dump.c \
+ ${FILESDIR}/extra-patch-bpf_image.c \
+ ${FILESDIR}/extra-patch-sf-gencode.h
+.endif
+
MAKE_ENV+= __MAKE_CONF=/dev/null
PLIST_FILES= sbin/pftop
Index: files/extra-patch-bpf_dump.c
===================================================================
RCS file: files/extra-patch-bpf_dump.c
diff -N files/extra-patch-bpf_dump.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/extra-patch-bpf_dump.c 9 Apr 2009 20:02:26 -0000
@@ -0,0 +1,15 @@
+--- bpf_dump.c.orig 2007-11-07 06:34:18.000000000 +0000
++++ bpf_dump.c 2009-04-09 19:59:03.986485991 +0000
+@@ -33,10 +33,10 @@
+ #include <stdio.h>
+
+
+-extern void bpf_dump(struct bpf_program *, int);
++extern void bpf_dump(const struct bpf_program *, int);
+
+ void
+-bpf_dump(struct bpf_program *p, int option)
++bpf_dump(const struct bpf_program *p, int option)
+ {
+ struct bpf_insn *insn;
+ int i;
Index: files/extra-patch-bpf_image.c
===================================================================
RCS file: files/extra-patch-bpf_image.c
diff -N files/extra-patch-bpf_image.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/extra-patch-bpf_image.c 9 Apr 2009 20:02:57 -0000
@@ -0,0 +1,11 @@
+--- bpf_image.c.orig 2007-11-07 06:34:18.000000000 +0000
++++ bpf_image.c 2009-04-09 19:59:03.986485991 +0000
+@@ -36,7 +36,7 @@
+
+ char *
+ bpf_image(p, n)
+- struct bpf_insn *p;
++ const struct bpf_insn *p;
+ int n;
+ {
+ int v;
Index: files/extra-patch-sf-gencode.h
===================================================================
RCS file: files/extra-patch-sf-gencode.h
diff -N files/extra-patch-sf-gencode.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/extra-patch-sf-gencode.h 9 Apr 2009 20:18:09 -0000
@@ -0,0 +1,12 @@
+--- sf-gencode.h.orig 2009-04-09 20:00:14.850928399 +0000
++++ sf-gencode.h 2009-04-09 20:03:39.399099396 +0000
+@@ -188,7 +188,8 @@
+ const char *sf_get_error(void);
+ int sf_compile(struct bpf_program *, char *, int, bpf_u_int32);
+ void sf_freecode(struct bpf_program *);
+-void bpf_dump(struct bpf_program *, int);
++/* void bpf_dump(struct bpf_program *, int); */
++u_int bpf_filter(struct bpf_insn *pc, u_char *p, u_int wirelen, u_int buflen);
+
+ extern int no_optimize;
+
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-pf
To unsubscribe, send any mail to "[email protected]"