From 7ea12faeb29fb9243946ba6331a881a0d1bf83b5 Mon Sep 17 00:00:00 2001 From: Ted Mielczarek Date: Mon, 22 Sep 2008 14:00:38 -0400 Subject: [PATCH] bug 448155 - builds should have changeset ID in about:buildconfig when possible. r=bsmedberg --HG-- rename : toolkit/content/buildconfig.html.in => toolkit/content/buildconfig.html --- config/autoconf.mk.in | 2 ++ toolkit/content/Makefile.in | 30 ++++++++++++++++--- .../{buildconfig.html.in => buildconfig.html} | 7 +++++ toolkit/content/jar.mn | 2 +- toolkit/toolkit-makefiles.sh | 1 - 5 files changed, 36 insertions(+), 6 deletions(-) rename toolkit/content/{buildconfig.html.in => buildconfig.html} (81%) diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index b0b73e59e14..58f526aa086 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -41,6 +41,8 @@ INCLUDED_AUTOCONF_MK = 1 USE_AUTOCONF = 1 MOZILLA_CLIENT = 1 +target = @target@ +ac_configure_args = @ac_configure_args@ BUILD_MODULES = @BUILD_MODULES@ MOZILLA_VERSION = @MOZILLA_VERSION@ FIREFOX_VERSION = @FIREFOX_VERSION@ diff --git a/toolkit/content/Makefile.in b/toolkit/content/Makefile.in index 45881f489e2..8001223e662 100644 --- a/toolkit/content/Makefile.in +++ b/toolkit/content/Makefile.in @@ -45,7 +45,32 @@ CHROME_DEPS = buildconfig.html include $(DEPTH)/config/autoconf.mk -DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) +DEFINES += \ + -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \ + -Dtarget="$(target)" \ + -Dac_configure_args="$(ac_configure_args)" \ + -DCC="$(CC)" \ + -DCC_VERSION="$(CC_VERSION)" \ + -DCFLAGS="$(CFLAGS)" \ + -DCXX="$(CXX)" \ + -DCXX_VERSION="$(CXX_VERSION)" \ + -DCXXFLAGS="$(CXXFLAGS)" \ + -DCPPFLAGS="$(CPPFLAGS)" \ + $(NULL) + +CHANGESET := $(shell hg identify -i $(topsrcdir) 2>/dev/null) +ifdef CHANGESET +DEFINES += -DSOURCE_CHANGESET="$(CHANGESET)" +endif + +# strip a trailing slash from the repo URL because it's not always present, +# and we want to construct a working URL in buildconfig.html +# make+shell+sed = awful +_dollar=$$ +SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/" -e "s/\/$(_dollar)//" ) +ifdef SOURCE_REPO +DEFINES += -DSOURCE_REPO="$(SOURCE_REPO)" +endif ifdef ENABLE_TESTS DIRS += tests @@ -55,6 +80,3 @@ EXTRA_JS_MODULES = debug.js EXTRA_PP_JS_MODULES = debug.js include $(topsrcdir)/config/rules.mk - -distclean:: - $(RM) -f buildconfig.html diff --git a/toolkit/content/buildconfig.html.in b/toolkit/content/buildconfig.html similarity index 81% rename from toolkit/content/buildconfig.html.in rename to toolkit/content/buildconfig.html index 76c23e1b5b2..b37d11d3189 100644 --- a/toolkit/content/buildconfig.html.in +++ b/toolkit/content/buildconfig.html @@ -1,4 +1,5 @@ +#filter substitution about:buildconfig @@ -7,6 +8,12 @@

about:buildconfig

+#ifdef SOURCE_REPO +#ifdef SOURCE_CHANGESET +

Source

+

Built from @SOURCE_REPO@/rev/@SOURCE_CHANGESET@

+#endif +#endif

Build platform

diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn index 7dcd644d412..dac13fd771b 100644 --- a/toolkit/content/jar.mn +++ b/toolkit/content/jar.mn @@ -11,7 +11,7 @@ toolkit.jar: * content/global/about.xhtml (about.xhtml) content/global/plugins.html content/global/plugins.css -+ content/global/buildconfig.html (buildconfig.html) +*+ content/global/buildconfig.html (buildconfig.html) + content/global/charsetOverlay.js (charsetOverlay.js) + content/global/charsetOverlay.xul (charsetOverlay.xul) *+ content/global/commonDialog.js (commonDialog.js) diff --git a/toolkit/toolkit-makefiles.sh b/toolkit/toolkit-makefiles.sh index b40e6105a1d..c363138c2e2 100644 --- a/toolkit/toolkit-makefiles.sh +++ b/toolkit/toolkit-makefiles.sh @@ -646,7 +646,6 @@ MAKEFILES_xulapp=" toolkit/crashreporter/google-breakpad/src/common/windows/Makefile toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/Makefile toolkit/content/Makefile - toolkit/content/buildconfig.html toolkit/obsolete/Makefile toolkit/components/alerts/Makefile toolkit/components/alerts/public/Makefile