Fixed bug 4911 - Build broken when hidapi enabled
authorSam Lantinga <slouken@libsdl.org>
Sun, 22 Dec 2019 13:42:20 -0800
changeset 133779d653cdc1797
parent 13376 35f99d918ca2
child 13378 d7e699bc1173
Fixed bug 4911 - Build broken when hidapi enabled

meyraud705

SDL_hidapi.c is added twice to 'SOURCES' which causes "multiple definition error" when linking.
configure
configure.ac
     1.1 --- a/configure	Sun Dec 22 13:39:44 2019 -0800
     1.2 +++ b/configure	Sun Dec 22 13:42:20 2019 -0800
     1.3 @@ -24332,6 +24332,7 @@
     1.4  
     1.5              EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
     1.6              SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
     1.7 +            SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
     1.8  
     1.9              if test x$have_libusb_h = xyes; then
    1.10                  EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
    1.11 @@ -24343,7 +24344,6 @@
    1.12                          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&5
    1.13  $as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&2;}
    1.14                      fi
    1.15 -                    SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
    1.16                      # libusb is loaded dynamically, so don't add it to LDFLAGS
    1.17                      libusb_lib=""
    1.18                      case "$host" in
    1.19 @@ -24363,8 +24363,6 @@
    1.20  _ACEOF
    1.21  
    1.22                  fi
    1.23 -            else
    1.24 -                SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
    1.25              fi
    1.26          fi
    1.27  
     2.1 --- a/configure.ac	Sun Dec 22 13:39:44 2019 -0800
     2.2 +++ b/configure.ac	Sun Dec 22 13:42:20 2019 -0800
     2.3 @@ -3326,7 +3326,6 @@
     2.4                      if test x$have_loadso != xyes; then
     2.5                          AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libusb loading])
     2.6                      fi
     2.7 -                    SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
     2.8                      # libusb is loaded dynamically, so don't add it to LDFLAGS
     2.9                      libusb_lib=""
    2.10                      case "$host" in
    2.11 @@ -3342,8 +3341,6 @@
    2.12                      fi
    2.13                      AC_DEFINE_UNQUOTED(SDL_LIBUSB_DYNAMIC, "$libusb_lib", [ ])
    2.14                  fi
    2.15 -            else
    2.16 -                SOURCES="$SOURCES $srcdir/src/hidapi/SDL_hidapi.c"
    2.17              fi
    2.18          fi
    2.19