configure.in
changeset 94 ae6e6b73333f
parent 86 13e4c612098d
child 121 43febd46d49d
equal deleted inserted replaced
93:fc774f445e10 94:ae6e6b73333f
   243 [  --enable-oss            support the OSS audio API [default=yes]],
   243 [  --enable-oss            support the OSS audio API [default=yes]],
   244                   , enable_oss=yes)
   244                   , enable_oss=yes)
   245     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   245     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
   246         AC_MSG_CHECKING(for OSS audio support)
   246         AC_MSG_CHECKING(for OSS audio support)
   247         have_oss=no
   247         have_oss=no
   248         AC_TRY_COMPILE([
   248         if test x$have_oss != xyes; then
   249           #include <sys/soundcard.h>
   249             AC_TRY_COMPILE([
   250         ],[
   250               #include <sys/soundcard.h>
   251           int arg = SNDCTL_DSP_SETFRAGMENT;
   251             ],[
   252         ],[
   252               int arg = SNDCTL_DSP_SETFRAGMENT;
   253         have_oss=yes
   253             ],[
   254         ])
   254             have_oss=yes
       
   255             ])
       
   256         fi
       
   257         if test x$have_oss != xyes; then
       
   258             AC_TRY_COMPILE([
       
   259               #include <soundcard.h>
       
   260             ],[
       
   261               int arg = SNDCTL_DSP_SETFRAGMENT;
       
   262             ],[
       
   263             have_oss=yes
       
   264             CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
       
   265             ])
       
   266         fi
   255         AC_MSG_RESULT($have_oss)
   267         AC_MSG_RESULT($have_oss)
   256         if test x$have_oss = xyes; then
   268         if test x$have_oss = xyes; then
   257             CFLAGS="$CFLAGS -DOSS_SUPPORT"
   269             CFLAGS="$CFLAGS -DOSS_SUPPORT"
   258             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
   270             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dsp"
   259             AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
   271             AUDIO_DRIVERS="$AUDIO_DRIVERS dsp/libaudio_dsp.la"
   284 
   296 
   285 dnl Check whether we want to use OpenBSD native audio or not
   297 dnl Check whether we want to use OpenBSD native audio or not
   286 CheckOPENBSDAUDIO()
   298 CheckOPENBSDAUDIO()
   287 {
   299 {
   288     AC_ARG_ENABLE(openbsdaudio,
   300     AC_ARG_ENABLE(openbsdaudio,
   289 [  --enable-openbsdaudio   OpenBSD native audio support [default=no]],
   301 [  --enable-openbsdaudio   OpenBSD native audio support [default=yes]],
   290                   , enable_openbsdaudio=no)
   302                   , enable_openbsdaudio=yes)
   291     if test x$enable_audio = xyes -a x$enable_openbsdaudio = xyes; then
   303     if test x$enable_audio = xyes -a x$enable_openbsdaudio = xyes; then
   292         SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
   304         CFLAGS="$CFLAGS -DOBSD_SUPPORT"
   293         AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
   305         AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
   294         AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
   306         AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
   295     fi
   307     fi
   296 }
   308 }
   297 
   309 
   992             AC_MSG_RESULT($has_recursive_mutexes)
  1004             AC_MSG_RESULT($has_recursive_mutexes)
   993             if test x$has_recursive_mutexes != xyes; then
  1005             if test x$has_recursive_mutexes != xyes; then
   994                 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
  1006                 CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
   995             fi
  1007             fi
   996 
  1008 
       
  1009             # Check to see if pthread semaphore support is missing
       
  1010             if test x$enable_pthread_sem = xyes; then
       
  1011                 AC_MSG_CHECKING(for pthread semaphores)
       
  1012                 have_pthread_sem=no
       
  1013                 AC_TRY_COMPILE([
       
  1014                   #include <pthread.h>
       
  1015                   #include <semaphore.h>
       
  1016                 ],[
       
  1017                 ],[
       
  1018                 have_pthread_sem=yes
       
  1019                 ])
       
  1020                 AC_MSG_RESULT($have_pthread_sem)
       
  1021             fi
       
  1022 
   997             # Check to see if this is broken glibc 2.0 pthreads
  1023             # Check to see if this is broken glibc 2.0 pthreads
   998             case "$target" in
  1024             case "$target" in
   999                 *-*-linux*)
  1025                 *-*-linux*)
  1000                     AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
  1026                     AC_MSG_CHECKING(for broken glibc 2.0 pthreads)
  1001                     glibc20_pthreads=no
  1027                     glibc20_pthreads=no
  1194             if test x$use_pthreads != xyes; then
  1220             if test x$use_pthreads != xyes; then
  1195                 COPY_ARCH_SRC(src/thread, linux, clone.S)
  1221                 COPY_ARCH_SRC(src/thread, linux, clone.S)
  1196             fi
  1222             fi
  1197             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1223             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1198             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1224             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1199             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1225             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1200                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1226                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1201             else
  1227             else
  1202                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1228                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1203             fi
  1229             fi
  1204             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1230             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1301         if test x$enable_threads = xyes; then
  1327         if test x$enable_threads = xyes; then
  1302             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1328             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1303             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1329             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1304             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1330             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1305             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1331             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1306             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1332             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1307                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1333                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1308             else
  1334             else
  1309                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1335                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1310             fi
  1336             fi
  1311             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1337             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1351         if test x$enable_threads = xyes; then
  1377         if test x$enable_threads = xyes; then
  1352             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1378             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1353             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1379             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1354             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1380             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1355             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1381             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1356             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1382             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1357                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1383                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1358             else
  1384             else
  1359                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1385                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1360             fi
  1386             fi
  1361             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1387             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1371         ;;
  1397         ;;
  1372     *-*-openbsd*)
  1398     *-*-openbsd*)
  1373         ARCH=openbsd
  1399         ARCH=openbsd
  1374         CheckDummyVideo
  1400         CheckDummyVideo
  1375         CheckDiskAudio
  1401         CheckDiskAudio
       
  1402         CheckOPENBSDAUDIO
  1376         CheckNASM
  1403         CheckNASM
  1377         CheckOSS
  1404         CheckOSS
  1378         CheckARTSC
  1405         CheckARTSC
  1379         CheckESD
  1406         CheckESD
  1380         CheckNAS
  1407         CheckNAS
  1383         CheckOpenGL
  1410         CheckOpenGL
  1384         CheckPTHREAD
  1411         CheckPTHREAD
  1385         # Set up files for the main() stub
  1412         # Set up files for the main() stub
  1386         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1413         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1387         # Set up files for the audio library
  1414         # Set up files for the audio library
  1388         CheckOPENBSDAUDIO
  1415         # We use the OSS and native API's, not the Sun audio API
       
  1416         #if test x$enable_audio = xyes; then
       
  1417         #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
       
  1418         #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
       
  1419         #fi
       
  1420         # OpenBSD needs linking with ossaudio emulation library
       
  1421         if test x$have_oss = xyes; then
       
  1422             SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
       
  1423         fi
  1389         # Set up files for the joystick library
  1424         # Set up files for the joystick library
  1390         # (No joystick support yet)
  1425         # (No joystick support yet)
  1391         if test x$enable_joystick = xyes; then
  1426         if test x$enable_joystick = xyes; then
  1392             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1427             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1393             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1428             JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
  1400         if test x$enable_threads = xyes; then
  1435         if test x$enable_threads = xyes; then
  1401             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1436             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1402             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1437             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1403             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1438             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1404             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1439             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1405             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1440             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1406                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1441                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1407             else
  1442             else
  1408                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1443                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1409             fi
  1444             fi
  1410             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1445             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1526         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1561         COPY_ARCH_SRC(src/main, linux, SDL_main.c)
  1527         # Set up files for the audio library
  1562         # Set up files for the audio library
  1528         if test x$enable_audio = xyes; then
  1563         if test x$enable_audio = xyes; then
  1529             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
  1564             AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
  1530             AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
  1565             AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
  1531             LIBS="$LIBS -laudio"
  1566             SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
  1532         fi
  1567         fi
  1533         # Set up files for the joystick library
  1568         # Set up files for the joystick library
  1534         # (No joystick support yet)
  1569         # (No joystick support yet)
  1535         if test x$enable_joystick = xyes; then
  1570         if test x$enable_joystick = xyes; then
  1536             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1571             JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
  1546             if test x$use_pthreads = xyes; then
  1581             if test x$use_pthreads = xyes; then
  1547                 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1582                 COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1548                 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1583                 COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1549                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1584                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1550                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1585                 COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1551                 if test x$enable_pthread_sem != xyes; then
  1586                 if test x$have_pthread_sem != xyes; then
  1552                     COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1587                     COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1553                 else
  1588                 else
  1554                     COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1589                     COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1555                 fi
  1590                 fi
  1556                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1591                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1935         if test x$enable_threads = xyes; then
  1970         if test x$enable_threads = xyes; then
  1936             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1971             COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
  1937             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1972             COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
  1938             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1973             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
  1939             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1974             COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
  1940             if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
  1975             if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
  1941                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1976                 COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
  1942             else
  1977             else
  1943                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1978                 COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
  1944             fi
  1979             fi
  1945             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1980             COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
  1987 if test $ARCH = solaris; then
  2022 if test $ARCH = solaris; then
  1988   SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
  2023   SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
  1989 fi
  2024 fi
  1990 
  2025 
  1991 if test $ARCH = openbsd; then
  2026 if test $ARCH = openbsd; then
  1992   SDL_RLD_FLAGS="-L${X11BASE}/lib -Wl,-rpath,\${exec_prefix}/lib -Wl,-rpath,${X11BASE}/lib"
  2027   SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib $SYSTEM_LIBS"
  1993 fi
  2028 fi
  1994 
  2029 
  1995 dnl Output the video drivers we use
  2030 dnl Output the video drivers we use
  1996 if test x$enable_video = xtrue; then
  2031 if test x$enable_video = xtrue; then
  1997     if test "$VIDEO_SUBDIRS" = ""; then
  2032     if test "$VIDEO_SUBDIRS" = ""; then