#!/usr/bin/env bash
-# Cycript - Optimizing JavaScript Compiler/Runtime
-# Copyright (C) 2009-2015 Jay Freeman (saurik)
+# Cycript - The Truly Universal Scripting Language
+# Copyright (C) 2009-2016 Jay Freeman (saurik)
# GNU Affero General Public License, Version 3 {{{
#
cd "${0%%/*}"
-if ! which aclocal; then
- touch aclocal.m4; fi
-if ! which autoconf; then
- touch configure.ac; fi
-if ! which automake; then
- touch Makefile.in; fi
-if ! which autoheader; then
- touch config.h.in; fi
-
flags=("$@")
ccf=(-g0 -O3)
xcs=$(xcode-select --print-path)
mac=$(path macosx)
+xct="${xcs}/Toolchains/XcodeDefault.xctoolchain/usr/lib"
+
+system=1
function configure() {
local dir=$1
ldf+=" -L../libuv.${arch}/.libs"
../configure --enable-maintainer-mode "${flags[@]}" --prefix="/usr" "$@" \
+ --with-libclang="-rpath ${xct} ${xct}/libclang.dylib" \
CC="${cc} ${flg}" CXX="${cxx} ${flg}" OBJCXX="${cxx} ${flg}" \
CFLAGS="${ccf[*]}" CXXFLAGS="${ccf[*]}" OBJCXXFLAGS="${ccf[*]} ${obc}" \
- CPPFLAGS="${cpf}" LDFLAGS="${ldf}"
+ CPPFLAGS="${cpf}" LDFLAGS="${ldf}" CY_SYSTEM="$((1<<system++))"
cd ..
}
for arch in i386 x86_64; do
configure "osx-${arch}" "${mac}" "${arch}" "-mmacosx-version-min=10.6" \
- false "-I../readline.osx" "-L../readline.osx" ""
+ false "-I../readline.osx" "-L../readline.osx" "" \
+ --with-python=/usr/bin/python-config
done
for arch in i386 x86_64; do
ldf=""
flg=()
- if [[ ${arch} != armv6 ]]; then
+ if [[ ${arch} == arm64 ]]; then
+ cpf+=" -I../extra.${arch}"
+ cpf+=" -I../readline.${arch}"
+ ldf+=" -L../readline.${arch}"
+ elif [[ ${arch} != armv6 ]]; then
flg+=(--disable-console)
else
flg+=(LTLIBGCC="-lgcc_s.1")
ldf+=" -L../sysroot.ios/usr/lib"
fi
+ ldf+=" -Wl,-dead_strip"
+ ldf+=" -Wl,-no_dead_strip_inits_and_terms"
+
if [[ ${arch} == arm64 ]]; then
min=7.0
else