Bug 799441 - Build GIO module in libxul. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 18 Oct 2012 14:47:10 +0200
changeset 110657 d243048bc966c3657962ba32c93db77089667abc
parent 110656 d9bd08b3cfb11944d2a65d8901fe574fe86c2c0d
child 110658 3779eb3f036fd4d1e5b7d56d4bc430cb209b6fd7
child 110662 c228ab000f4f52d2d12c9280960e90528373a103
push id23704
push useremorley@mozilla.com
push dateThu, 18 Oct 2012 17:12:58 +0000
treeherdermozilla-central@3779eb3f036f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs799441
milestone19.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 799441 - Build GIO module in libxul. r=ted
configure.in
extensions/gio/Makefile.in
toolkit/library/Makefile.in
toolkit/library/nsStaticXULComponents.cpp
toolkit/toolkit-tiers.mk
--- a/configure.in
+++ b/configure.in
@@ -6081,16 +6081,22 @@ if test -z "$MOZ_ENABLE_GIO" -a `echo "$
     MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
 fi
 
 dnl Do not build gio with libxul based apps
 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
     MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
 fi
 
+if test `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
+    MOZ_GIO_COMPONENT=1
+    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
+fi
+AC_SUBST(MOZ_GIO_COMPONENT)
+
 if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
     AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
     MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
 fi
 
 dnl xforms requires xtf
 if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
     AC_MSG_WARN([Cannot build XForms without XTF support.  Removing XForms from MOZ_EXTENSIONS.])
--- a/extensions/gio/Makefile.in
+++ b/extensions/gio/Makefile.in
@@ -9,27 +9,19 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= nkgio
 LIBRARY_NAME	= nkgio
 SHORT_LIBNAME	= nkgio
 IS_COMPONENT	= 1
+EXPORT_LIBRARY	= 1
+MODULE_NAME	= nsGIOModule
+LIBXUL_LIBRARY	= 1
 
 CPPSRCS		= \
 		nsGIOProtocolHandler.cpp \
 		$(NULL)
 
 LOCAL_INCLUDES	= $(MOZ_GIO_CFLAGS)
 
-EXTRA_DSO_LDOPTS = \
-		   $(XPCOM_GLUE_LDOPTS) \
-		   $(MOZ_COMPONENT_LIBS) \
-		   $(MOZ_GIO_LIBS) \
-		   $(NULL)
-
-# make sure this component is never statically linked into the main
-# application.  this is necessary since we don't want to force users
-# to install gio in order to use the rest of mozilla ;-)
-FORCE_SHARED_LIB= 1
-
 include $(topsrcdir)/config/rules.mk
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -328,16 +328,21 @@ endif
 COMPONENT_LIBS += services-crypto
 
 ifdef MOZ_DEBUG
 ifdef ENABLE_TESTS
 COMPONENT_LIBS += gkdebug
 endif
 endif
 
+ifdef MOZ_GIO_COMPONENT
+DEFINES += -DMOZ_GIO_COMPONENT
+COMPONENT_LIBS += nkgio
+endif
+
 ifdef MOZ_APP_COMPONENT_LIBS
 COMPONENT_LIBS += $(MOZ_APP_COMPONENT_LIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 OS_LIBS += -framework OpenGL -lcups
 endif
 
--- a/toolkit/library/nsStaticXULComponents.cpp
+++ b/toolkit/library/nsStaticXULComponents.cpp
@@ -165,16 +165,22 @@
 #endif
 
 #if defined(MOZ_WEBRTC)
 #define PEERCONNECTION_MODULE MODULE(peerconnection)
 #else
 #define PEERCONNECTION_MODULE
 #endif
 
+#if defined(MOZ_GIO_COMPONENT)
+#define GIO_MODULE MODULE(nsGIOModule)
+#else
+#define GIO_MODULE
+#endif
+
 #define XUL_MODULES                          \
     MODULE(nsUConvModule)                    \
     MODULE(nsI18nModule)                     \
     MODULE(nsChardetModule)                  \
     UNIVERSALCHARDET_MODULE                  \
     MODULE(necko)                            \
     PERMISSIONS_MODULES                      \
     AUTH_MODULE                              \
@@ -223,16 +229,17 @@
     MODULE(jsperf)                           \
     MODULE(identity)                         \
     MODULE(nsServicesCryptoModule)           \
     MOZ_APP_COMPONENT_MODULES                \
     MODULE(nsTelemetryModule)                \
     MODULE(jsinspector)                      \
     MODULE(jsdebugger)                       \
     PEERCONNECTION_MODULE                    \
+    GIO_MODULE                               \
     /* end of list */
 
 #define MODULE(_name) \
   NSMODULE_DECL(_name);
 
 XUL_MODULES
 
 #undef MODULE
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -247,16 +247,20 @@ endif
 tier_platform_dirs += services/crypto/component
 
 tier_platform_dirs += startupcache
 
 tier_platform_dirs += js/ductwork/debugger
 
 tier_platform_dirs += other-licenses/snappy
 
+ifdef MOZ_GIO_COMPONENT
+tier_platform_dirs += extensions/gio
+endif
+
 ifdef APP_LIBXUL_STATICDIRS
 # Applications can cheat and ask for code to be
 # built before libxul so libxul can be linked against it.
 tier_platform_staticdirs += $(APP_LIBXUL_STATICDIRS)
 endif
 ifdef APP_LIBXUL_DIRS
 # Applications can cheat and ask for code to be
 # built before libxul so it can be linked into libxul.