[vlc-devel] [PATCH 2/2] contrib: mfx: don't force a level optimization even on non optimized builds

Steve Lhomme robux4 at ycbcr.xyz
Fri Mar 30 08:27:43 CEST 2018


Le 29/03/2018 à 22:01, Martin Storsjö a écrit :
> On Thu, 29 Mar 2018, Steve Lhomme wrote:
>
>> No other contrib need it and we use the same compiler for them.
>> ---
>> contrib/src/mfx/rules.mak | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/contrib/src/mfx/rules.mak b/contrib/src/mfx/rules.mak
>> index a5b1fdaa61..f3b1287db5 100644
>> --- a/contrib/src/mfx/rules.mak
>> +++ b/contrib/src/mfx/rules.mak
>> @@ -23,6 +23,6 @@ mfx: mfx-$(MFX_GITHASH).tar.xz .sum-mfx
>>     $(MOVE)
>>
>> .mfx: mfx
>> -    cd $< && $(HOSTVARS) ./configure $(HOSTCONF) 
>> CXXFLAGS="$(CXXFLAGS) -std=c++98 -O2"
>> +    cd $< && $(HOSTVARS) ./configure $(HOSTCONF) 
>> CXXFLAGS="$(CXXFLAGS) -std=c++98"
>
> The reason for this is, if you don't override configure's CXXFLAGS, it 
> will implicitly contain -O2. If you do override it, it will clear all 
> the defaults and you'll end up with a build with no optimization flags 
> whatsoever, and you need to manually add the -O2 that would otherwise 
> have been there.

I think if it's placed after the env CXXFLAGS it will override whatever 
value was set before. It may depend on the compiler though.

In any case it's not a good idea to discard the env flags. For example 
you may lose the forced _WIN32_WINNT version and WINAPI_FAMILY when 
building on Windows.

> An alternative way of adding extra options would be to inject them via 
> the CXX variable instead, to let autotools add the default -O2 just 
> like it otherwise does.
>
> // Martin
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list