From e092eee869ee4bb78974985321b55a3235c32b4d Mon Sep 17 00:00:00 2001 From: Jin^eLD Date: Thu, 5 Sep 2013 13:02:26 +0300 Subject: Allow to build vs nacl instead of libsodium By default libsodium is used. Only if --enable-nacl is specified, then nacl will be used instead of libsodium. Pass locations of nacl headers and libraries by using the following options: --with-nacl-headers=/home/me/somewhere/nacl-20110221/build/469/include/amd64/ --with-nacl-libs=/home/me/somewhere/nacl-20110221/build/469/lib/amd64/ --- toxcore/DHT.c | 4 ++++ toxcore/LAN_discovery.c | 4 ++++ toxcore/Lossless_UDP.c | 4 ++++ toxcore/Makefile.inc | 7 +++++-- toxcore/Messenger.c | 4 ++++ toxcore/friend_requests.c | 4 ++++ toxcore/net_crypto.c | 4 ++++ toxcore/network.c | 4 ++++ toxcore/network.h | 2 -- toxcore/ping.c | 4 ++++ toxcore/tox.c | 4 ++++ toxcore/util.c | 4 ++++ 12 files changed, 45 insertions(+), 4 deletions(-) (limited to 'toxcore') diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 4807c369..e2d91256 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c @@ -23,6 +23,10 @@ /*----------------------------------------------------------------------------------*/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "DHT.h" #include "ping.h" #include "misc_tools.h" diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index 06e5a677..1980cd93 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c @@ -21,6 +21,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "LAN_discovery.h" #define MAX_INTERFACES 16 diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c index 3858716d..fbb473e7 100644 --- a/toxcore/Lossless_UDP.c +++ b/toxcore/Lossless_UDP.c @@ -26,6 +26,10 @@ * There are a couple of useless variables to get rid of. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "Lossless_UDP.h" diff --git a/toxcore/Makefile.inc b/toxcore/Makefile.inc index 23584953..5a9002ef 100644 --- a/toxcore/Makefile.inc +++ b/toxcore/Makefile.inc @@ -29,10 +29,13 @@ libtoxcore_la_SOURCES = ../toxcore/DHT.h \ libtoxcore_la_CFLAGS = -I$(top_srcdir) \ -I$(top_srcdir)/toxcore \ - $(LIBSODIUM_CFLAGS) + $(LIBSODIUM_CFLAGS) \ + $(NACL_CFLAGS) libtoxcore_la_LDFLAGS = $(EXTRA_LT_LDFLAGS) \ $(LIBSODIUM_LDFLAGS) \ + $(NACL_LDFLAGS) \ $(WINSOCK2_LIBS) -libtoxcore_la_LIBS = $(LIBSODIUM_LIBS) +libtoxcore_la_LIBS = $(LIBSODIUM_LIBS) \ + $(NAC_LIBS) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 846bed6d..6550b540 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -21,6 +21,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "Messenger.h" #define MIN(a,b) (((a)<(b))?(a):(b)) diff --git a/toxcore/friend_requests.c b/toxcore/friend_requests.c index 6e98f18b..b01015c4 100644 --- a/toxcore/friend_requests.c +++ b/toxcore/friend_requests.c @@ -21,6 +21,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "friend_requests.h" /* Try to send a friend request to peer with public_key. diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index b20917cf..a182bb53 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -24,6 +24,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "net_crypto.h" #define CONN_NO_CONNECTION 0 diff --git a/toxcore/network.c b/toxcore/network.c index 9e329949..ed3dff8a 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -21,6 +21,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "network.h" /* return current UNIX time in microseconds (us). */ diff --git a/toxcore/network.h b/toxcore/network.h index ca79a81b..2d08e88d 100644 --- a/toxcore/network.h +++ b/toxcore/network.h @@ -39,8 +39,6 @@ #include #include -#undef VANILLA_NACL /* Make sure on Windows we use libsodium. */ - #else // Linux includes #include diff --git a/toxcore/ping.c b/toxcore/ping.c index db7333d3..3b39d911 100644 --- a/toxcore/ping.c +++ b/toxcore/ping.c @@ -5,6 +5,10 @@ * Copyright 2013 plutooo */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include diff --git a/toxcore/tox.c b/toxcore/tox.c index e55f51ca..0af07ede 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -21,6 +21,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "Messenger.h" /* * returns a FRIEND_ADDRESS_SIZE byte address to give to others. diff --git a/toxcore/util.c b/toxcore/util.c index 59609340..1728ea21 100644 --- a/toxcore/util.c +++ b/toxcore/util.c @@ -5,6 +5,10 @@ * Copyright 2013 plutooo */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include -- cgit v1.2.3