This document shows how to compile Linux tools such as SDL (Simple DirectMedia Layer), zlib, etc.
# Writed by pecker.hu@gmail.com <br/> # Date: 2010/11/02 Nanjing <br/> #! /Bin/sh </P> <p> sdl_dir = $ PWD/SDL-1.2.14 <br/> zlib_dir = $ PWD/zlib-1.2.5 <br/> libpng_dir = $ PWD/libpng-1.4.4 <br/> sdl_image_dir = $ PWD/SDL_image-1.2.10 <br/> guichan_dir = $ PWD/guichan-0.8.2 <br/> cross_compile = arm-Linux <br/> install_dir = $ PWD/install </P> <p> echo "========================================== ======== "<br/> echo" 1.sdl( Simple DirectMedia Layer) "<br/> echo" 2. zlib-1.2.5 "<br/> echo" 3. libpng-1.4.4 "<br/> echo "4. SDL_image-1.2.10 "<br/> echo" 5. guichan librarys "<br/> echo" 6. guichan example-> "<br/> echo" Q. exit menu "<br/> echo" ============================== ============ "<br/> echo" Please Select menu> "</P> <p> Read number </P> <p> case $ number in <br/> "1 ") <br/> echo "start to compile the SDL-1.2.14" <br/> Cd $ sdl_dir <br/> make distclean <br/>. /configure -- prefix = $ install_dir -- disable-video-photon -- disable-V Ideo-cocoa -- disable-video-directfb -- enable-video-fbcon -- disable-video-ps2gs-disable-video-ps3 -- disable-video-svga -- disable-video-vgl -- disable-video-wscons -- disable- video-xbios -- disable-video-gem -- disable-video-dummy -- disable-video-OpenGL -- disable-video-x11 -- disable-DGA -- disable-input-tslib -- disable-audio -- disable- CDROM -- disable-joystick -- disable-loadso -- disable-SDL-dlopen -- hos T = $ cross_compile <br/> make all <br/> make install <br/>; </P> <p> "2 ") <br/> echo "start to compile the zlib" <br/> export cc = $ CROSS_COMPILE-gcc <br/> export AR = $ CROSS_COMPILE-ar <br/> export ranlib = $ CROSS_COMPILE-ranlib <br/> Cd $ zlib_dir <br/> make distclean <br/>. /configure -- prefix = $ install_dir <br/> make all <br/> make install <br/>; </P> <p> "3 ") <br/> echo "start to compile the libpng" <br/> Cd $ libpng_di R <br/> make distclean <br/>. /configure -- prefix = $ install_dir -- enable-static -- Host = $ cross_compile cflags = "-I $ install_dir/include-L $ install_dir/lib-LZ" <br/> make all <br/> make install <br/> ;; </P> <p> "4 ") <br/> echo "start to compile the sdl_image" <br/> Cd $ sdl_image_dir <br/> make distclean <br/>. /configure -- prefix = $ install_dir -- enable-static -- Host = $ cross_compile -- disable-sdltest -- enable-BMP- -Disable-JPG -- disable-LBM -- disable-PCX -- enable-PNG -- disable-TGA -- disable-TIF -- disable-xcf -- disable-XPM -- disable-XV sdl_cflags = "- I $ install_dir/include/SDL "sdl_libs ="-L $ install_dir/lib-lsdl "cflags ="-I $ install_dir/include-L $ install_dir/lib-lpng-LZ" <br/> make all <br/> make install <br/> ;; </P> <p> "5") <br/> echo "start to compile the guichan librarys" <br/> Cd $ guichan_dir <br/> make distclea N <br/>. /configure -- prefix = $ install_dir -- Host = $ cross_compile -- enable-force-SDL -- enable-force-sdlimage cxxflags = "-I $ install_dir/include/ SDL-L $ install_dir/lib-lsdl_image-lsdl-lpng-LZ-lpthread "<br/> make all <br/> make install <br/> ;; </P> <p> "6 ") <br/> Cd $ guichan_dir/examples <br/> echo "==================== ======================== "<br/> echo" 1. sdlhelloworld "<br/> echo" 2. sdlwidgets "<br/> echo" Q. exit menu "<br/> echo" ============================== ============ "<br/> echo" Please Select menu> "<br/> Read testcasenum </P> <p> case $ testcasenum in <br/> "1 ") <br/> echo "compile guichan example: sdlhelloworld. "<br/> $ CROSS_COMPILE-g ++-static sdlhelloworld. CPP-O sdlhelloworld-I $ install_dir/include/SDL-L $ install_dir/lib-lguichan_sdl-lguichan-LSD L_image-lsdl-lpng-LZ-lpthread <br/> $ CROSS_COMPILE-strip sdlhelloworld <br/>;</P> <p> "2 ") <br/> echo "compile guichan example: sdlwidgets. "<br/> $ CROSS_COMPILE-g ++-static sdlwidgets. CPP-O sdlwidgets-I $ install_dir/include/SDL-L $ install_dir/lib-lguichan_sdl-lguichan-lsdl_image-lsdl-lpng-LZ-lpthread <br /> $ CROSS_COMPILE-strip sdlwidgets <br/> ;; <br/> esac <br/>; </P> <P> "Q") <br/> echo "Exit menu !!! "<Br/> exit 0 <br/>; <br/> esac </P> <p> exit 0 <br/>
!!! When use "-static" flag to compile the image, we shoshould include the static librarys with order.
Pecker.hu@gmail.com
Nanjing