1. Get the sources ! Get the zbar library from sourceforge (I got zbar-0.8) Get jpeg library source from http://www.ijg.org/ (I got jpegsrc.v7.tar.gz) Get ImageMagick source from http://www.imagemagick.org (I got ImageMagick-6.5.4-3) 2. Extract the files Extract all sources in the directory of your choice. 3. Build jpeg library I use to create a file named "configure_environ" which contains environment variable needed to build a library. Here is this file : export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer export SDKROOT=$DEVROOT/SDKs/iPhoneOS3.0.sdk export PPREFIX=/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os export CC=$DEVROOT/usr/bin/gcc export LD=$DEVROOT/usr/bin/ld export CPP=$DEVROOT/usr/bin/cpp export CXX=$DEVROOT/usr/bin/g++ export AR=$DEVROOT/usr/bin/ar export AS=$DEVROOT/usr/bin/as export NM=$DEVROOT/usr/bin/nm export CXXCPP=$DEVROOT/usr/bin/cpp export LDFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -L$PPREFIX/lib" export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$PPREFIX/include" export CXXFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -I$PPREFIX/include/" Source this file : . compile_environ Run the following configure: ./configure --host=arm-apple-darwin9 --prefix=/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/ --enable-shared=no make and then make install ! 4. Build ImageMagick library the 'configure_environ file is the same as jpeg library To use ZBar library, I only needed jpeg support so in the configure line, a lot of options are disabled: ./configure --host=arm-apple-darwin9 --prefix=/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/ --without-x --without-gs-font-dir--without-perl --without-zlib --disable-largefile --without-bzlib --without-djvu --without-fpx --without-rsvg --without-openexr --without-gslib --without-gvc --without-wmf --enable-shared=no --with-modules=no With this, the configure step will be ok, you can check that you can use the jpeg library by reading the 'report' at the end of the configure. If you try to compile this (with 'make'), it will fails because of 'crt_externs.h' header: magick/random.c:111:25: error: crt_externs.h: No such file or directory make[1]: *** [magick/magick_libMagickCore_la-random.lo] Error 1 To get rid of this, I use this workaround ln -s /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/usr/include/crt_externs.h config/ and now, you can continue with make and make install. 5. Almost there, build Zbar library The following line should be added to configure_environ: export MAGICK_CFLAGS=-I/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/include/ImageMagick/ export MAGICK_LIBS=/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/lib/libMagick++.la Don't forget to source this new compile_environ Now the configure: ./configure --host=arm-apple-darwin9 --prefix=/Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/ --disable-video --enable-shared=no --without-qt --without-python --without-gtk --without-xv --without-xshm --with-x=no Make and make install That's all folk ! Indeed, we have at our disoposal the following that will be used as Framework in XCode : Path : /Users/olivier/Documents/IphoneDevProjects/3rdParty/iphone-os/lib File:
|