From f8d7b072fe5767f97825a3cfa6ff37f15dd887be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Mon, 19 Feb 2007 23:00:18 +0000 Subject: feature tests for functions requiring one or more headers Originally committed as revision 8032 to svn://svn.ffmpeg.org/ffmpeg/trunk --- configure | 91 ++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/configure b/configure index 308366d..eef8f57 100755 --- a/configure +++ b/configure @@ -438,6 +438,26 @@ int main(){ EOF } +check_func2(){ + log check_func2 "$@" + headers=$1 + func=$2 + shift 2 + disable $func + incs="" + for hdr in $headers; do + incs="$incs +#include <$hdr>" + done + check_ld "$@" <>$logfile 2>&1; } } @@ -462,6 +494,14 @@ require(){ check_lib $header $func "$@" || die "ERROR: $name not found" } +require2(){ + name="$1" + headers="$2" + func="$3" + shift 3 + check_lib2 "$headers" $func "$@" || die "ERROR: $name not found" +} + apply(){ file=$1 shift @@ -1486,54 +1526,9 @@ enabled xvid && require XviD xvid.h xvid_global -lxvidcore enabled x264 && require x264 x264.h x264_encoder_open -lx264 enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib - -# Ugh, libfaac uses stdcall calling convention on win32 so we can't use -# the generic test functions -if enabled libfaac; then - save_flags - temp_extralibs -lfaac - check_ld < -#include -int main(){ - char *id, *cpr; - faacEncGetVersion(&id, &cpr); - return 0; -} -EOF - restore_flags -fi - -# Ugh, recent faad2 versions have renamed all functions and #define the -# old names in faad.h. Generic tests won't work. -if enabled libfaad; then - save_flags - temp_extralibs -lfaad - check_ld < -int main(){ - faacDecOpen(); - return 0; -} -EOF - restore_flags -fi - -# Ugh, avisynth uses WINAPI calls. Generic tests won't work. -if enabled avisynth; then - save_flags - temp_extralibs -lvfw32 - check_ld < -#include -int main(){ - AVIFileInit(); - return 0; -} -EOF - restore_flags -fi - +enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac +enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad +enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32 # test for lrintf in math.h check_exec <