configure.in
changeset 94 ae6e6b73333f
parent 86 13e4c612098d
child 121 43febd46d49d
     1.1 --- a/configure.in	Sat Jul 07 23:27:29 2001 +0000
     1.2 +++ b/configure.in	Sun Jul 08 09:00:06 2001 +0000
     1.3 @@ -245,13 +245,25 @@
     1.4      if test x$enable_audio = xyes -a x$enable_oss = xyes; then
     1.5          AC_MSG_CHECKING(for OSS audio support)
     1.6          have_oss=no
     1.7 -        AC_TRY_COMPILE([
     1.8 -          #include <sys/soundcard.h>
     1.9 -        ],[
    1.10 -          int arg = SNDCTL_DSP_SETFRAGMENT;
    1.11 -        ],[
    1.12 -        have_oss=yes
    1.13 -        ])
    1.14 +        if test x$have_oss != xyes; then
    1.15 +            AC_TRY_COMPILE([
    1.16 +              #include <sys/soundcard.h>
    1.17 +            ],[
    1.18 +              int arg = SNDCTL_DSP_SETFRAGMENT;
    1.19 +            ],[
    1.20 +            have_oss=yes
    1.21 +            ])
    1.22 +        fi
    1.23 +        if test x$have_oss != xyes; then
    1.24 +            AC_TRY_COMPILE([
    1.25 +              #include <soundcard.h>
    1.26 +            ],[
    1.27 +              int arg = SNDCTL_DSP_SETFRAGMENT;
    1.28 +            ],[
    1.29 +            have_oss=yes
    1.30 +            CFLAGS="$CFLAGS -DOSS_USE_SOUNDCARD_H"
    1.31 +            ])
    1.32 +        fi
    1.33          AC_MSG_RESULT($have_oss)
    1.34          if test x$have_oss = xyes; then
    1.35              CFLAGS="$CFLAGS -DOSS_SUPPORT"
    1.36 @@ -286,10 +298,10 @@
    1.37  CheckOPENBSDAUDIO()
    1.38  {
    1.39      AC_ARG_ENABLE(openbsdaudio,
    1.40 -[  --enable-openbsdaudio   OpenBSD native audio support [default=no]],
    1.41 -                  , enable_openbsdaudio=no)
    1.42 +[  --enable-openbsdaudio   OpenBSD native audio support [default=yes]],
    1.43 +                  , enable_openbsdaudio=yes)
    1.44      if test x$enable_audio = xyes -a x$enable_openbsdaudio = xyes; then
    1.45 -        SYSTEM_LIBS="$SYSTEM_LIBS $ESD_LIBS"
    1.46 +        CFLAGS="$CFLAGS -DOBSD_SUPPORT"
    1.47          AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
    1.48          AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
    1.49      fi
    1.50 @@ -994,6 +1006,20 @@
    1.51                  CFLAGS="$CFLAGS -DPTHREAD_NO_RECURSIVE_MUTEX"
    1.52              fi
    1.53  
    1.54 +            # Check to see if pthread semaphore support is missing
    1.55 +            if test x$enable_pthread_sem = xyes; then
    1.56 +                AC_MSG_CHECKING(for pthread semaphores)
    1.57 +                have_pthread_sem=no
    1.58 +                AC_TRY_COMPILE([
    1.59 +                  #include <pthread.h>
    1.60 +                  #include <semaphore.h>
    1.61 +                ],[
    1.62 +                ],[
    1.63 +                have_pthread_sem=yes
    1.64 +                ])
    1.65 +                AC_MSG_RESULT($have_pthread_sem)
    1.66 +            fi
    1.67 +
    1.68              # Check to see if this is broken glibc 2.0 pthreads
    1.69              case "$target" in
    1.70                  *-*-linux*)
    1.71 @@ -1196,7 +1222,7 @@
    1.72              fi
    1.73              COPY_ARCH_SRC(src/thread, linux, SDL_systhread.c)
    1.74              COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
    1.75 -            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
    1.76 +            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
    1.77                  COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
    1.78              else
    1.79                  COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
    1.80 @@ -1303,7 +1329,7 @@
    1.81              COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
    1.82              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
    1.83              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
    1.84 -            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
    1.85 +            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
    1.86                  COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
    1.87              else
    1.88                  COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
    1.89 @@ -1353,7 +1379,7 @@
    1.90              COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
    1.91              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
    1.92              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
    1.93 -            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
    1.94 +            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
    1.95                  COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
    1.96              else
    1.97                  COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
    1.98 @@ -1373,6 +1399,7 @@
    1.99          ARCH=openbsd
   1.100          CheckDummyVideo
   1.101          CheckDiskAudio
   1.102 +        CheckOPENBSDAUDIO
   1.103          CheckNASM
   1.104          CheckOSS
   1.105          CheckARTSC
   1.106 @@ -1385,7 +1412,15 @@
   1.107          # Set up files for the main() stub
   1.108          COPY_ARCH_SRC(src/main, linux, SDL_main.c)
   1.109          # Set up files for the audio library
   1.110 -        CheckOPENBSDAUDIO
   1.111 +        # We use the OSS and native API's, not the Sun audio API
   1.112 +        #if test x$enable_audio = xyes; then
   1.113 +        #    AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
   1.114 +        #    AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
   1.115 +        #fi
   1.116 +        # OpenBSD needs linking with ossaudio emulation library
   1.117 +        if test x$have_oss = xyes; then
   1.118 +            SYSTEM_LIBS="$SYSTEM_LIBS -lossaudio"
   1.119 +        fi
   1.120          # Set up files for the joystick library
   1.121          # (No joystick support yet)
   1.122          if test x$enable_joystick = xyes; then
   1.123 @@ -1402,7 +1437,7 @@
   1.124              COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.125              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.126              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.127 -            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
   1.128 +            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
   1.129                  COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.130              else
   1.131                  COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.132 @@ -1528,7 +1563,7 @@
   1.133          if test x$enable_audio = xyes; then
   1.134              AUDIO_SUBDIRS="$AUDIO_SUBDIRS dmedia"
   1.135              AUDIO_DRIVERS="$AUDIO_DRIVERS dmedia/libaudio_dmedia.la"
   1.136 -            LIBS="$LIBS -laudio"
   1.137 +            SYSTEM_LIBS="$SYSTEM_LIBS -laudio"
   1.138          fi
   1.139          # Set up files for the joystick library
   1.140          # (No joystick support yet)
   1.141 @@ -1548,7 +1583,7 @@
   1.142                  COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.143                  COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.144                  COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.145 -                if test x$enable_pthread_sem != xyes; then
   1.146 +                if test x$have_pthread_sem != xyes; then
   1.147                      COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.148                  else
   1.149                      COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.150 @@ -1937,7 +1972,7 @@
   1.151              COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
   1.152              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
   1.153              COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
   1.154 -            if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
   1.155 +            if test x$use_pthreads = xyes -a x$have_pthread_sem != xyes; then
   1.156                  COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
   1.157              else
   1.158                  COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
   1.159 @@ -1989,7 +2024,7 @@
   1.160  fi
   1.161  
   1.162  if test $ARCH = openbsd; then
   1.163 -  SDL_RLD_FLAGS="-L${X11BASE}/lib -Wl,-rpath,\${exec_prefix}/lib -Wl,-rpath,${X11BASE}/lib"
   1.164 +  SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib $SYSTEM_LIBS"
   1.165  fi
   1.166  
   1.167  dnl Output the video drivers we use