]>
git.saurik.com Git - cycript.git/blob - apple-configure.sh
3 # Cycript - Optimizing JavaScript Compiler/Runtime
4 # Copyright (C) 2009-2015 Jay Freeman (saurik)
6 # GNU Affero General Public License, Version 3 {{{
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Affero General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU Affero General Public License for more details.
18 # You should have received a copy of the GNU Affero General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 if ! which aclocal
; then
28 if ! which autoconf
; then
29 touch configure.ac
; fi
30 if ! which automake
; then
32 if ! which autoheader
; then
39 xcodebuild
-sdk "$1" -version Path
42 xcs
=$(xcode-select --print-path)
45 function configure
() {
56 set -- "$@" --enable-static --with-pic
58 cc
=$(xcrun --sdk "${sdk}" -f clang)
59 cxx
=$(xcrun --sdk "${sdk}" -f clang++)
61 flg
="-arch ${arc} ${min}"
62 flg
+=" -isysroot $(path "${sdk}")"
69 cpf
+=" -I../libffi.${arch}/include"
70 ldf
+=" -L../libffi.${arch}/.libs"
73 cpf
+=" -I../libuv/include"
74 ldf
+=" -L../libuv.${arch}/.libs"
76 ..
/configure
--enable-maintainer-mode "${flags[@]}" --prefix="/usr" "$@" \
77 CC
="${cc} ${flg}" CXX
="${cxx} ${flg}" OBJCXX
="${cxx} ${flg}" \
78 CFLAGS
="${ccf[*]}" CXXFLAGS
="${ccf[*]}" OBJCXXFLAGS
="${ccf[*]} ${obc}" \
79 CPPFLAGS
="${cpf}" LDFLAGS
="${ldf}"
84 for arch
in i386 x86_64
; do
85 configure
"osx-${arch}" "${mac}" "${arch}" "-mmacosx-version-min=10.6" \
86 false
"-I../readline.osx" "-L../readline.osx" ""
89 for arch
in i386 x86_64
; do
90 configure
"sim-${arch}" iphonesimulator
"${arch}" "-mios-simulator-version-min=4.0" \
91 true
"" "" "-fobjc-abi-version=2 -fobjc-legacy-dispatch" \
95 for arch
in armv6 armv7 armv7s arm64
; do
100 if [[ ${arch} != armv6
]]; then
101 flg
+=(--disable-console)
103 flg
+=(LTLIBGCC
="-lgcc_s.1")
104 cpf
+=" -include ${PWD}/xcode.h"
105 cpf
+=" -mllvm -arm-reserve-r9"
106 cpf
+=" -I../sysroot.ios/usr/include"
107 ldf
+=" -L../sysroot.ios/usr/lib"
110 if [[ ${arch} == arm64
]]; then
114 ldf
+=" -Wl,-segalign,4000"
118 configure
"ios-${arch}" iphoneos
"${arch}" "-miphoneos-version-min=${min}" \
119 true
"${cpf[*]}" "${ldf[*]}" "" \
120 --host=arm
-apple-darwin10 LFLAGS
="--ecs --meta-ecs" "${flg[@]}"