Bug 453330 Make it possible to build Sunbird from comm-central. Patch by Standard8, Stefan Sitter and Ause. Most changes r=ause, some tidy ups r=Standard8
new file mode 100644
--- /dev/null
+++ b/calendar/app-config.mk
@@ -0,0 +1,39 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Mozilla build system.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+# Robert Kaiser <kairo@kairo.at> (Initial Code)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+MOZ_SUNBIRD = 1
+DEFINES += -DMOZ_SUNBIRD=1
--- a/calendar/build.mk
+++ b/calendar/build.mk
@@ -30,32 +30,44 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
+ifndef COMM_BUILD # Mozila Makefile
+
ifndef LIBXUL_SDK
include $(topsrcdir)/toolkit/toolkit-tiers.mk
endif
TIERS += app
ifdef MOZ_EXTENSIONS
tier_app_dirs += extensions
endif
+else # toplevel Makefile
+
+TIERS += app
+
ifdef MOZ_BRANDING_DIRECTORY
tier_app_dirs += $(MOZ_BRANDING_DIRECTORY)
endif
tier_app_dirs += \
calendar \
calendar/sunbird \
$(NULL)
+ifdef MOZ_CALENDAR
+tier_app_dirs += calendar/lightning
+endif
+
+endif # COMM_BUILD
+
installer:
@$(MAKE) -C calendar/installer installer
package:
@$(MAKE) -C calendar/installer
--- a/calendar/confvars.sh
+++ b/calendar/confvars.sh
@@ -49,8 +49,10 @@ MOZ_ACTIVEX_SCRIPTING_SUPPORT=
MOZ_INSTALLER=
MOZ_MATHML=
NECKO_DISK_CACHE=
MOZ_OJI=
NECKO_COOKIES=
MOZ_NO_XPCOM_OBSOLETE=1
MOZ_EXTENSIONS_DEFAULT=
MOZ_UNIVERSALCHARDET=
+MOZ_APP_VERSION=`cat $topsrcdir/$MOZ_BUILD_APP/sunbird/config/version.txt`
+SUNBIRD_VERSION=$MOZ_APP_VERSION
--- a/calendar/installer/Makefile.in
+++ b/calendar/installer/Makefile.in
@@ -84,27 +84,27 @@ MOZ_OPTIONAL_PKG_LIST = \
endif
DEFINES += -DAB_CD=$(AB_CD)
ifdef MOZ_PKG_MANIFEST_P
MOZ_PKG_MANIFEST = packages-static
$(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P)
- $(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $< > $@
+ $(PERL) $(MOZILLA_SRCDIR)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $< > $@
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
MOZ_PKG_MAC_DSSTORE=branding/dsstore
MOZ_PKG_MAC_BACKGROUND=branding/background.png
MOZ_PKG_MAC_ICON=branding/disk.icns
MOZ_PKG_MAC_RSRC=branding/license.r
endif
-include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
+include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/packager.mk
installer: removed-files
ifdef INSTALLER_DIR
$(MAKE) -C $(INSTALLER_DIR)
endif
make-package : removed-files-checked
--- a/calendar/installer/windows/Makefile.in
+++ b/calendar/installer/windows/Makefile.in
@@ -37,20 +37,20 @@
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
+include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
CONFIG_DIR = instgen
-SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/sunbird/7zSD.sfx
+SFX_MODULE = $(MOZILLA_SRCDIR)/other-licenses/7zstub/sunbird/7zSD.sfx
PP_LOCALIZED_FILES = \
packages-static \
$(NULL)
INSTALLER_FILES = \
app.tag \
nsis/installer.nsi \
@@ -69,56 +69,56 @@ DEFINES += \
-DAB_CD=$(AB_CD) \
-DPKG_BASENAME=$(PKG_BASENAME) \
-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
-DMOZ_APP_DISPLAYNAME=${MOZ_APP_DISPLAYNAME} \
-DMOZILLA_VERSION=${MOZILLA_VERSION} \
$(NULL)
include $(topsrcdir)/config/config.mk
-include $(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/installer/windows/charset.mk
+include $(call EXPAND_MOZLOCALE_SRCDIR,toolkit/locales)/installer/windows/charset.mk
installer::
$(MAKE) -C .. installer-stage
$(MAKE) $(CONFIG_DIR)/setup.exe
# For building the uninstaller during the application build so it can be
# included for mar file generation.
uninstaller::
$(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(EXIT_ON_ERROR) \
for i in $(PP_LOCALIZED_FILES); do \
- $(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
+ $(PERL) $(MOZILLA_SRCDIR)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
done
- $(PERL) $(topsrcdir)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) \
+ $(PERL) $(MOZILLA_SRCDIR)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
- $(PERL) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.pl \
+ $(PERL) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.pl \
$(topsrcdir) $(call EXPAND_LOCALE_SRCDIR,calendar/locales)/installer $(AB_CD) \
$(WIN_INSTALLER_CHARSET) $(CONFIG_DIR)
$(CONFIG_DIR)/setup.exe::
$(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(EXIT_ON_ERROR) \
for i in $(PP_LOCALIZED_FILES); do \
- $(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
+ $(PERL) $(MOZILLA_SRCDIR)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
done
- $(PERL) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/make-installremoves.pl \
+ $(PERL) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/make-installremoves.pl \
../removed-files > $(CONFIG_DIR)/removed-files.log
- $(PERL) $(topsrcdir)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) \
+ $(PERL) $(MOZILLA_SRCDIR)/config/preprocessor.pl -Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
- $(PERL) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.pl \
+ $(PERL) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.pl \
$(topsrcdir) $(call EXPAND_LOCALE_SRCDIR,calendar/locales)/installer $(AB_CD) \
$(WIN_INSTALLER_CHARSET) $(CONFIG_DIR)
include $(topsrcdir)/config/rules.mk
-include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk
+include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/makensis.mk
export::
ifndef MOZ_BRANDING_DIRECTORY
$(NSINSTALL) -D $(DIST)/branding
cp $(srcdir)/Header.bmp $(DIST)/branding/Header.bmp
cp $(srcdir)/Watermrk.bmp $(DIST)/branding/Watermrk.bmp
cp $(srcdir)/nsis/branding.nsi $(DIST)/branding/branding.nsi
cp $(srcdir)/license.txt $(DIST)/branding/license.txt
--- a/calendar/lightning/makefiles.sh
+++ b/calendar/lightning/makefiles.sh
@@ -36,9 +36,10 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
add_makefiles "
calendar/lightning/Makefile
calendar/lightning/components/Makefile
calendar/lightning/locales/Makefile
+calendar/itip/Makefile
"
--- a/calendar/locales/Makefile.in
+++ b/calendar/locales/Makefile.in
@@ -85,17 +85,17 @@ endif
ifeq (,$(filter-out pref,$(MOZ_EXTENSIONS)))
DEFINES += -DEXTENSION_PREF
endif
include $(topsrcdir)/config/rules.mk
libs-%:
- @$(MAKE) -C ../../toolkit/locales libs-$*
+ @$(MAKE) -C ../../mozilla/toolkit/locales libs-$*
@$(MAKE) -C ../sunbird/locales libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
ifdef MOZ_BRANDING_DIRECTORY
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
MOZ_PKG_MAC_DSSTORE=$(_ABS_DIST)/branding/dsstore
@@ -204,17 +204,17 @@ repackage-zip-%: $(ZIP_IN)
langpack-%: LANGPACK_FILE=$(_ABS_DIST)/install/sunbird-$(MOZ_APP_VERSION).$(AB_CD).langpack.xpi
langpack-%: AB_CD=$*
langpack-%: XPI_NAME=locale-$*
langpack-%:
@echo "Making langpack $(LANGPACK_FILE)"
$(NSINSTALL) -D $(DIST)/install
@$(RM) -rf $(DIST)/xpi-stage/locale-$(AB_CD)
@$(MAKE) libs-$(AB_CD) USE_EXTENSION_MANIFEST=1
- $(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) -I$(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/defines.inc -I$(LOCALE_SRCDIR)/defines.inc $(srcdir)/generic/install.rdf > $(FINAL_TARGET)/install.rdf
+ $(PERL) $(MOZILLA_SRCDIR)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) -I$(call EXPAND_MOZLOCALE_SRCDIR,toolkit/locales)/defines.inc -I$(LOCALE_SRCDIR)/defines.inc $(srcdir)/generic/install.rdf > $(FINAL_TARGET)/install.rdf
cd $(DIST)/xpi-stage/locale-$(AB_CD) && \
$(ZIP) -r9D $(LANGPACK_FILE) install.rdf chrome chrome.manifest
# This is a generic target that will make a langpack, repack ZIP (+tarball)
# builds, and repack an installer if applicable. It is called from the
# tinderbox scripts. Alter it with caution.
#
# Note: the last target called here should be repackage-zip-$* as the l10n build
--- a/calendar/makefiles.sh
+++ b/calendar/makefiles.sh
@@ -32,16 +32,19 @@
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
+if [ "$COMM_BUILD" ]; then
+
add_makefiles "
calendar/sunbird/Makefile
calendar/sunbird/app/Makefile
calendar/sunbird/base/Makefile
calendar/sunbird/locales/Makefile
"
. ${srcdir}/calendar/shared_makefiles.sh
+fi
--- a/calendar/shared_makefiles.sh
+++ b/calendar/shared_makefiles.sh
@@ -47,9 +47,12 @@ calendar/base/src/Makefile
calendar/base/build/Makefile
calendar/providers/Makefile
calendar/providers/memory/Makefile
calendar/providers/storage/Makefile
calendar/providers/composite/Makefile
calendar/installer/Makefile
calendar/installer/windows/Makefile
calendar/locales/Makefile
+calendar/import-export/Makefile
+calendar/timezones/Makefile
+calendar/timezones/locales/Makefile
"
--- a/calendar/sunbird/app/Makefile.in
+++ b/calendar/sunbird/app/Makefile.in
@@ -59,18 +59,18 @@ DEFINES += -DAB_CD=$(AB_CD)
APP_VERSION = $(SUNBIRD_VERSION)
DEFINES += -DAPP_VERSION="$(APP_VERSION)"
APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
DEFINES += -DAPP_UA_NAME="$(APP_UA_NAME)"
DIST_FILES = application.ini
-GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
-GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
+GRE_MILESTONE = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
+GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
ifndef LIBXUL_SDK
# Build a binary bootstrapping with XRE_main
MOZILLA_INTERNAL_API = 1
@@ -84,39 +84,42 @@ REQUIRES = \
appshell \
string \
xpcom \
xulapp \
$(NULL)
CPPSRCS = nsCalendarApp.cpp
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
+LOCAL_INCLUDES += -I$(MOZILLA_SRCDIR)/toolkit/xre
ifdef MOZILLA_1_8_BRANCH
LIBS += $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
else
ifdef BUILD_STATIC_LIBS
ifdef _MSC_VER
STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(DEPTH)/staticlib
else
STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
endif
-LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
+LIBS += $(MOZDEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
LIBS += $(DIST)/bin/XUL
else
EXTRA_DSO_LIBS += xul
endif
endif
endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
+ifdef BUILD_STATIC_LIBS
+TK_LIBS := -framework SystemConfiguration -framework CoreAudio -framework AudioToolbox -framework AudioUnit $(TK_LIBS)
+endif
endif
ifdef MOZ_ENABLE_LIBXUL
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
else
MOZILLA_INTERNAL_API = 1
APP_XPCOM_LIBS = $(XPCOM_LIBS)
endif
@@ -134,16 +137,20 @@ LIBS += \
ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
LIBS += $(XLDFLAGS) $(XLIBS)
endif
ifdef MOZ_JPROF
LIBS += -ljprof
endif
+ifdef MOZ_ENABLE_DBUS
+LIBS += $(MOZ_DBUS_GLIB_LIBS)
+endif
+
ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif
@@ -251,17 +258,17 @@ ifeq ($(OS_ARCH),WINNT)
#
# Set it to 256k. See bug 127069.
#
ifndef GNU_CC
LDFLAGS += /HEAP:0x40000
endif
endif
-$(PROGRAM): $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
+$(PROGRAM): $(MOZDEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
ifeq ($(OS_ARCH),OS2)
ifdef BUILD_STATIC_LIBS
$(EXE_DEF_FILE):
rm -f $@
@echo NAME mozilla >$(EXE_DEF_FILE)
@echo IMPORTS >>$(EXE_DEF_FILE)
@echo WinQueryProperty = PMMERGE.5450 >>$(EXE_DEF_FILE)
@@ -389,18 +396,18 @@ libs repackage:: $(PROGRAM)
endif
endif # LIBXUL_SDK
libs::
ifeq ($(OS_ARCH),WINNT)
$(EXIT_ON_ERROR) \
- $(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $(topsrcdir)/LICENSE > $(DIST)/bin/LICENSE
+ $(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $(MOZILLA_SRCDIR)/LICENSE > $(DIST)/bin/LICENSE
else
- $(INSTALL) $(topsrcdir)/LICENSE $(DIST)/bin
+ $(INSTALL) $(MOZILLA_SRCDIR)/LICENSE $(DIST)/bin
endif
libs:: $(srcdir)/profile/prefs.js
$(INSTALL) $^ $(DIST)/bin/defaults/profile
install:: $(srcdir)/profile/prefs.js
$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile
--- a/calendar/sunbird/locales/Makefile.in
+++ b/calendar/sunbird/locales/Makefile.in
@@ -55,17 +55,17 @@ DEFINES += \
-DAPP_VERSION="$(APP_VERSION)" \
$(NULL)
ifndef MOZ_BRANDING_DIRECTORY
DEFINES += -DMOZ_USE_GENERIC_BRANDING
endif
include $(topsrcdir)/config/rules.mk
-include $(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/installer/windows/charset.mk
+include $(call EXPAND_MOZLOCALE_SRCDIR,toolkit/locales)/installer/windows/charset.mk
libs:: $(addprefix $(LOCALE_SRCDIR)/,$(README_FILES))
ifeq ($(OS_ARCH),WINNT)
$(EXIT_ON_ERROR) \
for file in $^; do \
$(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $$file > $(FINAL_TARGET)/`basename $$file`; \
done
else