From 7393c80ae695a5ba55531390971260423aa58cfa Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Mon, 19 Dec 2016 10:07:33 -0800 Subject: [PATCH] Minor, build target updates --- Jenkinsfile | 12 ++++++------ make-linux.mk | 12 ++++++------ make-mac.mk | 32 +++++++++++++++++++------------- src/stack_drivers/lwip/lwip.cpp | 2 +- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 743f73a9..5b5a15f0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,14 +106,14 @@ parallel 'centos7': { // ------------------------------------------------------------------------------ - // ---------------------------- shared library (Linux) -------------------------- + // ---------------------------- static library (Linux) -------------------------- // ------------------------------------------------------------------------------ try { checkout scm stage('macOS shared lib') { - sh 'make linux_shared_lib SDK_PICOTCP=1 SDK_IPV4=1' + sh 'make linux_static_lib SDK_PICOTCP=1 SDK_IPV4=1' } } catch (err) { @@ -125,7 +125,7 @@ parallel 'centos7': { try { checkout scm stage('macOS shared lib') { - sh 'make linux_shared_lib SDK_PICOTCP=1 SDK_IPV6=1' + sh 'make linux_static_lib SDK_PICOTCP=1 SDK_IPV6=1' } } catch (err) { @@ -315,14 +315,14 @@ parallel 'centos7': { throw err } // ------------------------------------------------------------------------------ - // ----------------------------- shared library (macOS) ------------------------- + // ----------------------------- static library (macOS) ------------------------- // ------------------------------------------------------------------------------ try { checkout scm stage('macOS shared lib') { - sh 'make osx_shared_lib SDK_PICOTCP=1 SDK_IPV4=1' + sh 'make osx_static_lib SDK_PICOTCP=1 SDK_IPV4=1' } } catch (err) { @@ -334,7 +334,7 @@ parallel 'centos7': { try { checkout scm stage('macOS shared lib') { - sh 'make osx_shared_lib SDK_PICOTCP=1 SDK_IPV6=1' + sh 'make osx_static_lib SDK_PICOTCP=1 SDK_IPV6=1' } } catch (err) { diff --git a/make-linux.mk b/make-linux.mk index 5920cb3d..106ba9dc 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -187,18 +187,18 @@ one: $(OBJS) $(ZT1)/service/OneService.o $(ZT1)/one.o $(ZT1)/osdep/LinuxEthernet $(STRIP) $(ONE_SERVICE) cp $(ONE_SERVICE) $(INT)/docker/docker_demo/$(ONE_SERVICE_NAME) - # --------------------------------------- - # --------------- Intercept ------------- - # --------------------------------------- +# --------------------------------------- +# --------------- Intercept ------------- +# --------------------------------------- # Build only the intercept library linux_intercept: # Use gcc not clang to build standalone intercept library since gcc is typically used for libc and we want to ensure maximal ABI compatibility gcc $(DEFS) $(INCLUDES) -g -O2 -Wall -std=c99 -fPIC -DVERBOSE -D_GNU_SOURCE -DSDK_INTERCEPT -nostdlib -nostdlib -shared -o $(SDK_INTERCEPT) $(SDK_INTERCEPT_C_FILES) -ldl - # --------------------------------------- - # ----- Service Library Combinations ---- - # --------------------------------------- +# --------------------------------------- +# ----- Service Library Combinations ---- +# --------------------------------------- # Build only the SDK service ifeq ($(SDK_LWIP),1) diff --git a/make-mac.mk b/make-mac.mk index 8147e33e..63cd752b 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -184,11 +184,11 @@ one: $(OBJS) $(ZT1)/service/OneService.o $(ZT1)/one.o $(ZT1)/osdep/OSXEthernetTa ios: ios_app_framework ios_unity3d_bundle # Build all OSX targets -osx: osx_app_framework osx_unity3d_bundle osx_shared_lib osx_sdk_service osx_intercept +osx: osx_app_framework osx_unity3d_bundle osx_sdk_service osx_intercept - # --------------------------------------- - # ----------- App Frameworks ------------ - # --------------------------------------- +# --------------------------------------- +# ----------- App Frameworks ------------ +# --------------------------------------- # TODO: CHECK if XCODE TOOLS are installed # Build frameworks for application development @@ -202,9 +202,9 @@ ios_app_framework: cd $(INT)/apple/ZeroTierSDK_Apple; xcodebuild -configuration Debug -scheme ZeroTierSDK_iOS build SYMROOT="../../../$(BUILD)/ios_app_framework" cp docs/ios.md $(BUILD)/ios_app_framework/README.md - # --------------------------------------- - # ------------ Unity Bundles ------------ - # --------------------------------------- +# --------------------------------------- +# ------------ Unity Bundles ------------ +# --------------------------------------- # Build bundles for Unity integrations osx_unity3d_bundle: @@ -219,17 +219,17 @@ ios_unity3d_bundle: cd $(INT)/apple/ZeroTierSDK_Apple; xcodebuild -configuration Debug -scheme ZeroTierSDK_Unity3D_iOS build SYMROOT="../../../$(BUILD)/ios_unity3d_bundle" cp docs/ios_unity3d.md $(BUILD)/ios_unity3d_bundle/README.md - # --------------------------------------- - # --------------- Intercept ------------- - # --------------------------------------- +# --------------------------------------- +# --------------- Intercept ------------- +# --------------------------------------- osx_intercept: # Use gcc not clang to build standalone intercept library since gcc is typically used for libc and we want to ensure maximal ABI compatibility gcc $(DEFS) $(INCLUDES) -g -O2 -Wall -std=c99 -fPIC -DVERBOSE -D_GNU_SOURCE -DSDK_INTERCEPT -nostdlib -nostdlib -shared -o $(SDK_INTERCEPT) $(SDK_INTERCEPT_C_FILES) -ldl - # --------------------------------------- - # ----- Service Library Combinations ---- - # --------------------------------------- +# --------------------------------------- +# ----- Service Library Combinations ---- +# --------------------------------------- # Build only the SDK service ifeq ($(SDK_LWIP),1) @@ -245,9 +245,15 @@ endif # Build both intercept library and SDK service (separate) osx_service_and_intercept: osx_intercept osx_sdk_service +ifeq ($(SDK_LWIP),1) +osx_static_lib: lwip $(OBJS) + $(CXX) $(CXXFLAGS) $(STACK_FLAGS) $(DEFS) $(INCLUDES) $(ZTFLAGS) -DSDK_SERVICE -DSDK -DSDK_BUNDLED $(LWIP_DRIVER_FILES) $(SDK_INTERCEPT_C_FILES) $(SDK_SERVICE_CPP_FILES) src/service.cpp -c + libtool -static -o build/libzt.a lwip.o proxy.o tap.o one.o OneService.o service.o sockets.o rpc.o intercept.o OneService.o $(OBJS) +else osx_static_lib: pico $(OBJS) $(CXX) $(CXXFLAGS) $(STACK_FLAGS) $(DEFS) $(INCLUDES) $(ZTFLAGS) -DSDK_SERVICE -DSDK -DSDK_BUNDLED $(PICO_DRIVER_FILES) $(SDK_INTERCEPT_C_FILES) $(SDK_SERVICE_CPP_FILES) src/service.cpp -c libtool -static -o build/libzt.a picotcp.o proxy.o tap.o one.o OneService.o service.o sockets.o rpc.o intercept.o OneService.o $(OBJS) +endif # Builds zts_* library tests osx_static_lib_tests: diff --git a/src/stack_drivers/lwip/lwip.cpp b/src/stack_drivers/lwip/lwip.cpp index ad338705..49e91b66 100644 --- a/src/stack_drivers/lwip/lwip.cpp +++ b/src/stack_drivers/lwip/lwip.cpp @@ -107,7 +107,7 @@ namespace ZeroTier #if defined(LWIP_IPV6) #define DISCOVERY_INTERVAL 1000 - #elif + #elif defined(LWIP_IPV4) #define DISCOVERY_INTERVAL ARP_TMR_INTERVAL #endif