]> git.saurik.com Git - veency.git/commitdiff
Use an embedded copy of libjpeg to support ARM64.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 27 Jan 2014 01:26:47 +0000 (17:26 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 27 Jan 2014 01:26:47 +0000 (17:26 -0800)
.gitignore
libjpeg.sh [new file with mode: 0644]
libvncserver.sh
makefile

index d4d0aba34fceb2c2d1ce623efc332566b3e11072..2d24ca800fb99733f43aa2a4db0d70f531b28c21 100644 (file)
@@ -2,4 +2,6 @@ obj
 *.deb
 .theos
 _
 *.deb
 .theos
 _
+jpeg-9a
+libjpeg.arm*
 libvncserver.arm*
 libvncserver.arm*
diff --git a/libjpeg.sh b/libjpeg.sh
new file mode 100644 (file)
index 0000000..e69de29
index 79dd1f1f4da8cf749e3d85a9fc2e204168603a5f..30fd658375555c516948eeecaad4cff3ce29bec5 100755 (executable)
@@ -29,11 +29,14 @@ function arch() {
     local min=$5
     shift 5
 
     local min=$5
     shift 5
 
+    rm -rf "libjpeg.${arch}"
     rm -rf "libvncserver.${arch}"
     rm -rf "libvncserver.${arch}"
+
     if ! isysroot=$(xcodebuild -sdk "${sdk}" -version Path); then
         return
     fi
 
     if ! isysroot=$(xcodebuild -sdk "${sdk}" -version Path); then
         return
     fi
 
+    mkdir "libjpeg.${arch}"
     mkdir "libvncserver.${arch}"
 
     flags=()
     mkdir "libvncserver.${arch}"
 
     flags=()
@@ -46,8 +49,26 @@ function arch() {
         flags+=(-mthumb)
     fi
 
         flags+=(-mthumb)
     fi
 
+    cpp="$*"
+
+    function configure() {
+        code=$1
+        shift
+        CC="clang -arch ${arch}" CXX="clang++ -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} ${cpp}" ../"${code}"/configure --host="${host}" --disable-shared "$@"
+    }
+
+    cd "libjpeg.${arch}"
+    configure jpeg-9a
+    make
+    cd ..
+
+    flags+=(-I"${PWD}/jpeg-9a")
+
+    jpeg=${PWD}/libjpeg.${arch}
+    flags+=(-I"${jpeg}")
+
     cd "libvncserver.${arch}"
     cd "libvncserver.${arch}"
-    CC="clang -arch ${arch}" CXX="clang++ -arch ${arch}" CFLAGS="${flags[*]}" CPPFLAGS="${flags[*]} $*" ../libvncserver/configure --host="${host}" --disable-shared
+    configure libvncserver JPEG_LDFLAGS="-L${jpeg}/.libs -ljpeg"
     make
     cd ..
 }
     make
     cd ..
 }
index 42dde6edd1dd3bbf994c42881a3194bc9c528ad7..ff6cd4346d6a3020760a168357603b6a24458eb2 100644 (file)
--- a/makefile
+++ b/makefile
@@ -27,7 +27,13 @@ ADDITIONAL_CFLAGS += -fvisibility=hidden
 
 ADDITIONAL_LDFLAGS += -Xarch_armv6 -Llibvncserver.armv6/libvncserver/.libs
 ADDITIONAL_LDFLAGS += -Xarch_arm64 -Llibvncserver.arm64/libvncserver/.libs
 
 ADDITIONAL_LDFLAGS += -Xarch_armv6 -Llibvncserver.armv6/libvncserver/.libs
 ADDITIONAL_LDFLAGS += -Xarch_arm64 -Llibvncserver.arm64/libvncserver/.libs
-ADDITIONAL_LDFLAGS += -lvncserver -lz
+ADDITIONAL_LDFLAGS += -lvncserver
+
+ADDITIONAL_LDFLAGS += -Xarch_armv6 -Llibjpeg.armv6/.libs
+ADDITIONAL_LDFLAGS += -Xarch_arm64 -Llibjpeg.arm64/.libs
+ADDITIONAL_LDFLAGS += -ljpeg
+
+ADDITIONAL_LDFLAGS += -lz
 
 ADDITIONAL_LDFLAGS += -F/System/Library/PrivateFrameworks
 ADDITIONAL_LDFLAGS += -weak_reference_mismatches weak
 
 ADDITIONAL_LDFLAGS += -F/System/Library/PrivateFrameworks
 ADDITIONAL_LDFLAGS += -weak_reference_mismatches weak