1
0
Fork 0

First attempt to make it possible to use either SDL or glut at compile time.

This commit is contained in:
ehofman 2004-04-07 14:42:41 +00:00
parent 049fda00cf
commit b0a3ce0fc0
3 changed files with 30 additions and 7 deletions

View file

@ -10,6 +10,8 @@ dnl Require at least automake 2.52
AC_PREREQ(2.52)
dnl Initialize the automake stuff
dnl set the $host variable based on local machine/os
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(FlightGear, 0.9.4)
dnl Checks for programs.
@ -29,9 +31,6 @@ if test "x$with_simgear" != "x" ; then
EXTRA_DIRS="${EXTRA_DIRS} $with_simgear"
fi
dnl set the $host variable based on local machine/os
AC_CANONICAL_HOST
case "${host}" in
*-*-irix*)
if test "$CXX" = "CC"; then
@ -215,6 +214,15 @@ AC_SEARCH_LIBS(dlclose, dl)
base_LIBS="$LIBS"
dnl Check for SDL if enabled.
AC_ARG_ENABLE(sdl, [ --enable-sdl Configure to use SDL instead of GLUT], enable_sdl="yes", enable_sdl="")
AM_CONDITIONAL(USE_SDL, test "x$enable_sdl" = "xyes")
if test "x$enable_sdl" = "xyes"; then
AC_DEFINE([PU_USE_SDL], 1, [Define to use SDL])
else
AC_DEFINE([PU_USE_GLUT], 1, [Define to use glut])
fi
dnl check for glut location
AC_CHECK_HEADER(GL/glut.h)
if test "x$ac_cv_header_GL_glut_h" = "xyes"; then
@ -224,8 +232,10 @@ else
if test "x$ac_cv_header_GLUT_glut_h" = "xyes"; then
AC_DEFINE([FG_GLUT_H], <GLUT/glut.h>, [Define as glut.h include location])
else
echo "Neither GL/glut.h nor GLUT/glut.h found. Cannot continue"
exit
if test "x$enable_sdl" != "xyes"; then
echo "Neither GL/glut.h nor GLUT/glut.h found. Cannot continue"
exit
fi
fi
fi
@ -290,6 +300,9 @@ case "${host}" in
AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
if test "x$enable_sdl" = "xyes"; then
AC_SEARCH_LIBS(SDL_Init, SDL)
fi
;;
esac

View file

@ -10,6 +10,12 @@ else
THREAD_LIBS =
endif
if USE_SDL
GFX_SOURCES = fg_os_sdl.cxx fg_os.hxx
else
GFX_SOURCES = fg_os.cxx fg_os.hxx
endif
if FG_USE_CLOUDS_3D
CLOUD3D_LIBS = -lsgclouds3d
else
@ -41,7 +47,7 @@ libMain_a_SOURCES = \
util.cxx util.hxx \
viewer.cxx viewer.hxx \
viewmgr.cxx viewmgr.hxx \
fg_os.cxx fg_os.hxx
$(GFX_SOURCES)
fgfs_SOURCES = bootstrap.cxx

View file

@ -3,7 +3,11 @@
// Plib pui needs to know at compile time what toolkit is in use.
// Change this when we move to something other than glut.
#define PU_USE_GLUT
// #define PU_USE_GLUT -- moved to configure.ac -- EMH
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
enum { MOUSE_BUTTON_LEFT,
MOUSE_BUTTON_MIDDLE,