Make tap build on OSX 10.9, though not in a way that is easy for users. Instead package binaries.

This commit is contained in:
Adam Ierymenko 2013-10-28 09:33:32 -04:00
parent 17778a36ba
commit 148619f0ba
68 changed files with 67 additions and 12 deletions

View File

@ -35,18 +35,18 @@ idtool: $(OBJS)
$(CXX) $(CXXFLAGS) -o zerotier-idtool idtool.cpp $(OBJS) $(LIBS)
$(STRIP) zerotier-idtool
mac-tap: FORCE
cd mac-tap/tuntap ; make tap.kext
#mac-tap: FORCE
# cd mac-tap/tuntap ; make tap.kext
install-mac-tap: FORCE
mkdir -p /Library/Application\ Support/ZeroTier/One
rm -rf /Library/Application\ Support/ZeroTier/One/tap.kext
cp -R mac-tap/tuntap/tap.kext /Library/Application\ Support/ZeroTier/One
chown -R root:wheel /Library/Application\ Support/ZeroTier/One/tap.kext
#install-mac-tap: FORCE
# mkdir -p /Library/Application\ Support/ZeroTier/One
# rm -rf /Library/Application\ Support/ZeroTier/One/tap.kext
# cp -R mac-tap/tuntap/tap.kext /Library/Application\ Support/ZeroTier/One
# chown -R root:wheel /Library/Application\ Support/ZeroTier/One/tap.kext
clean:
rm -rf *.dSYM
rm -f $(OBJS) zerotier-*
cd mac-tap/tuntap ; make clean
cd tap-mac/tuntap ; make clean
FORCE:

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>tap</string>
<key>CFBundleIdentifier</key>
<string>com.zerotier.tap</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>tap</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>20111101</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kpi.mach</key>
<string>8.0</string>
<key>com.apple.kpi.bsd</key>
<string>8.0</string>
<key>com.apple.kpi.libkern</key>
<string>8.0</string>
<key>com.apple.kpi.unsupported</key>
<string>8.0</string>
</dict>
</dict>
</plist>

Binary file not shown.

View File

@ -0,0 +1,18 @@
Building the tap for both x86_64 and i386 requires an older version of the
Xcode tools than what now ships for Mavericks (10.9). The newer version
does not support creating i386 kernel images.
These can be obtained from:
https://developer.apple.com/downloads
It requires a bit of a dance to unpack the package and obtain an unpacked
tree, but once it's there you can change the line in tap/Makefile and
build for both architectures.
This will go on until i386 is thoroughly legacy, at which point we'll
probably start just supporting x86_64. But that might be a while. We want
to support old Macs through their entire useful life.
Since this build is irritating, a pre-built copy is packaged in ext/ and
is installed by 'make install'. So users shouldn't have to build this.

View File

@ -19,7 +19,7 @@ BUNDLE_SIGNATURE = ????
BUNDLE_PACKAGETYPE = KEXT
BUNDLE_VERSION = $(TAP_KEXT_VERSION)
INCLUDE = -I.. -I/System/Library/Frameworks/Kernel.framework/Headers
INCLUDE = -I.. -I/System/Library/Frameworks/Kernel.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Kernel.framework/Headers
CFLAGS = -Wall -mkernel -force_cpusubtype_ALL \
-fno-builtin -fno-stack-protector -arch i386 -arch x86_64 \
-DKERNEL -D__APPLE__ -DKERNEL_PRIVATE -DTUNTAP_VERSION=\"$(TUNTAP_VERSION)\" \
@ -27,7 +27,9 @@ CFLAGS = -Wall -mkernel -force_cpusubtype_ALL \
CCFLAGS = $(CFLAGS)
LDFLAGS = -Wall -mkernel -nostdlib -r -lcc_kext -arch i386 -arch x86_64 -Xlinker -kext
CCP = $(shell if [ -f /usr/bin/llvm-g++ ]; then echo llvm-g++; else echo g++; fi)
#CCP = g++
CCP = $(HOME)/Code/llvm-g++-Xcode4.6.2/bin/llvm-g++
CC = gcc
all: $(KMOD_BIN) bundle

View File

@ -34,8 +34,7 @@
#define TAP_IF_COUNT 16 /* max number of tap interfaces */
// ZeroTier default MTU, see Constants.hpp
#define TAP_MTU 2800
#define TAP_MTU 4000
#define TAP_LLADDR tap_lladdr