]> git.saurik.com Git - cydia.git/commitdiff
Make Cydia compile "out of the box" on Xcode 10.2.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 19 May 2019 21:40:15 +0000 (14:40 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 19 May 2019 21:40:15 +0000 (14:40 -0700)
apt32
make.sh
makefile
sysroot.sh
system.h [new file with mode: 0644]

diff --git a/apt32 b/apt32
index 9439ca0e8c0cb2523b756a4675f3fd1c69ce7eac..cd00e1829d369c12bef3ad86e5b9ac8af1c24c51 160000 (submodule)
--- a/apt32
+++ b/apt32
@@ -1 +1 @@
-Subproject commit 9439ca0e8c0cb2523b756a4675f3fd1c69ce7eac
+Subproject commit cd00e1829d369c12bef3ad86e5b9ac8af1c24c51
diff --git a/make.sh b/make.sh
index 0b27981488a85b929fbecb8d8cce645837342074..7926a00fdf22e477809ba0b17bd783ec6c15ffe4 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1,2 +1,2 @@
 #!/bin/bash
-DEVELOPER_DIR=/Applications/Xcode-5.1.1.app make "$@"
+DEVELOPER_DIR=/Applications/Xcode-5.1.1.app make "$@" do32=yes
index 4d64d5e48293df2bb0946765f16e8e462111550a..9ce7a0ccb1fbed3876123216b9f45b87d0a2d0cf 100644 (file)
--- a/makefile
+++ b/makefile
@@ -8,6 +8,7 @@ flag :=
 plus :=
 link := 
 libs := 
+lapt := 
 
 gxx := $(shell xcrun --sdk iphoneos -f g++)
 cycc := $(gxx)
@@ -19,6 +20,8 @@ cycc += -isysroot $(sdk)
 cycc += -idirafter $(mac)/usr/include
 cycc += -F$(sdk)/System/Library/PrivateFrameworks
 
+cycc += -include system.h
+
 cycc += -fmessage-length=0
 cycc += -gfull -O2
 cycc += -fvisibility=hidden
@@ -33,7 +36,10 @@ iapt += -Iapt32-deb
 iapt += -Iapt-extra
 iapt += -IObjects/apt32
 
+ifeq ($(do32),yes)
 flag += $(patsubst %,-Xarch_armv6 %,$(iapt))
+endif
+
 flag += $(patsubst %,-Xarch_arm64 %,$(subst apt32,apt64,$(iapt)))
 
 flag += -I.
@@ -70,16 +76,19 @@ libs += -framework WebKit
 libs += -framework CFNetwork
 libs += -llockdown
 
+ifeq ($(do32),yes)
 libs += -Xarch_armv6 -Wl,-force_load,Objects/libapt32.a
+lapt += Objects/libapt32.a
+endif
+
 libs += -Xarch_arm64 -Wl,-force_load,Objects/libapt64.a
+lapt += Objects/libapt64.a
 
 libs += -licucore
 
 uikit := 
 uikit += -framework UIKit
 
-link += -Xarch_armv6 -Wl,-segalign,4000
-
 dirs := Menes CyteKit Cydia SDURLCache
 
 code := $(foreach dir,$(dirs),$(wildcard $(foreach ext,h hpp c cpp m mm,$(dir)/*.$(ext))))
@@ -127,17 +136,16 @@ link += -Xarch_arm64 -Wl,-lz
 flag += -DAPT_PKG_EXPOSE_STRING_VIEW
 flag += -Dsighandler_t=sig_t
 
+ifeq ($(do32),yes)
 flag32 := 
 flag32 += -arch armv6
 flag32 += -Xarch_armv6 -miphoneos-version-min=2.0
 flag32 += -Xarch_armv6 -marm # @synchronized
 flag32 += -Xarch_armv6 -mcpu=arm1176jzf-s
 flag32 += -mllvm -arm-reserve-r9
-link += -Xarch_armv6 -Wl,-lgcc_s.1
 
-flag64 := 
-flag64 += -arch arm64
-flag64 += -Xarch_arm64 -miphoneos-version-min=7.0
+link += -Xarch_armv6 -Wl,-lgcc_s.1
+link += -Xarch_armv6 -Wl,-segalign,4000
 
 apt32 := $(cycc) $(flag32) $(flag)
 apt32 += -Wno-deprecated-register
@@ -146,6 +154,11 @@ apt32 += -Wno-tautological-compare
 apt32 += -Wno-uninitialized
 apt32 += -Wno-unused-private-field
 apt32 += -Wno-unused-variable
+endif
+
+flag64 := 
+flag64 += -arch arm64
+flag64 += -Xarch_arm64 -miphoneos-version-min=7.0
 
 apt64 := $(cycc) $(flag64) $(flag)
 apt64 += -include apt.h
@@ -161,7 +174,10 @@ eapt += -Wno-format
 eapt += -Wno-logical-op-parentheses
 iapt += $(eapt)
 
+ifeq ($(do32),yes)
 cycc += $(flag32)
+endif
+
 cycc += $(flag64)
 
 plus += -std=c++11
@@ -249,7 +265,7 @@ Objects/libapt64.a: $(libapt64)
        @echo "[arch] $@"
        @ar -rc $@ $^
 
-MobileCydia: $(object) entitlements.xml Objects/libapt32.a Objects/libapt64.a
+MobileCydia: $(object) entitlements.xml $(lapt)
        @echo "[link] $@"
        @$(cycc) -o $@ $(filter %.o,$^) $(link) $(libs) $(uikit) -Wl,-sdk_version,8.0
        @mkdir -p bins
index a124baa30d1cff189f27e032b0ca7474bfb02e97..469e14fff8dea8afb18a20cdd164a16a5a0d4d2b 100755 (executable)
@@ -107,4 +107,4 @@ wget --no-check-certificate -O CoreFoundation/CFUniChar.h "https://opensource.ap
 mkdir -p WebCore
 wget --no-check-certificate -O WebCore/WebCoreThread.h "https://opensource.apple.com/source/WebCore/WebCore-658.28/wak/WebCoreThread.h"
 
-ln -s /System/Library/Frameworks/IOKit.framework/Headers IOKit
+ln -s "$(xcodebuild -sdk macosx -version Path)"/System/Library/Frameworks/IOKit.framework/Headers IOKit
diff --git a/system.h b/system.h
new file mode 100644 (file)
index 0000000..132f524
--- /dev/null
+++ b/system.h
@@ -0,0 +1,7 @@
+#define system apl_system
+#include <stdlib.h>
+#undef system
+#ifdef __cplusplus
+extern "C"
+#endif
+int system(const char *);