[MPlayer-dev-eng] [PATCH] esound -> pkg-config

Enrico Weigelt weigelt at metux.de
Thu Oct 6 05:20:55 CEST 2005


Hi folks,


here are two different patches for the esound detection stuff.
The first one (eldest) just uses $ESD_CONFIG instead of 'esd-config',
so it's possible to pass another (probably customized) esd-config
command to ./configure. 

The second one goes one step further and uses pkg-config. If
$PKG_CONFIG is not set, it uses 'pkg-config' as default.


cu
-- 
"*Who am I*? I am Susan Ivanova, Commander, daughter of Andrei and Sophie
  Ivanova. I am the right hand of vengeance, and the boot that is going 
  to kick your sorry ass all the way back to Earth... I am Death Incarnate, 
  and the last living thing that you are ever going to see. God sent me."
                                                       -- Cmdr. Ivanova
-------------- next part --------------
diff -ruN MPlayer-1.0pre5.orig/configure MPlayer-1.0pre5/configure
--- MPlayer-1.0pre5.orig/configure	Thu Jul 15 00:04:42 2004
+++ MPlayer-1.0pre5/configure	Mon Aug 29 17:04:05 2005
@@ -4123,13 +4123,14 @@
 echocheck "EsounD"
 if test "$_esd" = auto ; then
   _esd=no
-  if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
+  if [ ! "$ESD_CONFIG" ]; then ESD_CONFIG="esd-config"; fi
+  if ( $ESD_CONFIG --version ) >> "$TMPLOG" 2>&1 ; then
 
 cat > $TMPC << EOF
 #include <esd.h>
 int main(void) { return 0; }
 EOF
-cc_check `esd-config --libs` `esd-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _esd=yes
+cc_check `$ESD_CONFIG --libs` `$ESD_CONFIG --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _esd=yes
 
   fi
 fi
@@ -4139,15 +4140,15 @@
   _def_esd='#define USE_ESD 1'
   _aosrc="$_aosrc ao_esd.c"
   _aomodules="esd $_aomodules"
-  _ld_esd=`esd-config --libs`
-  _inc_esd=`esd-config --cflags`
+  _ld_esd=`$ESD_CONFIG --libs`
+  _inc_esd=`$ESD_CONFIG --cflags`
 
   echocheck "esd_get_latency()"
   cat > $TMPC << EOF
 #include <esd.h>
 int main(void) { return esd_get_latency(0); }
 EOF
-  cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
+  cc_check `$ESD_CONFIG --libs` `$ESD_CONFIG --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
   echores "$_esd_latency"
 else
   _def_esd='#undef USE_ESD'
-------------- next part --------------
diff -ruN MPlayer-1.0pre6a.orig/configure MPlayer-1.0pre6a/configure
--- MPlayer-1.0pre6a.orig/configure	Wed Oct  5 23:00:05 2005
+++ MPlayer-1.0pre6a/configure	Wed Oct  5 23:12:58 2005
@@ -118,6 +118,18 @@
   echo "" >> "$TMPLOG"
   echo "$@"
 }
+
+#### pkgconfig helpers  #####
+if [ ! "$PKG_CONFIG" ]; then 
+    export PKG_CONFIG=pkg-config
+fi
+
+echo "Checking for pkg-config ..."
+if ! $PKG_CONFIG --version ; then
+    echo "pkg-config seems to be missing. Try to adjust $$PKG_CONFIG"
+    exit 1;
+fi
+
 #############################################################################
 
 # Check how echo works in this /bin/sh
@@ -4422,13 +4434,13 @@
 echocheck "EsounD"
 if test "$_esd" = auto ; then
   _esd=no
-  if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
+  if ( $PKG_CONFIG esound --modversion ) >> "$TMPLOG" 2>&1 ; then
 
 cat > $TMPC << EOF
 #include <esd.h>
 int main(void) { return 0; }
 EOF
-cc_check `esd-config --libs` `esd-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _esd=yes
+cc_check `$PKG_CONFIG esound --libs` `$PKG_CONFIG esound --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _esd=yes
 
   fi
 fi
@@ -4438,15 +4450,15 @@
   _def_esd='#define USE_ESD 1'
   _aosrc="$_aosrc ao_esd.c"
   _aomodules="esd $_aomodules"
-  _ld_esd=`esd-config --libs`
-  _inc_esd=`esd-config --cflags`
+  _ld_esd=`$PKG_CONFIG esound --libs`
+  _inc_esd=`$PKG_CONFIG esound --cflags`
 
   echocheck "esd_get_latency()"
   cat > $TMPC << EOF
 #include <esd.h>
 int main(void) { return esd_get_latency(0); }
 EOF
-  cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
+  cc_check `$PKG_CONFIG esound --libs` `$PKG_CONFIG esound --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
   echores "$_esd_latency"
 else
   _def_esd='#undef USE_ESD'


More information about the MPlayer-dev-eng mailing list