linux build fixes
This commit is contained in:
@@ -81,20 +81,23 @@ one: $(OBJS) service/OneService.o one.o osdep/LinuxEthernetTap.o
|
|||||||
ln -sf zerotier-one zerotier-idtool
|
ln -sf zerotier-one zerotier-idtool
|
||||||
ln -sf zerotier-one zerotier-cli
|
ln -sf zerotier-one zerotier-cli
|
||||||
|
|
||||||
osx_shared_lib: $(OBJS)
|
shared_lib: $(OBJS)
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
# Need to selectively rebuild one.cpp and OneService.cpp with ZT_SERVICE_NETCON and ZT_ONE_NO_ROOT_CHECK defined, and also NetconEthernetTap
|
|
||||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -DZT_SDK -DZT_ONE_NO_ROOT_CHECK -Iext/lwip/src/include -Iext/lwip/src/include/ipv4 -Iext/lwip/src/include/ipv6 -Izerotierone/osdep -Izerotierone/node -Isrc -o build/zerotier-sdk-service $(OBJS) zerotierone/service/OneService.cpp src/SDK_EthernetTap.cpp src/SDK_Proxy.cpp zerotierone/one.cpp -x c src/SDK_RPC.c $(LDLIBS) -ldl
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) -DZT_SDK -DZT_ONE_NO_ROOT_CHECK -Iext/lwip/src/include -Iext/lwip/src/include/ipv4 -Iext/lwip/src/include/ipv6 -Izerotierone/osdep -Izerotierone/node -Isrc -o build/zerotier-sdk-service $(OBJS) zerotierone/service/OneService.cpp src/SDK_EthernetTap.cpp src/SDK_Proxy.cpp zerotierone/one.cpp -x c src/SDK_RPC.c $(LDLIBS) -ldl
|
||||||
# Build liblwip.so which must be placed in ZT home for zerotier-sdk-service to work
|
# Build liblwip.so which must be placed in ZT home for zerotier-netcon-service to work
|
||||||
make -f make-liblwip.mk
|
make -f make-liblwip.mk
|
||||||
# Use gcc not clang to build standalone intercept library since gcc is typically used for libc and we want to ensure maximal ABI compatibility
|
# Use gcc not clang to build standalone intercept library since gcc is typically used for libc and we want to ensure maximal ABI compatibility
|
||||||
cd src ; gcc $(DEFS) -O2 -Wall -std=c99 -fPIC -fno-common -dynamiclib -flat_namespace -DVERBOSE -D_GNU_SOURCE -DNETCON_INTERCEPT -I. -I../zerotierone/node -nostdlib -shared -o libztintercept.so SDK_Sockets.c SDK_Intercept.c SDK_Debug.c SDK_RPC.c -ldl
|
cd src ; gcc $(DEFS) -g -O2 -Wall -std=c99 -fPIC -DVERBOSE -D_GNU_SOURCE -DNETCON_INTERCEPT -I. -I../zerotierone/node -nostdlib -shared -o libztintercept.so SDK_Sockets.c SDK_Intercept.c SDK_Debug.c SDK_RPC.c -ldl
|
||||||
mkdir -p build/osx_shared_lib
|
mkdir -p build/linux_shared_lib
|
||||||
cp src/libztintercept.so build/osx_shared_lib/libztintercept.so
|
cp src/libztintercept.so build/linux_shared_lib/libztintercept.so
|
||||||
ln -sf zerotier-sdk-service zerotier-cli
|
ln -sf zerotier-sdk-service zerotier-cli
|
||||||
ln -sf zerotier-sdk-service zerotier-idtool
|
ln -sf zerotier-sdk-service zerotier-idtool
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
rm -rf ${GENERATED_FILES} *.so *.o netcon/*.a node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o ext/miniupnpc/*.o ext/libnatpmp/*.o $(OBJS) zerotier-one zerotier-idtool zerotier-cli zerotier-selftest zerotier-netcon-service build-* ZeroTierOneInstaller-* *.deb *.rpm .depend netcon/.depend
|
||||||
|
find netcon -type f \( -name '*.o' -o -name '*.so' -o -name '*.1.0' -o -name 'zerotier-one' -o -name 'zerotier-cli' -o -name 'zerotier-netcon-service' \) -delete
|
||||||
|
find netcon/tests/docker -name "zerotier-intercept" -type f -delete
|
||||||
|
|
||||||
rm -rf zerotier-cli zerotier-idtool
|
rm -rf zerotier-cli zerotier-idtool
|
||||||
rm -rf build/*
|
rm -rf build/*
|
||||||
find . -type f -name '*.o' -delete
|
find . -type f -name '*.o' -delete
|
||||||
@@ -105,13 +108,3 @@ clean:
|
|||||||
rm -rf integrations/Android/proj/.gradle
|
rm -rf integrations/Android/proj/.gradle
|
||||||
rm -rf integrations/Android/proj/.idea
|
rm -rf integrations/Android/proj/.idea
|
||||||
rm -rf integrations/Android/proj/build
|
rm -rf integrations/Android/proj/build
|
||||||
|
|
||||||
clean: FORCE
|
|
||||||
rm -rf ${GENERATED_FILES} *.so *.o netcon/*.a node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/lz4/*.o ext/json-parser/*.o ext/miniupnpc/*.o ext/libnatpmp/*.o $(OBJS) zerotier-one zerotier-idtool zerotier-cli zerotier-selftest zerotier-netcon-service build-* ZeroTierOneInstaller-* *.deb *.rpm .depend netcon/.depend
|
|
||||||
find netcon -type f \( -name '*.o' -o -name '*.so' -o -name '*.1.0' -o -name 'zerotier-one' -o -name 'zerotier-cli' -o -name 'zerotier-netcon-service' \) -delete
|
|
||||||
find netcon/tests/docker -name "zerotier-intercept" -type f -delete
|
|
||||||
|
|
||||||
# Includes 'doc' target
|
|
||||||
include ${DOC_DIR}/module.mk
|
|
||||||
|
|
||||||
FORCE:
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#define _ZT_SDK_H 1
|
#define _ZT_SDK_H 1
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include "SDK_Signatures.h"
|
#include "SDK_Signatures.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -75,15 +76,13 @@ ssize_t zt_recvmsg(RECVMSG_SIG);
|
|||||||
ssize_t zt_recv(int fd, void *buf, int len);
|
ssize_t zt_recv(int fd, void *buf, int len);
|
||||||
ssize_t zt_send(int fd, void *buf, int len);
|
ssize_t zt_send(int fd, void *buf, int len);
|
||||||
int zt_set_nonblock(int fd);
|
int zt_set_nonblock(int fd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int zt_socket(SOCKET_SIG);
|
int zt_socket(SOCKET_SIG);
|
||||||
int zt_connect(CONNECT_SIG);
|
int zt_connect(CONNECT_SIG);
|
||||||
int zt_bind(BIND_SIG);
|
int zt_bind(BIND_SIG);
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
int zt_accept4(ACCEPT_SIG);
|
int zt_accept4(ACCEPT4_SIG);
|
||||||
#endif
|
#endif
|
||||||
int zt_accept(ACCEPT_SIG);
|
int zt_accept(ACCEPT_SIG);
|
||||||
int zt_listen(LISTEN_SIG);
|
int zt_listen(LISTEN_SIG);
|
||||||
|
|||||||
@@ -449,7 +449,7 @@ const char *get_netpath() {
|
|||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
// int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags
|
// int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags
|
||||||
|
|
||||||
#if defined(__linux)
|
#if defined(__linux__)
|
||||||
int zt_accept4(ACCEPT4_SIG)
|
int zt_accept4(ACCEPT4_SIG)
|
||||||
{
|
{
|
||||||
dwr(MSG_DEBUG,"zt_accept4(%d):\n", sockfd);
|
dwr(MSG_DEBUG,"zt_accept4(%d):\n", sockfd);
|
||||||
|
|||||||
Reference in New Issue
Block a user