Bug 1186748 - Move gtk-related things in a separate mozconfig. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 23 Jul 2015 17:28:30 +0900
changeset 254871 6f212df3de6faa3e4ba89b1069b8f824bad8b3ce
parent 254870 6f2cb2f8b5bc892e227832db7d09e673c29a557c
child 254872 d42313a9dbb57b56a916d20837f21ae6ba68f876
push id29123
push usercbook@mozilla.com
push dateTue, 28 Jul 2015 14:28:44 +0000
treeherdermozilla-central@bc589dd18ad5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1186748
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1186748 - Move gtk-related things in a separate mozconfig. r=mshal Some mozconfigs don't include mozconfig.linux*, and don't get gtk-related definitions, so move them in a separate mozconfig. To avoid having two files, one for 32-bit builds and one for 64-bit builds, rely on the includer to set PKG_CONFIG_LIBDIR appropriately. At the same time, move all the --enable-default-toolkit=cairo-gtk2 in that new file in the case the gtk3 package wasn't pulled from tooltool.
b2g/config/mozconfigs/linux32_gecko/debug
b2g/config/mozconfigs/linux32_gecko/nightly
b2g/config/mozconfigs/linux64_gecko/debug
b2g/config/mozconfigs/linux64_gecko/nightly
b2g/dev/config/mozconfigs/linux64/mulet
browser/config/mozconfigs/linux32/debug-asan
browser/config/mozconfigs/linux32/nightly-asan
browser/config/mozconfigs/linux32/valgrind
browser/config/mozconfigs/linux64/debug-asan
browser/config/mozconfigs/linux64/debug-static-analysis-clang
browser/config/mozconfigs/linux64/hazards
browser/config/mozconfigs/linux64/nightly-asan
browser/config/mozconfigs/linux64/valgrind
build/unix/mozconfig.gtk
build/unix/mozconfig.linux
build/unix/mozconfig.linux32
--- a/b2g/config/mozconfigs/linux32_gecko/debug
+++ b/b2g/config/mozconfigs/linux32_gecko/debug
@@ -1,16 +1,14 @@
 MOZ_AUTOMATION_L10N_CHECK=0
 MOZ_AUTOMATION_UPLOAD_SYMBOLS=0
 MOZ_AUTOMATION_UPDATE_PACKAGING=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux32"
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 ac_add_options --enable-debug
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
--- a/b2g/config/mozconfigs/linux32_gecko/nightly
+++ b/b2g/config/mozconfigs/linux32_gecko/nightly
@@ -1,17 +1,15 @@
 MOZ_AUTOMATION_L10N_CHECK=0
 MOZ_AUTOMATION_UPLOAD_SYMBOLS=0
 MOZ_AUTOMATION_UPDATE_PACKAGING=0
 MOZ_AUTOMATION_SDK=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux32"
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
--- a/b2g/config/mozconfigs/linux64_gecko/debug
+++ b/b2g/config/mozconfigs/linux64_gecko/debug
@@ -1,16 +1,14 @@
 MOZ_AUTOMATION_L10N_CHECK=0
 MOZ_AUTOMATION_UPLOAD_SYMBOLS=0
 MOZ_AUTOMATION_UPDATE_PACKAGING=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux"
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 ac_add_options --enable-debug
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
--- a/b2g/config/mozconfigs/linux64_gecko/nightly
+++ b/b2g/config/mozconfigs/linux64_gecko/nightly
@@ -1,17 +1,15 @@
 MOZ_AUTOMATION_L10N_CHECK=0
 MOZ_AUTOMATION_UPLOAD_SYMBOLS=0
 MOZ_AUTOMATION_UPDATE_PACKAGING=0
 MOZ_AUTOMATION_SDK=0
 . "$topsrcdir/b2g/config/mozconfigs/common"
 . "$topsrcdir/build/unix/mozconfig.linux"
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-signmar
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
--- a/b2g/dev/config/mozconfigs/linux64/mulet
+++ b/b2g/dev/config/mozconfigs/linux64/mulet
@@ -1,11 +1,10 @@
 MOZ_AUTOMATION_L10N_CHECK=0
 MOZ_AUTOMATION_UPLOAD_SYMBOLS=0
 MOZ_AUTOMATION_UPDATE_PACKAGING=0
 MOZ_AUTOMATION_SDK=0
 . "$topsrcdir/browser/config/mozconfigs/linux64/nightly"
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
 ac_add_options --enable-application=b2g/dev
 
 # Include Firefox OS fonts.
 MOZTTDIR=$topsrcdir/moz-tt
--- a/browser/config/mozconfigs/linux32/debug-asan
+++ b/browser/config/mozconfigs/linux32/debug-asan
@@ -5,15 +5,18 @@ ac_add_options --with-google-oauth-api-k
 ac_add_options --enable-debug
 ac_add_options --enable-optimize="-O1"
 
 # ASan specific options on Linux
 ac_add_options --enable-valgrind
 
 . $topsrcdir/build/unix/mozconfig.asan
 
+export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig
+. $topsrcdir/build/unix/mozconfig.gtk
+
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
 
 # Need this to prevent name conflicts with the normal nightly build packages
 export MOZ_PKG_SPECIAL=asan
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux32/nightly-asan
+++ b/browser/config/mozconfigs/linux32/nightly-asan
@@ -4,15 +4,18 @@ ac_add_options --with-google-oauth-api-k
 ac_add_options --disable-debug
 ac_add_options --enable-optimize="-O2 -g"
 
 # ASan specific options on Linux
 ac_add_options --enable-valgrind
 
 . $topsrcdir/build/unix/mozconfig.asan
 
+export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig
+. $topsrcdir/build/unix/mozconfig.gtk
+
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
 
 # Need this to prevent name conflicts with the normal nightly build packages
 export MOZ_PKG_SPECIAL=asan
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux32/valgrind
+++ b/browser/config/mozconfigs/linux32/valgrind
@@ -1,11 +1,9 @@
 . $topsrcdir/browser/config/mozconfigs/linux32/nightly
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 ac_add_options --enable-valgrind
 ac_add_options --disable-jemalloc
 ac_add_options --disable-install-strip
 
 # Include the override mozconfig again (even though the above includes it)
 # since it's supposed to override everything.
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux64/debug-asan
+++ b/browser/config/mozconfigs/linux64/debug-asan
@@ -3,19 +3,20 @@ ac_add_options --with-google-oauth-api-k
 # Use at least -O1 for optimization to avoid stack space
 # exhaustions caused by Clang function inlining.
 ac_add_options --enable-debug
 ac_add_options --enable-optimize="-O1"
 
 # ASan specific options on Linux
 ac_add_options --enable-valgrind
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
+. $topsrcdir/build/unix/mozconfig.asan
 
-. $topsrcdir/build/unix/mozconfig.asan
+export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig
+. $topsrcdir/build/unix/mozconfig.gtk
 
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
 
 # Need this to prevent name conflicts with the normal nightly build packages
 export MOZ_PKG_SPECIAL=asan
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux64/debug-static-analysis-clang
+++ b/browser/config/mozconfigs/linux64/debug-static-analysis-clang
@@ -2,21 +2,22 @@ MOZ_AUTOMATION_BUILD_SYMBOLS=0
 MOZ_AUTOMATION_PACKAGE_TESTS=0
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . "$topsrcdir/build/mozconfig.common"
 
 ac_add_options --enable-debug
 ac_add_options --enable-dmd
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 # Use Clang as specified in manifest
 export CC="$topsrcdir/clang/bin/clang"
 export CXX="$topsrcdir/clang/bin/clang++"
 
 # Add the static checker
 ac_add_options --enable-clang-plugin
 
 # Avoid dependency on libstdc++ 4.7
 ac_add_options --enable-stdcxx-compat
 
+export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig
+. $topsrcdir/build/unix/mozconfig.gtk
+
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux64/hazards
+++ b/browser/config/mozconfigs/linux64/hazards
@@ -6,26 +6,27 @@
 # tooltool-installed gcc, and the analysis works by wrapping the gcc invocation
 # with a script that invokes the real gcc with -fplugin and its configuration
 # directives. Instead, duplicate the contents of that mozconfig here:
 
 . "$topsrcdir/build/mozconfig.common"
 ac_add_options --enable-elf-hack
 ac_add_options --enable-stdcxx-compat
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 # The objdir must be at a known location so its path can be stripped from the
 # filenames stored by the analysis
 mk_add_options MOZ_OBJDIR=obj-analyzed
 
 # The configuration options are chosen to compile the most code
 # (--enable-debug, --enable-tests) in the trickiest way possible
 # (--enable-optimize) to maximize the chance of seeing tricky static orderings.
 ac_add_options --enable-debug
 ac_add_options --enable-tests
 ac_add_options --enable-optimize
 
 CFLAGS="$CFLAGS -Wno-attributes"
 CPPFLAGS="$CPPFLAGS -Wno-attributes"
 CXXFLAGS="$CXXFLAGS -Wno-attributes"
 
+export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig
+. $topsrcdir/build/unix/mozconfig.gtk
+
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux64/nightly-asan
+++ b/browser/config/mozconfigs/linux64/nightly-asan
@@ -2,19 +2,20 @@ ac_add_options --with-google-oauth-api-k
 
 # We still need to build with debug symbols
 ac_add_options --disable-debug
 ac_add_options --enable-optimize="-O2 -gline-tables-only"
 
 # ASan specific options on Linux
 ac_add_options --enable-valgrind
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
+. $topsrcdir/build/unix/mozconfig.asan
 
-. $topsrcdir/build/unix/mozconfig.asan
+export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig
+. $topsrcdir/build/unix/mozconfig.gtk
 
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
 
 # Need this to prevent name conflicts with the normal nightly build packages
 export MOZ_PKG_SPECIAL=asan
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux64/valgrind
+++ b/browser/config/mozconfigs/linux64/valgrind
@@ -1,13 +1,9 @@
 . $topsrcdir/browser/config/mozconfigs/linux64/nightly
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 ac_add_options --enable-valgrind
 ac_add_options --disable-jemalloc
 ac_add_options --disable-install-strip
 
-ac_add_options --enable-default-toolkit=cairo-gtk2
-
 # Include the override mozconfig again (even though the above includes it)
 # since it's supposed to override everything.
 . "$topsrcdir/build/mozconfig.common.override"
new file mode 100644
--- /dev/null
+++ b/build/unix/mozconfig.gtk
@@ -0,0 +1,48 @@
+# $topsrcdir/gtk3 comes from tooltool, when the tooltool manifest contains it.
+if [ -d "$topsrcdir/gtk3" ]; then
+  if [ -z "$PKG_CONFIG_LIBDIR" ]; then
+    echo PKG_CONFIG_LIBDIR must be set >&2
+    exit 1
+  fi
+  export PKG_CONFIG_SYSROOT_DIR="$topsrcdir/gtk3"
+  export PKG_CONFIG_PATH="$topsrcdir/gtk3/usr/local/lib/pkgconfig"
+  export PATH="$topsrcdir/gtk3/usr/local/bin:${PATH}"
+  # Ensure cairo, gdk-pixbuf, etc. are not taken from the system installed packages.
+  LDFLAGS="-L$topsrcdir/gtk3/usr/local/lib ${LDFLAGS}"
+  mk_add_options "export LD_LIBRARY_PATH=$topsrcdir/gtk3/usr/local/lib"
+  ac_add_options --enable-default-toolkit=cairo-gtk3
+
+  # Set things up to use Gtk+3 from the tooltool package
+  mk_add_options "export FONTCONFIG_PATH=$topsrcdir/gtk3/usr/local/etc/fonts"
+  mk_add_options "export PANGO_SYSCONFDIR=$topsrcdir/gtk3/usr/local/etc"
+  mk_add_options "export PANGO_LIBDIR=$topsrcdir/gtk3/usr/local/lib"
+  mk_add_options "export GDK_PIXBUF_MODULE_FILE=$topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
+  mk_add_options "export GDK_PIXBUF_MODULEDIR=$topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders"
+  mk_add_options "export LD_LIBRARY_PATH=$topsrcdir/gtk3/usr/local/lib"
+
+  # pango expects absolute paths in pango.modules, and topsrcdir may vary...
+  LD_LIBRARY_PATH=$topsrcdir/gtk3/usr/local/lib \
+  PANGO_SYSCONFDIR=$topsrcdir/gtk3/usr/local/etc \
+  PANGO_LIBDIR=$topsrcdir/gtk3/usr/local/lib \
+  $topsrcdir/gtk3/usr/local/bin/pango-querymodules > $topsrcdir/gtk3/usr/local/etc/pango/pango.modules
+
+  # same with gdb-pixbuf and loaders.cache
+  LD_LIBRARY_PATH=$topsrcdir/gtk3/usr/local/lib \
+  GDK_PIXBUF_MODULE_FILE=$topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
+  GDK_PIXBUF_MODULEDIR=$topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders \
+  $topsrcdir/gtk3/usr/local/bin/gdk-pixbuf-query-loaders > $topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
+
+  # mock build environment doesn't have fonts in /usr/share/fonts, but
+  # has some in /usr/share/X11/fonts. Add this directory to the
+  # fontconfig configuration without changing the gtk3 tooltool package.
+  cat << EOF > $topsrcdir/gtk3/usr/local/etc/fonts/local.conf
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+  <dir>/usr/share/X11/fonts</dir>
+</fontconfig>
+EOF
+
+else
+  ac_add_options --enable-default-toolkit=cairo-gtk2
+fi
--- a/build/unix/mozconfig.linux
+++ b/build/unix/mozconfig.linux
@@ -24,54 +24,14 @@ else
   CXX="/tools/gcc-4.7.3-0moz1/bin/g++"
 fi
 
 ac_add_options --enable-elf-hack
 
 # Avoid dependency on libstdc++ 4.7
 ac_add_options --enable-stdcxx-compat
 
-# $topsrcdir/gtk3 comes from tooltool, when the tooltool manifest contains it.
-if [ -d "$topsrcdir/gtk3" ]; then
-  # PKG_CONFIG_LIBDIR is appropriately overridden in mozconfig.linux32
-  export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig
-  export PKG_CONFIG_SYSROOT_DIR="$topsrcdir/gtk3"
-  export PKG_CONFIG_PATH="$topsrcdir/gtk3/usr/local/lib/pkgconfig"
-  export PATH="$topsrcdir/gtk3/usr/local/bin:${PATH}"
-  # Ensure cairo, gdk-pixbuf, etc. are not taken from the system installed packages.
-  LDFLAGS="-L$topsrcdir/gtk3/usr/local/lib"
-  mk_add_options "export LD_LIBRARY_PATH=$topsrcdir/gtk3/usr/local/lib"
-  ac_add_options --enable-default-toolkit=cairo-gtk3
-
-  # Set things up to use Gtk+3 from the tooltool package
-  mk_add_options "export FONTCONFIG_PATH=$topsrcdir/gtk3/usr/local/etc/fonts"
-  mk_add_options "export PANGO_SYSCONFDIR=$topsrcdir/gtk3/usr/local/etc"
-  mk_add_options "export PANGO_LIBDIR=$topsrcdir/gtk3/usr/local/lib"
-  mk_add_options "export GDK_PIXBUF_MODULE_FILE=$topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
-  mk_add_options "export GDK_PIXBUF_MODULEDIR=$topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders"
-  mk_add_options "export LD_LIBRARY_PATH=$topsrcdir/gtk3/usr/local/lib"
-
-  # pango expects absolute paths in pango.modules, and topsrcdir may vary...
-  LD_LIBRARY_PATH=$topsrcdir/gtk3/usr/local/lib \
-  PANGO_SYSCONFDIR=$topsrcdir/gtk3/usr/local/etc \
-  PANGO_LIBDIR=$topsrcdir/gtk3/usr/local/lib \
-  $topsrcdir/gtk3/usr/local/bin/pango-querymodules > $topsrcdir/gtk3/usr/local/etc/pango/pango.modules
-
-  # same with gdb-pixbuf and loaders.cache
-  LD_LIBRARY_PATH=$topsrcdir/gtk3/usr/local/lib \
-  GDK_PIXBUF_MODULE_FILE=$topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
-  GDK_PIXBUF_MODULEDIR=$topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders \
-  $topsrcdir/gtk3/usr/local/bin/gdk-pixbuf-query-loaders > $topsrcdir/gtk3/usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
-
-  # mock build environment doesn't have fonts in /usr/share/fonts, but
-  # has some in /usr/share/X11/fonts. Add this directory to the
-  # fontconfig configuration without changing the gtk3 tooltool package.
-  cat << EOF > $topsrcdir/gtk3/usr/local/etc/fonts/local.conf
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
-<fontconfig>
-  <dir>/usr/share/X11/fonts</dir>
-</fontconfig>
-EOF
-
-fi
+# PKG_CONFIG_LIBDIR is appropriately overridden in mozconfig.linux32
+export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig
 
 export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE=/builds/crash-stats-api.token
+
+. "$topsrcdir/build/unix/mozconfig.gtk"
--- a/build/unix/mozconfig.linux32
+++ b/build/unix/mozconfig.linux32
@@ -1,11 +1,12 @@
 . "$topsrcdir/build/unix/mozconfig.linux"
 
+export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig
+
 if test `uname -m` = "x86_64"; then
   # -march=pentiumpro is what our 32-bit native toolchain defaults to
   CC="$CC -m32 -march=pentiumpro"
   CXX="$CXX -m32 -march=pentiumpro"
   ac_add_options --target=i686-pc-linux
   ac_add_options --host=i686-pc-linux
   ac_add_options --x-libraries=/usr/lib
-  export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig
 fi