[vlc-devel] build contribs on windows with MSYS2

Rafaël Carré funman at videolan.org
Fri Aug 8 17:35:20 CEST 2014


On 08/08/14 13:51, Hannes Domani wrote:
> Hello
> 
> Jean-Baptiste Kempf <jb at videolan.org> schrieb am 9:09 Freitag, 8.August 2014:
>> Of course, this is a bit too intrusive to be applied as is.
>> Maybe some easy part can be merged?
> 
> I never thought that this would be applied.
> But I still tried to make it portable, most parts check for mingw (or WIN32).
> 
> There are a few things where I wonder how this works even with cross-compiling.
> - glew: the linking of glew32.dll (by default LD=ld).
> - qt: I had to specify "-no-freetype -no-fontconfig",
>   because it always tried to use the system freetype
>   (that was compiled for the contribs as well), but it's not in the Qt*.pc
>   and thus never linked into the qt-plugin.
>   Are freetype and fontconfig needed in qt for vlc?
> - I added CC_FOR_BUILD=gcc to the HOSTTOOLS because when not set,
>   it defaults to $(CC).
> 
>>> One thing I noticed, it seems not all of the contribs are compiled with optimization enabled.
>>> Is this intentional, or did I miss something?
>>
>> Like which?
> 
> The list is rather long, every package which doesn't optimize by default:
> cddb, dvdcss, dvdnav, dvdread, faad2, flac, fontconfig, fribidi, gettext,
> gmp, gnutls, goom, harfbuzz, iconv, ...
> 
> Should I have specified -O2/-O3 somewhere when compiling the contribs?

IIRC autoconf only adds -O2 to CFLAGS if it's unset, we need something
like this:

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index dd2bd25..5cd5192 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -162,8 +162,8 @@ cppcheck = $(shell $(CC) $(CFLAGS) -E -dM - <
/dev/null | grep -E $(1))

 EXTRA_CFLAGS += -I$(PREFIX)/include
 CPPFLAGS := $(CPPFLAGS) $(EXTRA_CFLAGS)
-CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS) -g
-CXXFLAGS := $(CXXFLAGS) $(EXTRA_CFLAGS) -g
+CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS) -g -O2
+CXXFLAGS := $(CXXFLAGS) $(EXTRA_CFLAGS) -g -O2
 EXTRA_LDFLAGS += -L$(PREFIX)/lib
 LDFLAGS := $(LDFLAGS) $(EXTRA_LDFLAGS)
 # Do not export those! Use HOSTVARS.



More information about the vlc-devel mailing list