Skip to content

Commit 5275e59

Browse files
authored
bpo-45573: check for ossaudiodev in configure (GH-29614)
1 parent 345ba3f commit 5275e59

File tree

4 files changed

+75
-7
lines changed

4 files changed

+75
-7
lines changed

configure

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ MODULE__ELEMENTTREE_FALSE
630630
MODULE__ELEMENTTREE_TRUE
631631
MODULE_PYEXPAT_FALSE
632632
MODULE_PYEXPAT_TRUE
633+
MODULE_OSSAUDIODEV_FALSE
634+
MODULE_OSSAUDIODEV_TRUE
633635
TEST_MODULES
634636
LIBRARY_DEPS
635637
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 \
81508152
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
81518153
linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
81528154
sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h \
8153-
sys/mman.h sys/eventfd.h
8155+
sys/mman.h sys/eventfd.h linux/soundcard.h sys/soundcard.h
81548156
do :
81558157
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
81568158
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -19227,6 +19229,57 @@ MODULE_BLOCK=
1922719229

1922819230

1922919231

19232+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module ossaudiodev" >&5
19233+
$as_echo_n "checking for stdlib extension module ossaudiodev... " >&6; }
19234+
case $py_stdlib_not_available in #(
19235+
*ossaudiodev*) :
19236+
py_cv_module_ossaudiodev=n/a ;; #(
19237+
*) :
19238+
19239+
if true; then :
19240+
if test "$ac_cv_header_linux_soundcard_h" = yes -o "$ac_cv_header_sys_soundcard_h" = yes; then :
19241+
py_cv_module_ossaudiodev=yes
19242+
else
19243+
py_cv_module_ossaudiodev=missing
19244+
fi
19245+
else
19246+
py_cv_module_ossaudiodev=disabled
19247+
19248+
fi
19249+
19250+
;;
19251+
esac
19252+
as_fn_append MODULE_BLOCK "MODULE_OSSAUDIODEV=$py_cv_module_ossaudiodev$as_nl"
19253+
if test "x$py_cv_module_ossaudiodev" = xyes; then :
19254+
19255+
as_fn_append MODULE_BLOCK "MODULE_OSSAUDIODEV_CFLAGS=$as_nl"
19256+
as_fn_append MODULE_BLOCK "MODULE_OSSAUDIODEV_LDFLAGS=$as_nl"
19257+
if true; then
19258+
MODULE_OSSAUDIODEV_TRUE=
19259+
MODULE_OSSAUDIODEV_FALSE='#'
19260+
else
19261+
MODULE_OSSAUDIODEV_TRUE='#'
19262+
MODULE_OSSAUDIODEV_FALSE=
19263+
fi
19264+
19265+
19266+
else
19267+
19268+
if false; then
19269+
MODULE_OSSAUDIODEV_TRUE=
19270+
MODULE_OSSAUDIODEV_FALSE='#'
19271+
else
19272+
MODULE_OSSAUDIODEV_TRUE='#'
19273+
MODULE_OSSAUDIODEV_FALSE=
19274+
fi
19275+
19276+
19277+
fi
19278+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $py_cv_module_ossaudiodev" >&5
19279+
$as_echo "$py_cv_module_ossaudiodev" >&6; }
19280+
19281+
19282+
1923019283
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module pyexpat" >&5
1923119284
$as_echo_n "checking for stdlib extension module pyexpat... " >&6; }
1923219285
case $py_stdlib_not_available in #(
@@ -19496,6 +19549,14 @@ LTLIBOBJS=$ac_ltlibobjs
1949619549

1949719550

1949819551

19552+
if test -z "${MODULE_OSSAUDIODEV_TRUE}" && test -z "${MODULE_OSSAUDIODEV_FALSE}"; then
19553+
as_fn_error $? "conditional \"MODULE_OSSAUDIODEV\" was never defined.
19554+
Usually this means the macro was only invoked conditionally." "$LINENO" 5
19555+
fi
19556+
if test -z "${MODULE_OSSAUDIODEV_TRUE}" && test -z "${MODULE_OSSAUDIODEV_FALSE}"; then
19557+
as_fn_error $? "conditional \"MODULE_OSSAUDIODEV\" was never defined.
19558+
Usually this means the macro was only invoked conditionally." "$LINENO" 5
19559+
fi
1949919560
if test -z "${MODULE_PYEXPAT_TRUE}" && test -z "${MODULE_PYEXPAT_FALSE}"; then
1950019561
as_fn_error $? "conditional \"MODULE_PYEXPAT\" was never defined.
1950119562
Usually this means the macro was only invoked conditionally." "$LINENO" 5

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,7 @@ sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
21622162
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
21632163
linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
21642164
sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h \
2165-
sys/mman.h sys/eventfd.h)
2165+
sys/mman.h sys/eventfd.h linux/soundcard.h sys/soundcard.h)
21662166
AC_HEADER_DIRENT
21672167
AC_HEADER_MAJOR
21682168

@@ -5990,6 +5990,10 @@ AC_DEFUN([PY_STDLIB_MOD], [
59905990
m4_popdef([modstate])dnl
59915991
])
59925992

5993+
dnl platform specific extensions
5994+
PY_STDLIB_MOD([ossaudiodev],
5995+
[], [test "$ac_cv_header_linux_soundcard_h" = yes -o "$ac_cv_header_sys_soundcard_h" = yes])
5996+
59935997
dnl _elementtree loads libexpat via CAPI hook in pyexpat
59945998
PY_STDLIB_MOD([pyexpat], [], [], [$LIBEXPAT_CFLAGS], [$LIBEXPAT_LDFLAGS])
59955999
PY_STDLIB_MOD([_elementtree], [], [], [$LIBEXPAT_CFLAGS], [])

pyconfig.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,9 @@
679679
/* Define to 1 if you have the <linux/random.h> header file. */
680680
#undef HAVE_LINUX_RANDOM_H
681681

682+
/* Define to 1 if you have the <linux/soundcard.h> header file. */
683+
#undef HAVE_LINUX_SOUNDCARD_H
684+
682685
/* Define to 1 if you have the <linux/tipc.h> header file. */
683686
#undef HAVE_LINUX_TIPC_H
684687

@@ -1217,6 +1220,9 @@
12171220
/* Define to 1 if you have the <sys/socket.h> header file. */
12181221
#undef HAVE_SYS_SOCKET_H
12191222

1223+
/* Define to 1 if you have the <sys/soundcard.h> header file. */
1224+
#undef HAVE_SYS_SOUNDCARD_H
1225+
12201226
/* Define to 1 if you have the <sys/statvfs.h> header file. */
12211227
#undef HAVE_SYS_STATVFS_H
12221228

setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,11 +1485,8 @@ def detect_platform_specific_exts(self):
14851485
else:
14861486
self.missing.extend(['resource', 'termios'])
14871487

1488-
# Platform-specific libraries
1489-
if HOST_PLATFORM.startswith(('linux', 'freebsd', 'gnukfreebsd')):
1490-
self.add(Extension('ossaudiodev', ['ossaudiodev.c']))
1491-
elif not AIX:
1492-
self.missing.append('ossaudiodev')
1488+
# linux/soundcard.h or sys/soundcard.h
1489+
self.addext(Extension('ossaudiodev', ['ossaudiodev.c']))
14931490

14941491
if MACOS:
14951492
self.add(Extension('_scproxy', ['_scproxy.c'],

0 commit comments

Comments
 (0)