Explorar el Código

Simplify OSS test by removing OpenBSD specific location of the soundcard.h header

OpenBSD has long since stopped using OSS. Remove checking for OpenBSD specific header.
Brad Smith hace 3 años
padre
commit
f4e3af15a1
Se han modificado 7 ficheros con 4 adiciones y 67 borrados
  1. 2 10
      cmake/sdlchecks.cmake
  2. 1 33
      configure
  3. 1 15
      configure.ac
  4. 0 1
      include/SDL_config.h.cmake
  5. 0 1
      include/SDL_config.h.in
  6. 0 6
      src/audio/dsp/SDL_dspaudio.c
  7. 0 1
      test/configure

+ 2 - 10
cmake/sdlchecks.cmake

@@ -59,21 +59,13 @@ macro(CheckOSS)
     check_c_source_compiles("
     check_c_source_compiles("
         #include <sys/soundcard.h>
         #include <sys/soundcard.h>
         int main(int argc, char **argv) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }" HAVE_OSS_SYS_SOUNDCARD_H)
         int main(int argc, char **argv) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }" HAVE_OSS_SYS_SOUNDCARD_H)
-    if(NOT HAVE_OSS_SYS_SOUNDCARD_H)
-      check_c_source_compiles("
-          #include <soundcard.h>
-          int main(int argc, char **argv) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }" HAVE_OSS_SOUNDCARD_H)
-    endif()
 
 
-    if(HAVE_OSS_SYS_SOUNDCARD_H OR HAVE_OSS_SOUNDCARD_H)
+    if(HAVE_OSS_SYS_SOUNDCARD_H)
       set(HAVE_OSS TRUE)
       set(HAVE_OSS TRUE)
       file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c)
       file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c)
-      if(HAVE_OSS_SOUNDCARD_H)
-        set(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1)
-      endif()
       set(SDL_AUDIO_DRIVER_OSS 1)
       set(SDL_AUDIO_DRIVER_OSS 1)
       list(APPEND SOURCE_FILES ${OSS_SOURCES})
       list(APPEND SOURCE_FILES ${OSS_SOURCES})
-      if(NETBSD OR OPENBSD)
+      if(NETBSD)
         list(APPEND EXTRA_LIBS ossaudio)
         list(APPEND EXTRA_LIBS ossaudio)
       endif()
       endif()
       set(HAVE_SDL_AUDIO TRUE)
       set(HAVE_SDL_AUDIO TRUE)

+ 1 - 33
configure

@@ -21007,10 +21007,6 @@ fi
     #  it on if you really want, though.
     #  it on if you really want, though.
     if test x$enable_oss = xmaybe; then
     if test x$enable_oss = xmaybe; then
         enable_oss=yes
         enable_oss=yes
-        case "$host" in
-            *-*-openbsd*)
-                enable_oss=no;;
-        esac
     fi
     fi
 
 
     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
@@ -21036,33 +21032,6 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"
 if ac_fn_c_try_compile "$LINENO"
 then :
 then :
   have_oss=yes
   have_oss=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-        fi
-        if test x$have_oss != xyes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-              #include <soundcard.h>
-
-int
-main (void)
-{
-
-              int arg = SNDCTL_DSP_SETFRAGMENT;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-
-            have_oss=yes
-
-printf "%s\n" "#define SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1" >>confdefs.h
-
-
 fi
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
         fi
         fi
@@ -21078,7 +21047,7 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_OSS 1" >>confdefs.h
 
 
             # We may need to link with ossaudio emulation library
             # We may need to link with ossaudio emulation library
             case "$host" in
             case "$host" in
-                *-*-openbsd*|*-*-netbsd*)
+                *-*-netbsd*)
                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
             esac
             esac
         fi
         fi
@@ -32564,4 +32533,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 fi
 
 
-

+ 1 - 15
configure.ac

@@ -933,10 +933,6 @@ CheckOSS()
     #  it on if you really want, though.
     #  it on if you really want, though.
     if test x$enable_oss = xmaybe; then
     if test x$enable_oss = xmaybe; then
         enable_oss=yes
         enable_oss=yes
-        case "$host" in
-            *-*-openbsd*)
-                enable_oss=no;;
-        esac
     fi
     fi
 
 
     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
     if test x$enable_audio = xyes -a x$enable_oss = xyes; then
@@ -949,16 +945,6 @@ CheckOSS()
               int arg = SNDCTL_DSP_SETFRAGMENT;
               int arg = SNDCTL_DSP_SETFRAGMENT;
             ]])], [have_oss=yes],[])
             ]])], [have_oss=yes],[])
         fi
         fi
-        if test x$have_oss != xyes; then
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-              #include <soundcard.h>
-            ]], [[
-              int arg = SNDCTL_DSP_SETFRAGMENT;
-            ]])], [
-            have_oss=yes
-            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ])
-            ],[])
-        fi
         AC_MSG_RESULT($have_oss)
         AC_MSG_RESULT($have_oss)
         if test x$have_oss = xyes; then
         if test x$have_oss = xyes; then
             SUMMARY_audio="${SUMMARY_audio} oss"
             SUMMARY_audio="${SUMMARY_audio} oss"
@@ -968,7 +954,7 @@ CheckOSS()
 
 
             # We may need to link with ossaudio emulation library
             # We may need to link with ossaudio emulation library
             case "$host" in
             case "$host" in
-                *-*-openbsd*|*-*-netbsd*)
+                *-*-netbsd*)
                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
             esac
             esac
         fi
         fi

+ 0 - 1
include/SDL_config.h.cmake

@@ -309,7 +309,6 @@
 #cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@
 #cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@
 #cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@
 #cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@
 #cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@
 #cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@
-#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@
 #cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@
 #cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@
 #cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE @SDL_AUDIO_DRIVER_PIPEWIRE@
 #cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE @SDL_AUDIO_DRIVER_PIPEWIRE@
 #cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC @SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC@
 #cmakedefine SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC @SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC@

+ 0 - 1
include/SDL_config.h.in

@@ -297,7 +297,6 @@
 #undef SDL_AUDIO_DRIVER_NETBSD
 #undef SDL_AUDIO_DRIVER_NETBSD
 #undef SDL_AUDIO_DRIVER_OPENSLES
 #undef SDL_AUDIO_DRIVER_OPENSLES
 #undef SDL_AUDIO_DRIVER_OSS
 #undef SDL_AUDIO_DRIVER_OSS
-#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
 #undef SDL_AUDIO_DRIVER_PAUDIO
 #undef SDL_AUDIO_DRIVER_PAUDIO
 #undef SDL_AUDIO_DRIVER_PIPEWIRE
 #undef SDL_AUDIO_DRIVER_PIPEWIRE
 #undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC
 #undef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC

+ 0 - 6
src/audio/dsp/SDL_dspaudio.c

@@ -34,13 +34,7 @@
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 
 
-#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
-/* This is installed on some systems */
-#include <soundcard.h>
-#else
-/* This is recommended by OSS */
 #include <sys/soundcard.h>
 #include <sys/soundcard.h>
-#endif
 
 
 #include "SDL_timer.h"
 #include "SDL_timer.h"
 #include "SDL_audio.h"
 #include "SDL_audio.h"

+ 0 - 1
test/configure

@@ -6103,4 +6103,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 fi
 
 
-