]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45573: check for ossaudiodev in configure (GH-29614)
authorChristian Heimes <christian@python.org>
Thu, 18 Nov 2021 09:56:26 +0000 (11:56 +0200)
committerGitHub <noreply@github.com>
Thu, 18 Nov 2021 09:56:26 +0000 (10:56 +0100)
configure
configure.ac
pyconfig.h.in
setup.py

index ab5afbf0b8aef9971ca68ffc5d5b6e95c4851c7c..f8987128a01cf78e6bf659d42d34d22e5b0574ad 100755 (executable)
--- a/configure
+++ b/configure
@@ -630,6 +630,8 @@ MODULE__ELEMENTTREE_FALSE
 MODULE__ELEMENTTREE_TRUE
 MODULE_PYEXPAT_FALSE
 MODULE_PYEXPAT_TRUE
+MODULE_OSSAUDIODEV_FALSE
+MODULE_OSSAUDIODEV_TRUE
 TEST_MODULES
 LIBRARY_DEPS
 STATIC_LIBPYTHON
@@ -8150,7 +8152,7 @@ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
 sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h \
-sys/mman.h sys/eventfd.h
+sys/mman.h sys/eventfd.h linux/soundcard.h sys/soundcard.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -19227,6 +19229,57 @@ MODULE_BLOCK=
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module ossaudiodev" >&5
+$as_echo_n "checking for stdlib extension module ossaudiodev... " >&6; }
+      case $py_stdlib_not_available in #(
+  *ossaudiodev*) :
+    py_cv_module_ossaudiodev=n/a ;; #(
+  *) :
+
+      if true; then :
+  if test "$ac_cv_header_linux_soundcard_h" = yes -o "$ac_cv_header_sys_soundcard_h" = yes; then :
+  py_cv_module_ossaudiodev=yes
+else
+  py_cv_module_ossaudiodev=missing
+fi
+else
+  py_cv_module_ossaudiodev=disabled
+
+fi
+
+   ;;
+esac
+  as_fn_append MODULE_BLOCK "MODULE_OSSAUDIODEV=$py_cv_module_ossaudiodev$as_nl"
+  if test "x$py_cv_module_ossaudiodev" = xyes; then :
+
+    as_fn_append MODULE_BLOCK "MODULE_OSSAUDIODEV_CFLAGS=$as_nl"
+    as_fn_append MODULE_BLOCK "MODULE_OSSAUDIODEV_LDFLAGS=$as_nl"
+     if true; then
+  MODULE_OSSAUDIODEV_TRUE=
+  MODULE_OSSAUDIODEV_FALSE='#'
+else
+  MODULE_OSSAUDIODEV_TRUE='#'
+  MODULE_OSSAUDIODEV_FALSE=
+fi
+
+
+else
+
+     if false; then
+  MODULE_OSSAUDIODEV_TRUE=
+  MODULE_OSSAUDIODEV_FALSE='#'
+else
+  MODULE_OSSAUDIODEV_TRUE='#'
+  MODULE_OSSAUDIODEV_FALSE=
+fi
+
+
+fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module_ossaudiodev" >&5
+$as_echo "$py_cv_module_ossaudiodev" >&6; }
+
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module pyexpat" >&5
 $as_echo_n "checking for stdlib extension module pyexpat... " >&6; }
       case $py_stdlib_not_available in #(
@@ -19496,6 +19549,14 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
+if test -z "${MODULE_OSSAUDIODEV_TRUE}" && test -z "${MODULE_OSSAUDIODEV_FALSE}"; then
+  as_fn_error $? "conditional \"MODULE_OSSAUDIODEV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${MODULE_OSSAUDIODEV_TRUE}" && test -z "${MODULE_OSSAUDIODEV_FALSE}"; then
+  as_fn_error $? "conditional \"MODULE_OSSAUDIODEV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${MODULE_PYEXPAT_TRUE}" && test -z "${MODULE_PYEXPAT_FALSE}"; then
   as_fn_error $? "conditional \"MODULE_PYEXPAT\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
index 43c8f768c18f8db0ff7ee1fc942673ff92b61e12..78b22d531b9439df900505576e885432ac6b7aa6 100644 (file)
@@ -2162,7 +2162,7 @@ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
 libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
 sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h \
-sys/mman.h sys/eventfd.h)
+sys/mman.h sys/eventfd.h linux/soundcard.h sys/soundcard.h)
 AC_HEADER_DIRENT
 AC_HEADER_MAJOR
 
@@ -5990,6 +5990,10 @@ AC_DEFUN([PY_STDLIB_MOD], [
   m4_popdef([modstate])dnl
 ])
 
+dnl platform specific extensions
+PY_STDLIB_MOD([ossaudiodev],
+  [], [test "$ac_cv_header_linux_soundcard_h" = yes -o "$ac_cv_header_sys_soundcard_h" = yes])
+
 dnl _elementtree loads libexpat via CAPI hook in pyexpat
 PY_STDLIB_MOD([pyexpat], [], [], [$LIBEXPAT_CFLAGS], [$LIBEXPAT_LDFLAGS])
 PY_STDLIB_MOD([_elementtree], [], [], [$LIBEXPAT_CFLAGS], [])
index cbab59b739f31c45ea797d77c0246d5d7378bded..b8f63955e3139c555253ea8bad4a1cb22c72548d 100644 (file)
 /* Define to 1 if you have the <linux/random.h> header file. */
 #undef HAVE_LINUX_RANDOM_H
 
+/* Define to 1 if you have the <linux/soundcard.h> header file. */
+#undef HAVE_LINUX_SOUNDCARD_H
+
 /* Define to 1 if you have the <linux/tipc.h> header file. */
 #undef HAVE_LINUX_TIPC_H
 
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
+/* Define to 1 if you have the <sys/soundcard.h> header file. */
+#undef HAVE_SYS_SOUNDCARD_H
+
 /* Define to 1 if you have the <sys/statvfs.h> header file. */
 #undef HAVE_SYS_STATVFS_H
 
index 8b9566e26bffd62dd4085e506d6d3ad70910a23c..a09cf18213f98b8d32394de6ca2994ced78bcec5 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1485,11 +1485,8 @@ class PyBuildExt(build_ext):
         else:
             self.missing.extend(['resource', 'termios'])
 
-        # Platform-specific libraries
-        if HOST_PLATFORM.startswith(('linux', 'freebsd', 'gnukfreebsd')):
-            self.add(Extension('ossaudiodev', ['ossaudiodev.c']))
-        elif not AIX:
-            self.missing.append('ossaudiodev')
+        # linux/soundcard.h or sys/soundcard.h
+        self.addext(Extension('ossaudiodev', ['ossaudiodev.c']))
 
         if MACOS:
             self.add(Extension('_scproxy', ['_scproxy.c'],