RedHat下移植仙剑游戏到S3C6410


仙剑移植之 arm--S3C6410
平台:x86PC 机 RedHat5.5 操作系统 arm-linux-交叉编译工具

资源介绍:解压 sdl.tar.bz2 包后, 有 data.tar lib.tar sdlpal.tar 三个压缩包, data.tar 是仙剑的运行资源,lib.tar 是仙剑的编译和运行需要的库,sdlpal.tar 是仙剑的源码。

【嵌入式】仙剑游戏移植源码与依赖库源码 下载见

一、首先编译安装仙剑编译和运行需要的库
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

  • 1
  • 2
  • 下一页

相关内容