summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-09-18 09:49:12 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:16:56 +0200
commit755ae2801d013b1ce85034738d577cb1b2b31935 (patch)
tree481e4dee0dd75aba265c638229603cca0ea20aff /configure
parent7cbcdddb2d6a15f609730c9bd76eccf4aab5a7c6 (diff)
downloadmpv-755ae2801d013b1ce85034738d577cb1b2b31935.tar.bz2
mpv-755ae2801d013b1ce85034738d577cb1b2b31935.tar.xz
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
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 15 insertions, 9 deletions
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 <inttypes.h>
-#include <dts.h>
-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