Almost :-)
I was looking to do the same thing - thanks for the helping hand with
the script.
I tried yours - failed, the command 'lipo -info <libname>' said I had
created an i386 library. Ahhhhh I thought to meself...
So here's my build script, derived from yours:
----------------- beginning of bash script file ---------------
#!/bin/bash
MY_FLAGS="-arch armv6 -pipe -Wno-trigraphs -fpascal-strings -fasm-
blocks -O0 -Wreturn-type -Wunused-variable -fmessage-length=0 -
fvisibility=hidden -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -I/
Library/iPhone/include -isysroot /Developer/Platforms/
iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk"
export CFLAGS="$MY_FLAGS"
export CXXFLAGS="$MY_FLAGS"
export CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-
apple-darwin9-g++-4.0.1
export GXX=$CC
export CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/
cpp
export AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
export AS=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/as
export LIBTOOL=/Developer/Platforms/iPhoneOS.platform/Developer/usr/
bin/libtool
export STRIP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/
strip
export RANLIB=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/
ranlib
CONFIGURE="./configure --host=arm-apple-darwin --prefix=/usr/local/
iphone-protobuf203 --program-prefix=iphone --disable-shared --disable-
crypto-auth --without-gnutls --without-ssl --without-zlib --without-
libssh2 --disable-ipv6 --disable-manual --disable-telnet --disable-
tftp --disable-ldap --disable-file --disable-ftp"
------------------- end of bash script file -------------------
right. save that as a script file somewhere, then 'source' it into
your current shell.
then you do something like this:
$ source <location of that script>
$ $CONFIGURE
$ make install-exec
and your done. I reckon your problem was that you'd CONFIGURED
properly, but since you hadn't exported the env vars for C and CXX
settings, the compile took place as normal.