Ticket #28935: ffmpeg-i386-no-inline-Portfile.diff

File ffmpeg-i386-no-inline-Portfile.diff, 3.1 KB (added by daitakahashi, 10 years ago)

disable inlining for intel 32bit architecture (darwin 10)

  • Portfile

    old new  
    33
    44PortSystem 1.0
    55PortGroup xcodeversion 1.0
     6PortGroup muniversal 1.0
    67
    78name            ffmpeg
    89conflicts       ffmpeg-devel
     
    119120
    120121#add --enable-libopenjpeg when problems with openjpeg.h are resolved
    121122
    122 if {$build_arch != ""} {
    123     configure.args-append --arch=${build_arch}
    124 }
    125 
    126123test.run        yes
    127124
    128125#
    129126# configure isn't autoconf and they do use a dep cache
    130127#
    131128
    132 universal_variant no
     129if { [variant_isset universal] } {
     130    configure.universal_args-delete             --disable-dependency-tracking
     131
     132    foreach arch ${universal_archs_supported} {
     133        lappend merger_configure_args($arch)    --arch=${arch}
     134        lappend merger_configure_env($arch)     ASFLAGS='-arch ${arch}'
     135    }
     136} else {
     137    configure.args-append --arch=${configure.build_arch}
     138    configure.env-append  ASFLAGS='-arch ${configure.build_arch}'
     139}
    133140
    134141post-destroot {
    135142    file mkdir ${destroot}${prefix}/share/doc/${name}
     
    139146    }
    140147}
    141148
     149set disable_mmx_config_args {--disable-mmx --disable-mmx2 \
     150                             --disable-sse --disable-ssse3 \
     151                             --disable-amd3dnow --disable-amd3dnowext}
     152
    142153platform darwin 10 {
    143     # ticket #20938 -- disable mmx for 32 bit intel only
    144     if { $build_arch == "i386" } {
    145         # swscale is no longer GPL only
    146         configure.args-delete --enable-swscale
    147         if { ![variant_isset no_mmx] } {
    148             configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
    149         }
     154    # gcc-4.2's resister starvation problem seems to be avoided by
     155    # suppression of inlining (generated binary may be slow)
     156    lappend merger_configure_cflags(i386)       -fno-inline
     157    if { ${configure.build_arch} == "i386" } {
     158        configure.cflags-append                 -fno-inline
    150159    }
     160
     161#    # ticket #20938 -- disable mmx for 32 bit intel only
     162#    if { [variant_isset universal] || ${configure.build_arch} == "i386" } {
     163#        # swscale is no longer GPL only
     164#        configure.args-delete --enable-swscale
     165#
     166#        # restore swscale for architectures other than 32 bit intel
     167#        foreach arch ${universal_archs_supported} {
     168#            if { $arch != "i386" } {
     169#                lappend merger_configure_args($arch) --enable-swscale
     170#            }
     171#        }
     172#
     173#        if { ![variant_isset no_mmx] } {
     174#            if { [variant_isset universal] } {
     175#                eval lappend merger_configure_args(i386)     ${disable_mmx_config_args}
     176#            } else {
     177#                eval configure.args-append                   ${disable_mmx_config_args}
     178#            }
     179#        }
     180#    }
    151181}
    152182
    153183platform powerpc {
     
    158188}
    159189
    160190variant no_mmx description {disable all x86 asm optimizations} {
    161     configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
     191    eval configure.args-append ${disable_mmx_config_args}
    162192}
    163193
    164194variant no_gpl description {disallow use of GPL code, license will be LGPL} {