]> git.saurik.com Git - ldid.git/blobdiff - make.sh
Fix regression on FAT files (from 64-bit support).
[ldid.git] / make.sh
diff --git a/make.sh b/make.sh
index 404c3d2ad31789c8e3146a08268435528b344331..9c5361b087a310b3421fa95f86422814570faffa 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -10,16 +10,30 @@ else
     shift
 fi
 
+export DEVELOPER_DIR=/Applications/Xcode-5.1.1.app
+
+os=()
+
 if "${ios}"; then
 
 out=ios
-sudo xcode-select --switch /Applications/Xcode-4.6.3.app
-flags=(cycc -- -miphoneos-version-min=2.0 -arch armv6)
+flags=(cycc -- -miphoneos-version-min=2.0 -arch armv6 -arch arm64)
+
+flags+=(-Xarch_armv6 -Isysroot32/usr/include)
+flags+=(-Xarch_arm64 -Isysroot64/usr/include)
+
+flags+=(-Xarch_armv6 -Lsysroot32/usr/lib)
+flags+=(-Xarch_arm64 -Lsysroot64/usr/lib)
+
+static=false
+flags+=(-framework CoreFoundation)
+
+flags+=(-lplist)
+flags+=(-lcrypto)
 
 else
 
 out=out
-sudo xcode-select --switch /Applications/Xcode-5.1.1.app
 
 if which xcrun &>/dev/null; then
     flags=(xcrun -sdk macosx g++)
@@ -32,20 +46,26 @@ else
     flags=(g++)
 fi
 
+#flags+=(-L../../lib-osx/openssl)
+
+# XXX: cannot redistribute
+static=true
+flags+=(-Isysroot64/usr/include)
+flags+=(-lcrypto)
+#flags+=(-Wl,/usr/lib/libcrypto.42.dylib)
+
 fi
 
 sdk=$(xcodebuild -sdk iphoneos -version Path)
 
 flags+=(-I.)
+
+if ${static}; then
+
 flags+=(-I"${sdk}"/usr/include/libxml2)
 flags+=(-Ilibplist/include)
 flags+=(-Ilibplist/libcnary/include)
 
-flags+=("$@")
-
-mkdir -p "${out}"
-os=()
-
 for c in libplist/libcnary/!(cnary).c libplist/src/*.c; do
     o=${c%.c}.o
     o="${out}"/${o##*/}
@@ -55,12 +75,15 @@ for c in libplist/libcnary/!(cnary).c libplist/src/*.c; do
     fi
 done
 
-set -x
+fi
+
+flags+=("$@")
 
-plist=(-Llibplist/src/.libs -lplist)
+mkdir -p "${out}"
+set -x
 
-"${flags[@]}" -c -std=c++11 -o "${out}"/ldid.o ldid.cpp
-"${flags[@]}" -o "${out}"/ldid "${out}"/ldid.o "${os[@]}" -x c lookup2.c -lxml2 -lcrypto "${plist[@]}"
+"${flags[@]}" -O3 -g0 -c -std=c++11 -o "${out}"/ldid.o ldid.cpp
+"${flags[@]}" -O3 -g0 -o "${out}"/ldid "${out}"/ldid.o "${os[@]}" -x c lookup2.c -lxml2 -framework Security
 
 if ! "${ios}"; then
     ln -sf out/ldid .