# HG changeset patch # User diego # Date 1295528137 0 # Node ID 1cdf5ed4b9d89b46ca5cdeb90e31cb9878466410 # Parent 1fc2df65b91596de63053daa9f6245107b96ec76 Add return_statement_check() helper function and use it to simplify some checks. diff -r 1fc2df65b915 -r 1cdf5ed4b9d8 configure --- a/configure Thu Jan 20 12:44:08 2011 +0000 +++ b/configure Thu Jan 20 12:55:37 2011 +0000 @@ -111,6 +111,15 @@ 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 @@ if test "$_vdpau" = auto ; then _vdpau=no if test "$_dl" = yes ; then - cat > $TMPC < -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 @@ echocheck "MNG support" if test "$_mng" = auto ; then _mng=no - cat > $TMPC << EOF -#include -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