SDL is cross-compiled but unable to cross compile SDL_mixer, SDL_ttf and SDL_net

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.

You can use MXE:

http://mxe.cc

It already comes with SDL (and much more.)On 08/09/12 13:43, spam.spam.spam.spam at free.fr wrote:

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.

2012/9/8 <spam.spam.spam.spam at free.fr>

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.

This is what MXE uses as the configure flags in order to cross-compile
it. Those configure flags should work.

But, again: just use MXE directly :slight_smile: There’s really no need to deal
with all the headaches in trying to set everything up manually.On 08/09/12 17:37, Gabriel Jacobo wrote:

2012/9/8 <spam.spam.spam.spam at free.fr <mailto:spam.spam.spam.spam at free.fr>>

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 ?

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!

Hmm, never ran into that compiling SDLMixer before (but a bit behind
compared to git).

I use mingw-w64 (which allows you to compile 32bit or 64bit libraries
for windows. I think that is what Sam uses for the dll’s offered on
the site as well.

My Setup for mingw-w64 is on http://nathancoulson.com/proj_cross.php,

64bit lib, I use
./configure --prefix=/opt/cross --host=x86_64-w64-mingw32
–disable-music-mod &&
make &&
make install

32bit lib, I use
WINDRES=“x86_64-w64-mingw32-windres -F pe-i386”
CC=“x86_64-w64-mingw32-gcc -m32”
./configure --prefix=/usr --host=x86_64-w64-mingw32
–disable-music-mod &&
make &&
make install

(hmm, wonder how ctools will affect this)On Sat, Sep 8, 2012 at 1:08 PM, Nikos Chantziaras wrote:

On 08/09/12 17:37, Gabriel Jacobo wrote:

2012/9/8 <spam.spam.spam.spam at free.fr
<mailto:spam.spam.spam.spam at free.fr>>

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.


Nathan Coulson (conathan)

Location: British Columbia, Canada
Timezone: PST (-8)
Webpage: http://www.nathancoulson.com

Yes you found, I need freetype and iconv :slight_smile:

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

2012/9/9 <spam.spam.spam.spam at free.fr>

Yes you found, I need freetype and iconv :slight_smile:

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

You are including stuff from the system copy of SDL instead of the cross
compiled one ( -I/usr/include/SDL). Use the --with-sdl-prefix parameter on
the configure script to let the libraries know which copy of SDL they
should be using.–
Gabriel.

Yes, true. That was a problem about the version of the libraries to choose.
In fact, I have not used the “–with-sdl-prefix” option, I used the PKG_CONFIG_PATH environment variable like this:
export PKG_CONFIG_PATH="/usr/i686-pc-mingw32/lib/pkgconfig"
And now I am able to cross compile SDL_ttf and SDL_net :slight_smile:

I still have a problem with cross compile SDL_mixer because it requires the “-pthread” option.
I edit the Makefile to change with “-lpthread” but when libtool is called, the “-pthread” option is again used :frowning:

Is there a way to tell to libtool to use “-lpthread” instead of “-pthread” ?

Thank you.
Regards.

----- Mail original -----De: “Gabriel Jacobo”
?: “SDL Development List”
Envoy?: Dimanche 9 Septembre 2012 15:36:59
Objet: Re: [SDL] SDL is cross-compiled but unable to cross compile SDL_mixer, SDL_ttf and SDL_net

2012/9/9 < @spam.spam.spam.spam >

Yes you found, I need freetype and iconv :slight_smile:

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

You are including stuff from the system copy of SDL instead of the cross compiled one ( -I/usr/include/SDL). Use the --with-sdl-prefix parameter on the configure script to let the libraries know which copy of SDL they should be using.


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org