Skip to content

Commit

Permalink
Reverting bug 383167 again for linux test bustage :-(
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmedberg committed Jun 26, 2007
1 parent a724bba commit b21f7b3
Show file tree
Hide file tree
Showing 41 changed files with 1,223 additions and 2,557 deletions.
2 changes: 1 addition & 1 deletion Makefile.in
Expand Up @@ -203,4 +203,4 @@ deliver: splitsymbols rebase signnss

endif # WINNT

BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
BUILDID = $(shell cat $(DEPTH)/config/build_number)
29 changes: 16 additions & 13 deletions browser/app/Makefile.in
Expand Up @@ -65,16 +65,27 @@ 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)"

ifdef LIBXUL_SDK
# Build application.ini for a XULRunner app

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_BUILD_ID is only available in nsBuildID.h in a form that we can't use
# directly. So munge it. Beware makefile and shell escaping
AWK_EXPR = '/\#define GRE_BUILD_ID/ { gsub(/"/, "", $$3); print $$3 }'
AWK_CMD = awk $(AWK_EXPR) < $(LIBXUL_DIST)/include/nsBuildID.h

GRE_BUILD_ID = $(shell $(AWK_CMD))

DEFINES += -DGRE_BUILD_ID=$(GRE_BUILD_ID)

DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
include $(topsrcdir)/config/rules.mk

ifndef LIBXUL_SDK
else
# Build a binary bootstrapping with XRE_main

MOZILLA_INTERNAL_API = 1

ifeq ($(USE_SHORT_LIBNAME), 1)
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
else
Expand All @@ -83,7 +94,6 @@ endif

REQUIRES = \
xpcom \
string \
xulapp \
$(NULL)

Expand All @@ -110,18 +120,11 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
TK_LIBS := -framework Cocoa $(TK_LIBS)
endif

ifdef MOZ_ENABLE_LIBXUL
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
else
MOZILLA_INTERNAL_API = 1
APP_XPCOM_LIBS = $(XPCOM_LIBS)
endif

LIBS += \
$(STATIC_COMPONENTS_LINKER_PATH) \
$(EXTRA_DSO_LIBS) \
$(MOZ_JS_LIBS) \
$(APP_XPCOM_LIBS) \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(TK_LIBS) \
$(NULL)
Expand Down
14 changes: 4 additions & 10 deletions browser/app/application.ini
Expand Up @@ -40,24 +40,18 @@
Vendor=Mozilla
Name=Firefox
Version=@APP_VERSION@
BuildID=@GRE_BUILDID@
BuildID=@BUILD_ID@
Copyright=Copyright (c) 1998 - 2007 mozilla.org
ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}

[Gecko]
MinVersion=@GRE_MILESTONE@
MaxVersion=@GRE_MILESTONE@
MinVersion=@GRE_BUILD_ID@
MaxVersion=@GRE_BUILD_ID@

[XRE]
EnableProfileMigrator=1
EnableExtensionManager=1

[Crash Reporter]
#if MOZILLA_OFFICIAL
#if XP_WIN
Enabled=1
#elif XP_MACOSX
Enabled=1
#endif
#endif
Enabled=0
ServerURL=https://crash-reports.mozilla.com/submit
62 changes: 21 additions & 41 deletions browser/app/nsBrowserApp.cpp
Expand Up @@ -41,52 +41,32 @@
#include <windows.h>
#include <stdlib.h>
#endif
#include "nsBuildID.h"

#include <stdio.h>
#include <stdarg.h>

#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsStringGlue.h"

static void Output(const char *fmt, ... )
{
va_list ap;
va_start(ap, fmt);

#if defined(XP_WIN) && !MOZ_WINCONSOLE
char msg[2048];

vsnprintf(msg, sizeof(msg), fmt, ap);

MessageBox(NULL, msg, "XULRunner", MB_OK | MB_ICONERROR);
#else
vfprintf(stderr, fmt, ap);
static const nsXREAppData kAppData = {
sizeof(nsXREAppData),
nsnull,
"Mozilla",
"Firefox",
NS_STRINGIFY(APP_VERSION),
NS_STRINGIFY(BUILD_ID),
"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}",
"Copyright (c) 1998 - 2007 mozilla.org",
NS_XRE_ENABLE_PROFILE_MIGRATOR |
NS_XRE_ENABLE_EXTENSION_MANAGER
#if defined(MOZILLA_OFFICIAL) && (defined(XP_WIN) || defined(XP_MACOSX))
| NS_XRE_ENABLE_CRASH_REPORTER
#endif

va_end(ap);
}
,
nsnull, // xreDirectory
nsnull, // minVersion
nsnull, // maxVersion
"https://crash-reports.mozilla.com/submit"
};

int main(int argc, char* argv[])
{
nsCOMPtr<nsILocalFile> appini;
nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini));
if (NS_FAILED(rv)) {
Output("Couldn't calculate the application directory.");
return 255;
}
appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini"));

nsXREAppData *appData;
rv = XRE_CreateAppData(appini, &appData);
if (NS_FAILED(rv)) {
Output("Couldn't read application.ini");
return 255;
}

int result = XRE_main(argc, argv, appData);
XRE_FreeAppData(appData);
return result;
return XRE_main(argc, argv, &kAppData);
}

#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)
Expand Down
2 changes: 0 additions & 2 deletions browser/installer/unix/packages-static
Expand Up @@ -45,8 +45,6 @@ bin/components/libjar50.so
; [Base Browser Files]
bin/@MOZ_APP_NAME@-bin
bin/@MOZ_APP_NAME@
bin/application.ini
bin/platform.ini
bin/mozilla-xremote-client
bin/run-mozilla.sh
bin/plugins/libnullplugin.so
Expand Down
2 changes: 0 additions & 2 deletions browser/installer/windows/packages-static
Expand Up @@ -48,8 +48,6 @@ bin\msvcr80.dll
[browser]
; [Base Browser Files]
bin\@MOZ_APP_NAME@.exe
bin\application.ini
bin\platform.ini
bin\plugins\npnul32.dll
bin\res\cmessage.txt
bin\res\effective_tld_names.dat
Expand Down
3 changes: 1 addition & 2 deletions client.mk
Expand Up @@ -457,7 +457,6 @@ ifndef MAKE
MAKE := gmake
endif
PERL ?= perl
PYTHON ?= python

CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
ifdef CONFIG_GUESS_SCRIPT
Expand Down Expand Up @@ -941,7 +940,7 @@ else
ifdef MOZ_UNIFY_BDATE
ifndef MOZ_BUILD_DATE
ifdef MOZ_BUILD_PROJECTS
MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
MOZ_BUILD_DATE = $(shell $(PERL) -I$(TOPSRCDIR)/config $(TOPSRCDIR)/config/bdate.pl)
export MOZ_BUILD_DATE
endif
endif
Expand Down
29 changes: 28 additions & 1 deletion config/Makefile.in
Expand Up @@ -59,6 +59,9 @@ PLSRCS = nfspwd.pl revdepth.pl

TARGETS = $(HOST_PROGRAM) $(PLSRCS:.pl=) $(SIMPLE_PROGRAMS)

# Generate the build number on the fly.
TARGETS += build_number nsBuildID.h

ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
TARGETS += elf-dynstr-gc
Expand Down Expand Up @@ -93,6 +96,7 @@ NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md
endif

HEADERS = \
nsBuildID.h \
$(DEPTH)/mozilla-config.h \
$(srcdir)/nsStaticComponents.h \
$(NULL)
Expand All @@ -119,12 +123,35 @@ export::
$(INSTALL) system_wrappers $(DIST)/include
endif

# we don't use an explicit dependency here because then we would
# regenerate nsBuildID.h during the make install phase and that would
# be bad.
install::
@if test ! -f nsBuildID.h; then\
echo "You must have done at least a make export before trying to do a make install."; \
echo "(nsBuildID.h is missing.)"; \
exit 1; \
fi;
$(SYSINSTALL) $(IFLAGS1) $(DEPTH)/mozilla-config.h $(DESTDIR)$(includedir)

GARBAGE += \
GARBAGE += build_number nsBuildID \
$(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES)

ifneq (,$(BUILD_OFFICIAL)$(MOZILLA_OFFICIAL))
_BN_OFFICIAL=1
else
_BN_OFFICIAL=
endif

build_number: FORCE
$(PERL) -I$(srcdir) $(srcdir)/bdate.pl $@ $(_BN_OFFICIAL)

nsBuildID.h: nsBuildID.h.in build_number $(srcdir)/milestone.txt Makefile
$(RM) $@
MOZ_MILESTONE_RELEASE=$(MOZ_MILESTONE_RELEASE); \
export MOZ_MILESTONE_RELEASE; \
$(PERL) -I$(srcdir) $(srcdir)/aboutime.pl -m $(srcdir)/milestone.txt $@ build_number $(srcdir)/nsBuildID.h.in

ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
elf-dynstr-gc: elf-dynstr-gc.c Makefile Makefile.in
Expand Down
24 changes: 24 additions & 0 deletions config/aboutime.pl
@@ -0,0 +1,24 @@

use strict;
use Getopt::Std;
require mozBDate;
require "Moz/Milestone.pm";

my $mfile;
getopts('m:');
if (defined($::opt_m)) {
$mfile = $::opt_m;
}

my $outfile = $ARGV[0];
my $build_num_file = $ARGV[1];
my $infile = "";

$infile = $ARGV[2] if ("$ARGV[2]" ne "");

if (defined($mfile)) {
my $milestone = &Moz::Milestone::getOfficialMilestone($mfile);
&mozBDate::SetMilestone($milestone);
}
&mozBDate::SubstituteBuildNumber($outfile, $build_num_file, $infile);

63 changes: 63 additions & 0 deletions config/bdate.c
@@ -0,0 +1,63 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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 mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */

/*
**
** bdate.c: Possibly cross-platform date-based build number
** generator. Output is YYJJJ, where YY == 2-digit
** year, and JJJ is the Julian date (day of the year).
**
** Author: briano@netscape.com
**
*/

#include <stdio.h>
#include <time.h>

#ifdef SUNOS4
#include "sunos4.h"
#endif

void main(void)
{
time_t t = time(NULL);
struct tm *tms;

tms = localtime(&t);
printf("500%02d%03d%02d\n", tms->tm_year, 1+tms->tm_yday, tms->tm_hour);
exit(0);
}
44 changes: 44 additions & 0 deletions config/bdate.pl
@@ -0,0 +1,44 @@
#
# ***** 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 mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of 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 *****

use mozBDate;

# Both "generate" args are optional
$file = $ARGV[0] if ("$ARGV[0]" ne "");
$official = 1 if ("$ARGV[1]" ne "");
&mozBDate::UpdateBuildNumber($file, $official);

0 comments on commit b21f7b3

Please sign in to comment.