]>
git.saurik.com Git - cycript.git/blob - apple-configure.sh
3 # Cycript - The Truly Universal Scripting Language
4 # Copyright (C) 2009-2016 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/>.
30 xcodebuild
-sdk "$1" -version Path
33 xcs
=$(xcode-select --print-path)
35 xct
="${xcs}/Toolchains/XcodeDefault.xctoolchain/usr/lib"
39 function configure
() {
50 set -- "$@" --enable-static --with-pic
52 cc
=$(xcrun --sdk "${sdk}" -f clang)
53 cxx
=$(xcrun --sdk "${sdk}" -f clang++)
55 flg
="-arch ${arc} ${min}"
56 flg
+=" -isysroot $(path "${sdk}")"
63 cpf
+=" -I../libffi.${arch}/include"
64 ldf
+=" -L../libffi.${arch}/.libs"
67 cpf
+=" -I../libuv/include"
68 ldf
+=" -L../libuv.${arch}/.libs"
70 ..
/configure
--enable-maintainer-mode "${flags[@]}" --prefix="/usr" "$@" \
71 --with-libclang="-rpath ${xct} ${xct}/libclang.dylib" \
72 CC
="${cc} ${flg}" CXX
="${cxx} ${flg}" OBJCXX
="${cxx} ${flg}" \
73 CFLAGS
="${ccf[*]}" CXXFLAGS
="${ccf[*]}" OBJCXXFLAGS
="${ccf[*]} ${obc}" \
74 CPPFLAGS
="${cpf}" LDFLAGS
="${ldf}" CY_SYSTEM
="$((1<<system++))"
79 for arch
in i386 x86_64
; do
80 configure
"osx-${arch}" "${mac}" "${arch}" "-mmacosx-version-min=10.6" \
81 false
"-I../readline.osx" "-L../readline.osx" "" \
82 --with-python=/usr
/bin
/python
-config
85 for arch
in i386 x86_64
; do
86 configure
"sim-${arch}" iphonesimulator
"${arch}" "-mios-simulator-version-min=4.0" \
87 true
"" "" "-fobjc-abi-version=2 -fobjc-legacy-dispatch" \
91 for arch
in armv6 armv7 armv7s arm64
; do
96 if [[ ${arch} != armv6
]]; then
97 flg
+=(--disable-console)
99 flg
+=(LTLIBGCC
="-lgcc_s.1")
100 cpf
+=" -include ${PWD}/xcode.h"
101 cpf
+=" -mllvm -arm-reserve-r9"
102 cpf
+=" -I../sysroot.ios/usr/include"
103 ldf
+=" -L../sysroot.ios/usr/lib"
106 if [[ ${arch} == arm64
]]; then
110 ldf
+=" -Wl,-segalign,4000"
114 configure
"ios-${arch}" iphoneos
"${arch}" "-miphoneos-version-min=${min}" \
115 true
"${cpf[*]}" "${ldf[*]}" "" \
116 --host=arm
-apple-darwin10 LFLAGS
="--ecs --meta-ecs" "${flg[@]}"