comparison configure.in @ 381:bc1401311390

Wilbern Cobb submitted a fix for building BSD joystick support that should work on all BSD flavors.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 28 May 2002 20:01:29 +0000
parents 6089cd59e3ca
children 74bdcae44bf5
comparison
equal deleted inserted replaced
380:bce7171e7a85 381:bc1401311390
1443 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl") 1443 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
1444 fi 1444 fi
1445 fi 1445 fi
1446 } 1446 }
1447 1447
1448 dnl Check for the usbhid(3) library on *BSD
1449 CheckUSBHID()
1450 {
1451 if test x$enable_joystick = xyes; then
1452 have_libusbhid=no
1453 have_libusb=no
1454 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
1455 AC_CHECK_LIB(usb, hid_init, have_libusb=yes)
1456 if test x$have_libusbhid = xyes; then
1457 SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
1458 fi
1459 if test x$have_libusb = xyes; then
1460 SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
1461 fi
1462
1463 AC_CHECK_HEADER(usbhid.h, have_usbhid_h=yes)
1464 AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
1465 AC_CHECK_HEADER(libusbhid.h, have_libusbhid_h=yes)
1466 if test x$have_usbhid_h = xyes; then
1467 CFLAGS="$CFLAGS -DHAVE_USBHID_H"
1468 fi
1469 if test x$have_libusb_h = xyes; then
1470 CFLAGS="$CFLAGS -DHAVE_LIBUSB_H"
1471 fi
1472 if test x$have_libusbhid_h = xyes; then
1473 CFLAGS="$CFLAGS -DHAVE_LIBUSBHID_H"
1474 fi
1475
1476 AC_MSG_CHECKING(for usbhid)
1477 have_usbhid=no
1478 AC_TRY_COMPILE([
1479 #include <dev/usb/usb.h>
1480 #include <dev/usb/usbhid.h>
1481 #if defined(HAVE_USBHID_H)
1482 #include <usbhid.h>
1483 #elif defined(HAVE_LIBUSB_H)
1484 #include <libusb.h>
1485 #elif defined(HAVE_LIBUSBHID_H)
1486 #include <libusbhid.h>
1487 #endif
1488 ],[
1489 struct report_desc *repdesc;
1490 struct usb_ctl_report *repbuf;
1491 enum hid_kind hidkind;
1492 ],[
1493 have_usbhid=yes
1494 ])
1495 AC_MSG_RESULT($have_usbhid)
1496
1497 if test x$have_usbhid = xyes; then
1498 AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
1499 have_usbhid_ucr_data=no
1500 AC_TRY_COMPILE([
1501 #include <dev/usb/usb.h>
1502 #include <dev/usb/usbhid.h>
1503 #include <stdio.h>
1504 #if defined(HAVE_USBHID_H)
1505 #include <usbhid.h>
1506 #elif defined(HAVE_LIBUSB_H)
1507 #include <libusb.h>
1508 #elif defined(HAVE_LIBUSBHID_H)
1509 #include <libusbhid.h>
1510 #endif
1511 ],[
1512 struct usb_ctl_report buf;
1513 if (buf.ucr_data) { }
1514 ],[
1515 have_usbhid_ucr_data=yes
1516 ])
1517 if test x$have_usbhid_ucr_data = xyes; then
1518 CFLAGS="$CFLAGS -DUSBHID_UCR_DATA"
1519 fi
1520 AC_MSG_RESULT($have_usbhid_ucr_data)
1521
1522 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
1523 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
1524 fi
1525 fi
1526 }
1527
1448 case "$target" in 1528 case "$target" in
1449 *-*-linux*) 1529 *-*-linux*)
1450 ARCH=linux 1530 ARCH=linux
1451 CheckDummyVideo 1531 CheckDummyVideo
1452 CheckDiskAudio 1532 CheckDiskAudio
1596 CheckDGA 1676 CheckDGA
1597 CheckSVGA 1677 CheckSVGA
1598 CheckAAlib 1678 CheckAAlib
1599 CheckOpenGL 1679 CheckOpenGL
1600 CheckPTHREAD 1680 CheckPTHREAD
1681 CheckUSBHID
1601 # Set up files for the main() stub 1682 # Set up files for the main() stub
1602 COPY_ARCH_SRC(src/main, linux, SDL_main.c) 1683 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1603 # Set up files for the audio library 1684 # Set up files for the audio library
1604 # We use the OSS and ALSA API's, not the Sun audio API 1685 # We use the OSS and ALSA API's, not the Sun audio API
1605 #if test x$enable_audio = xyes; then 1686 #if test x$enable_audio = xyes; then
1606 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" 1687 # CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
1607 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" 1688 # AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1608 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" 1689 # AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1609 #fi 1690 #fi
1610 # Set up files for the joystick library
1611 if test x$enable_joystick = xyes; then
1612 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
1613 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
1614 SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
1615 fi
1616 # Set up files for the cdrom library 1691 # Set up files for the cdrom library
1617 if test x$enable_cdrom = xyes; then 1692 if test x$enable_cdrom = xyes; then
1618 CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd" 1693 CDROM_SUBDIRS="$CDROM_SUBDIRS freebsd"
1619 CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la" 1694 CDROM_DRIVERS="$CDROM_DRIVERS freebsd/libcdrom_freebsd.la"
1620 fi 1695 fi
1650 CheckNAS 1725 CheckNAS
1651 CheckX11 1726 CheckX11
1652 CheckAAlib 1727 CheckAAlib
1653 CheckOpenGL 1728 CheckOpenGL
1654 CheckPTHREAD 1729 CheckPTHREAD
1730 CheckUSBHID
1655 # Set up files for the main() stub 1731 # Set up files for the main() stub
1656 COPY_ARCH_SRC(src/main, linux, SDL_main.c) 1732 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1657 # Set up files for the audio library 1733 # Set up files for the audio library
1658 if test x$enable_audio = xyes; then 1734 if test x$enable_audio = xyes; then
1659 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT" 1735 CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
1660 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" 1736 AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
1661 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" 1737 AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
1662 fi
1663 # Set up files for the joystick library
1664 if test x$enable_joystick = xyes; then
1665 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
1666 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
1667 SYSTEM_LIBS="$SYSTEM_LIBS -lusb"
1668 fi 1738 fi
1669 # Set up files for the cdrom library 1739 # Set up files for the cdrom library
1670 if test x$enable_cdrom = xyes; then 1740 if test x$enable_cdrom = xyes; then
1671 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd" 1741 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
1672 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la" 1742 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"
1705 CheckNAS 1775 CheckNAS
1706 CheckX11 1776 CheckX11
1707 CheckAAlib 1777 CheckAAlib
1708 CheckOpenGL 1778 CheckOpenGL
1709 CheckPTHREAD 1779 CheckPTHREAD
1780 CheckUSBHID
1710 # Set up files for the main() stub 1781 # Set up files for the main() stub
1711 COPY_ARCH_SRC(src/main, linux, SDL_main.c) 1782 COPY_ARCH_SRC(src/main, linux, SDL_main.c)
1712 # Set up files for the audio library 1783 # Set up files for the audio library
1713 if test x$enable_audio = xyes; then 1784 if test x$enable_audio = xyes; then
1714 CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT" 1785 CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
1716 AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la" 1787 AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
1717 fi 1788 fi
1718 # OpenBSD needs linking with ossaudio emulation library 1789 # OpenBSD needs linking with ossaudio emulation library
1719 if test x$have_oss = xyes; then 1790 if test x$have_oss = xyes; then
1720 SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio" 1791 SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
1721 fi
1722 # Set up files for the joystick library
1723 if test x$enable_joystick = xyes; then
1724 JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS bsd"
1725 JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS bsd/libjoystick_bsd.la"
1726 SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
1727 fi 1792 fi
1728 # Set up files for the cdrom library 1793 # Set up files for the cdrom library
1729 if test x$enable_cdrom = xyes; then 1794 if test x$enable_cdrom = xyes; then
1730 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd" 1795 CDROM_SUBDIRS="$CDROM_SUBDIRS openbsd"
1731 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la" 1796 CDROM_DRIVERS="$CDROM_DRIVERS openbsd/libcdrom_openbsd.la"