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

Brad Smith brad at comstyle.com
Mon Feb 28 00:41:23 EET 2022


On Sat, Feb 26, 2022 at 04:49:18PM -0500, Brad Smith wrote:
> 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.

Switch back to using statement_check.


Index: configure
===================================================================
--- configure	(revision 38350)
+++ 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
+    statement_check sndio.h 'sio_open(SIO_DEVANY, SIO_PLAY, 0)' $($_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