Cross-Compiling LibSDL for mips platform

Hi All,

I was trying to compile libSDL-1.2.14 for my mips platform.
But it was not successful.

These were the steps that I tried out :

  1. export PATH=/opt/mips-4.3/bin:$PATH
  2. Went inside the libSDL-1.2.14 source folder.
  3. Gave a “./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu”
  4. Executed the “make” command

This was the error received :

cc1: warning: include location “/usr/include” is unsafe for cross-compilation
./src/audio/dma/SDL_dmaaudio.c: In function ‘DMA_WaitAudio’:
./src/audio/dma/SDL_dmaaudio.c:167: error: can’t find a register in class ‘COP3_REGS’ while reloading ‘asm’
./src/audio/dma/SDL_dmaaudio.c:167: error: ‘asm’ operand has impossible constraints
make: *** [build/SDL_dmaaudio.lo] Error 1

But then i reconfigured the make file by giving the following commands :

  1. make clean
  2. ./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu CPPFLAGS=-I/opt/mips-4.3/mips-linux-gnu/libc/usr/include/
  3. make

NOTE : /opt/mips-4.3/mips-linux-gnu/libc/usr/include/ - This is the path where you can locate the select.h file for the mips Platform.
It contains the definitions of the macros FD_ZERO and FD_SET.

Still I am getting the same error.

cc1: warning: include location “/usr/include” is unsafe for cross-compilation
./src/audio/dma/SDL_dmaaudio.c: In function ‘DMA_WaitAudio’:
./src/audio/dma/SDL_dmaaudio.c:167: error: can’t find a register in class ‘COP3_REGS’ while reloading ‘asm’
./src/audio/dma/SDL_dmaaudio.c:167: error: ‘asm’ operand has impossible constraints
make: *** [build/SDL_dmaaudio.lo] Error 1

Please help me with some valuable pointers.

Thanks,
Sen