| Summary: | --disable-joystick causes undefined symbols | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Tim Wojtulewicz <timwoj> |
| Component: | joystick | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sol11x86 |
| Version: | HG 1.2 | ||
| Hardware: | Other | ||
| OS: | Solaris | ||
|
Description
Tim Wojtulewicz
2007-02-28 17:36:57 UTC
In addition, if --enable-joystick is configured, and there are no platform specific backend, IE, it defaults to the src/joystick/dummy/*.c files, the define SDL_JOYSTICK_DUMMY should be configured. This patch has been tested on Solaris 10/U3 x86 with both
--enable-joystick and --disable-joystick. The problems
with symbols not found has been resolved.
--- configure.in.ORIG 2007-03-04 10:02:00.000000000 -0500
+++ configure.in 2007-03-04 12:07:33.145203000 -0500
@@ -227,6 +227,7 @@
, enable_joystick=yes)
if test x$enable_joystick != xyes; then
AC_DEFINE(SDL_JOYSTICK_DISABLED)
+ SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
fi
AC_ARG_ENABLE(cdrom,
AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
@@ -2576,7 +2577,8 @@
if test x$enable_joystick = xyes; then
if test x$have_joystick != xyes; then
# Wants joystick subsystem, but doesn't have a platform-specific backend...
- SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
+ AC_DEFINE(SDL_JOYSTICK_DUMMY)
+ SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
fi
fi
if test x$have_cdrom != xyes; then
(Reopening bug so I remember to apply this patch...) --ryan. You might also duplicate that patch for the other dummy backends I took a slightly different approach here...instead of forcing the dummy driver to resolve symbols the higher level needs, I changed the configure script to not compile the higher level if built with --disable-joystick...in which case SDL_Init() will just fail if you try to init the joystick subsystem, as it should (and does with other subsystems). The reason --disable-audio, etc doesn't have this problem is because it expects to have multiple drivers, so it can handle zero drivers. The joystick subsystem expects one implementation per platform, so it threw up when it found none. This should be done for other subsystems, since there's no sense in including the audio mixers if you don't want the audio subsystem, etc, but since I expect that will cause havoc, I'm just changing the joysticks for now. When my OLPC prototype shows up, I'll revisit the other subsystems. The SDL_JOYSTICK_DUMMY define is a good fix though, I put that part of the patch in. Fixed in svn revision #3011 for the 1.2 branch, and #3013 for the 1.3 branch. Thanks! --ryan. |