configure
changeset 7811 9dfcc6bad831
parent 7803 97a1127629fb
child 7977 5272ae8fccd7
     1.1 --- a/configure	Sun Oct 13 19:48:45 2013 -0700
     1.2 +++ b/configure	Sun Oct 13 19:49:45 2013 -0700
     1.3 @@ -21634,8 +21634,10 @@
     1.4  
     1.5  CheckUSBHID()
     1.6  {
     1.7 -    if test x$enable_joystick = xyes; then
     1.8 -        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusbhid" >&5
     1.9 +    case "$host" in
    1.10 +        *-*-*bsd*)
    1.11 +            if test x$enable_joystick = xyes; then
    1.12 +                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusbhid" >&5
    1.13  $as_echo_n "checking for hid_init in -lusbhid... " >&6; }
    1.14  if ${ac_cv_lib_usbhid_hid_init+:} false; then :
    1.15    $as_echo_n "(cached) " >&6
    1.16 @@ -21675,34 +21677,34 @@
    1.17    have_libusbhid=yes
    1.18  fi
    1.19  
    1.20 -        if test x$have_libusbhid = xyes; then
    1.21 -            ac_fn_c_check_header_mongrel "$LINENO" "usbhid.h" "ac_cv_header_usbhid_h" "$ac_includes_default"
    1.22 +                if test x$have_libusbhid = xyes; then
    1.23 +                    ac_fn_c_check_header_mongrel "$LINENO" "usbhid.h" "ac_cv_header_usbhid_h" "$ac_includes_default"
    1.24  if test "x$ac_cv_header_usbhid_h" = xyes; then :
    1.25    USB_CFLAGS="-DHAVE_USBHID_H"
    1.26  fi
    1.27  
    1.28  
    1.29 -            ac_fn_c_check_header_mongrel "$LINENO" "libusbhid.h" "ac_cv_header_libusbhid_h" "$ac_includes_default"
    1.30 +                    ac_fn_c_check_header_mongrel "$LINENO" "libusbhid.h" "ac_cv_header_libusbhid_h" "$ac_includes_default"
    1.31  if test "x$ac_cv_header_libusbhid_h" = xyes; then :
    1.32    USB_CFLAGS="-DHAVE_LIBUSBHID_H"
    1.33  fi
    1.34  
    1.35  
    1.36 -            USB_LIBS="$USB_LIBS -lusbhid"
    1.37 -        else
    1.38 -            ac_fn_c_check_header_mongrel "$LINENO" "usb.h" "ac_cv_header_usb_h" "$ac_includes_default"
    1.39 +                    USB_LIBS="$USB_LIBS -lusbhid"
    1.40 +                else
    1.41 +                    ac_fn_c_check_header_mongrel "$LINENO" "usb.h" "ac_cv_header_usb_h" "$ac_includes_default"
    1.42  if test "x$ac_cv_header_usb_h" = xyes; then :
    1.43    USB_CFLAGS="-DHAVE_USB_H"
    1.44  fi
    1.45  
    1.46  
    1.47 -            ac_fn_c_check_header_mongrel "$LINENO" "libusb.h" "ac_cv_header_libusb_h" "$ac_includes_default"
    1.48 +                    ac_fn_c_check_header_mongrel "$LINENO" "libusb.h" "ac_cv_header_libusb_h" "$ac_includes_default"
    1.49  if test "x$ac_cv_header_libusb_h" = xyes; then :
    1.50    USB_CFLAGS="-DHAVE_LIBUSB_H"
    1.51  fi
    1.52  
    1.53  
    1.54 -            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusb" >&5
    1.55 +                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusb" >&5
    1.56  $as_echo_n "checking for hid_init in -lusb... " >&6; }
    1.57  if ${ac_cv_lib_usb_hid_init+:} false; then :
    1.58    $as_echo_n "(cached) " >&6
    1.59 @@ -21742,196 +21744,198 @@
    1.60    USB_LIBS="$USB_LIBS -lusb"
    1.61  fi
    1.62  
    1.63 -        fi
    1.64 -
    1.65 -        save_CFLAGS="$CFLAGS"
    1.66 -        CFLAGS="$CFLAGS $USB_CFLAGS"
    1.67 -
    1.68 -        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usbhid" >&5
    1.69 +                fi
    1.70 +
    1.71 +                save_CFLAGS="$CFLAGS"
    1.72 +                CFLAGS="$CFLAGS $USB_CFLAGS"
    1.73 +
    1.74 +                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usbhid" >&5
    1.75  $as_echo_n "checking for usbhid... " >&6; }
    1.76 -        have_usbhid=no
    1.77 -        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.78 -/* end confdefs.h.  */
    1.79 -
    1.80 -          #include <sys/types.h>
    1.81 -          #if defined(HAVE_USB_H)
    1.82 -          #include <usb.h>
    1.83 -          #endif
    1.84 -          #ifdef __DragonFly__
    1.85 -          # include <bus/usb/usb.h>
    1.86 -          # include <bus/usb/usbhid.h>
    1.87 -          #else
    1.88 -          # include <dev/usb/usb.h>
    1.89 -          # include <dev/usb/usbhid.h>
    1.90 -          #endif
    1.91 -          #if defined(HAVE_USBHID_H)
    1.92 -          #include <usbhid.h>
    1.93 -          #elif defined(HAVE_LIBUSB_H)
    1.94 -          #include <libusb.h>
    1.95 -          #elif defined(HAVE_LIBUSBHID_H)
    1.96 -          #include <libusbhid.h>
    1.97 -          #endif
    1.98 -
    1.99 -int
   1.100 -main ()
   1.101 -{
   1.102 -
   1.103 -          struct report_desc *repdesc;
   1.104 -          struct usb_ctl_report *repbuf;
   1.105 -          hid_kind_t hidkind;
   1.106 -
   1.107 -  ;
   1.108 -  return 0;
   1.109 -}
   1.110 -_ACEOF
   1.111 -if ac_fn_c_try_compile "$LINENO"; then :
   1.112 -
   1.113 -        have_usbhid=yes
   1.114 -
   1.115 -fi
   1.116 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.117 -        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid" >&5
   1.118 +                have_usbhid=no
   1.119 +                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.120 +/* end confdefs.h.  */
   1.121 +
   1.122 +                  #include <sys/types.h>
   1.123 +                  #if defined(HAVE_USB_H)
   1.124 +                  #include <usb.h>
   1.125 +                  #endif
   1.126 +                  #ifdef __DragonFly__
   1.127 +                  # include <bus/usb/usb.h>
   1.128 +                  # include <bus/usb/usbhid.h>
   1.129 +                  #else
   1.130 +                  # include <dev/usb/usb.h>
   1.131 +                  # include <dev/usb/usbhid.h>
   1.132 +                  #endif
   1.133 +                  #if defined(HAVE_USBHID_H)
   1.134 +                  #include <usbhid.h>
   1.135 +                  #elif defined(HAVE_LIBUSB_H)
   1.136 +                  #include <libusb.h>
   1.137 +                  #elif defined(HAVE_LIBUSBHID_H)
   1.138 +                  #include <libusbhid.h>
   1.139 +                  #endif
   1.140 +
   1.141 +int
   1.142 +main ()
   1.143 +{
   1.144 +
   1.145 +                  struct report_desc *repdesc;
   1.146 +                  struct usb_ctl_report *repbuf;
   1.147 +                  hid_kind_t hidkind;
   1.148 +
   1.149 +  ;
   1.150 +  return 0;
   1.151 +}
   1.152 +_ACEOF
   1.153 +if ac_fn_c_try_compile "$LINENO"; then :
   1.154 +
   1.155 +                have_usbhid=yes
   1.156 +
   1.157 +fi
   1.158 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.159 +                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid" >&5
   1.160  $as_echo "$have_usbhid" >&6; }
   1.161  
   1.162 -        if test x$have_usbhid = xyes; then
   1.163 -            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ucr_data member of usb_ctl_report" >&5
   1.164 +                if test x$have_usbhid = xyes; then
   1.165 +                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ucr_data member of usb_ctl_report" >&5
   1.166  $as_echo_n "checking for ucr_data member of usb_ctl_report... " >&6; }
   1.167 -            have_usbhid_ucr_data=no
   1.168 -            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.169 -/* end confdefs.h.  */
   1.170 -
   1.171 -              #include <sys/types.h>
   1.172 -              #if defined(HAVE_USB_H)
   1.173 -              #include <usb.h>
   1.174 -              #endif
   1.175 -              #ifdef __DragonFly__
   1.176 -              # include <bus/usb/usb.h>
   1.177 -              # include <bus/usb/usbhid.h>
   1.178 -              #else
   1.179 -              # include <dev/usb/usb.h>
   1.180 -              # include <dev/usb/usbhid.h>
   1.181 -              #endif
   1.182 -              #if defined(HAVE_USBHID_H)
   1.183 -              #include <usbhid.h>
   1.184 -              #elif defined(HAVE_LIBUSB_H)
   1.185 -              #include <libusb.h>
   1.186 -              #elif defined(HAVE_LIBUSBHID_H)
   1.187 -              #include <libusbhid.h>
   1.188 -              #endif
   1.189 -
   1.190 -int
   1.191 -main ()
   1.192 -{
   1.193 -
   1.194 -              struct usb_ctl_report buf;
   1.195 -              if (buf.ucr_data) { }
   1.196 -
   1.197 -  ;
   1.198 -  return 0;
   1.199 -}
   1.200 -_ACEOF
   1.201 -if ac_fn_c_try_compile "$LINENO"; then :
   1.202 -
   1.203 -            have_usbhid_ucr_data=yes
   1.204 -
   1.205 -fi
   1.206 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.207 -            if test x$have_usbhid_ucr_data = xyes; then
   1.208 -                USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
   1.209 -            fi
   1.210 -            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid_ucr_data" >&5
   1.211 +                    have_usbhid_ucr_data=no
   1.212 +                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.213 +/* end confdefs.h.  */
   1.214 +
   1.215 +                      #include <sys/types.h>
   1.216 +                      #if defined(HAVE_USB_H)
   1.217 +                      #include <usb.h>
   1.218 +                      #endif
   1.219 +                      #ifdef __DragonFly__
   1.220 +                      # include <bus/usb/usb.h>
   1.221 +                      # include <bus/usb/usbhid.h>
   1.222 +                      #else
   1.223 +                      # include <dev/usb/usb.h>
   1.224 +                      # include <dev/usb/usbhid.h>
   1.225 +                      #endif
   1.226 +                      #if defined(HAVE_USBHID_H)
   1.227 +                      #include <usbhid.h>
   1.228 +                      #elif defined(HAVE_LIBUSB_H)
   1.229 +                      #include <libusb.h>
   1.230 +                      #elif defined(HAVE_LIBUSBHID_H)
   1.231 +                      #include <libusbhid.h>
   1.232 +                      #endif
   1.233 +
   1.234 +int
   1.235 +main ()
   1.236 +{
   1.237 +
   1.238 +                      struct usb_ctl_report buf;
   1.239 +                      if (buf.ucr_data) { }
   1.240 +
   1.241 +  ;
   1.242 +  return 0;
   1.243 +}
   1.244 +_ACEOF
   1.245 +if ac_fn_c_try_compile "$LINENO"; then :
   1.246 +
   1.247 +                    have_usbhid_ucr_data=yes
   1.248 +
   1.249 +fi
   1.250 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.251 +                    if test x$have_usbhid_ucr_data = xyes; then
   1.252 +                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
   1.253 +                    fi
   1.254 +                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid_ucr_data" >&5
   1.255  $as_echo "$have_usbhid_ucr_data" >&6; }
   1.256  
   1.257 -            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new usbhid API" >&5
   1.258 +                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new usbhid API" >&5
   1.259  $as_echo_n "checking for new usbhid API... " >&6; }
   1.260 -            have_usbhid_new=no
   1.261 -            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.262 -/* end confdefs.h.  */
   1.263 -
   1.264 -              #include <sys/types.h>
   1.265 -              #if defined(HAVE_USB_H)
   1.266 -              #include <usb.h>
   1.267 -              #endif
   1.268 -              #ifdef __DragonFly__
   1.269 -              #include <bus/usb/usb.h>
   1.270 -              #include <bus/usb/usbhid.h>
   1.271 -              #else
   1.272 -              #include <dev/usb/usb.h>
   1.273 -              #include <dev/usb/usbhid.h>
   1.274 -              #endif
   1.275 -              #if defined(HAVE_USBHID_H)
   1.276 -              #include <usbhid.h>
   1.277 -              #elif defined(HAVE_LIBUSB_H)
   1.278 -              #include <libusb.h>
   1.279 -              #elif defined(HAVE_LIBUSBHID_H)
   1.280 -              #include <libusbhid.h>
   1.281 -              #endif
   1.282 -
   1.283 -int
   1.284 -main ()
   1.285 -{
   1.286 -
   1.287 -              report_desc_t d;
   1.288 -              hid_start_parse(d, 1, 1);
   1.289 -
   1.290 -  ;
   1.291 -  return 0;
   1.292 -}
   1.293 -_ACEOF
   1.294 -if ac_fn_c_try_compile "$LINENO"; then :
   1.295 -
   1.296 -            have_usbhid_new=yes
   1.297 -
   1.298 -fi
   1.299 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.300 -            if test x$have_usbhid_new = xyes; then
   1.301 -                USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
   1.302 -            fi
   1.303 -            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid_new" >&5
   1.304 +                    have_usbhid_new=no
   1.305 +                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.306 +/* end confdefs.h.  */
   1.307 +
   1.308 +                      #include <sys/types.h>
   1.309 +                      #if defined(HAVE_USB_H)
   1.310 +                      #include <usb.h>
   1.311 +                      #endif
   1.312 +                      #ifdef __DragonFly__
   1.313 +                      #include <bus/usb/usb.h>
   1.314 +                      #include <bus/usb/usbhid.h>
   1.315 +                      #else
   1.316 +                      #include <dev/usb/usb.h>
   1.317 +                      #include <dev/usb/usbhid.h>
   1.318 +                      #endif
   1.319 +                      #if defined(HAVE_USBHID_H)
   1.320 +                      #include <usbhid.h>
   1.321 +                      #elif defined(HAVE_LIBUSB_H)
   1.322 +                      #include <libusb.h>
   1.323 +                      #elif defined(HAVE_LIBUSBHID_H)
   1.324 +                      #include <libusbhid.h>
   1.325 +                      #endif
   1.326 +
   1.327 +int
   1.328 +main ()
   1.329 +{
   1.330 +
   1.331 +                      report_desc_t d;
   1.332 +                      hid_start_parse(d, 1, 1);
   1.333 +
   1.334 +  ;
   1.335 +  return 0;
   1.336 +}
   1.337 +_ACEOF
   1.338 +if ac_fn_c_try_compile "$LINENO"; then :
   1.339 +
   1.340 +                    have_usbhid_new=yes
   1.341 +
   1.342 +fi
   1.343 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.344 +                    if test x$have_usbhid_new = xyes; then
   1.345 +                        USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
   1.346 +                    fi
   1.347 +                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid_new" >&5
   1.348  $as_echo "$have_usbhid_new" >&6; }
   1.349  
   1.350 -            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct joystick in machine/joystick.h" >&5
   1.351 +                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct joystick in machine/joystick.h" >&5
   1.352  $as_echo_n "checking for struct joystick in machine/joystick.h... " >&6; }
   1.353 -            have_machine_joystick=no
   1.354 -            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.355 -/* end confdefs.h.  */
   1.356 -
   1.357 -              #include <machine/joystick.h>
   1.358 -
   1.359 -int
   1.360 -main ()
   1.361 -{
   1.362 -
   1.363 -              struct joystick t;
   1.364 -
   1.365 -  ;
   1.366 -  return 0;
   1.367 -}
   1.368 -_ACEOF
   1.369 -if ac_fn_c_try_compile "$LINENO"; then :
   1.370 -
   1.371 -            have_machine_joystick=yes
   1.372 -
   1.373 -fi
   1.374 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.375 -            if test x$have_machine_joystick = xyes; then
   1.376 +                    have_machine_joystick=no
   1.377 +                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.378 +/* end confdefs.h.  */
   1.379 +
   1.380 +                      #include <machine/joystick.h>
   1.381 +
   1.382 +int
   1.383 +main ()
   1.384 +{
   1.385 +
   1.386 +                      struct joystick t;
   1.387 +
   1.388 +  ;
   1.389 +  return 0;
   1.390 +}
   1.391 +_ACEOF
   1.392 +if ac_fn_c_try_compile "$LINENO"; then :
   1.393 +
   1.394 +                    have_machine_joystick=yes
   1.395 +
   1.396 +fi
   1.397 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   1.398 +                    if test x$have_machine_joystick = xyes; then
   1.399  
   1.400  $as_echo "#define SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1" >>confdefs.h
   1.401  
   1.402 -            fi
   1.403 -            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_machine_joystick" >&5
   1.404 +                    fi
   1.405 +                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_machine_joystick" >&5
   1.406  $as_echo "$have_machine_joystick" >&6; }
   1.407  
   1.408  
   1.409  $as_echo "#define SDL_JOYSTICK_USBHID 1" >>confdefs.h
   1.410  
   1.411 -            SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
   1.412 -            EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
   1.413 -            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
   1.414 -            have_joystick=yes
   1.415 -        fi
   1.416 -        CFLAGS="$save_CFLAGS"
   1.417 -    fi
   1.418 +                    SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
   1.419 +                    EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
   1.420 +                    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
   1.421 +                    have_joystick=yes
   1.422 +                fi
   1.423 +                CFLAGS="$save_CFLAGS"
   1.424 +            fi
   1.425 +        ;;
   1.426 +    esac
   1.427  }
   1.428  
   1.429  CheckClockGettime()