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()
{
case "$host" in
*-*-*bsd*)
if test x$enable_joystick = xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusbhid" >&5
$as_echo_n "checking for hid_init in -lusbhid... " >&6; }
@ -21932,6 +21934,8 @@ $as_echo "#define SDL_JOYSTICK_USBHID 1" >>confdefs.h
fi
CFLAGS="$save_CFLAGS"
fi
;;
esac
}
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
CheckUSBHID()
{
case "$host" in
*-*-*bsd*)
if test x$enable_joystick = xyes; then
AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
if test x$have_libusbhid = xyes; then
@ -2321,6 +2323,8 @@ CheckUSBHID()
fi
CFLAGS="$save_CFLAGS"
fi
;;
esac
}
dnl Check for clock_gettime()

3
test/configure vendored
View file

@ -586,8 +586,8 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
SDL_TTF_LIB
XLIB
GLLIB
GLESLIB
GLLIB
CPP
XMKMF
SDL_CONFIG
@ -3874,6 +3874,7 @@ fi
{ $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; }
if ${ac_cv_lib_SDL2_ttf_TTF_Init+:} false; then :