Fixed bug 2149 - Don't search for libusbhid except on BSD

Joseph Carter

There's a whole set of configure tests for BSD's libusbhid, and they only matter on BSD.  However, if you have the library on Linux, it gets pulled in as library bloat.  And it's bloat of the highest order since not a single function call to the library is ever made unless you're on a *BSD.
This commit is contained in:
Sam Lantinga 2013-10-13 19:49:45 -07:00
parent a7b2db05cd
commit 2337a684b3
3 changed files with 251 additions and 242 deletions

4
configure vendored
View File

@ -21634,6 +21634,8 @@ $as_echo "#define SDL_LOADSO_DLOPEN 1" >>confdefs.h
CheckUSBHID() CheckUSBHID()
{ {
case "$host" in
*-*-*bsd*)
if test x$enable_joystick = xyes; then if test x$enable_joystick = xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusbhid" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusbhid" >&5
$as_echo_n "checking for hid_init in -lusbhid... " >&6; } $as_echo_n "checking for hid_init in -lusbhid... " >&6; }
@ -21932,6 +21934,8 @@ $as_echo "#define SDL_JOYSTICK_USBHID 1" >>confdefs.h
fi fi
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
fi fi
;;
esac
} }
CheckClockGettime() CheckClockGettime()

View File

@ -2189,6 +2189,8 @@ AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[de
dnl Check for the usbhid(3) library on *BSD dnl Check for the usbhid(3) library on *BSD
CheckUSBHID() CheckUSBHID()
{ {
case "$host" in
*-*-*bsd*)
if test x$enable_joystick = xyes; then if test x$enable_joystick = xyes; then
AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes) AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
if test x$have_libusbhid = xyes; then if test x$have_libusbhid = xyes; then
@ -2321,6 +2323,8 @@ CheckUSBHID()
fi fi
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
fi fi
;;
esac
} }
dnl Check for clock_gettime() dnl Check for clock_gettime()

3
test/configure vendored
View File

@ -586,8 +586,8 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
SDL_TTF_LIB SDL_TTF_LIB
XLIB XLIB
GLLIB
GLESLIB GLESLIB
GLLIB
CPP CPP
XMKMF XMKMF
SDL_CONFIG SDL_CONFIG
@ -3874,6 +3874,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTF_Init in -lSDL2_ttf" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTF_Init in -lSDL2_ttf" >&5
$as_echo_n "checking for TTF_Init in -lSDL2_ttf... " >&6; } $as_echo_n "checking for TTF_Init in -lSDL2_ttf... " >&6; }
if ${ac_cv_lib_SDL2_ttf_TTF_Init+:} false; then : if ${ac_cv_lib_SDL2_ttf_TTF_Init+:} false; then :