[MPlayer-dev-eng] [PATCH] Have sndio check use the pkg-config file

Brad Smith brad at comstyle.com
Sat Feb 26 23:49:17 EET 2022


Have the sndio check use the pkg-config file.

BTW, looking at other examples to take inspiration for this I noticed the Pulse
and JACK bits use libs_mplayer vs extra_ldflags and echores is higher up. Little
inconsistencies are kind of annoying when looking at code to get an idea of how
to do things.


Index: configure
===================================================================
--- configure	(revision 38348)
+++ configure	(working copy)
@@ -6358,12 +6358,16 @@
 echocheck "sndio audio"
 if test "$_sndio" = auto ; then
   _sndio=no
-  statement_check sndio.h 'sio_open(SIO_DEVANY, SIO_PLAY, 0)' -lsndio && _sndio=yes
+  if $_pkg_config --exists 'sndio' ; then
+    header_check sndio.h $($_pkg_config --libs --cflags sndio) &&
+      _sndio=yes
+  fi
 fi
 if test "$_sndio" = yes ; then
   def_sndio='#define CONFIG_SNDIO_AUDIO 1'
   aomodules="sndio $aomodules"
-  extra_ldflags="$extra_ldflags -lsndio"
+  extra_ldflags="$extra_ldflags $($_pkg_config --libs sndio)"
+  extra_cflags="$extra_cflags $($_pkg_config --cflags sndio)"
 else
   def_sndio='#undef CONFIG_SNDIO_AUDIO'
   noaomodules="sndio $noaomodules"


More information about the MPlayer-dev-eng mailing list