diff configure.in @ 2713:0906692aa6a4

Final merge of Google Summer of Code 2008 work... Force Feedback for SDL by Edgar Simo, mentored by Ryan C. Gordon
author Sam Lantinga <slouken@libsdl.org>
date Mon, 25 Aug 2008 09:55:03 +0000
parents 44e49d3fa6cf
children 1d1be6137875
line wrap: on
line diff
--- a/configure.in	Mon Aug 25 08:50:37 2008 +0000
+++ b/configure.in	Mon Aug 25 09:55:03 2008 +0000
@@ -235,6 +235,14 @@
 else
     SOURCES="$SOURCES $srcdir/src/joystick/*.c"
 fi
+AC_ARG_ENABLE(haptic,
+AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]),
+              , enable_haptic=yes)
+if test x$enable_haptic != xyes; then
+    AC_DEFINE(SDL_HAPTIC_DISABLED)
+else
+    SOURCES="$SOURCES $srcdir/src/haptic/*.c"
+fi
 AC_ARG_ENABLE(cdrom,
 AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
               , enable_cdrom=yes)
@@ -2179,6 +2187,18 @@
             ;;
           esac
         fi
+        # Set up files for the haptic library
+        if test x$enable_haptic = xyes; then
+           if test x$use_input_events = xyes; then
+             case $ARCH in
+               linux)
+                   AC_DEFINE(SDL_HAPTIC_LINUX)
+                   SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c"
+                   have_haptic=yes
+               ;;
+             esac
+           fi
+        fi
         # Set up files for the cdrom library
         if test x$enable_cdrom = xyes; then
           case $ARCH in
@@ -2316,6 +2336,13 @@
             fi
             have_joystick=yes
         fi
+        if test x$enable_haptic = xyes; then
+            if test x$have_dinput = xyes; then
+                AC_DEFINE(SDL_HAPTIC_DINPUT)
+                SOURCES="$SOURCES $srcdir/src/haptic/win32/SDL_syshaptic.c"
+                have_haptic=yes
+            fi
+        fi
         # Set up files for the cdrom library
         if test x$enable_cdrom = xyes; then
             AC_DEFINE(SDL_CDROM_WIN32)
@@ -2457,6 +2484,13 @@
             SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
             have_joystick=yes
         fi
+        # Set up files for the haptic library
+        if test x$enable_haptic = xyes; then
+            AC_DEFINE(SDL_HAPTIC_IOKIT)
+            SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c"
+            have_haptic=yes
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback"
+        fi
         # Set up files for the cdrom library
         if test x$enable_cdrom = xyes; then
             AC_DEFINE(SDL_CDROM_MACOSX)
@@ -2565,6 +2599,12 @@
     SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
   fi
 fi
+if test x$have_haptic != xyes; then
+    if test x$enable_haptic = xyes; then
+        AC_DEFINE(SDL_HAPTIC_DISABLED)
+    fi
+    SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
+fi
 if test x$have_cdrom != xyes; then
     if test x$enable_cdrom = xyes; then
         AC_DEFINE(SDL_CDROM_DISABLED)