ARM-linux transplant SDL

ref : https://blog.csdn.net/u012075739/article/details/24877639

 

2. cross compiler SDL     

Before compiling SDL must first compile its dependencies tslib, libiconv



 

Tslib

$ cd tslib-1.4

$ sudo apt-get install libtool automake autoconf

$ ./autogen.sh

 

$ echo "ac_cv_func_malloc_0_nonnull=yes"> arm-linux.cache

$ ./configure  --prefix=/xyq/cross_compile/SDL  --host=arm-linux  --cache-file=arm-linux.cache

$ make

$ make install

 

Libiconv

$ cd ../libiconv-1.14

$ ./configure  --prefix=/xyq/cross_compile/SDL  --host= arm-linux   --with-gnu-ld

$ make

$ make install

 

SDL 

$ cd ../SDL-1.2.14

$ ./configure --prefix=/xyq/cross_compile/SDL  --host= arm-linux   --build=i386  --with-gnu-ld   --disable-video-nanox  --disable-video-qtopia   --disable-pulseaudio   --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  CPPFLAGS="-I/xyq/cross_compile/SDL/include"   LDFLAGS="-L/xyq/cross_compile/SDL/lib -lts-liconv"

$ make

$ make install

 

3.   SDL test program cross compiler   

SDL test program in the test directory SDL source directory.

1) the test directory, execute the following configure script generated Malefile

$ ./configure --prefix=/xyq/cross_compile/SDL  --host=arm-linux NM=arm-linux-nm LD=arm-linux-ld

    CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar

  

2) Makefile default is to compile all the test program, but on the ARM, joysticks, and can not compile opengl test, remove from the Makefile TARGETS testgl, compiled testjoystick of.

      In addition, the default path to the X86 version of the test is the most simple way, you can manually modify Makefile tune into ARM version. will

       

       Read:

      

      After $ make will generate an executable file in the current directory.

 

 

4.     the SDL test procedure

     Outcomes to compile the first SDL ARM, are compiled obtained lib, bin respectively copying the ARM / usr / lib, / usr / bin. Then test the executable file copying ARM, pay attention to change the executable permission.

Note that the device must be specified MOUSE SDL runtime. As used tslib, SDL is set by using the following command tslib.

      $ export SDL_MOUSEDRV=TSLIB

    If you do not have any input device, the environment variable export SDL_NOMOUSE = 1, otherwise initialization will prompt: Could not initializeSDL: Unable to open mouse

 

Next comes testalpha with SDL SDL to test whether under tslib is working properly. Run the program, if a yellow color accurate click, the SDL represents tslib and together with the successful completion of the following are in the 320 * 240bpp = 16 Screenshot measured development board.

         

 

5. The      SDL_image Transplantation

SDL has supported itself only bmp format images, you want to use another format will use its extensive library of SDL_image, following is a compilation process:

$ cd ../SDL_image-1.2.8

$ ./autogen.sh

$ ./configure --prefix=/xyq/cross_compile/SDL  --host= arm-linux   –-enable-shared  --build=i386  –-enable-static  -–enable-bmp  -–enable-gif  -–enable-jpg  -–enable-png  -–enable-tif  -–enable-pnm  -–enable-xpm  –disbale-sdltest 

SDL_CFLAGS=”-I/xyq/cross_compile/SDLnclude/SDL”  

SDL_LIBS=”-L/xyq/cross_compile/SDL/lib -lSDL”

LIBPNG_CFLAGS="-I/xyq/cross_compile/SDL/include"  

LIBPNG_LIBS="-L/xyq/cross_compile/SDL/lib-lpng" CPPFLAGS="-I/xyq/cross_compile/SDL/include"

LDFLAGS="-L/xyq/cross_compile/SDL/lib -ljpeg-lts -liconv"

$ make

$ make install 

 

Guess you like

Origin www.cnblogs.com/schips/p/11525509.html