comparison configure.in @ 1565:57431b199aed

Fixed bug #52 Integrated most of the NetBSD and DragonFly patches at: ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/devel/SDL/patches/ Thanks to Thomas Klausner for defailed information on the patches
author Sam Lantinga <slouken@libsdl.org>
date Tue, 21 Mar 2006 08:54:50 +0000
parents 011b633fa0c9
children 5bc2a95f9dcf
comparison
equal deleted inserted replaced
1564:4950a25bd91e 1565:57431b199aed
48 else 48 else
49 AC_DEFINE(SDL_BYTEORDER, 1234) 49 AC_DEFINE(SDL_BYTEORDER, 1234)
50 fi 50 fi
51 51
52 dnl Set up the compiler and linker flags 52 dnl Set up the compiler and linker flags
53 INCLUDE="-I$srcdir/include" 53 INCLUDE="-I$srcdir/include $INCLUDE"
54 if test x$srcdir != x.; then 54 if test x$srcdir != x.; then
55 INCLUDE="-Iinclude $INCLUDE" 55 INCLUDE="-Iinclude $INCLUDE"
56 fi
57 if test -d /usr/local/include; then
58 INCLUDE="$INCLUDE -I/usr/local/include"
56 fi 59 fi
57 case "$host" in 60 case "$host" in
58 *-*-cygwin*) 61 *-*-cygwin*)
59 # We build SDL on cygwin without the UNIX emulation layer 62 # We build SDL on cygwin without the UNIX emulation layer
60 BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin" 63 BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
282 AC_DEFINE(SDL_AUDIO_DRIVER_OSS) 285 AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
283 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c" 286 SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
284 SOURCES="$SOURCES $srcdir/src/audio/dma/*.c" 287 SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
285 have_audio=yes 288 have_audio=yes
286 289
287 # OpenBSD needs linking with ossaudio emulation library 290 # We may need to link with ossaudio emulation library
288 case "$host" in 291 case "$host" in
289 *-*-openbsd*|*-*-netbsd*) 292 *-*-openbsd*|*-*-netbsd*)
290 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";; 293 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
291 esac 294 esac
292 fi 295 fi
1497 *-*-darwin*) 1500 *-*-darwin*)
1498 pthread_cflags="-D_THREAD_SAFE" 1501 pthread_cflags="-D_THREAD_SAFE"
1499 # causes Carbon.p complaints? 1502 # causes Carbon.p complaints?
1500 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" 1503 # pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1501 ;; 1504 ;;
1502 *-*-freebsd*) 1505 *-*-freebsd*|*-*-dragonfly*)
1503 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" 1506 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1504 pthread_lib="-pthread" 1507 pthread_lib="-pthread"
1505 ;; 1508 ;;
1506 *-*-netbsd*) 1509 *-*-netbsd*)
1507 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" 1510 pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
1759 1762
1760 dnl Check for the usbhid(3) library on *BSD 1763 dnl Check for the usbhid(3) library on *BSD
1761 CheckUSBHID() 1764 CheckUSBHID()
1762 { 1765 {
1763 if test x$enable_joystick = xyes; then 1766 if test x$enable_joystick = xyes; then
1764 AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"]) 1767 AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
1765 AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"]) 1768 if test x$have_libusbhid = xyes; then
1766 AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"]) 1769 AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
1767 AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"]) 1770 AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
1771 USB_LIBS="$USB_LIBS -lusbhid"
1772 else
1773 AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
1774 AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
1775 AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
1776 fi
1768 1777
1769 AC_CHECK_LIB(usbhid, hid_init, [USB_LIBS="$USB_LIBS -lusbhid"])
1770 AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
1771
1772 save_CFLAGS="$CFLAGS" 1778 save_CFLAGS="$CFLAGS"
1773 CFLAGS="$CFLAGS $USB_CFLAGS" 1779 CFLAGS="$CFLAGS $USB_CFLAGS"
1774 1780
1775 AC_MSG_CHECKING(for usbhid) 1781 AC_MSG_CHECKING(for usbhid)
1776 have_usbhid=no 1782 have_usbhid=no
1777 AC_TRY_COMPILE([ 1783 AC_TRY_COMPILE([
1778 #include <sys/types.h> 1784 #include <sys/types.h>
1779 #if defined(HAVE_USB_H) 1785 #if defined(HAVE_USB_H)
1780 #include <usb.h> 1786 #include <usb.h>
1781 #endif 1787 #endif
1782 #include <dev/usb/usb.h> 1788 #ifdef __DragonFly__
1783 #include <dev/usb/usbhid.h> 1789 # include <bus/usb/usb.h>
1790 # include <bus/usb/usbhid.h>
1791 #else
1792 # include <dev/usb/usb.h>
1793 # include <dev/usb/usbhid.h>
1794 #endif
1784 #if defined(HAVE_USBHID_H) 1795 #if defined(HAVE_USBHID_H)
1785 #include <usbhid.h> 1796 #include <usbhid.h>
1786 #elif defined(HAVE_LIBUSB_H) 1797 #elif defined(HAVE_LIBUSB_H)
1787 #include <libusb.h> 1798 #include <libusb.h>
1788 #elif defined(HAVE_LIBUSBHID_H) 1799 #elif defined(HAVE_LIBUSBHID_H)
1803 AC_TRY_COMPILE([ 1814 AC_TRY_COMPILE([
1804 #include <sys/types.h> 1815 #include <sys/types.h>
1805 #if defined(HAVE_USB_H) 1816 #if defined(HAVE_USB_H)
1806 #include <usb.h> 1817 #include <usb.h>
1807 #endif 1818 #endif
1808 #include <dev/usb/usb.h> 1819 #ifdef __DragonFly__
1809 #include <dev/usb/usbhid.h> 1820 # include <bus/usb/usb.h>
1821 # include <bus/usb/usbhid.h>
1822 #else
1823 # include <dev/usb/usb.h>
1824 # include <dev/usb/usbhid.h>
1825 #endif
1810 #if defined(HAVE_USBHID_H) 1826 #if defined(HAVE_USBHID_H)
1811 #include <usbhid.h> 1827 #include <usbhid.h>
1812 #elif defined(HAVE_LIBUSB_H) 1828 #elif defined(HAVE_LIBUSB_H)
1813 #include <libusb.h> 1829 #include <libusb.h>
1814 #elif defined(HAVE_LIBUSBHID_H) 1830 #elif defined(HAVE_LIBUSBHID_H)
1850 if test x$have_usbhid_new = xyes; then 1866 if test x$have_usbhid_new = xyes; then
1851 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW" 1867 USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
1852 fi 1868 fi
1853 AC_MSG_RESULT($have_usbhid_new) 1869 AC_MSG_RESULT($have_usbhid_new)
1854 1870
1871 AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
1872 have_machine_joystick=no
1873 AC_TRY_COMPILE([
1874 #include <machine/joystick.h>
1875 ],[
1876 struct joystick t;
1877 ],[
1878 have_machine_joystick=yes
1879 ])
1880 if test x$have_machine_joystick = xyes; then
1881 AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
1882 fi
1883 AC_MSG_RESULT($have_machine_joystick)
1884
1855 AC_DEFINE(SDL_JOYSTICK_USBHID) 1885 AC_DEFINE(SDL_JOYSTICK_USBHID)
1856 SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c" 1886 SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
1857 EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS" 1887 EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
1858 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS" 1888 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
1859 have_joystick=yes 1889 have_joystick=yes
1860 fi 1890 fi
1861 CFLAGS="$save_CFLAGS" 1891 CFLAGS="$save_CFLAGS"
1862 fi 1892 fi
1863 } 1893 }
1894
1864 1895
1865 dnl Check for clock_gettime() 1896 dnl Check for clock_gettime()
1866 CheckClockGettime() 1897 CheckClockGettime()
1867 { 1898 {
1868 AC_ARG_ENABLE(clock_gettime, 1899 AC_ARG_ENABLE(clock_gettime,
1905 AC_DEFINE(SDL_TIMER_UNIX) 1936 AC_DEFINE(SDL_TIMER_UNIX)
1906 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" 1937 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
1907 have_timers=yes 1938 have_timers=yes
1908 fi 1939 fi
1909 ;; 1940 ;;
1910 *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*) 1941 *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
1911 case "$host" in 1942 case "$host" in
1912 *-*-linux*) ARCH=linux ;; 1943 *-*-linux*) ARCH=linux ;;
1913 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;; 1944 *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
1914 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;; 1945 *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
1915 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;; 1946 *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
1916 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants 1947 *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
1917 *-*-bsdi*) ARCH=bsdi ;; 1948 *-*-bsdi*) ARCH=bsdi ;;
1918 *-*-freebsd*) ARCH=freebsd ;; 1949 *-*-freebsd*) ARCH=freebsd ;;
1950 *-*-dragonfly*) ARCH=freebsd ;;
1919 *-*-netbsd*) ARCH=netbsd ;; 1951 *-*-netbsd*) ARCH=netbsd ;;
1920 *-*-openbsd*) ARCH=openbsd ;; 1952 *-*-openbsd*) ARCH=openbsd ;;
1921 *-*-sysv5*) ARCH=sysv5 ;; 1953 *-*-sysv5*) ARCH=sysv5 ;;
1922 *-*-solaris*) ARCH=solaris ;; 1954 *-*-solaris*) ARCH=solaris ;;
1923 *-*-hpux*) ARCH=hpux ;; 1955 *-*-hpux*) ARCH=hpux ;;
1959 CheckLinuxVersion 1991 CheckLinuxVersion
1960 CheckRPATH 1992 CheckRPATH
1961 # Set up files for the audio library 1993 # Set up files for the audio library
1962 if test x$enable_audio = xyes; then 1994 if test x$enable_audio = xyes; then
1963 case $ARCH in 1995 case $ARCH in
1964 netbsd|sysv5|solaris|hpux) 1996 sysv5|solaris|hpux)
1965 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO) 1997 AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
1966 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" 1998 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
1967 have_audio=yes 1999 have_audio=yes
1968 ;; 2000 ;;
1969 openbsd) 2001 netbsd|openbsd)
1970 AC_DEFINE(SDL_AUDIO_DRIVER_OPENBSD) 2002 AC_DEFINE(SDL_AUDIO_DRIVER_OPENBSD)
1971 SOURCES="$SOURCES $srcdir/src/audio/openbsd/*.c" 2003 SOURCES="$SOURCES $srcdir/src/audio/openbsd/*.c"
1972 have_audio=yes 2004 have_audio=yes
1973 ;; 2005 ;;
1974 aix) 2006 aix)
2386 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'` 2418 SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
2387 2419
2388 # Set runtime shared library paths as needed 2420 # Set runtime shared library paths as needed
2389 2421
2390 if test "x$enable_rpath" = "xyes"; then 2422 if test "x$enable_rpath" = "xyes"; then
2391 if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi -o $ARCH = irix; then 2423 if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
2392 SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib" 2424 SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
2393 fi 2425 fi
2394 if test $ARCH = solaris; then 2426 if test $ARCH = solaris; then
2395 SDL_RLD_FLAGS="-R\${exec_prefix}/lib" 2427 SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
2396 fi 2428 fi