From aebea5691e6b512e546a8627b3af7b8088054b5a Mon Sep 17 00:00:00 2001 From: PwnyTail Date: Mon, 6 Jul 2015 20:36:18 +0200 Subject: [PATCH 1/2] FreeBSD support --- Darwin.mak | 4 ++-- FreeBSD.mak | 6 ++++++ Makefile | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 FreeBSD.mak diff --git a/Darwin.mak b/Darwin.mak index 7e67910..9577749 100644 --- a/Darwin.mak +++ b/Darwin.mak @@ -1,6 +1,6 @@ # OS X CC = MACOSX_DEPLOYMENT_TARGET="10.3" gcc +LUA = lua LDFLAGS = -fno-common -bundle -undefined dynamic_lookup CLUA=-I/usr/local/include -LLUA=-llua - +LLUA=-l${LUA} diff --git a/FreeBSD.mak b/FreeBSD.mak new file mode 100644 index 0000000..7885ebb --- /dev/null +++ b/FreeBSD.mak @@ -0,0 +1,6 @@ +# FreeBSD +CC = clang +LDFLAGS = -fPIC -fno-common -shared +LUA = lua51 +CLUA=-I/usr/local/include -I/usr/local/include/${LUA} +LLUA=-llua-5.1 diff --git a/Makefile b/Makefile index bf45053..bc7bead 100644 --- a/Makefile +++ b/Makefile @@ -59,15 +59,15 @@ echo: test: pcap.test $(TOUT) %.test: %.lua net.so - lua $< + $(LUA) $< touch $@ %.test: %-test %.so - lua $< + $(LUA) $< touch $@ %.test: %-test net.so - lua $< + $(LUA) $< touch $@ doc: README.txt From 14af799ed62194a77520055386ccfbeb7e7b6fbf Mon Sep 17 00:00:00 2001 From: PwnyTail Date: Mon, 6 Jul 2015 20:37:38 +0200 Subject: [PATCH 2/2] update README --- README.txt | 2 +- README.txt.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index 5e8f31a..0c6dfc3 100644 --- a/README.txt +++ b/README.txt @@ -8,7 +8,7 @@ systems. The binding doesn't implement the full libpcap API, just what we've needed so far. -To build, see Makefile, it supports Linux and OS X. +To build, see Makefile, it supports FreeBSD, Linux and OS X. To decode the packets, you might want to use libnet's lua bindings, see the lua/ subdirectory of . diff --git a/README.txt.in b/README.txt.in index 72b87dc..c1e0a31 100644 --- a/README.txt.in +++ b/README.txt.in @@ -8,7 +8,7 @@ systems. The binding doesn't implement the full libpcap API, just what we've needed so far. -To build, see Makefile, it supports Linux and OS X. +To build, see Makefile, it supports FreeBSD, Linux and OS X. To decode the packets, you might want to use libnet's lua bindings, see the lua/ subdirectory of .