[MPlayer-cvslog] r32806 - trunk/configure

diego subversion at mplayerhq.hu
Thu Jan 20 13:55:37 CET 2011


Author: diego
Date: Thu Jan 20 13:55:37 2011
New Revision: 32806

Log:
Add return_statement_check() helper function and use it to simplify some checks.

Modified:
   trunk/configure

Modified: trunk/configure
==============================================================================
--- trunk/configure	Thu Jan 20 13:44:08 2011	(r32805)
+++ trunk/configure	Thu Jan 20 13:55:37 2011	(r32806)
@@ -111,6 +111,15 @@ EOF
   compile_check $TMPC $@
 }
 
+return_statement_check() {
+  cat > $TMPC << EOF
+#include <$1>
+int main(void) { $2; return $3; }
+EOF
+  shift 3
+  compile_check $TMPC $@
+}
+
 inline_asm_check() {
   cat > $TMPC << EOF
 int main(void) { __asm__ volatile ($1); return 0; }
@@ -4353,13 +4362,7 @@ echocheck "VDPAU"
 if test "$_vdpau" = auto ; then
   _vdpau=no
   if test "$_dl" = yes ; then
-    cat > $TMPC <<EOF
-#include <vdpau/vdpau_x11.h>
-int main(void) {
-    vdp_device_create_x11(0, 0, 0, 0);
-    return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
-EOF
-    cc_check -lvdpau && _vdpau=yes
+    return_statement_check vdpau/vdpau_x11.h 'vdp_device_create_x11(0, 0, 0, 0)' VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 -lvdpau && _vdpau=yes
   fi
 fi
 if test "$_vdpau" = yes ; then
@@ -4820,16 +4823,7 @@ fi
 echocheck "MNG support"
 if test "$_mng" = auto ; then
   _mng=no
-  cat > $TMPC << EOF
-#include <libmng.h>
-int main(void) {
-  const char * p_ver = mng_version_text();
-  return !p_ver || p_ver[0] == 0;
-}
-EOF
-  if cc_check -lmng -lz $_ld_lm ; then
-    _mng=yes
-  fi
+  return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
 fi
 echores "$_mng"
 if test "$_mng" = yes ; then


More information about the MPlayer-cvslog mailing list