diff --git a/mozilla/browser/app/Makefile.in b/mozilla/browser/app/Makefile.in index e26682432bf..d969229a236 100644 --- a/mozilla/browser/app/Makefile.in +++ b/mozilla/browser/app/Makefile.in @@ -168,9 +168,6 @@ endif APP_VERSION = $(shell cat $(srcdir)/../config/version.txt) DEFINES += -DAPP_VERSION=\"$(APP_VERSION)\" -BUILD_ID = $(shell cat $(DEPTH)/config/build_number) -DEFINES += -DBUILD_ID=\"$(BUILD_ID)\" - ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifdef BUILD_STATIC_LIBS LIBS += -framework QuickTime -framework IOKit diff --git a/mozilla/browser/app/nsBrowserApp.cpp b/mozilla/browser/app/nsBrowserApp.cpp index 021196fb8ea..fe2a57937ad 100644 --- a/mozilla/browser/app/nsBrowserApp.cpp +++ b/mozilla/browser/app/nsBrowserApp.cpp @@ -47,7 +47,7 @@ static const nsXREAppData kAppData = { "Mozilla", "Firefox", APP_VERSION, - BUILD_ID, + NS_STRINGIFY(BUILD_ID), // ec8030f7-c20a-464f-9b0e-13a3a9e97384 { 0xec8030f7, 0xc20a, 0x464f, { 0x9b, 0x0e, 0x13, 0xa3, 0xa9, 0xe9, 0x73, 0x84 } }, "Copyright (c) 2004 mozilla.org", diff --git a/mozilla/calendar/sunbird/app/Makefile.in b/mozilla/calendar/sunbird/app/Makefile.in index ee2a673303b..a4117f2823a 100644 --- a/mozilla/calendar/sunbird/app/Makefile.in +++ b/mozilla/calendar/sunbird/app/Makefile.in @@ -168,9 +168,6 @@ endif APP_VERSION = $(shell cat $(srcdir)/../config/version.txt) DEFINES += -DAPP_VERSION=\"$(APP_VERSION)\" -BUILD_ID = $(shell cat $(DEPTH)/config/build_number) -DEFINES += -DBUILD_ID=\"$(BUILD_ID)\" - ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifdef BUILD_STATIC_LIBS LIBS += -framework QuickTime -framework IOKit diff --git a/mozilla/calendar/sunbird/app/nsCalendarApp.cpp b/mozilla/calendar/sunbird/app/nsCalendarApp.cpp index ba7b6c22450..600733b5c85 100644 --- a/mozilla/calendar/sunbird/app/nsCalendarApp.cpp +++ b/mozilla/calendar/sunbird/app/nsCalendarApp.cpp @@ -49,7 +49,7 @@ static const nsXREAppData kAppData = { "Mozilla", "Sunbird", APP_VERSION, - BUILD_ID, + NS_STRINGIFY(BUILD_ID), // {718e30fb-e89b-41dd-9da7-e25a45638b28} { 0x718e30fb, 0xe89b, 0x41dd, { 0x9d, 0xa7, 0xe2, 0x5a, 0x45, 0x63, 0x8b, 0x28 } }, "Copyright (c) 2004 mozilla.org", diff --git a/mozilla/config/config.mk b/mozilla/config/config.mk index 3fa9afd9bd6..e0522b1b5ca 100644 --- a/mozilla/config/config.mk +++ b/mozilla/config/config.mk @@ -814,3 +814,8 @@ EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/$(1)/en-US,$(t ifdef relativesrcdir LOCALE_SRCDIR = $(call EXPAND_LOCALE_SRCDIR,$(relativesrcdir)) endif + +# +# Add BUILD_ID to set of DEFINES +# +DEFINES += -DBUILD_ID=$(shell cat $(DEPTH)/config/build_number) diff --git a/mozilla/config/rules.mk b/mozilla/config/rules.mk index 780eb3f6ebb..3ad379d9d4a 100644 --- a/mozilla/config/rules.mk +++ b/mozilla/config/rules.mk @@ -1,3 +1,4 @@ +# vim:set ts=8 sw=8 sts=8 noet: # # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -1283,8 +1284,12 @@ PREF_DIST_DIR = $(GRE_DIST) PREF_DIR = greprefs else PREF_DIST_DIR = $(FINAL_TARGET) +ifdef XPI_NAME +PREF_DIR = defaults/preferences +else PREF_DIR = defaults/pref endif +endif $(FINAL_TARGET)/$(PREF_DIR) $(GRE_DIST)/$(PREF_DIR) $(DESTDIR)$(mozappdir)/$(PREF_DIR): @if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi @@ -1664,6 +1669,26 @@ libs realchrome:: fi endif +ifneq ($(DIST_FILES),) +libs:: $(DIST_FILES) + @$(EXIT_ON_ERROR) \ + for f in $(DIST_FILES); do \ + $(PERL) $(MOZILLA_DIR)/config/preprocessor.pl \ + $(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) \ + $(srcdir)/$$f > $(FINAL_TARGET)/`basename $$f`; \ + done +endif + +ifneq ($(DIST_CHROME_FILES),) +libs:: $(DIST_CHROME_FILES) + @$(EXIT_ON_ERROR) \ + for f in $(DIST_CHROME_FILES); do \ + $(PERL) $(MOZILLA_DIR)/config/preprocessor.pl \ + $(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) \ + $(srcdir)/$$f > $(FINAL_TARGET)/chrome/`basename $$f`; \ + done +endif + REGCHROME = $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \ $(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \ $(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(FINAL_TARGET)/chrome/installed-chrome.txt \ diff --git a/mozilla/configure.in b/mozilla/configure.in index a19696c8a33..aef99ed6405 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -922,6 +922,14 @@ dnl Get mozilla version from central milestone file MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir` AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION") +dnl Get the major and minor versions from the MOZILLA_VERSION +changequote(,) +MOZILLA_VERSION_MAJOR=`echo $MOZILLA_VERSION | sed 's|^\([0-9]*\).*|\1|'` +MOZILLA_VERSION_MINOR=`echo $MOZILLA_VERSION | sed 's|^[0-9]*\.\([0-9]*\).*|\1|'` +changequote([,]) +AC_DEFINE_UNQUOTED(MOZILLA_VERSION_MAJOR,$MOZILLA_VERSION_MAJOR) +AC_DEFINE_UNQUOTED(MOZILLA_VERSION_MINOR,$MOZILLA_VERSION_MINOR) + dnl ======================================================== dnl System overrides of the defaults for target dnl ======================================================== @@ -6241,6 +6249,8 @@ esac AC_SUBST(CYGDRIVE_MOUNT) AC_SUBST(MOZILLA_VERSION) +AC_SUBST(MOZILLA_VERSION_MAJOR) +AC_SUBST(MOZILLA_VERSION_MINOR) . ${srcdir}/config/chrome-versions.sh AC_SUBST(MOZILLA_LOCALE_VERSION) diff --git a/mozilla/extensions/layout-debug/Makefile.in b/mozilla/extensions/layout-debug/Makefile.in index 491b2fe8dc5..eec7eb2457f 100644 --- a/mozilla/extensions/layout-debug/Makefile.in +++ b/mozilla/extensions/layout-debug/Makefile.in @@ -1,3 +1,4 @@ +# vim:set ts=8 sw=8 sts=8 noet: # # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -45,5 +46,14 @@ include $(DEPTH)/config/autoconf.mk MODULE = layout_debug DIRS = src ui -include $(topsrcdir)/config/rules.mk +# If we have a XULRunner-enabled tree, then build as a standalone XUL app. +ifdef MOZ_XULRUNNER +export XPI_NAME = layoutdebug +PREF_JS_EXPORTS = $(srcdir)/layoutdebug-prefs.js +DIST_FILES = application.ini +DIST_CHROME_FILES = chrome.manifest + +endif # MOZ_XULRUNNER + +include $(topsrcdir)/config/rules.mk diff --git a/mozilla/extensions/layout-debug/application.ini b/mozilla/extensions/layout-debug/application.ini new file mode 100644 index 00000000000..b1472ba0a95 --- /dev/null +++ b/mozilla/extensions/layout-debug/application.ini @@ -0,0 +1,12 @@ +#filter substitution +[App] +Vendor=MozillaTest +Name=LayoutDebug +Version=0.1 +BuildID=@BUILD_ID@ +Copyright=Copyright (c) 2004 Mozilla.org +ID={da915c15-c21a-41e2-95c3-2e0f76fd3191} + +[Gecko] +MinVersion=@MOZILLA_VERSION_MAJOR@.@MOZILLA_VERSION_MINOR@ +MaxVersion=@MOZILLA_VERSION_MAJOR@.@MOZILLA_VERSION_MINOR@ diff --git a/mozilla/extensions/layout-debug/chrome.manifest b/mozilla/extensions/layout-debug/chrome.manifest new file mode 100644 index 00000000000..f7e95704195 --- /dev/null +++ b/mozilla/extensions/layout-debug/chrome.manifest @@ -0,0 +1,2 @@ +content layoutdebug jar:layoutdebug.jar!/content/layoutdebug/ +locale layoutdebug en-US jar:layoutdebug.jar!/locale/en-US/layoutdebug/ diff --git a/mozilla/extensions/layout-debug/layoutdebug-prefs.js b/mozilla/extensions/layout-debug/layoutdebug-prefs.js new file mode 100644 index 00000000000..cd1f0903a6c --- /dev/null +++ b/mozilla/extensions/layout-debug/layoutdebug-prefs.js @@ -0,0 +1 @@ +pref("toolkit.defaultChromeURI", "chrome://layoutdebug/content/layoutdebug.xul"); diff --git a/mozilla/mail/app/Makefile.in b/mozilla/mail/app/Makefile.in index d513a7c7224..a0a2a8b891b 100644 --- a/mozilla/mail/app/Makefile.in +++ b/mozilla/mail/app/Makefile.in @@ -146,9 +146,6 @@ endif APP_VERSION = $(shell cat $(srcdir)/../config/version.txt) DEFINES += -DAPP_VERSION=\"$(APP_VERSION)\" -BUILD_ID = $(shell cat $(DEPTH)/config/build_number) -DEFINES += -DBUILD_ID=\"$(BUILD_ID)\" - ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifdef BUILD_STATIC_LIBS LIBS += -framework QuickTime -framework IOKit diff --git a/mozilla/mail/app/nsMailApp.cpp b/mozilla/mail/app/nsMailApp.cpp index e2c70125be4..b1d12d4a750 100644 --- a/mozilla/mail/app/nsMailApp.cpp +++ b/mozilla/mail/app/nsMailApp.cpp @@ -48,7 +48,7 @@ static const nsXREAppData kAppData = { 0, "Thunderbird", APP_VERSION, - BUILD_ID, + NS_STRINGIFY(BUILD_ID), // {3550f703-e582-4d05-9a08-453d09bdfdc6} { 0x3550f703, 0xe582, 0x4d05, { 0x9a, 0x08, 0x45, 0x3d, 0x09, 0xbd, 0xfd, 0xc6 } }, "Copyright (c) 2005 mozilla.org", diff --git a/mozilla/toolkit/xre/Makefile.in b/mozilla/toolkit/xre/Makefile.in index 26442916842..8b6840edd31 100644 --- a/mozilla/toolkit/xre/Makefile.in +++ b/mozilla/toolkit/xre/Makefile.in @@ -104,9 +104,6 @@ CPPSRCS = \ nsNativeAppSupportBase.cpp \ $(NULL) -BUILD_ID = $(shell cat $(DEPTH)/config/build_number) -DEFINES += -DBUILD_ID=\"$(BUILD_ID)\" - ifeq ($(MOZ_WIDGET_TOOLKIT),windows) CPPSRCS += nsNativeAppSupportWin.cpp DEFINES += -DWIN32_LEAN_AND_MEAN diff --git a/mozilla/toolkit/xre/nsAppRunner.cpp b/mozilla/toolkit/xre/nsAppRunner.cpp index 78f80f7c506..f4e3fc11bf7 100644 --- a/mozilla/toolkit/xre/nsAppRunner.cpp +++ b/mozilla/toolkit/xre/nsAppRunner.cpp @@ -474,7 +474,7 @@ nsXULAppInfo::GetAppBuildID(nsACString& aResult) NS_IMETHODIMP nsXULAppInfo::GetGeckoBuildID(nsACString& aResult) { - aResult.Assign(BUILD_ID); + aResult.Assign(NS_STRINGIFY(BUILD_ID)); return NS_OK; } diff --git a/mozilla/xpcom/base/nscore.h b/mozilla/xpcom/base/nscore.h index 2e97756b734..c823fce3f28 100644 --- a/mozilla/xpcom/base/nscore.h +++ b/mozilla/xpcom/base/nscore.h @@ -426,6 +426,11 @@ typedef PRUint32 nsresult; #define NS_PTR_TO_INT32(x) ((char *)(x) - (char *)0) #define NS_INT32_TO_PTR(x) ((void *)((char *)0 + (x))) +/* + * Use this macro to form a string literal from an identifier. + */ +#define NS_STRINGIFY(x) #x + /* * These macros allow you to give a hint to the compiler about branch * probability so that it can better optimize. Use them like this: @@ -449,4 +454,3 @@ typedef PRUint32 nsresult; #endif #endif /* nscore_h___ */ - diff --git a/mozilla/xulrunner/app/Makefile.in b/mozilla/xulrunner/app/Makefile.in index eb964ec6976..11defb1348a 100644 --- a/mozilla/xulrunner/app/Makefile.in +++ b/mozilla/xulrunner/app/Makefile.in @@ -183,9 +183,6 @@ endif APP_VERSION = $(shell cat $(srcdir)/../config/version.txt) DEFINES += -DAPP_VERSION=\"$(APP_VERSION)\" -BUILD_ID = $(shell cat $(DEPTH)/config/build_number) -DEFINES += -DBUILD_ID=\"$(BUILD_ID)\" - ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifdef BUILD_STATIC_LIBS LIBS += -framework QuickTime -framework IOKit diff --git a/mozilla/xulrunner/app/nsXULRunnerApp.cpp b/mozilla/xulrunner/app/nsXULRunnerApp.cpp index 7f3f55aabf9..63594e21e36 100644 --- a/mozilla/xulrunner/app/nsXULRunnerApp.cpp +++ b/mozilla/xulrunner/app/nsXULRunnerApp.cpp @@ -237,7 +237,7 @@ int main(int argc, char* argv[]) if (argc == 2 && (IsArg(argv[1], "v") || IsArg(argv[1], "version"))) { - printf("Mozilla XULRunner %s %s\n", MOZILLA_VERSION, BUILD_ID); + printf("Mozilla XULRunner %s %d\n", MOZILLA_VERSION, BUILD_ID); return 0; } diff --git a/mozilla/xulrunner/examples/simple/Makefile.in b/mozilla/xulrunner/examples/simple/Makefile.in index c1a5c52331b..9982ed17f43 100644 --- a/mozilla/xulrunner/examples/simple/Makefile.in +++ b/mozilla/xulrunner/examples/simple/Makefile.in @@ -45,32 +45,20 @@ include $(DEPTH)/config/autoconf.mk MODULE = simple export XPI_NAME = simple -ifneq (,$(filter os2 windows,$(MOZ_WIDGET_TOOLKIT))) +PREF_JS_EXPORTS = $(srcdir)/simple-prefs.js +DIST_FILES = application.ini +DIST_CHROME_FILES = chrome.manifest + +ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT))) ICONS = icons/simple.ico endif ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT))) ICONS = icons/simple.xpm icons/simple16.xpm endif -PREFS = simple-prefs.js - include $(topsrcdir)/config/rules.mk -# generate various fields for simple.xulapp -BUILD_ID := `date +%Y%m%d%H` -GECKO_VERSION := `echo $(MOZILLA_VERSION) | sed 's|\(^[0-9]*\.[0-9]*\).*|\1|'` - -libs:: simple.manifest - $(INSTALL) $^ $(FINAL_TARGET)/chrome - +ifneq (,$(ICONS)) libs:: $(ICONS) $(INSTALL) $^ $(FINAL_TARGET)/chrome/icons/default - -libs:: $(PREFS) - $(INSTALL) $^ $(FINAL_TARGET)/defaults/preferences - -libs:: simple.xulapp - $(EXIT_ON_ERROR) \ - cat $< | sed 's|BUILD_ID|'$(BUILD_ID)'|' \ - | sed 's|GECKO_VERSION|'$(GECKO_VERSION)'|' \ - > $(FINAL_TARGET)/simple.xulapp +endif diff --git a/mozilla/xulrunner/examples/simple/simple.xulapp b/mozilla/xulrunner/examples/simple/application.ini similarity index 90% rename from mozilla/xulrunner/examples/simple/simple.xulapp rename to mozilla/xulrunner/examples/simple/application.ini index 74e2b1b5077..17368c5e663 100644 --- a/mozilla/xulrunner/examples/simple/simple.xulapp +++ b/mozilla/xulrunner/examples/simple/application.ini @@ -1,3 +1,4 @@ +#filter substitution [App] ; ; This field specifies your organization's name. This field is recommended, @@ -12,7 +13,7 @@ Version=0.1 ; ; This field specifies your application's build ID (timestamp). This field is ; required. -BuildID=BUILD_ID +BuildID=@BUILD_ID@ ; ; This field specifies a compact copyright notice for your application. This ; field is optional. @@ -28,13 +29,13 @@ ID={3aea3f07-ffe3-4060-bb03-bff3a5365e90} ; This field is required. It specifies the minimum Gecko version that this ; application requires. Specifying 1.8 matches all releases with a version ; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2). -MinVersion=GECKO_VERSION +MinVersion=@MOZILLA_VERSION_MAJOR@.@MOZILLA_VERSION_MINOR@ ; ; This field is optional. It specifies the maximum Gecko version that this ; application requires. It should be specified if your application uses ; unfrozen interfaces. Specifying 1.8 matches all releases with a version ; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2). -MaxVersion=GECKO_VERSION +MaxVersion=@MOZILLA_VERSION_MAJOR@.@MOZILLA_VERSION_MINOR@ [Shell] ; diff --git a/mozilla/xulrunner/examples/simple/simple.manifest b/mozilla/xulrunner/examples/simple/chrome.manifest similarity index 100% rename from mozilla/xulrunner/examples/simple/simple.manifest rename to mozilla/xulrunner/examples/simple/chrome.manifest