[FFmpeg-cvslog] r25037 - trunk/configure

mru subversion
Fri Sep 3 23:27:12 CEST 2010


Author: mru
Date: Fri Sep  3 23:27:12 2010
New Revision: 25037

Log:
configure: make print_config() more flexible

Modified:
   trunk/configure

Modified: trunk/configure
==============================================================================
--- trunk/configure	Fri Sep  3 23:13:01 2010	(r25036)
+++ trunk/configure	Fri Sep  3 23:27:12 2010	(r25037)
@@ -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 optimizatio
     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
 



More information about the ffmpeg-cvslog mailing list