Cross compiling SDL and OpenGL apps

I’ve dl’d and installed the latest cross compile environment (thanks Sam
and friends) and have successfully compiled SDL and installed it into
the environment without a hitch. Now I wish to compile a little SDL/GL
test app based on Lesson 10 that I’ve hacked to oblivion and built an
autoconf environment to ease building. It compiles and plays fine on
Linux. However, it fails to see the GL libs and include files when I try
to run the cross-configure on it. I notice that the cross-build script
installed gl.h and glu.h but didn’t see any libs for gl - unless I
overlooked them. Is this something I need to do manually so I can use
cross-configure.sh to build my SDL/GL apps? I doubt I can cross-compile
mesa since it’s targetted intrinsically for *nix, so what do I need to do?

Thanks,
Mike–
http://dotfile.net/ - Dedicated to Open Source Software

I’ve dl’d and installed the latest cross compile environment (thanks Sam
and friends) and have successfully compiled SDL and installed it into
the environment without a hitch. Now I wish to compile a little SDL/GL
test app based on Lesson 10 that I’ve hacked to oblivion and built an
autoconf environment to ease building. It compiles and plays fine on
Linux. However, it fails to see the GL libs and include files when I try
to run the cross-configure on it. I notice that the cross-build script
installed gl.h and glu.h but didn’t see any libs for gl - unless I
overlooked them. Is this something I need to do manually so I can use
cross-configure.sh to build my SDL/GL apps? I doubt I can cross-compile
mesa since it’s targetted intrinsically for *nix, so what do I need to do?

Check out test/configure.in in the SDL source archive to see what I did.
Look for “mingw32”

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Well, slap me and call me fred - all the test apps compiled fine and
played on my win32 box - including your testgl app. Guess i gotta dig
into my little sdl/gl app and find out where things are screwed up. I
could have sworn I’ve cross compiled it before - the old ming32 scripts
are in that directory.

Thanks,
Mike

Sam Lantinga wrote:>>I’ve dl’d and installed the latest cross compile environment (thanks Sam

and friends) and have successfully compiled SDL and installed it into
the environment without a hitch. Now I wish to compile a little SDL/GL
test app based on Lesson 10 that I’ve hacked to oblivion and built an
autoconf environment to ease building. It compiles and plays fine on
Linux. However, it fails to see the GL libs and include files when I try
to run the cross-configure on it. I notice that the cross-build script
installed gl.h and glu.h but didn’t see any libs for gl - unless I
overlooked them. Is this something I need to do manually so I can use
cross-configure.sh to build my SDL/GL apps? I doubt I can cross-compile
mesa since it’s targetted intrinsically for *nix, so what do I need to do?

Check out test/configure.in in the SDL source archive to see what I did.
Look for “mingw32”

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


http://dotfile.net/ - Dedicated to Open Source Software

Did anything change between 1.1 and 1.2? Attached is the configure
output for your test apps and the NeHe tutes - virgin download (the zip
file linked from the sdl site):

[mikev at Linux OpenGL-intro-1.1.1]$ ./cross-configure.sh
creating cache cross-config.cache
checking for a BSD compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking whether make sets ${MAKE}… yes
checking for working aclocal… found
checking for working autoconf… found
checking for working automake… found
checking for working autoheader… found
checking for working makeinfo… found
checking host system type… i386-pc-mingw32msvc
checking target system type… i386-pc-mingw32msvc
checking for gcc… gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… yes
checking whether we are using GNU C… yes
checking whether gcc accepts -g… yes
checking for working const… yes
checking for sdl-config…
/usr/local/cross-tools/i386-mingw32msvc/bin/sdl-config
checking for SDL - version >= 1.2.0… cross compiling; assumed OK… yes
checking for OpenGL support… no
configure: error: Unable to find OpenGL headers and libraries
[mikev at Linux OpenGL-intro-1.1.1]$

[mikev at Linux test]# ./cross-configure.sh
creating cache cross-config.cache
checking host system type… i386-pc-mingw32msvc
checking target system type… i386-pc-mingw32msvc
checking for a BSD compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking whether make sets ${MAKE}… yes
checking for working aclocal… found
checking for working autoconf… found
checking for working automake… found
checking for working autoheader… found
checking for working makeinfo… found
checking for gcc… gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… yes
checking whether we are using GNU C… yes
checking whether gcc accepts -g… yes
checking for working const… yes
checking for sdl-config…
/usr/local/cross-tools/i386-mingw32msvc/bin/sdl-config
checking for SDL - version >= 1.2.3… cross compiling; assumed OK… yes
checking for OpenGL support… yes
updating cache cross-config.cache
creating ./config.status
creating Makefile
[mikev at Linux test]#

Thanks,
Mike

Sam Lantinga wrote:>>I’ve dl’d and installed the latest cross compile environment (thanks Sam

and friends) and have successfully compiled SDL and installed it into
the environment without a hitch. Now I wish to compile a little SDL/GL
test app based on Lesson 10 that I’ve hacked to oblivion and built an
autoconf environment to ease building. It compiles and plays fine on
Linux. However, it fails to see the GL libs and include files when I try
to run the cross-configure on it. I notice that the cross-build script
installed gl.h and glu.h but didn’t see any libs for gl - unless I
overlooked them. Is this something I need to do manually so I can use
cross-configure.sh to build my SDL/GL apps? I doubt I can cross-compile
mesa since it’s targetted intrinsically for *nix, so what do I need to do?

Check out test/configure.in in the SDL source archive to see what I did.
Look for “mingw32”

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


http://dotfile.net/ - Dedicated to Open Source Software

All I did to get the other apps to compile was go into the configure.in
and change it from:

dnl Check for OpenGL
AC_MSG_CHECKING(for OpenGL support)
have_opengl=no
AC_TRY_COMPILE([
#include <GL/gl.h>
],[
],[
have_opengl=yes
])

to:

dnl Check for OpenGL
AC_MSG_CHECKING(for OpenGL support)
have_opengl=no
AC_TRY_COMPILE([
#include “SDL_opengl.h”
],[
],[
have_opengl=yes
])

re-ran autogen.sh and it cross-configured and cross-compiled fine. I’m
curious - what’s in SDL_opengl.h that makes cross compiling work and
what change occured? I’ve cross compiled the glworld app before with the
older mingw32-cross-configure.sh and environment and older SDL libs with
no problem. The NeHe configure.in will have to be altered as well as
SDLgears and a host of other demos to get it to work with the new
mingw32 cross-compile environment… SDLgears gives me a ton of warnings
in cross-make.sh - doesn’t appear that the gl libs were included in the
compile and even when I manually stuck them in they still gave me a ton
of warnings. The NeHe tutes configured and compiled fine though…I’ve
been out for a bit and some things seem to be broken and others work
fine with the new system - has there been some major changes during my
absense that rendered some of this stuff obsolete?

Cheers,
Mike>> Check out test/configure.in in the SDL source archive to see what I did.

Look for “mingw32”

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


http://dotfile.net/ - Dedicated to Open Source Software