[erlang-questions] Compiling Erlang for the iPhone
Uwe Dauernheim
uwe@REDACTED
Sun Sep 14 15:16:38 CEST 2008
Hi all,
I'd like to compile Erlang for the iPhone. Since I read in the Readme
(and could already do it myself) it is possible to compile it for Mac
OS X. So I thought compiling it for the iPhone should also be
possible. But I don't get it to work. I tried cross compiling it on my
Mac and also direct compile it on the iPhone. Neither method works.
Maybe I don't know what to change, to make it iPhone compatible. Below
you can see my testing script. Maybe someone find the missing value or
the error?
Thanks in advance.
Regards,
Uwe.
==
#!/bin/bash -x
srcfolder=~/Desktop
srcname=otp_src_R12B-4
binfolder=~/Desktop
binname=otp_bin_R12B-4
prefix=/usr/libexec/erlang
iphoneip=192.168.178.5
# Temporarily change to temp directory
pushd /tmp
# Remove old compiling tries
rm -Rf $srcname
# (Download and) unpack sourcefiles
#curl http://www.erlang.org/download/$srcname.tar.gz | tar -xz
cat $srcfolder/$srcname.tar.gz | tar -xz
# Change to source directory
cd $srcname
# Remove any "historic" files
./otp_build remove_prebuilt_files
# Configure Part
./configure --target=arm-apple-darwin --disable-hipe --disable-smp-
support --with-ssl --prefix=$prefix
make noboot
make install
# Remove unneccessary files
rm -Rf $prefix/lib/erlang/lib/cos*
rm -Rf $prefix/lib/erlang/lib/et-*
rm -Rf $prefix/lib/erlang/lib/gs-*
rm -Rf $prefix/lib/erlang/lib/megaco-*
rm -Rf $prefix/lib/erlang/lib/orber-*
rm -Rf $prefix/lib/erlang/lib/toolbar-*
# Create a compress file of the compiled binaries
tar -cf $binname.tar $prefix
gzip $binname.tar
mv $binname.tar.gz $binfolder/$binname.tar.gz
# Clean-up
rm -Rf $srcname
rm -Rf $prefix
# Go back to where we came from
popd
# Transfer to iPhone
scp $binfolder/$binname.tar.gz root@$iphoneip:/
# Decompress on iPhone
ssh root@$iphoneip "cd / ; tar -xzf $binname.tar.gz"
# Test it on the iPhone
ssh root@$iphoneip "/usr/libexec/erlang/bin/erl"
More information about the erlang-questions
mailing list