[MPlayer-dev-eng] [patch] check pkg-config first for libdvd{nav, read}

Mike Frysinger vapier at gentoo.org
Fri Mar 30 20:18:04 CEST 2012


managing pkg-config files is a lot easier when cross-compiling then a variety of
config scripts.  the libdvd{nav,read} packages install .pc files now, so check
those first before falling back to the config scripts.

(please cc me as i'm not on the list)
-mike

--- configure	(revision 34835)
+++ configure	(working copy)
@@ -4042,7 +4042,7 @@ echores "$_apple_ir"
 fi #if linux
 
 echocheck "pkg-config"
-_pkg_config=pkg-config
+_pkg_config=${PKG_CONFIG:-pkg-config}
 if $($_pkg_config --version > /dev/null 2>&1); then
   if test "$ld_static"; then
     _pkg_config="$_pkg_config --static"
@@ -5740,8 +5740,13 @@ if test "$_dvdread_internal" = auto ; th
 elif test "$_dvdread" = auto ; then
   _dvdread=no
   if test "$_dl" = yes; then
-    _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
-    _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
+    if ! $_pkg_config --exists dvdread ; then
+      _dvdreadcflags=$($_pkgconfig dvdread --cflags)
+      _dvdreadlibs=$($_pkgconfig dvdread --libs)
+    else
+      _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
+      _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
+    fi
     if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $ld_dl ; then
       _dvdread=yes
       extra_cflags="$extra_cflags $_dvdreadcflags"
@@ -7721,13 +7726,20 @@ if test "$_dvdnav" = auto ; then
     dvdnav_internal=yes
     res_comment="internal"
   else
-    $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
+    if ! $_pkg_config --exists dvdnavmini ; then
+      $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
+    fi
   fi
 fi
 if test "$_dvdnav" = auto ; then
   _dvdnav=no
-  _dvdnavdir=$($_dvdnavconfig --cflags)
-  _dvdnavlibs=$($_dvdnavconfig --libs)
+  if $_pkg_config --exists dvdnavmini ; then
+    _dvdnavdir=$($_pkg_config --cflags dvdnavmini)
+    _dvdnavlibs=$($_pkg_config --libs dvdnavmini)
+  else
+    _dvdnavdir=$($_dvdnavconfig --cflags)
+    _dvdnavlibs=$($_dvdnavconfig --libs)
+  fi
   statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $ld_dl $ld_pthread && 
_dvdnav=yes
 fi
 if test "$_dvdnav" = yes ; then
@@ -7736,8 +7748,13 @@ if test "$_dvdnav" = yes ; then
     cflags_libdvdnav="-Ilibdvdnav"
     inputmodules="dvdnav(internal) $inputmodules"
   else
-    extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
-    extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
+    if $_pkg_config --exists dvdnavmini ; then
+      extra_cflags="$extra_cflags $($_pkg_config --cflags dvdnavmini)"
+      extra_ldflags="$extra_ldflags $($_pkg_config --libs dvdnavmini)"
+    else
+      extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
+      extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
+    fi
     inputmodules="dvdnav $inputmodules"
   fi
 else
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120330/3629f6b8/attachment.asc>


More information about the MPlayer-dev-eng mailing list