From 9d13f949e19c9abd5500fe826f33cf03f0b7eb0b Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 20 May 2011 06:58:58 +0000 Subject: [PATCH] Add initial support for -arch armv6. --- GNUmakefile.in | 5 +++-- configure | 9 +++++---- configure.ac | 5 +++-- ios.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 8 deletions(-) create mode 100755 ios.sh diff --git a/GNUmakefile.in b/GNUmakefile.in index 7bb0164..913e229 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -18,6 +18,7 @@ objcxx := @OBJCXX@ cflags := @CPPFLAGS@ @CXXFLAGS@ -DYYDEBUG=1 $(filter -DHAVE_FFI% -DHAVE_READLINE% -DHAVE_HISTORY_H,@DEFS@) objcxxflags := @OBJCXXFLAGS@ ldflags := @LDFLAGS@ +ltflags := @LTFLAGS@ library := @LIBS@ @LTLIBAPR@ @LTLIBICONV@ sed := @SED@ bison := @BISON@ @@ -232,11 +233,11 @@ lex.cy.lo: lex.cy.c $(header) $(libtool) --mode=compile $(objcxx) $(objcxxflags) $(cflags) -c -o $@ $< libcycript.la: $(code) - $(libtool) --mode=link $(cxx) $(ldflags) -o $@ $(filter %.lo,$^) $(library) $(link) -rpath $(libdir) + $(libtool) --mode=link $(cxx) $(ltflags) $(ldflags) -o $@ $(filter %.lo,$^) $(library) $(link) -rpath $(libdir) $(ldid) $@ cycript: Console.lo libcycript.la $(inject) - $(libtool) --mode=link $(cxx) $(ldflags) -o $@ $(filter %.lo,$^) libcycript.la $(link) -rpath $(libdir) + $(libtool) --mode=link $(cxx) $(ltflags) $(ldflags) -o $@ $(filter %.lo,$^) libcycript.la $(link) -rpath $(libdir) $(entitle) cycript package: $(deb) diff --git a/configure b/configure index 8a4edc5..0a9c987 100755 --- a/configure +++ b/configure @@ -783,6 +783,7 @@ BISON TIME _BASH GMAKE +LTFLAGS ifGNUmake PKG_CONFIG CPP @@ -14463,9 +14464,9 @@ $as_echo_n "checking for universal binary support... " >&6; } apple) : case $host_cpu in #( - i386|x86_64) : + armv6|i386|x86_64) : - for cy_arch in i386 x86_64; do + for cy_arch in armv6 i386 x86_64; do cy_save_CXXFLAGS=$CXXFLAGS for element in "-arch $cy_arch"; do @@ -14625,9 +14626,9 @@ $as_echo_n "checking for universal binary support... " >&6; } apple) : case $host_cpu in #( - i386|x86_64) : + armv6|i386|x86_64) : - for cy_arch in i386 x86_64; do + for cy_arch in armv6 i386 x86_64; do cy_save_CXXFLAGS=$CXXFLAGS for element in "-arch $cy_arch"; do diff --git a/configure.ac b/configure.ac index a89979c..446e6c6 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,7 @@ LT_INIT([disable-static]) PKG_PROG_PKG_CONFIG([0.22]) CHECK_GNU_MAKE AC_SUBST([GMAKE], [$_cv_gnu_make_command]) +AC_SUBST([LTFLAGS]) AS_IF([test "x$GMAKE" = x], [AC_MSG_ERROR([You need GNU make])]) AC_PATH_PROGS([_BASH], [bash]) AS_IF([test "x$_BASH" = x], [AC_MSG_ERROR([You need GNU bash])]) @@ -59,8 +60,8 @@ AC_PROG_OBJCXX AC_DEFUN([CY_CHECK_UNIVERSAL], [ AC_MSG_CHECKING([for universal binary support]) AS_CASE([$host_vendor], [apple], [ - AS_CASE([$host_cpu], [i386|x86_64], [ - for cy_arch in i386 x86_64; do + AS_CASE([$host_cpu], [armv6|i386|x86_64], [ + for cy_arch in armv6 i386 x86_64; do cy_save_CXXFLAGS=$CXXFLAGS AC_LIB_APPENDTOVAR([CXXFLAGS], ["-arch $cy_arch"]) AC_TRY_LINK([], [], [ diff --git a/ios.sh b/ios.sh new file mode 100755 index 0000000..a308908 --- /dev/null +++ b/ios.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +mkdir -p sysroot.ios + +for deb in apr-lib_1.3.3-2 readline_6.0-7; do + deb=${deb}_iphoneos-arm.deb + #wget http://apt.saurik.com/debs/"${deb}" + tar=data.tar.lzma + ar -x "${deb}" "${tar}" + tar -C sysroot.ios -xf "${tar}" + rm -f "${tar}" +done + +dev=/Developer/Platforms/iPhoneOS.platform/Developer +export CC=${dev}/usr/bin/gcc +export CXX=${dev}/usr/bin/g++ + +flags_armv6=() +flags_armv6+=(-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk) + +flags_armv6+=(-Isysroot.ios/usr/include) +flags_armv6+=(-Lsysroot.ios/usr/lib) + +flags=() +for flag in "${flags_armv6[@]}"; do + flags+=(-Xarch_armv6 "${flag}") +done + +cflags=${flags[*]} +export CFLAGS=${cflags} +export CXXFLAGS=${cflags} + +lflags=() +for flag in "${flags[@]}"; do + lflags+=("-Xcompiler ${flag}") +done + +lflags=${lflags[*]} +export LTFLAGS=${lflags} + +./configure --prefix=/usr "$@" -- 2.47.2