summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
30676ff)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@942
7f0cb862-5218-0410-a997-
914c9d46530a
AC_SUBST([VERSION_INFO])
AC_SUBST([EXPORT_FLAGS])
AC_SUBST([VERSION_INFO])
AC_SUBST([EXPORT_FLAGS])
+AC_CHECK_LIB([usbhid], [hid_init],
+ [LIBUSBHID=-lusbhid], [LIBUSBHID=])
+AC_SUBST(LIBUSBHID)
+
# Checks for header files.
AC_HEADER_STDC
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
# Checks for header files.
AC_HEADER_STDC
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-AC_CHECK_HEADERS([usbhid.h errno.h GL/gl.h GL/glu.h GL/glx.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h])
+AC_CHECK_HEADERS([usbhid.h libusbhid.h errno.h GL/gl.h GL/glu.h GL/glx.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h])
AC_HEADER_TIME
AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [], [], [#include <X11/Xlib.h>])
AC_CHECK_HEADERS([X11/extensions/Xrandr.h])
AC_HEADER_TIME
AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [], [], [#include <X11/Xlib.h>])
AC_CHECK_HEADERS([X11/extensions/Xrandr.h])
#
# Additional linker flags
#
#
# Additional linker flags
#
-lib@LIBRARY@_la_LIBADD = $(GL_LIBS) $(X_LIBS) $(LIBM)
+lib@LIBRARY@_la_LIBADD = $(GL_LIBS) $(X_LIBS) $(LIBM) $(LIBUSBHID)
lib@LIBRARY@_la_LDFLAGS = $(VERSION_INFO) -no-undefined
lib@LIBRARY@_la_CFLAGS = $(GL_FLAGS) $(X_CFLAGS) $(EXPORT_FLAGS)
lib@LIBRARY@_la_CPPFLAGS= -I$(top_srcdir)/include
lib@LIBRARY@_la_LDFLAGS = $(VERSION_INFO) -no-undefined
lib@LIBRARY@_la_CFLAGS = $(GL_FLAGS) $(X_CFLAGS) $(EXPORT_FLAGS)
lib@LIBRARY@_la_CPPFLAGS= -I$(top_srcdir)/include
# include <errno.h>
# include <string.h>
# endif
# include <errno.h>
# include <string.h>
# endif
-# if defined(__FreeBSD__) || defined(__NetBSD__)
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
/* XXX The below hack is done until freeglut's autoconf is updated. */
# define HAVE_USB_JS 1
/* XXX The below hack is done until freeglut's autoconf is updated. */
# define HAVE_USB_JS 1
-# if defined(__FreeBSD__)
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
# include <sys/joystick.h>
# else
/*
# include <sys/joystick.h>
# else
/*
/* BSD defines from "jsBSD.cxx" around lines 42-270 */
/* BSD defines from "jsBSD.cxx" around lines 42-270 */
-#if defined(__NetBSD__) || defined(__FreeBSD__)
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
# ifdef HAVE_USB_JS
# if defined(__NetBSD__)
# ifdef HAVE_USB_JS
# if defined(__NetBSD__)
# else
# include <usb.h>
# endif
# else
# include <usb.h>
# endif
-# elif defined(__FreeBSD__)
-# if __FreeBSD_version < 500000
-# include <libusbhid.h>
-# else
-/* XXX The below hack is done until freeglut's autoconf is updated. */
-# define HAVE_USBHID_H 1
+# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+# ifdef HAVE_USBHID_H
+# else
+# include <libusbhid.h>
-# include <dev/usb/usb.h>
+# include <legacy/dev/usb/usb.h>
# include <dev/usb/usbhid.h>
/* Compatibility with older usb.h revisions */
# include <dev/usb/usbhid.h>
/* Compatibility with older usb.h revisions */
#if TARGET_HOST_POSIX_X11
#if TARGET_HOST_POSIX_X11
-# if defined(__FreeBSD__) || defined(__NetBSD__)
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
struct os_specific_s *os;
# endif
struct os_specific_s *os;
# endif
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
#endif
#if TARGET_HOST_POSIX_X11
#endif
#if TARGET_HOST_POSIX_X11
-# if defined(__FreeBSD__) || defined(__NetBSD__)
+# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
if ( joy->os->is_analog )
{
int status = read ( joy->os->fd, &joy->os->ajs, sizeof(joy->os->ajs) );
if ( joy->os->is_analog )
{
int status = read ( joy->os->fd, &joy->os->ajs, sizeof(joy->os->ajs) );
-# if defined( __FreeBSD__ ) || defined( __NetBSD__ )
+# if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
*buttons = ( joy->js.b1 ? 1 : 0 ) | ( joy->js.b2 ? 2 : 0 ); /* XXX Should not be here -- BSD is handled earlier */
# else
*buttons = joy->js.buttons;
*buttons = ( joy->js.b1 ? 1 : 0 ) | ( joy->js.b2 ? 2 : 0 ); /* XXX Should not be here -- BSD is handled earlier */
# else
*buttons = joy->js.buttons;
CFTypeRef topLevelElement;
#endif
#if TARGET_HOST_POSIX_X11
CFTypeRef topLevelElement;
#endif
#if TARGET_HOST_POSIX_X11
-# if defined( __FreeBSD__ ) || defined( __NetBSD__ )
+# if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
char *cp;
# endif
# ifdef JS_NEW
char *cp;
# endif
# ifdef JS_NEW
#endif
#if TARGET_HOST_POSIX_X11
#endif
#if TARGET_HOST_POSIX_X11
-#if defined( __FreeBSD__ ) || defined( __NetBSD__ )
+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
for( i = 0; i < _JS_MAX_AXES; i++ )
joy->os->cache_axes[ i ] = 0.0f;
for( i = 0; i < _JS_MAX_AXES; i++ )
joy->os->cache_axes[ i ] = 0.0f;
#endif
#if TARGET_HOST_POSIX_X11
#endif
#if TARGET_HOST_POSIX_X11
-# if defined( __FreeBSD__ ) || defined( __NetBSD__ )
+# if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
fgJoystick[ ident ]->id = ident;
fgJoystick[ ident ]->error = GL_FALSE;
fgJoystick[ ident ]->id = ident;
fgJoystick[ ident ]->error = GL_FALSE;
#endif
#if TARGET_HOST_POSIX_X11
#endif
#if TARGET_HOST_POSIX_X11
-#if defined( __FreeBSD__ ) || defined( __NetBSD__ )
+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )
if( fgJoystick[ident]->os )
{
if( ! fgJoystick[ ident ]->error )
if( fgJoystick[ident]->os )
{
if( ! fgJoystick[ ident ]->error )