Skip to content

Commit

Permalink
[unix] [configure] unify sound plugin detection, pt2 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
krono committed Apr 22, 2020
1 parent 2a6699d commit 662737e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
14 changes: 8 additions & 6 deletions platforms/unix/config/acinclude.m4
Expand Up @@ -256,6 +256,10 @@ dnl AC_PLUGIN_SUBST(varname,value)
AC_DEFUN([AC_PLUGIN_DISABLE_PLUGIN],[
AC_MSG_RESULT([******** disabling $1])
disabled_plugins="${disabled_plugins} $1"])
AC_DEFUN([AC_PLUGIN_DISABLE_PLUGIN_MISSING],[
AC_MSG_RESULT([******** disabling $1 due to missing libraries])
disabled_plugins="${disabled_plugins} $1"])


AC_DEFUN([AC_PLUGIN_DISABLE],[
AC_PLUGIN_DISABLE_PLUGIN(${plugin})])
Expand All @@ -276,18 +280,16 @@ AC_DEFUN([AC_PLUGIN_SEARCH_LIBS],[
[dnl AC_SEARCH_LIBS generates LIBS with -l, plibs expects libnames wihtout
dnl since at most one can be found, strip the "-l"
plib=`echo "${LIBS}" | cut -c3-`
plibs="${plibs} ${plib}"],
[AC_MSG_RESULT([******** disabling ${plugin} due to missing libraries])
disabled_plugins="${disabled_plugins} ${plugin}"])
AC_PLUGIN_USE_LIB(${plib})],
[AC_PLUGIN_DISABLE_PLUGIN_MISSING(${plugin})])
LIBS="$save_LIBS"])

dnl AC_PLUGIN_CHECK_LIB(lib,func,ok,bad)

AC_DEFUN([AC_PLUGIN_CHECK_LIB],[
AC_CHECK_LIB($1,$2,
[plibs="${plibs} $1"],
[AC_MSG_RESULT([******** disabling ${plugin} due to missing libraries])
disabled_plugins="${disabled_plugins} ${plugin}"])])
[AC_PLUGIN_USE_LIB($1)],
[AC_PLUGIN_DISABLE_PLUGIN_MISSING(${plugin})])

dnl Recent Unix stuff
m4_include([ax_require_defined.m4])
Expand Down
2 changes: 0 additions & 2 deletions platforms/unix/vm-sound-sndio/Makefile.inc

This file was deleted.

24 changes: 3 additions & 21 deletions platforms/unix/vm-sound-sndio/acinclude.m4
@@ -1,23 +1,5 @@
# -*- sh -*-

AC_MSG_CHECKING([for sndio sound support])

AC_ARG_WITH(sndio-sound,
[ --with-sndio-sound enable sndio sound support [default=disabled]],
[have_snd_sndio="$withval"],
[have_snd_sndio="no"])

if test "$have_snd_sndio" = "yes"; then
# check for libraries, headers, etc., here...
AC_MSG_CHECKING([for OpenBSD sndio Sound System])
sio_h_found="no"
AC_CHECK_HEADERS([sndio.h],[sndio_h_found="yes"; break])
if test "$sndio_h_found" = "no"; then
AC_PLUGIN_DISABLE
else
AC_CHECK_LIB([sndio],[sio_open],[AC_PLUGIN_USE_LIB([sndio])])
fi
else
AC_MSG_RESULT([no])
AC_PLUGIN_DISABLE
fi
AC_MSG_CHECKING([for OpenBSD sndio Sound System])
AC_CHECK_HEADERS([sndio.h],,AC_PLUGIN_DISABLE)
AC_PLUGIN_SEARCH_LIBS([sio_open],[sndio])

0 comments on commit 662737e

Please sign in to comment.