diff --git a/src/freetype.mk b/src/freetype.mk index 3e097755..0f7c546d 100644 --- a/src/freetype.mk +++ b/src/freetype.mk @@ -18,11 +18,15 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD + # alias harfbuzz to handle linking circularity + $(if $(BUILD_STATIC),\ + ln -sf libharfbuzz.a '$(PREFIX)/$(TARGET)/lib/libharfbuzz_too.a',) cd '$(1)' && GNUMAKE=$(MAKE) ./configure \ $(MXE_CONFIGURE_OPTS) \ LIBPNG_CFLAGS="`$(TARGET)-pkg-config libpng --cflags`" \ LIBPNG_LDFLAGS="`$(TARGET)-pkg-config libpng --libs`" \ - FT2_EXTRA_LIBS="`$(TARGET)-pkg-config libpng --libs`" + FT2_EXTRA_LIBS="`$(TARGET)-pkg-config libpng --libs`" \ + $(if $(BUILD_STATIC),HARFBUZZ_LIBS="`$(TARGET)-pkg-config harfbuzz --libs` -lharfbuzz_too",) $(MAKE) -C '$(1)' -j '$(JOBS)' $(MAKE) -C '$(1)' -j 1 install ln -sf '$(PREFIX)/$(TARGET)/bin/freetype-config' '$(PREFIX)/bin/$(TARGET)-freetype-config' diff --git a/src/harfbuzz.mk b/src/harfbuzz.mk index b7d62795..472ff60c 100644 --- a/src/harfbuzz.mk +++ b/src/harfbuzz.mk @@ -22,6 +22,4 @@ define $(PKG)_BUILD $(MXE_CONFIGURE_OPTS) \ LIBS='-lstdc++' $(MAKE) -C '$(1)' -j '$(JOBS)' install - # alias for this library will help qmake deal with the freetype/harfbuzz linking circularity - ln -sf libharfbuzz.a '$(PREFIX)/$(TARGET)/lib/libharfbuzz_too.a' endef diff --git a/src/qtbase-1.patch b/src/qtbase-1.patch index 6f26d21d..0968913d 100644 --- a/src/qtbase-1.patch +++ b/src/qtbase-1.patch @@ -58,46 +58,24 @@ index 2c1b431..e29798b 100644 1.8.4.5 -From 377ebc9636652d5ba46bcf71b60c6bfe91f46008 Mon Sep 17 00:00:00 2001 +From ab88cc720914a7d472553b98259c9f1b7f26adcc Mon Sep 17 00:00:00 2001 From: Mark Brand -Date: Wed, 18 Jun 2014 16:37:08 +0200 -Subject: [PATCH 3/3] workaround harfbuzz/freetype static linking circularity - (MXE-specific) +Date: Sat, 21 Jun 2014 13:12:49 +0200 +Subject: [PATCH 3/3] use pkg-config for harfbuzz (MXE specific) -Pkg-config provides the -lfreetype needed by -lharfbuzz. -Fontconfig also introduces -lfreetype. -Manually add -lharfbuzz_too needed after these -lfreetype occurrences. +Change-Id: Id4e4c37d68b63c9f480d72a561d95d4d2a5ded50 -This assumes that the libharfbuzz_too.a exists and is a symbolic -link (or copy of) libharfbuzz.a. If we were to simply add an -extra -lharfbuzz, qmake would remove the duplicate. - -Change-Id: Ia6a1d1d58cfc58ee470aab4830309596085d52a2 - -diff --git a/configure b/configure -index 601d84a..24ea55e 100755 ---- a/configure -+++ b/configure -@@ -4812,6 +4812,7 @@ if [ "$CFG_FONTCONFIG" != "no" ]; then - QT_CFLAGS_FONTCONFIG= - QT_LIBS_FONTCONFIG="-lfreetype -lfontconfig" - fi -+ [ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_SHARED" = "no" ] && QT_LIBS_FONTCONFIG="$QT_LIBS_FONTCONFIG -lharfbuzz_too" - if compileTest unix/fontconfig "FontConfig" $QT_CFLAGS_FONTCONFIG $QT_LIBS_FONTCONFIG; then - QT_CONFIG="$QT_CONFIG fontconfig" - QMakeVar set QMAKE_CFLAGS_FONTCONFIG "$QT_CFLAGS_FONTCONFIG" diff --git a/src/3rdparty/harfbuzzng.pri b/src/3rdparty/harfbuzzng.pri -index 7443368..466135e 100644 +index 7443368..c24e684 100644 --- a/src/3rdparty/harfbuzzng.pri +++ b/src/3rdparty/harfbuzzng.pri -@@ -2,5 +2,7 @@ contains(QT_CONFIG, harfbuzz) { +@@ -2,5 +2,6 @@ contains(QT_CONFIG, harfbuzz) { INCLUDEPATH += $$PWD/harfbuzz-ng/include LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtharfbuzzng$$qtPlatformTargetSuffix() } else:contains(QT_CONFIG, system-harfbuzz) { - LIBS_PRIVATE += -lharfbuzz -+ isEmpty(PKG_CONFIG):PKG_CONFIG = pkg-config -+ LIBS_PRIVATE += $$system($$PKG_CONFIG --static --libs harfbuzz) -+ mingw:static:contains(LIBS_PRIVATE, -lfreetype):LIBS_PRIVATE += -lharfbuzz_too ++ CONFIG += link_pkgconfig ++ PKGCONFIG += harfbuzz } -- 1.8.4.5