]>
git.saurik.com Git - cycript.git/blob - xcode.sh
3 # Cycript - Optimizing JavaScript Compiler/Runtime
4 # Copyright (C) 2009-2013 Jay Freeman (saurik)
6 # GNU General Public License, Version 3 {{{
8 # Cycript is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published
10 # by the Free Software Foundation, either version 3 of the License,
11 # or (at your option) any later version.
13 # Cycript is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Cycript. If not, see <http://www.gnu.org/licenses/>.
26 if [[ ! -e readline
/libreadline.a
]]; then
28 if [[ ! -e libffi.a
]]; then
31 if ! which aclocal
; then
33 if ! which autoconf
; then
34 touch configure.ac
; fi
35 if ! which automake
; then
37 if ! which autoheader
; then
43 xcodebuild
-sdk "$1" -version Path
46 xcs
=$(xcode-select --print-path)
49 function configure
() {
55 cc
=$(xcrun --sdk "${sdk}" -f clang)
56 cxx
=$(xcrun --sdk "${sdk}" -f clang++)
57 flg
+=" -isysroot $(path "${sdk}")"
63 CC
="${cc} ${flg}" CXX
="${cxx} ${flg}" OBJCXX
="${cxx} ${flg}" \
64 ..
/configure
"${flags[@]}" --prefix="/usr" "$@"
69 for arch
in i386 x86_64
; do
70 configure
"mac-${arch}" "${mac}" "-arch ${arch} -mmacosx-version-min=10.6" \
71 CPPFLAGS
="-I../readline" LDFLAGS
="-L../readline"
80 configure
"${dir}" "${sdk}" "${flg}" "$@" --enable-static --with-pic
84 build
"sim-${arch}" iphonesimulator
"-arch ${arch} -mios-simulator-version-min=2.0" \
85 OBJCXXFLAGS
="-fobjc-abi-version=2 -fobjc-legacy-dispatch" \
86 CPPFLAGS
="-I../libffi.${arch}/include" \
91 for arch
in armv6 armv7 armv7s
; do
92 if [[ ${arch} == armv6
]]; then
97 flg
=(--disable-console)
100 build
"ios-${arch}" "${sdk}" "-arch ${arch} -miphoneos-version-min=2.0" --host=arm
-apple-darwin10 \
101 CPPFLAGS
="-I../libffi.${arch}/include -I../sysroot.ios/usr/include -I../sysroot.ios/usr/include/apr-1" \
102 LDFLAGS
="-L.. -L../sysroot.ios/usr/lib" \
103 LTLIBAPR
="../sysroot.ios/usr/lib/libapr-1.dylib" \