bug 448155 - builds should have changeset ID in about:buildconfig when possible. r=bsmedberg
authorTed Mielczarek <ted.mielczarek@gmail.com>
Mon, 22 Sep 2008 14:00:38 -0400
changeset 19511 dedc9cf1052c5490100eedaaea74c9558e8d029b
parent 19510 aad88696e0f5e643a204933afeabc265d58ba41d
child 19512 9864735a4241e50eb036df6386c734a277c8a147
push id2298
push usertmielczarek@mozilla.com
push dateMon, 22 Sep 2008 18:00:47 +0000
treeherdermozilla-central@dedc9cf1052c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs448155
milestone1.9.1b1pre
bug 448155 - builds should have changeset ID in about:buildconfig when possible. r=bsmedberg
config/autoconf.mk.in
toolkit/content/Makefile.in
toolkit/content/buildconfig.html
toolkit/content/buildconfig.html.in
toolkit/content/jar.mn
toolkit/toolkit-makefiles.sh
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -36,16 +36,18 @@
 #
 # ***** END LICENSE BLOCK *****
 
 # A netscape style .mk file for autoconf builds
 
 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@
 
 MOZ_BUILD_APP = @MOZ_BUILD_APP@
 MOZ_APP_NAME	= @MOZ_APP_NAME@
 MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@
 MOZ_APP_VERSION = @MOZ_APP_VERSION@
--- a/toolkit/content/Makefile.in
+++ b/toolkit/content/Makefile.in
@@ -40,21 +40,43 @@ DEPTH     = ../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 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
 endif
 
 EXTRA_JS_MODULES = debug.js
 EXTRA_PP_JS_MODULES = debug.js
 
 include $(topsrcdir)/config/rules.mk
-
-distclean::
-	$(RM) -f buildconfig.html
rename from toolkit/content/buildconfig.html.in
rename to toolkit/content/buildconfig.html
--- a/toolkit/content/buildconfig.html.in
+++ b/toolkit/content/buildconfig.html
@@ -1,17 +1,24 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+#filter substitution
 <html>
 <head>
   <title>about:buildconfig</title>
   <link rel="stylesheet" href="chrome://global/skin/about.css" type="text/css">
 </head>
 <body class="aboutPageWideContainer">
 <h1>about:buildconfig</h1>
 <p> </p>
+#ifdef SOURCE_REPO
+#ifdef SOURCE_CHANGESET
+<h2>Source</h2>
+<p>Built from <a href="@SOURCE_REPO@/rev/@SOURCE_CHANGESET@">@SOURCE_REPO@/rev/@SOURCE_CHANGESET@</a></p>
+#endif
+#endif
 <h2>Build platform</h2>
 <table>
   <tbody>
     <tr>
       <th>target</th>
     </tr>
     <tr>
       <td>@target@</td>
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -6,17 +6,17 @@ toolkit.jar:
 # work with Geckos from before 1.9, when there was a separate file
 %  override chrome://global/content/nsTransferable.js chrome://global/content/nsDragAndDrop.js
 *  content/global/license.html                (license.html)
    content/global/XPCNativeWrapper.js         (XPCNativeWrapper.js)
 *  content/global/xul.css                     (xul.css)
 *  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)
 *+ content/global/commonDialog.xul            (commonDialog.xul)
    content/global/commonDialog.css            (commonDialog.css)
 *  content/global/contentAreaUtils.js         (contentAreaUtils.js)
 *  content/global/customizeCharset.js         (customizeCharset.js)
 *  content/global/customizeCharset.xul        (customizeCharset.xul)
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -641,17 +641,16 @@ MAKEFILES_xulapp="
   toolkit/crashreporter/google-breakpad/src/client/windows/Makefile
   toolkit/crashreporter/google-breakpad/src/client/windows/handler/Makefile
   toolkit/crashreporter/google-breakpad/src/client/windows/sender/Makefile
   toolkit/crashreporter/google-breakpad/src/common/Makefile
   toolkit/crashreporter/google-breakpad/src/common/mac/Makefile
   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
   toolkit/components/alerts/src/Makefile
   toolkit/components/autocomplete/Makefile
   toolkit/components/autocomplete/public/Makefile
   toolkit/components/autocomplete/src/Makefile
   toolkit/components/Makefile