Yes you found, I need freetype and iconv
To build SDL_ttf, I cross compiled freetype.
To build SDL_net, I cross compiled iconv.
To build SDL_mixer, I edit the Makefiles and I change “-pthread” by “-lpthread” manually (I don’t like this solution, I prefer to correct my cross compiler but don’t know how to do this).
But I still have a problem with alloca.h:
SDL_mixer:
$ make
/bin/sh ./libtool --mode=compile i686-pc-mingw32-gcc -g -O2 -D_GNU_SOURCE=1 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -fvisibility=hidden -DWAV_MUSIC -DMOD_MUSIC -lpthread -D_REENTRANT -DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI -I./native_midi -DHAVE_SIGNAL_H -DMP3_MUSIC -I/usr/include/smpeg -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -MMD -MT build/effect_position.lo -c effect_position.c -o build/effect_position.lo
libtool: compile: i686-pc-mingw32-gcc -g -O2 -D_GNU_SOURCE=1 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -fvisibility=hidden -DWAV_MUSIC -DMOD_MUSIC -lpthread -D_REENTRANT -DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI -I./native_midi -DHAVE_SIGNAL_H -DMP3_MUSIC -I/usr/include/smpeg -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -MMD -MT build/effect_position.lo -c effect_position.c -DDLL_EXPORT -DPIC -o build/.libs/effect_position.o
In file included from /usr/include/SDL/SDL_main.h:26:0,
from /usr/include/SDL/SDL.h:30,
from effect_position.c:33:
/usr/include/SDL/SDL_stdinc.h:187:22: fatal error: alloca.h: No such file or directory
compilation terminated.
make: *** [build/effect_position.lo] Error 1
SDL_ttf:
$ make
/bin/sh ./libtool --tag=CC --mode=compile i686-pc-mingw32-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -DPACKAGE=“SDL_ttf” -DVERSION=“2.0.11” -I. -g -O2 -I/usr/include/freetype2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -DHAVE_OPENGL -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c -o SDL_ttf.lo SDL_ttf.c
libtool: compile: i686-pc-mingw32-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -DPACKAGE=“SDL_ttf” -DVERSION=“2.0.11” -I. -g -O2 -I/usr/include/freetype2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -DHAVE_OPENGL -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c SDL_ttf.c -DDLL_EXPORT -DPIC -o .libs/SDL_ttf.o
In file included from /usr/include/SDL/SDL_main.h:26:0,
from /usr/include/SDL/SDL.h:30,
from SDL_ttf.c:46:
/usr/include/SDL/SDL_stdinc.h:187:22: fatal error: alloca.h: No such file or directory
compilation terminated.
make: *** [SDL_ttf.lo] Error 1
SDL_net:
$ make
/bin/sh ./libtool --tag=CC --mode=compile i686-pc-mingw32-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -DPACKAGE=“SDL_net” -DVERSION=“1.2.8” -I. -g -O2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -MT SDLnet.lo -MD -MP -MF .deps/SDLnet.Tpo -c -o SDLnet.lo SDLnet.c
libtool: compile: i686-pc-mingw32-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -DPACKAGE=“SDL_net” -DVERSION=“1.2.8” -I. -g -O2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -MT SDLnet.lo -MD -MP -MF .deps/SDLnet.Tpo -c SDLnet.c -DDLL_EXPORT -DPIC -o .libs/SDLnet.o
In file included from /usr/include/SDL/SDL_endian.h:31:0,
from SDLnet.c:26:
/usr/include/SDL/SDL_stdinc.h:187:22: fatal error: alloca.h: No such file or directory
compilation terminated.
make: *** [SDLnet.lo] Error 1
The same error for SDL_mixer, SDL_ttf and SDL_net.
I think I must cross compile an other library but don’t know what library give the alloca.h file.
Do you know where to find this requirement?
Thank you.
Regards.
----- Mail original -----De: “Gabriel Jacobo”
?: “SDL Development List”
Envoy?: Samedi 8 Septembre 2012 16:37:28
Objet: Re: [SDL] SDL is cross-compiled but unable to cross compile SDL_mixer, SDL_ttf and SDL_net
2012/9/8 < @spam.spam.spam.spam >
Hello,
I build myself a cross-compiler i686-pc-mingw32 (building binutils, gcc, mingw32rt and w32api).
I am using this cross-compiler to generate binaries for Windows whereas I am on a GNU/Linux operating system.
It works well to cross-compile SDL.
That’s how I do:
$ ./configure --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32
$ make
$ make install
It works well to cross compile other programs (goattracker and xmp).
But I got problems with SDL_mixer, SDL_ttf and SDL_net.
SDL_mixer:
$ ./configure --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32
$ make
function execcmd()
{
echo -n "executing the ‘${COMMAND}’ command… "
if test ${VERBOSE} -eq 0; then
${COMMAND} 1>/dev/null 2>&1
else
${COMMAND}
/bin/sh ./libtool --mode=compile i686-pc-mingw32-gcc -g -O2 -D_GNU_SOURCE=1 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -fvisibility=hidden -DWAV_MUSIC -DMOD_MUSIC -pthread -D_REENTRANT -DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI -I./native_midi -DHAVE_SIGNAL_H -DMP3_MUSIC -I/usr/include/smpeg -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -MMD -MT build/effect_position.lo -c effect_position.c -o build/effect_position.lo
libtool: compile: i686-pc-mingw32-gcc -g -O2 -D_GNU_SOURCE=1 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -fvisibility=hidden -DWAV_MUSIC -DMOD_MUSIC -pthread -D_REENTRANT -DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI -I./native_midi -DHAVE_SIGNAL_H -DMP3_MUSIC -I/usr/include/smpeg -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -MMD -MT build/effect_position.lo -c effect_position.c -DDLL_EXPORT -DPIC -o build/.libs/effect_position.o
i686-pc-mingw32-gcc: error: unrecognized option '-pthread’
make: *** [build/effect_position.lo] Error 1
SDL_ttf:
$ ./configure --prefix=/usr/i686-pc-mingw32 --host=i686-pc-mingw32
$ make
/bin/sh ./libtool --tag=CC --mode=compile i686-pc-mingw32-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -DPACKAGE=“SDL_ttf” -DVERSION=“2.0.11” -I. -g -O2 -I/usr/include/freetype2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -DHAVE_OPENGL -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c -o SDL_ttf.lo SDL_ttf.c
libtool: compile: i686-pc-mingw32-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -DPACKAGE=“SDL_ttf” -DVERSION=“2.0.11” -I. -g -O2 -I/usr/include/freetype2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -DHAVE_OPENGL -MT SDL_ttf.lo -MD -MP -MF .deps/SDL_ttf.Tpo -c SDL_ttf.c -DDLL_EXPORT -DPIC -o .libs/SDL_ttf.o
SDL_ttf.c:39:22: fatal error: ft2build.h: No such file or directory
compilation terminated.
make: *** [SDL_ttf.lo] Error 1
SDL_net:
$ make
/bin/sh ./libtool --tag=CC --mode=compile i686-pc-mingw32-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -DPACKAGE=“SDL_net” -DVERSION=“1.2.8” -I. -g -O2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -MT SDLnet.lo -MD -MP -MF .deps/SDLnet.Tpo -c -o SDLnet.lo SDLnet.c
libtool: compile: i686-pc-mingw32-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=".libs/" -DPACKAGE=“SDL_net” -DVERSION=“1.2.8” -I. -g -O2 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -MT SDLnet.lo -MD -MP -MF .deps/SDLnet.Tpo -c SDLnet.c -DDLL_EXPORT -DPIC -o .libs/SDLnet.o
In file included from /usr/include/SDL/SDL_endian.h:31:0,
from SDLnet.c:26:
/usr/include/SDL/SDL_stdinc.h:74:20: fatal error: iconv.h: No such file or directory
compilation terminated.
make: *** [SDLnet.lo] Error 1
I don’t understand why my cross compiler doesn’t support the “-pthread” option. Is there a way to disable pthread for SDL_mixer or enable pthread on my cross-compiler?
Also, do I need to cross-compile freetype2 and iconv in order to be able to cross compile SDL_ttf and SDL_net ?
Thank you.
Regards.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
To build SDL_ttf you need freetype, besides that it should work, I do exactly what you want to do in my engine: https://bitbucket.org/gabomdq/ignifuga/src/b2a785e9955f/tools/modules/sdl/mingw32.py
SDL_net seems to depend on iconv, judging from your log. About SDL_mixer, it stands to reason that a Win32 compiler won’t support pthread (Posix Threads)…the question is how to get rid of it, I’m going to be looking into it in the next few days as I wanted to add SDL_mixer support to my engine as well. If you figure something out, please report back!
–
Gabriel.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org