]> git.saurik.com Git - veency.git/commitdiff
Use an embedded copy of libvncserver for ARM64.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 27 Jan 2014 00:22:57 +0000 (16:22 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 27 Jan 2014 00:23:59 +0000 (16:23 -0800)
.gitignore
.gitmodules [new file with mode: 0644]
Tweak.mm
control
libvncserver [new submodule]
libvncserver.sh [new file with mode: 0755]
makefile

index e512e525c85bf1231d48df0ea52e02afbed2c5a1..d4d0aba34fceb2c2d1ce623efc332566b3e11072 100644 (file)
@@ -2,3 +2,4 @@ obj
 *.deb
 .theos
 _
+libvncserver.arm*
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..7aff9c9
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "libvncserver"]
+       path = libvncserver
+       url = https://github.com/SaurikIT/libvncserver.git
index a25550390a8157d8b0352b2e4be0668c06327924..0d49df74b63910e8bfcdb8faa57da17a17112497 100644 (file)
--- a/Tweak.mm
+++ b/Tweak.mm
@@ -105,7 +105,7 @@ extern "C" void CoreSurfaceBufferFlushProcessorCaches(CoreSurfaceBufferRef buffe
 
 typedef void *CoreSurfaceAcceleratorRef;
 
-extern "C" int CoreSurfaceAcceleratorCreate(CFAllocatorRef allocator, int type, CoreSurfaceAcceleratorRef *accel);
+extern "C" int CoreSurfaceAcceleratorCreate(CFAllocatorRef allocator, void *type, CoreSurfaceAcceleratorRef *accel);
 extern "C" unsigned int CoreSurfaceAcceleratorTransferSurface(CoreSurfaceAcceleratorRef accelerator, CoreSurfaceBufferRef dest, CoreSurfaceBufferRef src, CFDictionaryRef options/*, void *, void *, void **/);
 
 typedef void *IOMobileFramebufferRef;
diff --git a/control b/control
index 18316b2ab68d336b2481f98b0a3f3c0cc011df38..68e03980cab6ecc1139a14be8fbb9d22eabdc71d 100644 (file)
--- a/control
+++ b/control
@@ -7,7 +7,7 @@ Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
 Description: a VNC /server/ for the iPhone
 Name: Veency
-Depends: mobilesubstrate (>= 0.9.2966-1), libvncserver, com.saurik.iphone.ske, preferenceloader, jp.ashikase.mousesupport | firmware (<< 3.0), libstatusbar | firmware (<< 4.0), firmware (<< 6.0) | ch.ringwald.springboardaccess
+Depends: mobilesubstrate (>= 0.9.2966-1), com.saurik.iphone.ske, preferenceloader, jp.ashikase.mousesupport | firmware (<< 3.0), libstatusbar | firmware (<< 4.0), firmware (<< 6.0) | ch.ringwald.springboardaccess
 Author: Jay Freeman (saurik) <saurik@saurik.com>
 Depiction: http://cydia.saurik.com/info/veency/
 Tag: purpose::daemon, role::enduser
diff --git a/libvncserver b/libvncserver
new file mode 160000 (submodule)
index 0000000..30e11cf
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 30e11cfcd39a8bf7ec3038bff6803d031a4d4dfe
diff --git a/libvncserver.sh b/libvncserver.sh
new file mode 100755 (executable)
index 0000000..70fef63
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash
+
+# Cycript - Optimizing JavaScript Compiler/Runtime
+# Copyright (C) 2009-2013  Jay Freeman (saurik)
+
+# GNU General Public License, Version 3 {{{
+#
+# Cycript is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation, either version 3 of the License,
+# or (at your option) any later version.
+#
+# Cycript is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Cycript.  If not, see <http://www.gnu.org/licenses/>.
+# }}}
+
+set -e
+
+archs=()
+function arch() {
+    local arch=$1
+    local host=$2
+    local sdk=$3
+    local os=$4
+    local min=$5
+    shift 5
+
+    rm -rf "libvncserver.${arch}"
+    if ! isysroot=$(xcodebuild -sdk "${sdk}" -version Path); then
+        return
+    fi
+
+    archs+=("${arch}")
+    mkdir "libvncserver.${arch}"
+
+    flags=()
+    flags+=(-isysroot "${isysroot}")
+    flags+=(-m${os}-version-min="${min}")
+    flags+=(-O3 -g3)
+    flags+=(-fvisibility=hidden)
+
+    if [[ ${arch} == arm* && ${arch} != arm64 ]]; then
+        flags+=(-mthumb)
+    fi
+
+    cd "libvncserver.${arch}"
+    CC="clang -arch ${arch}" CXX="clang++ -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} $*" ../libvncserver/configure --host="${host}" --disable-shared
+    make
+    cd ..
+}
+
+arch armv6 arm-apple-darwin10 iphoneos iphoneos 2.0 -mllvm -arm-reserve-r9
+arch arm64 aarch64-apple-darwin11 iphoneos iphoneos 2.0
+
+libvncserver=()
+for arch in "${archs[@]}"; do
+    libvncserver+=(libvncserver."${arch}"/.libs/libvncserver.a)
+done
+
+lipo -create -output libvncserver.a "${libvncserver[@]}"
index d7852c1585436960355368f150ffe4fc85cacdaa..42dde6edd1dd3bbf994c42881a3194bc9c528ad7 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,5 +1,5 @@
 TARGET := iphone:7.0:2.0
-ARCHS := armv6 #arm64
+ARCHS := armv6 arm64
 PACKAGE_VERSION := $(shell ./version.sh)
 
 include theos/makefiles/common.mk
@@ -17,12 +17,18 @@ Veency_FRAMEWORKS += UIKit
 ADDITIONAL_OBJCFLAGS += -Wno-gnu
 ADDITIONAL_OBJCFLAGS += -Wno-dangling-else
 
-ADDITIONAL_OBJCFLAGS += -Isysroot/usr/include
 ADDITIONAL_OBJCFLAGS += -idirafter .
 
+ADDITIONAL_OBJCFLAGS += -Ilibvncserver
+ADDITIONAL_OBJCFLAGS += -Xarch_armv6 -Ilibvncserver.armv6
+ADDITIONAL_OBJCFLAGS += -Xarch_arm64 -Ilibvncserver.arm64
+
 ADDITIONAL_CFLAGS += -fvisibility=hidden
 
-ADDITIONAL_LDFLAGS += -Lsysroot/usr/lib -lvncserver
+ADDITIONAL_LDFLAGS += -Xarch_armv6 -Llibvncserver.armv6/libvncserver/.libs
+ADDITIONAL_LDFLAGS += -Xarch_arm64 -Llibvncserver.arm64/libvncserver/.libs
+ADDITIONAL_LDFLAGS += -lvncserver -lz
+
 ADDITIONAL_LDFLAGS += -F/System/Library/PrivateFrameworks
 ADDITIONAL_LDFLAGS += -weak_reference_mismatches weak