From 6485e9930260e845025709be8664e99cffdb1db9 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 16 Feb 2012 09:52:48 -0800 Subject: Autodetect whether dnet.h is provided as dumbnet.h --- lua/.gitignore | 1 + lua/Makefile | 5 +++++ lua/net.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/.gitignore b/lua/.gitignore index 2b7fc5c..8c096ef 100644 --- a/lua/.gitignore +++ b/lua/.gitignore @@ -1,6 +1,7 @@ *.so *.test _* +dnet.h recoded-*.pcap passed-*.pcap cap0.pcap diff --git a/lua/Makefile b/lua/Makefile index d37eb81..db25977 100644 --- a/lua/Makefile +++ b/lua/Makefile @@ -45,6 +45,11 @@ CC.SO := $(CC) $(COPT) $(CFLAGS) net.so: net.c libnet_decode.c net.so: LDLIBS+=$(LDDNET) $(LDLNET) net.so: CDEFS=$(DNETDEFS) $(LNETDEFS) +net.so: dnet.h + +dnet.h: + if test -e /usr/include/dumbnet.h; then echo '#include' > dnet.h; \ + else echo '#include' > dnet.h; fi TNET=$(wildcard test-*.lua) TOUT=$(TNET:.lua=.test) diff --git a/lua/net.c b/lua/net.c index 9b14897..f3510fb 100644 --- a/lua/net.c +++ b/lua/net.c @@ -32,7 +32,7 @@ THE POSSIBILITY OF SUCH DAMAGE. #include -#include +#include "dnet.h" #include "libnet_decode.h" #include -- cgit v1.2.1