aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-09-03 21:27:12 +0000
committerMåns Rullgård <mans@mansr.com>2010-09-03 21:27:12 +0000
commit72cfcf41568d34c8d0ae0e01205ee62bb79f207d (patch)
tree9123eae3a53d035c4e60176b07bcf28828c68e62 /configure
parentdab95c05843c1e2152fdc5bd61306564cf3a59d1 (diff)
downloadffmpeg-72cfcf41568d34c8d0ae0e01205ee62bb79f207d.tar.gz
configure: make print_config() more flexible
Originally committed as revision 25037 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure35
1 files changed, 21 insertions, 14 deletions
diff --git a/configure b/configure
index 2f9c9b6e22..b92c91fb70 100755
--- a/configure
+++ b/configure
@@ -495,20 +495,25 @@ check_deps(){
done
}
+print_config_h(){
+ enabled $1 && v=1 || v=0
+ echo "#define $2 $v"
+}
+
+print_config_mak(){
+ enabled $1 && v= || v=!
+ echo "$v$2=yes"
+}
+
print_config(){
pfx=$1
- header=$2
- makefile=$3
- shift 3
+ files=$2
+ shift 2
for cfg; do
ucname="$(toupper $cfg)"
- if enabled $cfg; then
- echo "#define ${pfx}${ucname} 1" >> $header
- echo "${pfx}${ucname}=yes" >> $makefile
- else
- echo "#define ${pfx}${ucname} 0" >> $header
- echo "!${pfx}${ucname}=yes" >> $makefile
- fi
+ for f in $files; do
+ "print_config_${f##*.}" $cfg ${pfx}${ucname} >>$f
+ done
done
}
@@ -3062,6 +3067,8 @@ fi
enabled stripping || strip="echo skipping strip"
+config_files="$TMPH config.mak"
+
cat > config.mak <<EOF
# Automatically generated by configure - do not modify!
ifndef FFMPEG_CONFIG_MAK
@@ -3177,9 +3184,9 @@ if enabled small || disabled optimizations; then
echo "#define av_always_inline" >> $TMPH
fi
-print_config ARCH_ $TMPH config.mak $ARCH_LIST
-print_config HAVE_ $TMPH config.mak $HAVE_LIST
-print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
+print_config ARCH_ "$config_files" $ARCH_LIST
+print_config HAVE_ "$config_files" $HAVE_LIST
+print_config CONFIG_ "$config_files" $CONFIG_LIST \
$CONFIG_EXTRA \
$DECODER_LIST \
$ENCODER_LIST \
@@ -3214,7 +3221,7 @@ cat > $TMPH <<EOF
#define AVUTIL_AVCONFIG_H
EOF
-print_config AV_HAVE_ $TMPH /dev/null $HAVE_LIST_PUB
+print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH