jeudi 17 décembre 2009

How to compile Axis2/C on Mac OS X Snow Leopard

- Download and extract Axis2/C 1.6 sources
- Create an installation directory
- set AXIS2C_HOME to your installation directory:
export AXIS2C_HOME=/MyInstallDir

- set CFLAGS
env CFLAGS="-O -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64" LDFLAGS="-arch i386 -arch x86_64" ./configure --disable-dependency-tracking --enable-libcurl=yes --enable-openssl=yes --prefix=${AXIS2C_HOME}

- remove any unwanted compiler flags from makefiles:
find . -name Makefile | xargs perl -pi -e 's/-Werror//g'
find . -name Makefile | xargs perl -pi -e 's/-ansi//g'
find . -name Makefile | xargs perl -pi -e 's/-Wno-long-double//g'

- modify dir_handler.c and remove const for the function file_select
- edit uuid_gen_unix.c and comment out sys/sockio.h
- edit axutil_unix.h and comment out getopt.h and the usleep prototype
- edit config.h and add a "#define HAVE_NET_IF_H 1" line.

- compile:
make && make install

You should found anything in your installation directory.

lundi 1 décembre 2008

Compile Boost for msvc 8.0 with STLport

- download bjam and boost
- modify tools\build\v2\user-config.jam:
- uncomment using msvc : 8.0 ;
- set stlport options using stlport : : STLport-5.1.6\\stlport STLport-5.1.6\\lib ;
- execute bjam msvc/variant=release/threading=multi/stdlib=stlport/link=static/runtime-link=shared stage

librairies should be available in stage\lib

vendredi 24 octobre 2008

Universal library for iPhone and Mac (or iPhone simulator)

use lipo tool to create from n architectures libraries a universal library:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo -create libcurl-iphone.a libcurl.a -output libcurl-universal.a 
this will create a file called libcurl-universal.a which can be linked against an iPhone executable or a Mac executable.
Of course it works with all architectures (ppc, 32/64 bits, etc...)

libcurl on iPhone

In Terminal:
- export CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
- export CFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk"
- export LDFLAGS="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk -Wl,-syslibroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk"
- export CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp
-./configure --host=arm-apple-darwin9 --disable-shared --without-ssl --without-ldap --without-libssh2 --disable-ldap
then modify config.h and comment #define HAVE_STRERROR_R 1
- make
should compile with curl-7.19.0

jeudi 23 octobre 2008

stlport on iPhone

Here is how i've compiled stlport 5.1.6 for iPhone:
- Copied lib/Makefiles/gmake/darwin in lib/Makefiles/gmake/iphone
- Modify lib/Makefiles/gmake/gcc.mak to add iphone compilation support with those lines:
ifeq ($(OSNAME), iphone)
OPT=-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk -Wl,-syslibroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk
CXX_VERSION := $(shell ${CXX} -dumpversion)
# TODO: ensure PANTHER's gcc compatibility...
CXX_VERSION_MAJOR := $(shell ${CXX} -dumpversion | awk 'BEGIN { FS = "."; } { print $1; }')
CXX_VERSION_MINOR := $(shell ${CXX} -dumpversion | awk 'BEGIN { FS = "."; } { print $2; }')
CXX_VERSION_PATCH := $(shell ${CXX} -dumpversion | awk 'BEGIN { FS = "."; } { print $3; }')
# This is to differentiate Apple-builded compiler from original
# compiler (it's has different behaviour)
ifneq ("$(shell ${CXX} -v 2>&1 | grep Apple)", "")

Then :
ifeq ($(OSNAME),iphone)
CXXFLAGS = -fexceptions $(OPT)

And :
# Required for correct order of static objects dtors calls:
ifneq ($(OSNAME),cygming)
ifneq ($(OSNAME),windows)
ifneq ($(OSNAME),darwin)
ifneq ($(OSNAME),iphone)
ifneq ($(CXX_VERSION_MAJOR),2)
CXXFLAGS += -fuse-cxa-atexit

- In build/lib run ./configure --target='iphone'; make -f gcc.mak install-release-static
- The lib should be in ./iphone-lib

That's should work without errors.

lundi 6 octobre 2008

OpenMAX and iPhone

ARM is providing library for OpenMAX optimized for ARM11 cpu.
You need RVDS 3.1 to compile it.

Cross Compile for iPhone (ffmpeg)

Configure commande line to Cross Compile ffmpeg for iPhone :
./configure --enable-cross-compile --cross-prefix=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ --cc=arm-apple-darwin9-gcc-4.0.1 --prefix=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk --extra-cflags="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk" --extra-ldflags="-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk -Wl,-syslibroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk" --disable-ffmpeg --disable-ffserver --disable-ffplay --arch=generic --enable-armv6 --disable-devices --enable-pthreads --disable-encoders --disable-muxers
Architecture is generic because arm does not compile (asm fail to compile).

I've made a little ffmpeg-opengl texture class to test movie as opengl texture. It works, slowly but it works.