仙劍移植之 arm--S3C6410
平台:x86PC 機 RedHat5.5 操作系統 arm-linux-交叉編譯工具
資源介紹:解壓 sdl.tar.bz2 包後, 有 data.tar lib.tar sdlpal.tar 三個壓縮包, data.tar 是仙劍的運行資源,lib.tar 是仙劍的編譯和運行需要的庫,sdlpal.tar 是仙劍的源碼。
【嵌入式】仙劍游戲移植源碼與依賴庫源碼 下載見 http://www.linuxidc.com/Linux/2012-12/75555.htm
一、首先編譯安裝仙劍編譯和運行需要的庫
1.安裝 freetype
[root@localhost lib]# tar -zxvf freetype-2.3.11.tar.gz
[root@localhost lib]# cd freetype-2.3.11
[root@localhost freetype-2.3.11]# ./configure --host=arm-linux --prefix=$PWD/../../output/arm-linux
[root@localhost freetype-2.3.11]# make -j4
[root@localhost freetype-2.3.11]# make install
2.安裝 zlib
[root@localhost lib]# tar -zxvf zlib-1.2.3.tar.gz
[root@localhost lib]# cd zlib-1.2.3
[root@localhost zlib-1.2.3]# CC=arm-linux-gcc NM=arm-linux-nm CPP="arm-linux-gcc -E " RANLIB="arm-linux-ranlib" AR="arm-linux-ar rcv" ./configure
--shared --prefix=$PWD/../../output/arm-linux
[root@localhost zlib-1.2.3]# make -j4
[root@localhost zlib-1.2.3]# make install
3.安裝 jpegsrc.v6b
[root@localhost lib]# tar -zxvf jpegsrc.v6b.tar.gz
[root@localhost lib]# cd jpeg-6b/
[root@localhost jpeg-6b]# ./configure --host=arm-linux --prefix=$PWD/../../output/arm-linux --enable-shared
[root@localhost jpeg-6b]# vim Makefile
手工修改 Makefile ,把所有工具鏈用 arm-linux-gcc 工具鏈
23 行改為 CC= arm-linux-gcc
63 行改為 AR = arm-linux-ar rc
65 行改為 AR2= arm-linux-ranlib
[root@localhost jpeg-6b]# mkdir -p $PWD/../../output/arm-linux/man/man1
[root@localhost jpeg-6b]# make -j4
[root@localhost jpeg-6b]# make install
4.安裝 libpng-1.2.19
[root@localhost lib]# tar -jxvf libpng-1.2.19.tar.bz2
[root@localhost lib]# cd libpng-1.2.19
[root@localhost libpng-1.2.19]# export CPPFLAGS="-I/root/Desktop/sdl/output/arm-linux/include"
[root@localhost libpng-1.2.19]# export LDFLAGS="-L/root/Desktop/sdl/output/arm-linux/lib"
[root@localhost libpng-1.2.19]# ./configure --host=arm-linux --prefix=$PWD/../../output/arm-linux
[root@localhost libpng-1.2.19]# make -j4
[root@localhost libpng-1.2.19]# vim Makefile
把-L 後面的空格去掉
[root@localhost libpng-1.2.19]# make
[root@localhost libpng-1.2.19]# make install
5.安裝 libmad
[root@localhost lib]# tar -zxvf libmad-0.15.1b.tar.gz
[root@localhost lib]# cd libmad-0.15.1b
[root@localhost libmad-0.15.1b]# ./configure --host=arm-linux --prefix=$PWD/../../output/arm-linux
[root@localhost libmad-0.15.1b]# vim Makefile
手工修改 Makefile 把 129 的-fforce-mem 去掉
[root@localhost libmad-0.15.1b]# make
[root@localhost libmad-0.15.1b]# make install
6.安裝 libiconv
[root@localhost lib]# tar -zxvf libiconv-1.13.1.tar.gz
[root@localhost lib]# cd libiconv-1.13.1
[root@localhost libiconv-1.13.1]# ./configure --host=arm-linux --prefix=$PWD/../../output/arm-linux
[root@localhost libiconv-1.13.1]# vim Makefile
[root@localhost libiconv-1.13.1]# vim lib/Makefile
[root@localhost libiconv-1.13.1]# vim libcharset/Makefile
[root@localhost libiconv-1.13.1]# vim libcharset/lib/Makefile
[root@localhost libiconv-1.13.1]# vim preload/Makefile
[root@localhost libiconv-1.13.1]# vim srclib/Makefile
[root@localhost libiconv-1.13.1]# vim src/Makefile
把-L 後面的空格去掉
[root@localhost libiconv-1.13.1]# make
[root@localhost libiconv-1.13.1]# make intall
7.安裝 SDL-1.2.14
[root@localhost lib]# tar -xvzf SDL-1.2.14.tar.gz
[root@localhost lib]# cd SDL-1.2.14
[root@localhost SDL-1.2.14]# ./configure --prefix=$PWD/../../output/arm-linux --disable-video-nanox --disable-video-qtopia --disable-video-photon --disable-video-
ggi --disable-video-svga --disable-video-aalib --disable-video-dummy --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-video-x11 --disable-nasm --enable-joystick --enable-input-tslib --enable-video-fbcon --host=arm-linux --build=i386 CPPFLAGS="-I$PWD/../../output/arm-linux/include" LDFLAGS="-L$PWD/../../output/arm-linux/lib "
[root@localhost SDL-1.2.14]# make -j4
[root@localhost SDL-1.2.14]# make install
8.安裝 SDL_image
[root@localhost lib]# tar -zxvf SDL_image-1.2.8.tar.gz
[root@localhost lib]# cd SDL_image-1.2.8
[root@localhost SDL_image-1.2.8]# ./configure --enable-shared --enable-static --host=arm-linux --prefix=$PWD/../../output/arm-linux --enable-bmp --enable-gif --enable-jpg --enable-png --enable-tif --enable-pnm --enable-xpm --disable-sdltest CC=arm-linux-gcc
[root@localhost SDL_image-1.2.8]# vim Makefile
把-L 後面的空格去掉
[root@localhost SDL_image-1.2.8]# make
[root@localhost SDL_image-1.2.8]# make install
9.安裝 SDL_ttf
[root@localhost lib]# tar -zxvf SDL_ttf-2.0.9.tar.gz
[root@localhost lib]# cd SDL_ttf-2.0.9
[root@localhost SDL_ttf-2.0.9]# vim glfont.c
手工修改 glfont.c.全部清空,寫入如下
void main() {}
[root@localhost SDL_ttf-2.0.9]# ./configure --host=arm-linux --prefix=$PWD/../../output/arm-linux --enable-shared --enable-static --disable-sdltest --with-freetype-prefix=$PWD/../../output/arm-linux/ --with-sdl-prefix=$PWD/../../output/arm-linux/ CFLAG="-I$PWD/../../output/arm-
linux/include" CC=arm-linux-gcc
[root@localhost SDL_ttf-2.0.9]# vim Makefile
手工修改 Makefile
123 行去 掉-I/usr/include -DHAVE_OPENGL
143 行 改成 GL_LIBS =
266 行 glfont_LDADD = libSDL_ttf.la -lm
[root@localhost SDL_ttf-2.0.9]# make -j4
[root@localhost SDL_ttf-2.0.9]# make install
10.安裝 SDL_mixer
[root@localhost lib]# tar -zxvf SDL_mixer-1.2.9.tar.gz
[root@localhost lib]# cd SDL_mixer-1.2.9
[root@localhost lib]# ./configure --host=arm-linux --prefix=$PWD/../../output/arm-linux --enable-shared --enable-static --disable-sdltest --with-freetype-prefix=$PWD/../../output/arm-linux/ --with-sdl-prefix=$PWD/../../output/arm-linux/CFLAG="-I$PWD/../../output/arm-linux/include" LDFLAGS="-L$PWD/../../output/arm-linux/lib -lSDL -liconv -lfreetype" CC=arm-linux-gcc
[root@localhost lib]# make -j4
[root@localhost lib]# make install