Browse code

Create config.asm for use with yasm

Originally committed as revision 25039 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård authored on 2010/09/04 06:27:19
Showing 2 changed files
... ...
@@ -36,6 +36,7 @@ ALLFFLIBS = avcodec avcore avdevice avfilter avformat avutil postproc swscale
36 36
 IFLAGS   := -I$(BUILD_ROOT_REL) -I$(SRC_PATH)
37 37
 CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
38 38
 CFLAGS   += $(ECFLAGS)
39
+YASMFLAGS += $(IFLAGS) -Pconfig.asm
39 40
 
40 41
 HOSTCFLAGS += $(IFLAGS)
41 42
 
... ...
@@ -505,6 +505,10 @@ print_config_mak(){
505 505
     echo "$v$2=yes"
506 506
 }
507 507
 
508
+print_config_asm(){
509
+    enabled $1 && echo "%define $2"
510
+}
511
+
508 512
 print_config(){
509 513
     pfx=$1
510 514
     files=$2
... ...
@@ -1784,6 +1788,7 @@ tmpfile TMPO  .o
1784 1784
 tmpfile TMPS  .S
1785 1785
 tmpfile TMPV  .ver
1786 1786
 tmpfile TMPSH .sh
1787
+tmpfile TMPASM .asm
1787 1788
 
1788 1789
 unset -f mktemp
1789 1790
 
... ...
@@ -2578,7 +2583,7 @@ EOF
2578 2578
 
2579 2579
     check_asm bswap '"bswap %%eax" ::: "%eax"'
2580 2580
 
2581
-    YASMFLAGS="-f $objformat -DARCH_$(toupper $subarch)"
2581
+    YASMFLAGS="-f $objformat"
2582 2582
     enabled     x86_64        && append YASMFLAGS "-m amd64"
2583 2583
     enabled     pic           && append YASMFLAGS "-DPIC"
2584 2584
     test -n "$extern_prefix"  && append YASMFLAGS "-DPREFIX"
... ...
@@ -3184,6 +3189,11 @@ if enabled small || disabled optimizations; then
3184 3184
     echo "#define av_always_inline"  >> $TMPH
3185 3185
 fi
3186 3186
 
3187
+if enabled yasm; then
3188
+    append config_files $TMPASM
3189
+    printf '' >$TMPASM
3190
+fi
3191
+
3187 3192
 print_config ARCH_   "$config_files" $ARCH_LIST
3188 3193
 print_config HAVE_   "$config_files" $HAVE_LIST
3189 3194
 print_config CONFIG_ "$config_files" $CONFIG_LIST       \
... ...
@@ -3215,6 +3225,8 @@ echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
3215 3215
 cp_if_changed $TMPH config.h
3216 3216
 touch .config
3217 3217
 
3218
+enabled yasm && cp_if_changed $TMPASM config.asm
3219
+
3218 3220
 cat > $TMPH <<EOF
3219 3221
 /* Generated by ffconf */
3220 3222
 #ifndef AVUTIL_AVCONFIG_H