fi
-if test "$wxUSE_GUI" = "yes"; then
- if test "$wxUSE_JOYSTICK" = "yes"; then
+if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then
+ wxUSE_JOYSTICK=no
+
+ if test "$TOOLKIT" = "MSW"; then
+ wxUSE_JOYSTICK=yes
+
+ elif test "$TOOLKIT" = "MAC" -o "$TOOLKIT" = "COCOA"; then
+ if test "$USE_DARWIN" = 1; then
+ echo "$as_me:$LINENO: checking headers have declarations needed for joystick support" >&5
+echo $ECHO_N "checking headers have declarations needed for joystick support... $ECHO_C" >&6
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+ #include <IOKit/hid/IOHIDLib.h>
+int
+main ()
+{
+ IOHIDQueueInterface *qi = NULL;
+ IOHIDCallbackFunction cb = NULL;
+ qi->setEventCallout(NULL, cb, NULL, NULL);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ wxUSE_JOYSTICK=yes
- if test "$TOOLKIT" != "MAC" -a "$TOOLKIT" != "COCOA" -a "$TOOLKIT" != "MSW"; then
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ echo "$as_me:$LINENO: result: $wxUSE_JOYSTICK" >&5
+echo "${ECHO_T}$wxUSE_JOYSTICK" >&6
+ fi
+
+ else
for ac_header in linux/joystick.h
do
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
-
+ wxUSE_JOYSTICK=yes
fi
done
- if test "$ac_cv_header_linux_joystick_h" != "yes"; then
- wxUSE_JOYSTICK=no
- { echo "$as_me:$LINENO: WARNING: Joystick not supported by this system... disabled" >&5
-echo "$as_me: WARNING: Joystick not supported by this system... disabled" >&2;}
- fi
- else
- if test "$USE_DARWIN" != 1 -a "$TOOLKIT" != "MSW"; then
- wxUSE_JOYSTICK=no
- { echo "$as_me:$LINENO: WARNING: Joystick not supported by this system... disabled" >&5
-echo "$as_me: WARNING: Joystick not supported by this system... disabled" >&2;}
- fi
- fi
-
+ fi
- if test "$wxUSE_JOYSTICK" = "yes"; then
- cat >>confdefs.h <<\_ACEOF
+ if test "$wxUSE_JOYSTICK" = "yes"; then
+ cat >>confdefs.h <<\_ACEOF
#define wxUSE_JOYSTICK 1
_ACEOF
- SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
- fi
+ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
+ else
+ { echo "$as_me:$LINENO: WARNING: Joystick not supported by this system... disabled" >&5
+echo "$as_me: WARNING: Joystick not supported by this system... disabled" >&2;}
fi
fi
dnl Joystick support
dnl ---------------------------------------------------------------------------
-if test "$wxUSE_GUI" = "yes"; then
- dnl under MSW we always have joystick support
- if test "$wxUSE_JOYSTICK" = "yes"; then
-
- dnl joystick support is only for Linux 2.1.x or greater
- if test "$TOOLKIT" != "MAC" -a "$TOOLKIT" != "COCOA" -a "$TOOLKIT" != "MSW"; then
- AC_CHECK_HEADERS(linux/joystick.h)
- if test "$ac_cv_header_linux_joystick_h" != "yes"; then
- wxUSE_JOYSTICK=no
- AC_MSG_WARN(Joystick not supported by this system... disabled)
- fi
- else
- dnl mac only available on darwin
- if test "$USE_DARWIN" != 1 -a "$TOOLKIT" != "MSW"; then
- wxUSE_JOYSTICK=no
- AC_MSG_WARN(Joystick not supported by this system... disabled)
- fi
- fi
+if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then
+ wxUSE_JOYSTICK=no
+ dnl under MSW we always have joystick support
+ if test "$TOOLKIT" = "MSW"; then
+ wxUSE_JOYSTICK=yes
- if test "$wxUSE_JOYSTICK" = "yes"; then
- AC_DEFINE(wxUSE_JOYSTICK)
- SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
+ dnl mac only available on darwin
+ elif test "$TOOLKIT" = "MAC" -o "$TOOLKIT" = "COCOA"; then
+ if test "$USE_DARWIN" = 1; then
+ dnl check for a bug in the headers, some have bad setEventCallout
+ AC_MSG_CHECKING([headers have declarations needed for joystick support])
+ AC_LANG_PUSH(C++)
+ AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ],
+ [ IOHIDQueueInterface *qi = NULL;
+ IOHIDCallbackFunction cb = NULL;
+ qi->setEventCallout(NULL, cb, NULL, NULL); ],
+ [ wxUSE_JOYSTICK=yes ]
+ )
+ AC_LANG_POP
+ AC_MSG_RESULT($wxUSE_JOYSTICK)
fi
+
+ dnl joystick support is only for Linux 2.1.x or greater
+ else
+ AC_CHECK_HEADERS(linux/joystick.h, wxUSE_JOYSTICK=yes)
+ fi
+
+ if test "$wxUSE_JOYSTICK" = "yes"; then
+ AC_DEFINE(wxUSE_JOYSTICK)
+ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
+ else
+ AC_MSG_WARN(Joystick not supported by this system... disabled)
fi
fi