diff --git a/calendar/installer/Makefile.in b/calendar/installer/Makefile.in
--- a/calendar/installer/Makefile.in
+++ b/calendar/installer/Makefile.in
@@ -53,17 +53,17 @@ NO_PKG_FILES = \
     xpt_link* \
     nspr-config \
     $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
-ifdef BUILD_STATIC_LIBS
+ifneq (,$(BUILD_STATIC_LIBS)$(MOZ_ENABLE_LIBXUL))
 ifeq (WINNT,$(OS_ARCH))
 MOZ_PKG_MANIFEST_P = $(srcdir)/windows/packages-static
 # XXX Enable when landing unix installer
 # else
 # ifneq (,$(filter-out OS2 Darwin,$(OS_ARCH)))
 # MOZ_PKG_MANIFEST_P = $(srcdir)/unix/packages-static
 # endif
 endif
diff --git a/calendar/locales/Makefile.in b/calendar/locales/Makefile.in
--- a/calendar/locales/Makefile.in
+++ b/calendar/locales/Makefile.in
@@ -107,17 +107,19 @@ endif
 endif
 endif
 
 clobber-%:
 	$(RM) -rf $(DIST)/xpi-stage/locale-$*
 
 libs-%:
 	$(NSINSTALL) -D $(DIST)/install
+ifndef LIBXUL_SDK
 	@$(MAKE) -C ../../mozilla/toolkit/locales libs-$* BOTH_MANIFESTS=1
+endif
 ifdef MOZ_SUNBIRD
 	@$(MAKE) -C ../sunbird/locales libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref BOTH_MANIFESTS=1
 endif
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref BOTH_MANIFESTS=1
 ifdef MOZ_BRANDING_DIRECTORY
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
 endif
 	@$(MAKE) tests AB_CD=$*
diff --git a/calendar/sunbird/app/Makefile.in b/calendar/sunbird/app/Makefile.in
--- a/calendar/sunbird/app/Makefile.in
+++ b/calendar/sunbird/app/Makefile.in
@@ -74,17 +74,19 @@ ifdef SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP="$(SOURCE_STAMP)"
 endif
 
 SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
 endif
  
-ifndef LIBXUL_SDK
+ifdef LIBXUL_SDK
+include $(topsrcdir)/config/rules.mk
+else
 # Build a binary bootstrapping with XRE_main
 
 MOZILLA_INTERNAL_API = 1
 
 ifeq ($(USE_SHORT_LIBNAME), 1)
 PROGRAM = sunbird$(BIN_SUFFIX)
 else
 PROGRAM = sunbird-bin$(BIN_SUFFIX)
@@ -219,22 +221,16 @@ RCFLAGS += -DDEBUG
 endif
 RCFLAGS += -DSUNBIRD_ICO=\"$(DIST)/branding/sunbird.ico\"
 endif
 
 LIBS += $(JEMALLOC_LIBS)
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DMOZILLA_OFFICIAL
-endif
-
-DEFINES += -DSUNBIRD_ICO=\"$(DIST)/branding/sunbird.ico\"
-
 ifdef BUILD_STATIC_LIBS
 include $(topsrcdir)/config/static-rules.mk
 endif
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 ifdef BUILD_STATIC_LIBS
 LIBS	+= -framework QuickTime -framework IOKit
 endif
@@ -275,66 +271,16 @@ libs:: sunbird
 install:: sunbird
 	$(SYSINSTALL) $< $(DESTDIR)$(bindir)
 
 GARBAGE += sunbird
 GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, sunbird.js)
 
 endif
 
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
-ICON_FILES = \
-    $(DIST)/branding/mozicon128.png \
-    $(DIST)/branding/mozicon50.xpm \
-    $(DIST)/branding/mozicon16.xpm \
-    $(NULL)
-
-libs:: $(ICON_FILES)
-	$(INSTALL) $^ $(DIST)/bin/icons
-
-install::
-	$(SYSINSTALL) $(IFLAGS1) $(ICON_FILES) $(DESTDIR)$(mozappdir)/icons
-endif
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
-libs::
-	$(INSTALL) $(DIST)/branding/default.xpm $(DIST)/bin/chrome/icons/default
-
-install::
-	$(SYSINSTALL) $(IFLAGS1) $(DIST)/branding/default.xpm $(DESTDIR)$(mozappdir)/chrome/icons/default
-endif
-
-export::
-ifndef MOZ_BRANDING_DIRECTORY
-	$(NSINSTALL) -D $(DIST)/branding
-ifeq ($(OS_ARCH),WINNT)
-	cp $(srcdir)/sunbird.ico  $(DIST)/branding/sunbird.ico
-	cp $(srcdir)/sunbird.ico  $(DIST)/branding/app.ico
-	cp $(srcdir)/sunbird.ico  $(DIST)/branding/document.ico
-endif
-ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
-	cp $(srcdir)/macbuild/sunbird.icns  $(DIST)/branding/sunbird.icns
-	cp $(srcdir)/macbuild/sb_ICS.icns  $(DIST)/branding/sb_ICS.icns
-	cp $(srcdir)/macbuild/dsstore  $(DIST)/branding/dsstore
-	cp $(srcdir)/macbuild/background.png  $(DIST)/branding/background.png
-	cp $(srcdir)/macbuild/disk.icns  $(DIST)/branding/disk.icns
-endif
-ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
-	cp $(srcdir)/mozicon128.png  $(DIST)/branding/mozicon128.png
-	cp $(srcdir)/mozicon50.xpm   $(DIST)/branding/mozicon50.xpm
-	cp $(srcdir)/mozicon16.xpm   $(DIST)/branding/mozicon16.xpm
-endif
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
-	cp $(srcdir)/default.xpm  $(DIST)/branding/default.xpm
-endif
-ifeq ($(OS_ARCH),OS2)
-	cp $(srcdir)/sunbird-os2.ico  $(DIST)/branding/sunbird.ico
-endif
-endif
-
 libs::
 	touch $(DIST)/bin/.autoreg
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 
 APP_NAME = $(MOZ_APP_DISPLAYNAME)
 
 ifdef MOZ_DEBUG
@@ -373,16 +319,77 @@ libs repackage:: $(PROGRAM)
 	printf APPL$(MAC_CREATOR_CODE) > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
 #	remove CVS dirs from packaged app
 	find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \;
 
 endif
 
 endif # LIBXUL_SDK
 
+ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+ICON_FILES = \
+    $(DIST)/branding/mozicon128.png \
+    $(DIST)/branding/mozicon50.xpm \
+    $(DIST)/branding/mozicon16.xpm \
+    $(NULL)
+
+libs:: $(ICON_FILES)
+	$(INSTALL) $^ $(DIST)/bin/chrome/icons/default
+
+install::
+	$(SYSINSTALL) $(IFLAGS1) $(ICON_FILES) $(DESTDIR)$(mozappdir)/chrome/icons/default
+endif
+
+export::
+ifndef MOZ_BRANDING_DIRECTORY
+	$(NSINSTALL) -D $(DIST)/branding
+ifeq ($(OS_ARCH),WINNT)
+	cp $(srcdir)/sunbird.ico  $(DIST)/branding/sunbird.ico
+	cp $(srcdir)/sunbird.ico  $(DIST)/branding/app.ico
+	cp $(srcdir)/sunbird.ico  $(DIST)/branding/document.ico
+endif
+ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+	cp $(srcdir)/macbuild/sunbird.icns  $(DIST)/branding/sunbird.icns
+	cp $(srcdir)/macbuild/sb_ICS.icns  $(DIST)/branding/sb_ICS.icns
+	cp $(srcdir)/macbuild/dsstore  $(DIST)/branding/dsstore
+	cp $(srcdir)/macbuild/background.png  $(DIST)/branding/background.png
+	cp $(srcdir)/macbuild/disk.icns  $(DIST)/branding/disk.icns
+endif
+ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
+	cp $(srcdir)/mozicon128.png  $(DIST)/branding/mozicon128.png
+	cp $(srcdir)/mozicon50.xpm   $(DIST)/branding/mozicon50.xpm
+	cp $(srcdir)/mozicon16.xpm   $(DIST)/branding/mozicon16.xpm
+endif
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
+	cp $(srcdir)/default.xpm  $(DIST)/branding/default.xpm
+endif
+ifeq ($(OS_ARCH),OS2)
+	cp $(srcdir)/sunbird-os2.ico  $(DIST)/branding/sunbird.ico
+endif
+endif
+
+ifdef MOZILLA_OFFICIAL
+DEFINES += -DMOZILLA_OFFICIAL
+endif
+
+DEFINES += -DSUNBIRD_ICO=\"$(DIST)/branding/sunbird.ico\"
+
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
+libs::
+	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default* $(DIST)/bin/chrome/icons/default
+
+install::
+	$(SYSINSTALL) $(IFLAGS1) $(DIST)/branding/default* $(DESTDIR)$(mozappdir)/chrome/icons/default
+endif
+
+ifdef LIBXUL_SDK
+libs::
+	cp $(LIBXUL_DIST)/bin/xulrunner-stub$(BIN_SUFFIX) $(DIST)/bin/sunbird$(BIN_SUFFIX)
+endif
+
 libs::
 ifeq ($(OS_ARCH),WINNT)
 	$(EXIT_ON_ERROR) \
 	$(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $(MOZILLA_SRCDIR)/LICENSE > $(DIST)/bin/LICENSE
 else
 	$(INSTALL) $(MOZILLA_SRCDIR)/LICENSE $(DIST)/bin
 endif
 
diff --git a/calendar/sunbird/app/application.ini b/calendar/sunbird/app/application.ini
--- a/calendar/sunbird/app/application.ini
+++ b/calendar/sunbird/app/application.ini
@@ -47,18 +47,18 @@ SourceRepository=@MOZ_SOURCE_REPO@
 #endif
 #ifdef MOZ_SOURCE_STAMP
 SourceStamp=@MOZ_SOURCE_STAMP@
 #endif
 Copyright=Copyright (c) 1998 - 2009 mozilla.org
 ID={718e30fb-e89b-41dd-9da7-e25a45638b28}
 
 [Gecko]
-MinVersion=@GRE_MILESTONE@
-MaxVersion=@GRE_MILESTONE@
+MinVersion=1.9.1
+MaxVersion=1.9.1.*
 
 [XRE]
 EnableProfileMigrator=1
 EnableExtensionManager=1
 
 [Crash Reporter]
 #if MOZILLA_OFFICIAL
 Enabled=1
