MacOS fixes

This commit is contained in:
Luca Deri 2020-04-24 00:36:32 +02:00
parent 3c8837cfa3
commit 97c8948113
4 changed files with 241 additions and 229 deletions

View File

@ -16,6 +16,8 @@ PLATOPTS_SPARC64=-mcpu=ultrasparc -pipe -fomit-frame-pointer -ffast-math -finlin
N2N_OBJS_OPT=
LIBS_EDGE_OPT=@N2N_LIBS@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
OPENSSL_CFLAGS=$(shell pkg-config openssl; echo $$?)
ifeq ($(OPENSSL_CFLAGS), 0)
@ -75,19 +77,19 @@ tools: $(N2N_LIB)
$(MAKE) -C $@
edge: edge.c $(N2N_LIB) n2n_wire.h n2n.h Makefile
$(CC) $(CFLAGS) $< $(N2N_LIB) $(LIBS_EDGE) -o $@
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_EDGE) -o $@
supernode: sn.c $(N2N_LIB) n2n.h Makefile
$(CC) $(CFLAGS) $< $(N2N_LIB) $(LIBS_SN) -o $@
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_SN) -o $@
example_edge_embed_quick_edge_init: example_edge_embed_quick_edge_init.c $(N2N_LIB) n2n.h
$(CC) $(CFLAGS) $< $(N2N_LIB) $(LIBS_EDGE) -o $@
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_EDGE) -o $@
example_sn_embed: example_sn_embed.c $(N2N_LIB) n2n.h
$(CC) $(CFLAGS) $< $(N2N_LIB) $(LIBS_EDGE) -o $@
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_EDGE) -o $@
example_edge_embed: example_edge_embed.c $(N2N_LIB) n2n.h
$(CC) $(CFLAGS) $< $(N2N_LIB) $(LIBS_EDGE) -o $@
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_EDGE) -o $@
.c.o: n2n.h n2n_transforms.h n2n_wire.h twofish.h Makefile
$(CC) $(CFLAGS) -c $< -o $@

View File

@ -16,7 +16,6 @@ fi
AC_CHECK_LIB([crypto], [AES_cbc_encrypt])
N2N_LIBS=
if test "x$ac_cv_lib_crypto_AES_cbc_encrypt" != xyes; then
AC_MSG_RESULT(Building n2n without AES support)
else
@ -24,6 +23,15 @@ else
N2N_LIBS=-lcrypto
fi
CFLAGS="${CFLAGS} -I/usr/local/opt/openssl@1.1/include"
LDFLAGS="${LDFLAGS} -L/usr/local/opt/openssl@1.1/lib/"
AC_CHECK_LIB([crypto], [EVP_CIPHER_CTX_reset])
if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_reset" != xyes; then
echo ""
echo "You do not seem to use OpenSSL 1.1 or better. Please upgrade"
echo ""
fi
AC_CHECK_LIB([pcap], [pcap_open_live], pcap=true)
if test x$pcap != x; then
@ -64,6 +72,8 @@ fi
DATE=`date +"%Y-%m-%d"`
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(N2N_MAJOR)
AC_SUBST(N2N_MINOR)
AC_SUBST(N2N_PATCH)
@ -79,4 +89,3 @@ AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(tools/Makefile)
AC_OUTPUT

View File

@ -17,9 +17,10 @@ endif
LIBS_EDGE_OPT=@N2N_LIBS@
LIBS_EDGE+=$(LIBS_EDGE_OPT)
HEADERS=../n2n_wire.h ../n2n.h ../twofish.h ../n2n_transforms.h
CFLAGS+=-I..
CFLAGS+=-I.. @CFLAGS@
LDFLAGS+=-L..
CFLAGS+=$(DEBUG) $(OPTIMIZATION) $(WARN)
LDFLAGS=@LDFLAGS@
N2N_LIB=../libn2n.a
@ -30,10 +31,10 @@ TOOLS+=@ADDITIONAL_TOOLS@
all: $(TOOLS)
n2n-benchmark: benchmark.c $(N2N_LIB) $(HEADERS)
$(CC) $(CFLAGS) $< $(N2N_LIB) $(LIBS_EDGE) -o $@
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_EDGE) -o $@
n2n-decode: n2n_decode.c $(N2N_LIB) $(HEADERS)
$(CC) $(CFLAGS) $< $(N2N_LIB) $(LIBS_EDGE) -lpcap -o $@
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_EDGE) -lpcap -o $@
.c.o: $(HEADERS) ../Makefile Makefile
$(CC) $(CFLAGS) -c $< -o $@

View File

@ -1,5 +1,5 @@
/**
* (C) 2007-18 - ntop.org and contributors
* (C) 2007-20 - ntop.org and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by