[racket] compiling Racket to android and ios apps

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Feb 22 18:21:16 EST 2015

[Jens and I have traded a few more messages...]

My guess is that "/usr/bin/gcc" isn't compatible with the SDK in
"/Applications/XCode.app". Jens will adjust his path to use a more
recent gcc already installed on his machine, which I think matches the
current XCode release and probably his "/Applications/XCode.app".

Meanwhile, I'm able to build on a machine that has this older version
of the tools, including an older "/Application/XCode.app", but only by
using `--host=i386-...` and by providing a full path for the simulator
SDK (which ends in "iPhoneSimulator6.1.sdk" instead of just
"iPhoneSimulator.sdk").

At Sun, 22 Feb 2015 23:45:44 +0100, Jens Axel Søgaard wrote:
> >> I'd be interested in helping with iOS apps (writing bindings etc)
> >> provided someone
> >> solves the initial hurdle: getting Racket to cross compile to iOS and get it
> >> running on an emulator (and later an actual phone/tablet).
> >
> > I've pushed changes to make the Racket runtime system at least compile
> > as a framework for iOS (as it does already for Android). Build with
> > something like
> >
> >   ../configure --host=armv7-apple-darwin \
> >                --enable-ios=iPhoneOS \
> >                --enable-racket=racket
> >
> > or
> >
> >   ../configure --host=x86_64-apple-darwin \
> >                --enable-ios=iPhoneSimulator \
> >                --enable-racket=racket
> 
> I installed the Command Line Tools for XCode (for Mavericks).
> Then I tried using the options above for the simulator build.
> The configuration fails - I think it is using the wrong C compiler?
> 
> mba-5:src soegaard$ ./configure --host=x86_64-apple-darwin
> --enable-ios=iPhoneSimulator
> --enable-racket=/Users/soegaard/racket-from-github/racket/racket/bin/racket
> checking build system type... x86_64-apple-darwin13.4.0
> checking host system type... x86_64-apple-darwin
> checking target system type... x86_64-apple-darwin
> === Using ios SDK directory iPhoneSimulator
> === Using Racket executable
> /Users/soegaard/racket-from-github/racket/racket/bin/racket
> checking for x86_64-apple-darwin-gcc... no
> checking for gcc... gcc
> checking whether the C compiler works... no
> configure: error: in `/Users/soegaard/racket-from-github/racket/racket/src':
> configure: error: C compiler cannot create executables
> See `config.log' for more details
> 
> 
> Here is config.log
> 
> This file contains any messages produced by compilers while
> running configure, to aid debugging if configure makes a mistake.
> 
> It was created by configure, which was
> generated by GNU Autoconf 2.69.  Invocation command line was
> 
>   $ ./configure --host=x86_64-apple-darwin
> --enable-ios=iPhoneSimulator
> --enable-racket=/Users/soegaard/racket-from-github/racket/racket/bin/racket
> 
> ## --------- ##
> ## Platform. ##
> ## --------- ##
> 
> hostname = mba-5.local
> uname -m = x86_64
> uname -r = 13.4.0
> uname -s = Darwin
> uname -v = Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014;
> root:xnu-2422.115.4~1/RELEASE_X86_64
> 
> /usr/bin/uname -p = i386
> /bin/uname -X     = unknown
> 
> /bin/arch              = unknown
> /usr/bin/arch -k       = unknown
> /usr/convex/getsysinfo = unknown
> /usr/bin/hostinfo      = Mach kernel version:
> Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014;
> root:xnu-2422.115.4~1/RELEASE_X86_64
> Kernel configured for up to 4 processors.
> 2 processors are physically available.
> 4 processors are logically available.
> Processor type: i486 (Intel 80486)
> Processors active: 0 1 2 3
> Primary memory available: 4.00 gigabytes
> Default processor set: 254 tasks, 901 threads, 4 processors
> Load average: 1.77, Mach factor: 2.22
> /bin/machine           = unknown
> /usr/bin/oslevel       = unknown
> /bin/universe          = unknown
> 
> PATH: /Users/soegaard/anaconda/anaconda/bin
> PATH: /opt/local/bin
> PATH: /opt/local/sbin
> PATH: /opt/local/bin
> PATH: /opt/local/sbin
> PATH: /usr/bin
> PATH: /bin
> PATH: /usr/sbin
> PATH: /sbin
> PATH: /usr/local/bin
> PATH: /opt/X11/bin
> PATH: /Users/soegaard/racket-from-plt-git/plt/racket/bin
> PATH: /usr/texbin
> 
> 
> ## ----------- ##
> ## Core tests. ##
> ## ----------- ##
> 
> configure:2469: checking build system type
> configure:2483: result: x86_64-apple-darwin13.4.0
> configure:2503: checking host system type
> configure:2516: result: x86_64-apple-darwin
> configure:2536: checking target system type
> configure:2549: result: x86_64-apple-darwin
> configure:3280: checking for x86_64-apple-darwin-gcc
> configure:3310: result: no
> configure:3320: checking for gcc
> configure:3336: found /usr/bin/gcc
> configure:3347: result: gcc
> configure:3576: checking for C compiler version
> configure:3585: gcc --version >&5
> i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
> build 5658) (LLVM build 2335.6)
> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> configure:3596: $? = 0
> configure:3585: gcc -v >&5
> Using built-in specs.
> Target: i686-apple-darwin10
> Configured with: /var/tmp/llvmgcc42/llvmgcc42-2335.6~17/src/configure
> --disable-checking --enable-werror
> --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man
> --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm-
> --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
> --with-slibdir=/usr/lib --build=i686-apple-darwin10
> --enable-llvm=/var/tmp/llvmgcc42/llvmgcc42-2335.6~17/dst-llvmCore/Developer/usr
> /local
> --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10
> --target=i686-apple-darwin10
> --with-gxx-include-dir=/usr/include/c++/4.2.1
> Thread model: posix
> gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.6)
> configure:3596: $? = 0
> configure:3585: gcc -V >&5
> llvm-gcc-4.2: argument to `-V' is missing
> configure:3596: $? = 1
> configure:3585: gcc -qversion >&5
> i686-apple-darwin10-llvm-gcc-4.2: no input files
> configure:3596: $? = 1
> configure:3616: checking whether the C compiler works
> configure:3638: gcc   -DTARGET_OS_IPHONE -arch x86_64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/D
> eveloper/SDKs/iPhoneSimulator.sdk
> -miphoneos-version-min=6.0  -arch x86_64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/D
> eveloper/SDKs/iPhoneSimulator.sdk
> -miphoneos-version-min=6.0 -liconv conftest.c  >&5
> ld: library not found for -lgcc_s.10.5
> collect2: ld returned 1 exit status
> configure:3642: $? = 1
> configure:3680: result: no
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME ""
> | #define PACKAGE_TARNAME ""
> | #define PACKAGE_VERSION ""
> | #define PACKAGE_STRING ""
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE_URL ""
> | #define USE_SINGLE_FLOATS 1
> | /* end confdefs.h.  */
> |
> | int
> | main ()
> | {
> |
> |   ;
> |   return 0;
> | }
> configure:3685: error: in
> `/Users/soegaard/racket-from-github/racket/racket/src':
> configure:3687: error: C compiler cannot create executables
> See `config.log' for more details
> 
> ## ---------------- ##
> ## Cache variables. ##
> ## ---------------- ##
> 
> ac_cv_build=x86_64-apple-darwin13.4.0
> ac_cv_env_CC_set=
> ac_cv_env_CC_value=
> ac_cv_env_CFLAGS_set=
> ac_cv_env_CFLAGS_value=
> ac_cv_env_CPPFLAGS_set=
> ac_cv_env_CPPFLAGS_value=
> ac_cv_env_CPP_set=
> ac_cv_env_CPP_value=
> ac_cv_env_LDFLAGS_set=
> ac_cv_env_LDFLAGS_value=
> ac_cv_env_LIBS_set=
> ac_cv_env_LIBS_value=
> ac_cv_env_build_alias_set=
> ac_cv_env_build_alias_value=
> ac_cv_env_host_alias_set=set
> ac_cv_env_host_alias_value=x86_64-apple-darwin
> ac_cv_env_target_alias_set=
> ac_cv_env_target_alias_value=
> ac_cv_host=x86_64-apple-darwin
> ac_cv_prog_ac_ct_CC=gcc
> ac_cv_target=x86_64-apple-darwin
> 
> ## ----------------- ##
> ## Output variables. ##
> ## ----------------- ##
> 
> AR=''
> ARFLAGS=''
> AS=''
> CC='gcc'
> CC_FOR_BUILD=''
> CFLAGS=''
> CGC='cgc'
> CGCOPTIONS=''
> CGC_CAP_INSTALLED='CGC'
> CGC_IF_NEEDED_FOR_MMM=''
> CGC_INSTALLED='cgc'
> COLLECTS_PATH='../collects'
> COMPFLAGS=''
> CONFIG_PATH='../etc'
> CPP=''
> CPPFLAGS=' -DTARGET_OS_IPHONE -arch x86_64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/D
> eveloper/SDKs/iPhoneSimulator.sdk
> -miphoneos-version-min=6.0'
> DEFS=''
> DIRCVTPOST=''
> DIRCVTPRE=''
> DLLTOOL='dlltool'
> DYN_CFLAGS=''
> ECHO_C='\c'
> ECHO_N=''
> ECHO_T=''
> EGREP=''
> EXEEXT=''
> EXE_SUFFIX=''
> EXTRA_GMP_DEP=''
> EXTRA_GMP_OBJ=''
> EXTRA_OSK_LIBS=''
> FOREIGNTARGET=''
> FOREIGN_CONVENIENCE=''
> FOREIGN_IF_USED=''
> FOREIGN_OBJSLIB=''
> FRAMEWORK_INSTALL_DIR=''
> FRAMEWORK_PREFIX=''
> FRAMEWORK_REL_INSTALL=''
> GC2OPTIONS=''
> GCDIR='gc'
> GREP=''
> ICP=''
> INCLUDEDEP='#'
> INSTALL_LIBS_ENABLE='no-install'
> INSTALL_ORIG_TREE='yes'
> INSTALL_PKGSCOPE='user'
> INSTALL_SETUP_FLAGS=''
> LDFLAGS=' -arch x86_64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/D
> eveloper/SDKs/iPhoneSimulator.sdk
> -miphoneos-version-min=6.0 -liconv'
> LIBFINISH=''
> LIBOBJS=''
> LIBRACKET_DEP=''
> LIBS=''
> LIBSFX=''
> LTA=''
> LTLIBOBJS=''
> LTO=''
> MAIN_VARIANT='3m'
> MAKE_COPYTREE='no'
> MAKE_FINISH=''
> MAKE_GRACKET=''
> MAKE_INSTALL_PKGSCOPE='preserve'
> MINGW=''
> MMM='3m'
> MMM_CAP_INSTALLED=''
> MMM_INSTALLED=''
> MRLIBINSTALL=''
> MROPTIONS=''
> MZBINTARGET='normal-bin'
> MZINSTALLBINDIR='$(bindir)'
> MZINSTALLTARGET='unix-install'
> MZLINKER=''
> MZOPTIONS=''
> NOT_MINGW=''
> NOT_OSX=''
> OBJEXT=''
> OPTIONS=''
> OSKHOME=''
> OSX=''
> OWN_LIBFFI='ON'
> PACKAGE_BUGREPORT=''
> PACKAGE_NAME=''
> PACKAGE_STRING=''
> PACKAGE_TARNAME=''
> PACKAGE_URL=''
> PACKAGE_VERSION=''
> PATH_SEPARATOR=':'
> PLAIN_CC=''
> PREFLAGS=' -DTARGET_OS_IPHONE -arch x86_64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/D
> eveloper/SDKs/iPhoneSimulator.sdk
> -miphoneos-version-min=6.0'
> PROFFLAGS=''
> PWD='pwd'
> RANLIB=''
> REZ=''
> RUN_RACKET_CGC=''
> RUN_RACKET_MAIN_VARIANT=''
> RUN_RACKET_MMM=''
> SED=''
> SHELL='/bin/sh'
> SO_SUFFIX='.so'
> STATIC_AR=''
> STRIP=''
> STRIP_DEBUG=':'
> USE_WXPRECOMP=''
> WINDRES='windres'
> WXLIBS=''
> WXPRECOMP=''
> WXVARIANT='wx_xt'
> WX_MMD_FLAG=''
> XFORMFLAGS=''
> X_CFLAGS=''
> X_EXTRA_LIBS=''
> X_LIBS=''
> X_PRE_LIBS=''
> ac_ct_CC='gcc'
> appsdir='${prefix}/share/applications'
> appsdir='${prefix}/share/applications'
> bindir='${prefix}/bin'
> build='x86_64-apple-darwin13.4.0'
> build_alias=''
> build_cpu='x86_64'
> build_os='darwin13.4.0'
> build_vendor='apple'
> collectsdir='${prefix}/collects'
> collectsdir='${prefix}/collects'
> datadir='${datarootdir}'
> datarootdir='${prefix}/share'
> docdir='${prefix}/doc'
> etcpltdir='${prefix}/etc'
> exec_prefix='NONE'
> host='x86_64-apple-darwin'
> host_alias='x86_64-apple-darwin'
> host_cpu='x86_64'
> host_os='darwin'
> host_vendor='apple'
> htmldir='${docdir}'
> includedir='${prefix}/include'
> includepltdir='${prefix}/include'
> infodir='${datarootdir}/info'
> libdir='${exec_prefix}/lib'
> libexecdir='${exec_prefix}/libexec'
> libpltdir='${prefix}/lib'
> localedir='${datarootdir}/locale'
> localstatedir='${prefix}/var'
> mandir='${prefix}/man'
> oldincludedir='/usr/include'
> platform_ar_found=''
> prefix='/Users/soegaard/racket-from-github/racket/racket'
> program_transform_name='s,x,x,'
> psdir='${docdir}'
> sbindir='${exec_prefix}/sbin'
> sharedstatedir='${prefix}/com'
> sharepltdir='${prefix}/share'
> subdirs=''
> sysconfdir='${prefix}/etc'
> target='x86_64-apple-darwin'
> target_alias=''
> target_cpu='x86_64'
> target_os='darwin'
> target_vendor='apple'
> x_includes='NONE'
> x_libraries='NONE'
> 
> ## ----------- ##
> ## confdefs.h. ##
> ## ----------- ##
> 
> /* confdefs.h */
> #define PACKAGE_NAME ""
> #define PACKAGE_TARNAME ""
> #define PACKAGE_VERSION ""
> #define PACKAGE_STRING ""
> #define PACKAGE_BUGREPORT ""
> #define PACKAGE_URL ""
> #define USE_SINGLE_FLOATS 1
> 
> configure: exit 77
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users


Posted on the users mailing list.