summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2019-05-19 14:40:15 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2019-05-19 14:40:15 -0700
commit533d9675271212f948b4284471b7be15d3a56d99 (patch)
tree1e0431bc61be7be56f442c54634a746b203eb6d4
parent34424c32c60c9f4ccbcce02e948da87045c1cc8c (diff)
Make Cydia compile "out of the box" on Xcode 10.2.
m---------apt320
-rwxr-xr-xmake.sh2
-rw-r--r--makefile30
-rwxr-xr-xsysroot.sh2
-rw-r--r--system.h7
5 files changed, 32 insertions, 9 deletions
diff --git a/apt32 b/apt32
-Subproject 9439ca0e8c0cb2523b756a4675f3fd1c69ce7ea
+Subproject cd00e1829d369c12bef3ad86e5b9ac8af1c24c5
diff --git a/make.sh b/make.sh
index 0b27981..7926a00 100755
--- 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
diff --git a/makefile b/makefile
index 4d64d5e..9ce7a0c 100644
--- 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
diff --git a/sysroot.sh b/sysroot.sh
index a124baa..469e14f 100755
--- a/sysroot.sh
+++ b/sysroot.sh
@@ -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
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 *);