From 755ae2801d013b1ce85034738d577cb1b2b31935 Mon Sep 17 00:00:00 2001 From: diego Date: Sat, 18 Sep 2010 09:49:12 +0000 Subject: configure: Add function_check_broken(), simplify test It can be used similar to header_check_broken, but it also tests for the availability of functions along with the needed headers. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32298 b3059339-0415-0410-9bf9-f77b7e298cf2 Simplify libdca check using function_check_broken(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32299 b3059339-0415-0410-9bf9-f77b7e298cf2 1000l: Fix shift amount in function_check_broken(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32311 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 305fa40ce5..d269616e00 100755 --- a/configure +++ b/configure @@ -115,8 +115,9 @@ EOF compile_check $TMPC $@ } -# This is a special check only to be used for broken headers that do not -# include all dependencies. +# The following checks are special and should only be used with broken and +# non-selfsufficient headers that do not include all of their dependencies. + header_check_broken() { cat > $TMPC << EOF #include <$1> @@ -128,6 +129,16 @@ EOF compile_check $TMPC $@ } +function_check_broken() { + cat > $TMPC << EOF +#include <$1> +#include <$2> +int main(void) { $3; return 0; } +EOF + shift 3 + compile_check $TMPC $@ +} + yasm_check() { echo >> "$TMPLOG" cat "$TMPS" >> "$TMPLOG" @@ -6264,14 +6275,9 @@ echores "$_libmpeg2" echocheck "libdca support" if test "$_libdca" = auto ; then _libdca=no - cat > $TMPC << EOF -#include -#include -int main(void) { dts_init(0); return 0; } -EOF for _ld_dca in -ldca -ldts ; do - cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \ - && _libdca=yes && break + function_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm && + extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break done fi if test "$_libdca" = yes ; then -- cgit v1.2.3