summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2006-11-15 00:14:50 +0000
committerMåns Rullgård <mans@mansr.com>2006-11-15 00:14:50 +0000
commit0701ca7f952a5ffdb8752221040fb6f178e04608 (patch)
tree344bf859a7fd94798855edad8125b5cc0a79bb23 /configure
parent18b67ae59e83f97c2f05518579ac885b9fb5e86e (diff)
set status variables automatically in check_header and check_func
Originally committed as revision 7079 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure36
1 files changed, 16 insertions, 20 deletions
diff --git a/configure b/configure
index e516075cb2..41104a0a34 100755
--- a/configure
+++ b/configure
@@ -334,6 +334,10 @@ check_header(){
#include <$header>
int x;
EOF
+ err=$?
+ var=`echo $header | sed 's/[^[:alnum:]]/_/g'`
+ test "$err" = 0 && enable $var || disable $var
+ return $err
}
check_func(){
@@ -346,6 +350,9 @@ int main(){
$func();
}
EOF
+ err=$?
+ test "$err" = 0 && enable $func || disable $func
+ return $err
}
check_lib(){
@@ -1327,7 +1334,7 @@ if test $arch = "powerpc"; then
fi
fi
-check_header altivec.h && altivec_h=yes || altivec_h=no
+check_header altivec.h
# check if our compiler supports Motorola AltiVec C API
if test $altivec = "yes"; then
@@ -1403,13 +1410,8 @@ fi
# ---
# check availability of some header files
-memalign=no
-malloc_h=no
-if check_header malloc.h; then
- malloc_h=yes
- memalign=yes
- check_func memalign || memalign="no"
-fi
+check_header malloc.h
+check_func memalign
if test "$memalign" = "no" -a "$mmx" = "yes" -a \
"$memalign_hack" != "yes" -a "$targetos" != "Darwin" -a \
@@ -1417,10 +1419,10 @@ if test "$memalign" = "no" -a "$mmx" = "yes" -a \
die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
fi
-check_header byteswap.h && byteswap_h=yes || byteswap_h=no
+check_header byteswap.h
-check_func inet_aton && inet_aton=yes || inet_aton=no
-check_func localtime_r && localtime_r=yes || localtime_r=no
+check_func inet_aton
+check_func localtime_r
enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
# check for some common methods of building with pthread support
@@ -1509,18 +1511,12 @@ done
# dlopen/dlfcn.h probing
-check_header dlfcn.h && dlfcn_h=yes
+check_header dlfcn.h
-temp_extralibs -ldl
if check_func dlopen; then
- dlopen=yes
- ldl=-ldl
-fi
-restore_flags
-
-if check_func dlopen; then
- dlopen=yes
ldl=
+elif check_func dlopen -ldl; then
+ ldl=-ldl
fi
if test "$vhook" = "default"; then