Skip to content
Permalink
Browse files

Fixed bug 4911 - Build broken when hidapi enabled

meyraud705

SDL_hidapi.c is added twice to 'SOURCES' which causes "multiple definition error" when linking.
  • Loading branch information
slouken committed Dec 22, 2019
1 parent 5e19e66 commit dd5987e80a31f888e0b69ce2cc81e08afb73f249
Showing with 1 addition and 6 deletions.
  1. +1 −3 configure
  2. +0 −3 configure.ac

EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"

if test x$have_libusb_h = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&5
$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&2;}
fi
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
# libusb is loaded dynamically, so don't add it to LDFLAGS
libusb_lib=""
case "$host" in
_ACEOF

fi
else
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
fi
fi

@@ -3326,7 +3326,6 @@ AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[d
if test x$have_loadso != xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libusb loading])
fi
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
# libusb is loaded dynamically, so don't add it to LDFLAGS
libusb_lib=""
case "$host" in
@@ -3342,8 +3341,6 @@ AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[d
fi
AC_DEFINE_UNQUOTED(SDL_LIBUSB_DYNAMIC, "$libusb_lib", [ ])
fi
else
SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
fi
fi

0 comments on commit dd5987e

Please sign in to comment.