Changeset View
Changeset View
Standalone View
Standalone View
www/firefox/files/patch-bug847568
# Allow building against system-wide graphite2/harfbuzz. | # Allow building against system-wide graphite2/harfbuzz. | ||||
diff --git config/system-headers.mozbuild config/system-headers.mozbuild | diff --git config/system-headers.mozbuild config/system-headers.mozbuild | ||||
index 7620b4d00623..09d3db5ca8c0 100644 | index 7620b4d00623..09d3db5ca8c0 100644 | ||||
--- config/system-headers.mozbuild | --- config/system-headers.mozbuild | ||||
+++ config/system-headers.mozbuild | +++ config/system-headers.mozbuild | ||||
@@ -1312,6 +1312,19 @@ if not CONFIG['MOZ_TREE_PIXMAN']: | @@ -1300,6 +1300,19 @@ if CONFIG['MOZ_ENABLE_CONTENTMANAGER']: | ||||
'pixman.h', | 'SelectSingleContentItemPage.h', | ||||
] | ] | ||||
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: | +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: | ||||
+ system_headers += [ | + system_headers += [ | ||||
+ 'graphite2/Font.h', | + 'graphite2/Font.h', | ||||
+ 'graphite2/Segment.h', | + 'graphite2/Segment.h', | ||||
+ ] | + ] | ||||
+ | + | ||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | ||||
+ system_headers += [ | + system_headers += [ | ||||
+ 'harfbuzz/hb-glib.h', | + 'harfbuzz/hb-glib.h', | ||||
+ 'harfbuzz/hb-ot.h', | + 'harfbuzz/hb-ot.h', | ||||
+ 'harfbuzz/hb.h', | + 'harfbuzz/hb.h', | ||||
+ ] | + ] | ||||
+ | + | ||||
if CONFIG['MOZ_SYSTEM_LIBVPX']: | if CONFIG['MOZ_SYSTEM_LIBVPX']: | ||||
system_headers += [ | system_headers += [ | ||||
'vpx_mem/vpx_mem.h', | 'vpx_mem/vpx_mem.h', | ||||
diff --git dom/base/moz.build dom/base/moz.build | diff --git dom/base/moz.build dom/base/moz.build | ||||
index 8e19020315ae..2fcdbb6f7b42 100644 | index 8e19020315ae..2fcdbb6f7b42 100644 | ||||
--- dom/base/moz.build | --- dom/base/moz.build | ||||
+++ dom/base/moz.build | +++ dom/base/moz.build | ||||
@@ -470,6 +470,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']: | @@ -495,6 +495,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']: | ||||
if CONFIG['MOZ_X11']: | if CONFIG['MOZ_X11']: | ||||
CXXFLAGS += CONFIG['TK_CFLAGS'] | CXXFLAGS += CONFIG['TK_CFLAGS'] | ||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | ||||
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | ||||
+ | + | ||||
GENERATED_FILES += [ | GENERATED_FILES += [ | ||||
'PropertyUseCounterMap.inc', | 'PropertyUseCounterMap.inc', | ||||
Show All 27 Lines | |||||
+hg stat old-configure.in gfx/graphite2 | +hg stat old-configure.in gfx/graphite2 | ||||
echo | echo | ||||
echo If gfx/graphite2/src/files.mk has changed, please make corresponding | echo If gfx/graphite2/src/files.mk has changed, please make corresponding | ||||
diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla | diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla | ||||
index 22c76a7df020..a01490bd49ee 100644 | index 22c76a7df020..a01490bd49ee 100644 | ||||
--- gfx/harfbuzz/README-mozilla | --- gfx/harfbuzz/README-mozilla | ||||
+++ gfx/harfbuzz/README-mozilla | +++ gfx/harfbuzz/README-mozilla | ||||
@@ -19,3 +19,8 @@ the mozilla tree. | @@ -15,3 +15,8 @@ from within the gfx/harfbuzz directory. | ||||
If the collection of source files changes, manual updates to moz.build may be | If the collection of source files changes, manual updates to moz.build may be | ||||
needed, as we don't use the upstream makefiles. | needed as we don't use the upstream makefiles. | ||||
+ | + | ||||
+The in-tree copy may be omitted during build by --with-system-harfbuzz. | +The in-tree copy may be omitted during build by --with-system-harfbuzz. | ||||
+Make sure to keep pkg-config version check within toolkit/moz.configure in sync | +Make sure to keep pkg-config version check within toolkit/moz.configure in sync | ||||
+with checkout version or increment latest tag by one if it's not based | +with checkout version or increment latest tag by one if it's not based | ||||
+on upstream release. | +on upstream release. | ||||
diff --git gfx/moz.build gfx/moz.build | diff --git gfx/moz.build gfx/moz.build | ||||
index 771f652e837a..3b358d84e384 100644 | index 771f652e837a..3b358d84e384 100644 | ||||
--- gfx/moz.build | --- gfx/moz.build | ||||
Show All 19 Lines | |||||
- 'harfbuzz/src', | - 'harfbuzz/src', | ||||
'ots/src', | 'ots/src', | ||||
'thebes', | 'thebes', | ||||
'ipc', | 'ipc', | ||||
diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py | diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py | ||||
index e06ae3457a47..93faa61594a3 100755 | index e06ae3457a47..93faa61594a3 100755 | ||||
--- gfx/skia/generate_mozbuild.py | --- gfx/skia/generate_mozbuild.py | ||||
+++ gfx/skia/generate_mozbuild.py | +++ gfx/skia/generate_mozbuild.py | ||||
@@ -135,6 +135,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']: | @@ -148,6 +148,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): | ||||
'-Wno-unused-private-field', | '-Wno-unused-private-field', | ||||
] | ] | ||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | ||||
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | ||||
+ | + | ||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'): | if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'): | ||||
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] | CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] | ||||
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] | CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] | ||||
diff --git gfx/skia/moz.build gfx/skia/moz.build | diff --git gfx/skia/moz.build gfx/skia/moz.build | ||||
index 2118677ca3a8..e4978b413784 100644 | index 2118677ca3a8..e4978b413784 100644 | ||||
--- gfx/skia/moz.build | --- gfx/skia/moz.build | ||||
+++ gfx/skia/moz.build | +++ gfx/skia/moz.build | ||||
@@ -780,6 +780,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']: | @@ -822,6 +822,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): | ||||
'-Wno-unused-private-field', | '-Wno-unused-private-field', | ||||
] | ] | ||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | ||||
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | ||||
+ | + | ||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'): | if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'): | ||||
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] | CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] | ||||
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] | CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] | ||||
diff --git gfx/thebes/moz.build gfx/thebes/moz.build | diff --git gfx/thebes/moz.build gfx/thebes/moz.build | ||||
index 56f1b9fe3f4b..0ac1100b0df3 100644 | index 56f1b9fe3f4b..0ac1100b0df3 100644 | ||||
--- gfx/thebes/moz.build | --- gfx/thebes/moz.build | ||||
+++ gfx/thebes/moz.build | +++ gfx/thebes/moz.build | ||||
@@ -267,7 +267,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'): | @@ -288,7 +288,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3': | ||||
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] | LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] | ||||
-DEFINES['GRAPHITE2_STATIC'] = True | -DEFINES['GRAPHITE2_STATIC'] = True | ||||
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: | +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: | ||||
+ CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] | + CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] | ||||
+else: | +else: | ||||
+ DEFINES['GRAPHITE2_STATIC'] = True | + DEFINES['GRAPHITE2_STATIC'] = True | ||||
Show All 14 Lines | |||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | ||||
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | ||||
+ | + | ||||
FINAL_LIBRARY = 'xul' | FINAL_LIBRARY = 'xul' | ||||
diff --git netwerk/dns/moz.build netwerk/dns/moz.build | diff --git netwerk/dns/moz.build netwerk/dns/moz.build | ||||
index 79c26e3e7001..c4d93bc5f7dc 100644 | index 79c26e3e7001..c4d93bc5f7dc 100644 | ||||
--- netwerk/dns/moz.build | --- netwerk/dns/moz.build | ||||
+++ netwerk/dns/moz.build | +++ netwerk/dns/moz.build | ||||
@@ -73,3 +73,6 @@ USE_LIBS += ['icu'] | @@ -76,3 +76,6 @@ USE_LIBS += ['icu'] | ||||
if CONFIG['CC_TYPE'] in ('clang', 'gcc'): | if CONFIG['CC_TYPE'] in ('clang', 'gcc'): | ||||
CXXFLAGS += ['-Wno-error=shadow'] | CXXFLAGS += ['-Wno-error=shadow'] | ||||
+ | + | ||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | ||||
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] | ||||
diff --git old-configure.in old-configure.in | diff --git old-configure.in old-configure.in | ||||
index 95a58b634593..b614eef85c89 100644 | index 95a58b634593..b614eef85c89 100644 | ||||
--- old-configure.in | --- old-configure.in | ||||
+++ old-configure.in | +++ old-configure.in | ||||
@@ -4333,6 +4333,27 @@ dnl ======================================================== | @@ -3951,6 +3951,27 @@ dnl ======================================================== | ||||
AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR) | AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR) | ||||
+dnl ======================================================== | +dnl ======================================================== | ||||
+dnl Check for graphite2 | +dnl Check for graphite2 | ||||
+dnl ======================================================== | +dnl ======================================================== | ||||
+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then | +if test -n "$MOZ_SYSTEM_GRAPHITE2"; then | ||||
+ dnl graphite2.pc has bogus version, check manually | + dnl graphite2.pc has bogus version, check manually | ||||
+ _SAVE_CFLAGS=$CFLAGS | + _SAVE_CFLAGS=$CFLAGS | ||||
+ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" | + CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" | ||||
+ AC_TRY_COMPILE([ #include <graphite2/Font.h> | + AC_TRY_COMPILE([ #include <graphite2/Font.h> | ||||
+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ | + #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ | ||||
+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ | + ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ | ||||
+ * 100 + GR2_VERSION_BUGFIX >= \ | + * 100 + GR2_VERSION_BUGFIX >= \ | ||||
+ (major) * 10000 + (minor) * 100 + (bugfix) ) | + (major) * 10000 + (minor) * 100 + (bugfix) ) | ||||
+ ], [ | + ], [ | ||||
+ #if !GR2_VERSION_REQUIRE(1,3,10) | + #if !GR2_VERSION_REQUIRE(1,3,12) | ||||
+ #error "Insufficient graphite2 version." | + #error "Insufficient graphite2 version." | ||||
+ #endif | + #endif | ||||
+ ], [], | + ], [], | ||||
+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) | + [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) | ||||
+ CFLAGS=$_SAVE_CFLAGS | + CFLAGS=$_SAVE_CFLAGS | ||||
+fi | +fi | ||||
+ | + | ||||
dnl ======================================================== | dnl ======================================================== | ||||
dnl Check for pixman and cairo | dnl Check for pixman and cairo | ||||
dnl ======================================================== | dnl ======================================================== | ||||
diff --git toolkit/library/moz.build toolkit/library/moz.build | diff --git toolkit/library/moz.build toolkit/library/moz.build | ||||
index 24f940e1ed7e..079a575adec3 100644 | index 24f940e1ed7e..079a575adec3 100644 | ||||
--- toolkit/library/moz.build | --- toolkit/library/moz.build | ||||
+++ toolkit/library/moz.build | +++ toolkit/library/moz.build | ||||
@@ -238,6 +238,12 @@ if CONFIG['MOZ_SYSTEM_JPEG']: | @@ -223,6 +223,12 @@ if CONFIG['MOZ_SYSTEM_JPEG']: | ||||
if CONFIG['MOZ_SYSTEM_PNG']: | if CONFIG['MOZ_SYSTEM_PNG']: | ||||
OS_LIBS += CONFIG['MOZ_PNG_LIBS'] | OS_LIBS += CONFIG['MOZ_PNG_LIBS'] | ||||
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: | +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: | ||||
+ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] | + OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] | ||||
+ | + | ||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: | ||||
+ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] | + OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] | ||||
+ | + | ||||
if CONFIG['MOZ_SYSTEM_LIBEVENT']: | if CONFIG['MOZ_SYSTEM_LIBEVENT']: | ||||
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] | OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] | ||||
diff --git toolkit/moz.configure toolkit/moz.configure | diff --git toolkit/moz.configure toolkit/moz.configure | ||||
index 9297e4d6f501..d8e273887e4b 100644 | index 9297e4d6f501..d8e273887e4b 100644 | ||||
--- toolkit/moz.configure | --- toolkit/moz.configure | ||||
+++ toolkit/moz.configure | +++ toolkit/moz.configure | ||||
@@ -1065,6 +1065,26 @@ add_old_configure_assignment('FT2_LIBS', | @@ -883,6 +883,26 @@ add_old_configure_assignment('FT2_LIBS', | ||||
add_old_configure_assignment('FT2_CFLAGS', | add_old_configure_assignment('FT2_CFLAGS', | ||||
ft2_info.cflags) | ft2_info.cflags) | ||||
+# Graphite2 | +# Graphite2 | ||||
+# ============================================================== | +# ============================================================== | ||||
+option('--with-system-graphite2', | +option('--with-system-graphite2', | ||||
+ help="Use system graphite2 (located with pkgconfig)") | + help="Use system graphite2 (located with pkgconfig)") | ||||
+ | + | ||||
+system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2', | +system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2', | ||||
+ when='--with-system-graphite2') | + when='--with-system-graphite2') | ||||
+ | + | ||||
+set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True)) | +set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True)) | ||||
+ | + | ||||
+# HarfBuzz | +# HarfBuzz | ||||
+# ============================================================== | +# ============================================================== | ||||
+option('--with-system-harfbuzz', | +option('--with-system-harfbuzz', | ||||
+ help="Use system harfbuzz (located with pkgconfig)") | + help="Use system harfbuzz (located with pkgconfig)") | ||||
+ | + | ||||
+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.7.4', | +system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.8.8', | ||||
+ when='--with-system-harfbuzz') | + when='--with-system-harfbuzz') | ||||
+ | + | ||||
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True)) | +set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True)) | ||||
+ | + | ||||
# Mortar | # Mortar | ||||
# ============================================================== | # ============================================================== | ||||
option('--enable-mortar', help='Enable mortar extension') | option('--enable-mortar', help='Enable mortar extension') |