Bug 383167 - Need buildid in an external file, r=luser sr=jst

This commit is contained in:
benjamin%smedbergs.us 2007-06-25 15:26:03 +00:00
Родитель 288cb44ead
Коммит 81d0ea8604
41 изменённых файлов: 2835 добавлений и 656 удалений

Просмотреть файл

@ -203,4 +203,4 @@ deliver: splitsymbols rebase signnss
endif # WINNT
BUILDID = $(shell cat $(DEPTH)/config/build_number)
BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)

Просмотреть файл

@ -65,27 +65,16 @@ 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_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_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 = $(shell $(AWK_CMD))
DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
DEFINES += -DGRE_BUILD_ID=$(GRE_BUILD_ID)
include $(topsrcdir)/config/rules.mk
else
ifndef LIBXUL_SDK
# Build a binary bootstrapping with XRE_main
MOZILLA_INTERNAL_API = 1
ifeq ($(USE_SHORT_LIBNAME), 1)
PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
else
@ -94,6 +83,7 @@ endif
REQUIRES = \
xpcom \
string \
xulapp \
$(NULL)
@ -120,11 +110,18 @@ 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) \
$(XPCOM_LIBS) \
$(APP_XPCOM_LIBS) \
$(NSPR_LIBS) \
$(TK_LIBS) \
$(NULL)

Просмотреть файл

@ -40,18 +40,24 @@
Vendor=Mozilla
Name=Firefox
Version=@APP_VERSION@
BuildID=@BUILD_ID@
BuildID=@GRE_BUILDID@
Copyright=Copyright (c) 1998 - 2007 mozilla.org
ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
[Gecko]
MinVersion=@GRE_BUILD_ID@
MaxVersion=@GRE_BUILD_ID@
MinVersion=@GRE_MILESTONE@
MaxVersion=@GRE_MILESTONE@
[XRE]
EnableProfileMigrator=1
EnableExtensionManager=1
[Crash Reporter]
Enabled=0
#if MOZILLA_OFFICIAL
#if XP_WIN
Enabled=1
#elif XP_MACOSX
Enabled=1
#endif
#endif
ServerURL=https://crash-reports.mozilla.com/submit

Просмотреть файл

@ -41,32 +41,52 @@
#include <windows.h>
#include <stdlib.h>
#endif
#include "nsBuildID.h"
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
#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);
#endif
,
nsnull, // xreDirectory
nsnull, // minVersion
nsnull, // maxVersion
"https://crash-reports.mozilla.com/submit"
};
va_end(ap);
}
int main(int argc, char* argv[])
{
return XRE_main(argc, argv, &kAppData);
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;
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)

Просмотреть файл

@ -45,6 +45,7 @@ bin/components/libjar50.so
; [Base Browser Files]
bin/@MOZ_APP_NAME@-bin
bin/@MOZ_APP_NAME@
bin/application.ini
bin/mozilla-xremote-client
bin/run-mozilla.sh
bin/plugins/libnullplugin.so

Просмотреть файл

@ -48,6 +48,7 @@ bin\msvcr80.dll
[browser]
; [Base Browser Files]
bin\@MOZ_APP_NAME@.exe
bin\application.ini
bin\plugins\npnul32.dll
bin\res\cmessage.txt
bin\res\effective_tld_names.dat

Просмотреть файл

@ -59,9 +59,6 @@ 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
@ -96,7 +93,6 @@ NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md
endif
HEADERS = \
nsBuildID.h \
$(DEPTH)/mozilla-config.h \
$(srcdir)/nsStaticComponents.h \
$(NULL)
@ -123,35 +119,12 @@ 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 += build_number nsBuildID \
GARBAGE += \
$(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

Просмотреть файл

@ -1,232 +0,0 @@
#!/usr/bin/perl -w
# ***** 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 Win32 Version System.
#
# The Initial Developer of the Original Code is Netscape Communications Corporation
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# 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 *****
package Moz::Milestone;
use strict;
use vars qw($officialMilestone
$milestone);
local $Moz::Milestone::milestone;
local $Moz::Milestone::officialMilestone;
#
# Usage: getOfficialMilestone($milestoneFile)
# Returns full milestone (x.x.x.x[ab12pre+])
#
sub getOfficialMilestone($) {
my $mfile = $_[0];
open(FILE,"$mfile") ||
die ("Can't open $mfile for reading!");
my $num = <FILE>;
while($num =~ /^\s*#/ || $num !~ /^\d/) {
$num = <FILE>;
}
close(FILE);
if ($num !~ /^\d/) { return; }
chomp($num);
# Remove extra ^M caused by using dos-mode line-endings
chop $num if (substr($num, -1, 1) eq "\r");
$Moz::Milestone::officialMilestone = $num;
$Moz::Milestone::milestone = &getMilestoneNum;
return $num;
}
#
# Usage: getMilestoneNum($num)
# Returns: milestone without a + if it exists.
#
sub getMilestoneNum {
if (defined($Moz::Milestone::milestone)) {
return $Moz::Milestone::milestone;
}
if (defined($Moz::Milestone::officialMilestone)) {
$Moz::Milestone::milestone = $Moz::Milestone::officialMilestone;
} else {
$Moz::Milestone::milestone = $_[0];
}
if ($Moz::Milestone::milestone =~ /\+$/) { # for x.x.x+, strip off the +
$Moz::Milestone::milestone =~ s/\+$//;
}
return $Moz::Milestone::milestone;
}
#
# Usage: getMilestoneQualifier($num)
# Returns: + if it exists.
#
sub getMilestoneQualifier {
my $milestoneQualifier;
if (defined($Moz::Milestone::officialMilestone)) {
$milestoneQualifier = $Moz::Milestone::officialMilestone;
} else {
$milestoneQualifier = $_[0];
}
if ($milestoneQualifier =~ /\+$/) {
return "+";
}
}
sub getMilestoneMajor {
my $milestoneMajor;
if (defined($Moz::Milestone::milestone)) {
$milestoneMajor = $Moz::Milestone::milestone;
} else {
$milestoneMajor = $_[0];
}
my @parts = split(/\./,$milestoneMajor);
return $parts[0];
}
sub getMilestoneMinor {
my $milestoneMinor;
if (defined($Moz::Milestone::milestone)) {
$milestoneMinor = $Moz::Milestone::milestone;
} else {
$milestoneMinor = $_[0];
}
my @parts = split(/\./,$milestoneMinor);
if ($#parts < 1 ) { return 0; }
return $parts[1];
}
sub getMilestoneMini {
my $milestoneMini;
if (defined($Moz::Milestone::milestone)) {
$milestoneMini = $Moz::Milestone::milestone;
} else {
$milestoneMini = $_[0];
}
my @parts = split(/\./,$milestoneMini);
if ($#parts < 2 ) { return 0; }
return $parts[2];
}
sub getMilestoneMicro {
my $milestoneMicro;
if (defined($Moz::Milestone::milestone)) {
$milestoneMicro = $Moz::Milestone::milestone;
} else {
$milestoneMicro = $_[0];
}
my @parts = split(/\./,$milestoneMicro);
if ($#parts < 3 ) { return 0; }
return $parts[3];
}
sub getMilestoneAB {
my $milestoneAB;
if (defined($Moz::Milestone::milestone)) {
$milestoneAB = $Moz::Milestone::milestone;
} else {
$milestoneAB = $_[0];
}
if ($milestoneAB =~ /a/) { return "alpha"; }
if ($milestoneAB =~ /b/) { return "beta"; }
return "final";
}
#
# build_file($template_file,$output_file)
#
sub build_file($$) {
my @FILE;
my @MILESTONE_PARTS;
my $MINI_VERSION = 0;
my $MICRO_VERSION = 0;
my $OFFICIAL = 0;
my $QUALIFIER = "";
if (!defined($Moz::Milestone::milestone)) { die("$0: no milestone file set!\n"); }
@MILESTONE_PARTS = split(/\./, &getMilestoneNum);
if ($#MILESTONE_PARTS >= 2) {
$MINI_VERSION = 1;
} else {
$MILESTONE_PARTS[2] = 0;
}
if ($#MILESTONE_PARTS >= 3) {
$MICRO_VERSION = 1;
} else {
$MILESTONE_PARTS[3] = 0;
}
if (! &getMilestoneQualifier) {
$OFFICIAL = 1;
} else {
$QUALIFIER = "+";
}
if (-e $_[0]) {
open(FILE, "$_[0]") || die("$0: Can't open $_[0] for reading!\n");
@FILE = <FILE>;
close(FILE);
open(FILE, ">$_[1]") || die("$0: Can't open $_[1] for writing!\n");
#
# There will be more of these based on what we need for files.
#
foreach(@FILE) {
s/__MOZ_MAJOR_VERSION__/$MILESTONE_PARTS[0]/g;
s/__MOZ_MINOR_VERSION__/$MILESTONE_PARTS[1]/g;
s/__MOZ_MINI_VERSION__/$MILESTONE_PARTS[2]/g;
s/__MOZ_MICRO_VERSION__/$MILESTONE_PARTS[3]/g;
if ($MINI_VERSION) {
s/__MOZ_OPTIONAL_MINI_VERSION__/.$MILESTONE_PARTS[2]/g;
}
if ($MICRO_VERSION) {
s/__MOZ_OPTIONAL_MICRO_VERSION__/.$MILESTONE_PARTS[3]/g;
}
print FILE $_;
}
close(FILE);
} else {
die("$0: $_[0] doesn't exist for autoversioning!\n");
}
}
1;

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -871,12 +871,6 @@ ifdef LOCALE_SRCDIR
MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR)
endif
#
# Add BUILD_ID to set of DEFINES
#
BUILD_ID := $(shell cat $(DEPTH)/config/build_number)
DEFINES += -DBUILD_ID=$(BUILD_ID)
ifeq (,$(filter WINCE WINNT OS2,$(OS_ARCH)))
RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
endif

2279
config/configobj.py Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,112 +0,0 @@
#!/usr/bin/perl -w
# ***** 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 Win32 Version System.
#
# The Initial Developer of the Original Code is Netscape Communications Corporation
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# 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 *****
use Getopt::Long;
use strict;
use vars qw(
$OBJDIR
$SRCDIR
$TOPSRCDIR
$SCRIPTDIR
@TEMPLATE_FILE
$MILESTONE_FILE
$MILESTONE
$MILESTONE_NUM
@MILESTONE_PARTS
$MINI_VERSION
$MICRO_VERSION
$opt_debug
$opt_template
$opt_help
);
$SCRIPTDIR = $0;
$SCRIPTDIR =~ s/[^\/]*$//;
push(@INC,$SCRIPTDIR);
require "Moz/Milestone.pm";
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template');
if (defined($opt_help)) {
&usage();
exit;
}
if (defined($opt_template)) {
@TEMPLATE_FILE = @ARGV;
if ($opt_debug) {
print("TEMPLATE_FILE = --@TEMPLATE_FILE--\n");
}
}
if (!defined($SRCDIR)) { $SRCDIR = '.'; }
if (!defined($OBJDIR)) { $OBJDIR = '.'; }
$MILESTONE_FILE = "$TOPSRCDIR/config/milestone.txt";
@MILESTONE_PARTS = (0, 0, 0, 0);
#
# Grab milestone (top line of $MILESTONE_FILE that starts with a digit)
#
my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE);
if (defined(@TEMPLATE_FILE)) {
my $TFILE;
foreach $TFILE (@TEMPLATE_FILE) {
my $BUILT_FILE = "$OBJDIR/$TFILE";
$TFILE = "$SRCDIR/$TFILE.tmpl";
if (-e $TFILE) {
Moz::Milestone::build_file($TFILE,$BUILT_FILE);
} else {
warn("$0: No such file $TFILE!\n");
}
}
} else {
print "$milestone\n";
}
sub usage() {
print <<END
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list]` # will build file list from .tmpl files
END
;
}

Просмотреть файл

Просмотреть файл

@ -0,0 +1,21 @@
import configobj, sys
try:
(file, section, key) = sys.argv[1:]
except ValueError:
print "Usage: printconfigsetting.py <file> <section> <setting>"
sys.exit(1)
c = configobj.ConfigObj(file)
try:
s = c[section]
except KeyError:
print >>sys.stderr, "Section [%s] not found." % section
sys.exit(1)
try:
print s[key]
except KeyError:
print >>sys.stderr, "Key %s not found." % key
sys.exit(1)

Просмотреть файл

@ -157,6 +157,7 @@
#include "nsCDefaultURIFixup.h"
#include "nsEventDispatcher.h"
#include "nsIObserverService.h"
#include "nsIXULAppInfo.h"
#include "nsNetUtil.h"
#include "plbase64.h"
@ -193,8 +194,6 @@
static PRLogModuleInfo* gDOMLeakPRLog;
#endif
#include "nsBuildID.h"
nsIFactory *nsGlobalWindow::sComputedDOMStyleFactory = nsnull;
static nsIEntropyCollector *gEntropyCollector = nsnull;
@ -8247,8 +8246,18 @@ nsNavigator::GetOnLine(PRBool* aOnline)
NS_IMETHODIMP
nsNavigator::GetBuildID(nsAString& aBuildID)
{
aBuildID = NS_LITERAL_STRING(NS_STRINGIFY(NS_BUILD_ID));
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
if (!appInfo)
return NS_ERROR_NOT_IMPLEMENTED;
nsCAutoString buildID;
nsresult rv = appInfo->GetAppBuildID(buildID);
if (NS_FAILED(rv))
return rv;
aBuildID.Truncate();
AppendASCIItoUTF16(buildID, aBuildID);
return NS_OK;
}

Просмотреть файл

@ -73,10 +73,6 @@
#include "nsCRT.h"
#include "nsFontMetricsPS.h"
#ifndef NS_BUILD_ID
#include "nsBuildID.h"
#endif /* !NS_BUILD_ID */
#include "nsPrintfCString.h"
#include "prenv.h"
@ -413,8 +409,8 @@ nsPostScriptObj::write_prolog(FILE *aHandle, PRBool aFTPEnable)
fpCString(fWidth).get(),
fpCString(fHeight).get());
fprintf(f, "%%%%Creator: Mozilla PostScript module (%s/%lu)\n",
"rv:" MOZILLA_VERSION, (unsigned long)NS_BUILD_ID);
fprintf(f, "%%%%Creator: Mozilla PostScript module (%s)\n",
"rv:" MOZILLA_VERSION);
fprintf(f, "%%%%DocumentData: Clean8Bit\n");
fprintf(f, "%%%%DocumentPaperSizes: %s\n", mPrintSetup->paper_name);
fprintf(f, "%%%%Orientation: %s\n",

Просмотреть файл

@ -42,11 +42,17 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MOZILLA_INTERNAL_API = 1
AB_CD = $(MOZ_UI_LOCALE)
DEFINES += -DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\" -DAB_CD=$(AB_CD)
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)
DEFINES += \
-DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\" \
-DAB_CD=$(AB_CD) \
-DGRE_MILESTONE=$(GRE_MILESTONE) \
-DGRE_BUILDID=$(GRE_BUILDID) \
$(NULL)
DIRS = profile
@ -67,11 +73,14 @@ endif
REQUIRES = \
xpcom \
string \
xulapp \
$(NULL)
CPPSRCS = nsMailApp.cpp
DIST_FILES = application.ini
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
ifdef BUILD_STATIC_LIBS
@ -93,11 +102,18 @@ 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) \
$(MOZ_JS_LIBS) \
$(EXTRA_DSO_LIBS) \
$(XPCOM_LIBS) \
$(APP_XPCOM_LIBS) \
$(NSPR_LIBS) \
$(TK_LIBS) \
$(NULL)

55
mail/app/application.ini Normal file
Просмотреть файл

@ -0,0 +1,55 @@
; ***** 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 Firefox.
;
; The Initial Developer of the Original Code is
; Benjamin Smedberg <benjamin@smedbergs.us>.
;
; Portions created by the Initial Developer are Copyright (C) 2006
; the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
;
; Contributor(s):
;
; 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 *****
#filter substitution
[App]
Name=Thunderbird
Version=@APP_VERSION@
BuildID=@GRE_BUILDID@
Copyright=Copyright (c) 1998-2007 mozilla.org
ID={3550f703-e582-4d05-9a08-453d09bdfdc6}
[Gecko]
MinVersion=@GRE_MILESTONE@
MaxVersion=@GRE_MILESTONE@
[XRE]
EnableProfileMigrator=1
EnableExtensionManager=1
[Crash Reporter]
ServerURL=https://crash-reports.mozilla.com/submit

Просмотреть файл

@ -41,29 +41,52 @@
#include <windows.h>
#include <stdlib.h>
#endif
#include "nsBuildID.h"
#include "prtypes.h"
static const nsXREAppData kAppData = {
sizeof(nsXREAppData),
nsnull,
nsnull,
"Thunderbird",
NS_STRINGIFY(APP_VERSION),
NS_STRINGIFY(BUILD_ID),
"{3550f703-e582-4d05-9a08-453d09bdfdc6}",
"Copyright (c) 1998-2007 mozilla.org",
NS_XRE_ENABLE_PROFILE_MIGRATOR |
NS_XRE_ENABLE_EXTENSION_MANAGER,
nsnull, // xreDirectory
nsnull, // minVersion
nsnull, // maxVersion
"https://crash-reports.mozilla.com/submit"
};
#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);
#endif
va_end(ap);
}
int main(int argc, char* argv[])
{
return XRE_main(argc, argv, &kAppData);
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;
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)

Просмотреть файл

@ -60,6 +60,7 @@ bin\extensions\talkback@mozilla.org\components\talkback.hlp
bin\xpicleanup.exe
bin\thunderbird.exe
bin\application.ini
bin\LICENSE.txt
bin\license.html
bin\README.txt

Просмотреть файл

@ -606,17 +606,10 @@ int strncasecmp(const char *str1, const char *str2, int length)
#include "NSReg.h"
#include "VerReg.h"
#include "nsBuildID.h"
char *TheRegistry = "registry";
char *Flist;
/* WARNING: build hackery */
#if defined(STANDALONE_REGISTRY) && !defined(XP_MAC) && !defined(XP_MACOSX)
long BUILDNUM = NS_BUILD_ID;
#endif
REGERR vr_ParseVersion(char *verstr, VERSION *result);
#if defined(XP_UNIX) && !defined(XP_MACOSX)

Просмотреть файл

@ -42,13 +42,16 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MOZILLA_INTERNAL_API = 1
AB_CD = $(MOZ_UI_LOCALE)
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)
DEFINES += \
-DAB_CD=$(AB_CD) \
-DAPP_VERSION="$(MOZ_APP_VERSION)" \
-DGRE_MILESTONE=$(GRE_MILESTONE) \
-DGRE_BUILDID=$(GRE_BUILDID) \
$(NULL)
ifeq ($(USE_SHORT_LIBNAME), 1)
@ -59,11 +62,14 @@ endif
REQUIRES = \
xpcom \
string \
xulapp \
$(NULL)
CPPSRCS = nsSuiteApp.cpp
DIST_FILES = application.ini
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
ifdef BUILD_STATIC_LIBS
@ -85,11 +91,18 @@ 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) \
$(MOZ_JS_LIBS) \
$(EXTRA_DSO_LIBS) \
$(XPCOM_LIBS) \
$(APP_XPCOM_LIBS) \
$(NSPR_LIBS) \
$(TK_LIBS) \
$(NULL)

53
suite/app/application.ini Normal file
Просмотреть файл

@ -0,0 +1,53 @@
; ***** 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 Firefox.
;
; The Initial Developer of the Original Code is
; Benjamin Smedberg <benjamin@smedbergs.us>.
;
; Portions created by the Initial Developer are Copyright (C) 2006
; the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
;
; Contributor(s):
;
; 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 *****
#filter substitution
[App]
Vendor=mozilla.org
Name=SeaMonkey
Version=@APP_VERSION@
BuildID=@GRE_BUILDID@
Copyright=Copyright (c) 1998-2007 mozilla.org
ID={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
[Gecko]
MinVersion=@GRE_MILESTONE@
MaxVersion=@GRE_MILESTONE@
[XRE]
EnableProfileMigrator=1
EnableExtensionManager=1

Просмотреть файл

@ -15,12 +15,12 @@
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* the mozilla.org SeaMonkey project.
* Portions created by the Initial Developer are Copyright (C) 2006
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mark Banner <bugzilla@standard8.demon.co.uk>
* Brian Ryner <bryner@brianryner.com>
*
* 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
@ -41,25 +41,52 @@
#include <windows.h>
#include <stdlib.h>
#endif
#include "nsBuildID.h"
#include "prtypes.h"
static const nsXREAppData kAppData = {
offsetof(nsXREAppData, xreDirectory),
nsnull,
"mozilla.org",
"SeaMonkey",
NS_STRINGIFY(APP_VERSION),
NS_STRINGIFY(BUILD_ID),
"{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}",
"Copyright (c) 1998-2007 mozilla.org",
NS_XRE_ENABLE_PROFILE_MIGRATOR |
NS_XRE_ENABLE_EXTENSION_MANAGER
};
#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);
#endif
va_end(ap);
}
int main(int argc, char* argv[])
{
return XRE_main(argc, argv, &kAppData);
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;
}
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)
@ -67,7 +94,7 @@ int main(int argc, char* argv[])
// unused if we are a console application.
int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR args, int )
{
// Do the real work.
return main( __argc, __argv );
// Do the real work.
return main( __argc, __argv );
}
#endif

Просмотреть файл

@ -59,6 +59,7 @@ bin\README.txt,bin\readme.txt
bin\LICENSE,bin\license.txt
bin\jpeg3250.dll
bin\seamonkey.exe
bin\application.ini
bin\regxpcom.exe
bin\xpicleanup.exe
bin\jsj3250.dll

Просмотреть файл

@ -1,7 +1,7 @@
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
@ -9,33 +9,36 @@ Do Not Edit! -->
<DL><p>
<DT><H3 PERSONAL_TOOLBAR_FOLDER="true" ID="NC:PersonalToolbarFolder">Personal Toolbar Folder</H3>
<DL><p>
<DT><A HREF="http://www.mozilla.org/">mozilla.org</A>
<DT><A HREF="http://www.mozillazine.org/">mozillaZine</A>
<DT><A HREF="http://www.mozdev.org/">mozdev.org</A>
<DT><A HREF="http://www.mozilla.org/" ID="rdf:#$MD9qK1">mozilla.org</A>
<DT><A HREF="http://www.mozillazine.org/" ID="rdf:#$ND9qK1">mozillaZine</A>
<DT><A HREF="http://www.mozdev.org/" ID="rdf:#$OD9qK1">mozdev.org</A>
</DL><p>
<DT><H3>Mozilla Project</H3>
<DT><H3 ID="rdf:#$PD9qK1">Mozilla Project</H3>
<DL><p>
<DT><H3>mozilla.org</H3>
<DT><H3 ID="rdf:#$QD9qK1">mozilla.org</H3>
<DL><p>
<DT><A HREF="http://www.mozilla.org/">The Mozilla Organization</A>
<DT><A HREF="http://www.mozilla.org/projects/seamonkey/">SeaMonkey Project</a>
<DT><A HREF="http://www.mozilla.org/products/">Mozilla Products</A>
<DT><A HREF="http://www.mozilla.org/feedback.html">Feedback</A>
<DT><A HREF="http://www.mozilla.org/" ID="rdf:#$RD9qK1">The Mozilla Organization</A>
<DT><A HREF="http://www.mozilla.org/projects/seamonkey/" ID="rdf:#$SD9qK1">SeaMonkey Project</A>
<DT><A HREF="http://www.mozilla.org/products/" ID="rdf:#$TD9qK1">Mozilla Products</A>
<DT><A HREF="http://www.mozilla.org/feedback.html" ID="rdf:#$UD9qK1">Feedback</A>
</DL><p>
<DT><H3>Community & Support</H3>
<DT><H3 ID="rdf:#$VD9qK1">Community &amp; Support</H3>
<DL><p>
<DT><A HREF="http://www.mozillazine.org/">mozillaZine</A>
<DT><A HREF="http://forums.mozillazine.org/viewforum.php?f=40">SeaMonkey Support (mozillaZine)</A>
<DT><A HREF="http://www.mozdev.org/">mozdev.org</A>
<DT><A HREF="http://plugindoc.mozdev.org/">Mozilla Plug-in Information (mozdev)</A>
<DT><A HREF="http://extensionroom.mozdev.org/">Mozilla Extensions (mozdev)</A>
<DT><A HREF="http://www.mozillazine.org/" ID="rdf:#$WD9qK1">mozillaZine</A>
<DT><A HREF="http://forums.mozillazine.org/viewforum.php?f=40" ID="rdf:#$XD9qK1">SeaMonkey Support (mozillaZine)</A>
<DT><A HREF="http://www.mozdev.org/" ID="rdf:#$YD9qK1">mozdev.org</A>
<DT><A HREF="http://plugindoc.mozdev.org/" ID="rdf:#$ZD9qK1">Mozilla Plug-in Information (mozdev)</A>
<DT><A HREF="http://extensionroom.mozdev.org/" ID="rdf:#$.D9qK1">Mozilla Extensions (mozdev)</A>
</DL><p>
</DL><p>
<DT><H3>Search the Web</H3>
<DT><H3 ID="rdf:#$+D9qK1">Search the Web</H3>
<DL><p>
<DT><A HREF="http://www.google.com/">Google</A>
<DT><A HREF="http://groups.google.com/">Google Groups</A>
<DT><A HREF="http://news.google.com/">Google News</A>
<DT><A HREF="http://www.google.com/" ID="rdf:#$0E9qK1">Google</A>
<DT><A HREF="http://groups.google.com/" ID="rdf:#$1E9qK1">Google Groups</A>
<DT><A HREF="http://news.google.com/" ID="rdf:#$2E9qK1">Google News</A>
</DL><p>
<HR>
<DT><H3 ID="NC:SystemBookmarksStaticRoot">Imported IE Favorites</H3>
<DL><p>
</DL><p>
</DL><p>

Просмотреть файл

@ -1,19 +1,20 @@
<?xml version="1.0"?>
<RDF:RDF
xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-panels">
<last-selected-panel>urn:sidebar:panel:bookmarks</last-selected-panel>
</RDF:Description>
<RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-box">
<hidden>true</hidden>
</RDF:Description>
<RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-splitter">
<hidden>true</hidden>
</RDF:Description>
<RDF:Description about="chrome://navigator/content/navigator.xul">
<NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-panels"/>
<NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-box"/>
<NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-splitter"/>
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Description RDF:about="chrome://navigator/content/navigator.xul">
<NC:persist RDF:resource="chrome://navigator/content/navigator.xul#sidebar-panels"/>
<NC:persist RDF:resource="chrome://navigator/content/navigator.xul#sidebar-box"/>
<NC:persist RDF:resource="chrome://navigator/content/navigator.xul#sidebar-splitter"/>
<NC:persist RDF:resource="chrome://navigator/content/navigator.xul#main-window"/>
</RDF:Description>
<RDF:Description RDF:about="chrome://navigator/content/navigator.xul#main-window"
width="732"
height="607"
sizemode="normal" />
<RDF:Description RDF:about="chrome://navigator/content/navigator.xul#sidebar-splitter"
hidden="true" />
<RDF:Description RDF:about="chrome://navigator/content/navigator.xul#sidebar-box"
hidden="true" />
<RDF:Description RDF:about="chrome://navigator/content/navigator.xul#sidebar-panels"
last-selected-panel="urn:sidebar:panel:bookmarks" />
</RDF:RDF>

Просмотреть файл

@ -93,7 +93,6 @@ FORCE_STATIC_LIB = 1
XPIDLSRCS = \
nsINativeAppSupport.idl \
nsIXULAppInfo.idl \
nsIXULRuntime.idl \
$(NULL)
@ -253,3 +252,12 @@ endif
export:: $(addprefix $(topsrcdir)/xpfe/bootstrap/, $(SHAREDCPPSRCS)) $(STACKWALK_CPPSRCS)
$(INSTALL) $^ .
platform.ini: FORCE
$(PYTHON) $(srcdir)/make-platformini.py $(topsrcdir)/config/milestone.txt > $@
libs:: platform.ini
$(INSTALL) $^ $(DIST)/bin
install::
$(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)

Просмотреть файл

@ -0,0 +1,21 @@
#!/usr/bin/python
from optparse import OptionParser
from datetime import datetime
import sys
(milestoneFile,) = sys.argv[1:]
for line in open(milestoneFile, 'r'):
if line[0] == '#':
continue
line = line.strip()
if line == '':
continue
milestone = line
print """[Build]
BuildID=%s
Milestone=%s""" % (datetime.now().strftime('%Y%m%d%H'), milestone)

Просмотреть файл

@ -46,7 +46,6 @@
#include "nsAppRunner.h"
#include "nsUpdateDriver.h"
#include "nsBuildID.h"
#ifdef XP_MACOSX
#include "MacLaunchHelper.h"
@ -265,6 +264,9 @@ extern "C" {
int gArgc;
char **gArgv;
static char gToolkitVersion[20];
static char gToolkitBuildID[40];
static int gRestartArgc;
static char **gRestartArgv;
@ -573,7 +575,7 @@ nsXULAppInfo::GetVersion(nsACString& aResult)
NS_IMETHODIMP
nsXULAppInfo::GetPlatformVersion(nsACString& aResult)
{
aResult.AssignLiteral(TOOLKIT_EM_VERSION);
aResult.AssignLiteral(gToolkitVersion);
return NS_OK;
}
@ -589,7 +591,7 @@ nsXULAppInfo::GetAppBuildID(nsACString& aResult)
NS_IMETHODIMP
nsXULAppInfo::GetPlatformBuildID(nsACString& aResult)
{
aResult.Assign(NS_STRINGIFY(BUILD_ID));
aResult.Assign(gToolkitBuildID);
return NS_OK;
}
@ -1936,7 +1938,7 @@ static void BuildVersion(nsCString &aBuf)
aBuf.Append('_');
aBuf.Append(gAppData->buildID);
aBuf.Append('/');
aBuf.AppendLiteral(GRE_BUILD_ID);
aBuf.Append(gToolkitBuildID);
}
static void
@ -2261,27 +2263,6 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
return 1;
}
if (appData.size > offsetof(nsXREAppData, minVersion)) {
if (!appData.minVersion) {
Output(PR_TRUE, "Error: Gecko:MinVersion not specified in application.ini\n");
return 1;
}
if (!appData.maxVersion) {
// If no maxVersion is specified, we assume the app is only compatible
// with the initial preview release. Do not increment this number ever!
SetAllocatedString(appData.maxVersion, "1.*");
}
if (NS_CompareVersions(appData.minVersion, TOOLKIT_EM_VERSION) > 0 ||
NS_CompareVersions(appData.maxVersion, TOOLKIT_EM_VERSION) < 0) {
Output(PR_TRUE, "Error: Platform version " TOOLKIT_EM_VERSION " is not compatible with\n"
"minVersion >= %s\nmaxVersion <= %s\n",
appData.minVersion, appData.maxVersion);
return 1;
}
}
ScopedLogging log;
if (!appData.xreDirectory) {
@ -2300,6 +2281,54 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
return 2;
}
nsCOMPtr<nsIFile> iniFile;
rv = appData.xreDirectory->Clone(getter_AddRefs(iniFile));
if (NS_FAILED(rv))
return 2;
iniFile->AppendNative(NS_LITERAL_CSTRING("platform.ini"));
nsCOMPtr<nsILocalFile> localIniFile = do_QueryInterface(iniFile);
if (!localIniFile)
return 2;
nsINIParser parser;
rv = parser.Init(localIniFile);
if (NS_SUCCEEDED(rv)) {
rv = parser.GetString("Build", "Milestone",
gToolkitVersion, sizeof(gToolkitVersion));
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to get toolkit version");
rv = parser.GetString("Build", "BuildID",
gToolkitBuildID, sizeof(gToolkitBuildID));
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to get toolkit buildid");
}
else {
NS_ERROR("Couldn't parse platform.ini!");
}
if (appData.size > offsetof(nsXREAppData, minVersion)) {
if (!appData.minVersion) {
Output(PR_TRUE, "Error: Gecko:MinVersion not specified in application.ini\n");
return 1;
}
if (!appData.maxVersion) {
// If no maxVersion is specified, we assume the app is only compatible
// with the initial preview release. Do not increment this number ever!
SetAllocatedString(appData.maxVersion, "1.*");
}
if (NS_CompareVersions(appData.minVersion, gToolkitVersion) > 0 ||
NS_CompareVersions(appData.maxVersion, gToolkitVersion) < 0) {
Output(PR_TRUE, "Error: Platform version '%s' is not compatible with\n"
"minVersion >= %s\nmaxVersion <= %s\n",
gToolkitVersion,
appData.minVersion, appData.maxVersion);
return 1;
}
}
#ifdef MOZ_AIRBAG
const char* airbagEnv = PR_GetEnv("MOZ_CRASHREPORTER");
if (airbagEnv && *airbagEnv) {

Просмотреть файл

Просмотреть файл

@ -84,7 +84,6 @@ CSRCS = \
CPPSRCS = \
$(XPCOM_GLUE_SRC_LCPPSRCS) \
nsXPCOMGlue.cpp \
nsGREDirServiceProvider.cpp \
$(LINKSRC) \
$(NULL)

Просмотреть файл

@ -42,7 +42,6 @@
#include "nspr.h"
#include "nsDebug.h"
#include "nsIServiceManager.h"
#include "nsGREDirServiceProvider.h"
#include "nsXPCOMPrivate.h"
#include "nsCOMPtr.h"
#include <stdlib.h>
@ -518,68 +517,3 @@ NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
return xpcomFunctions.invokeByIndexFunc(that, methodIndex,
paramCount, params);
}
// Default GRE startup/shutdown code
extern "C"
nsresult GRE_Startup()
{
const char* xpcomLocation = GRE_GetXPCOMPath();
// Startup the XPCOM Glue that links us up with XPCOM.
nsresult rv = XPCOMGlueStartup(xpcomLocation);
if (NS_FAILED(rv)) {
NS_WARNING("gre: XPCOMGlueStartup failed");
return rv;
}
#ifdef XP_WIN
// On windows we have legacy GRE code that does not load the GRE dependent
// libs (seamonkey GRE, not libxul)... add the GRE to the PATH.
// See bug 301043.
const char *lastSlash = strrchr(xpcomLocation, '\\');
if (lastSlash) {
int xpcomPathLen = lastSlash - xpcomLocation;
DWORD pathLen = GetEnvironmentVariable("PATH", nsnull, 0);
char *newPath = (char*) _alloca(xpcomPathLen + pathLen + 1);
strncpy(newPath, xpcomLocation, xpcomPathLen);
// in case GetEnvironmentVariable fails
newPath[xpcomPathLen] = ';';
newPath[xpcomPathLen + 1] = '\0';
GetEnvironmentVariable("PATH", newPath + xpcomPathLen + 1, pathLen);
SetEnvironmentVariable("PATH", newPath);
}
#endif
nsGREDirServiceProvider *provider = new nsGREDirServiceProvider();
if ( !provider ) {
NS_WARNING("GRE_Startup failed");
XPCOMGlueShutdown();
return NS_ERROR_OUT_OF_MEMORY;
}
nsCOMPtr<nsIServiceManager> servMan;
NS_ADDREF( provider );
rv = NS_InitXPCOM2(getter_AddRefs(servMan), nsnull, provider);
NS_RELEASE(provider);
if ( NS_FAILED(rv) || !servMan) {
NS_WARNING("gre: NS_InitXPCOM failed");
XPCOMGlueShutdown();
return rv;
}
return NS_OK;
}
extern "C"
nsresult GRE_Shutdown()
{
NS_ShutdownXPCOM(nsnull);
XPCOMGlueShutdown();
return NS_OK;
}

Просмотреть файл

@ -127,45 +127,5 @@ XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad *symbols);
extern "C" NS_HIDDEN_(nsresult)
XPCOMGlueShutdown();
/**
* Locate the path of the XPCOM shared library of a compatible GRE.
* The result of this function is normally passed directly to
* XPCOMGlueStartup. This looks for the GRE version in
* nsBuildID.h, which is generated at build time. Unless you set
* MOZ_MILESTONE_RELEASE this will probably not be a useful GRE version string.
*
* @return string buffer pointing to the XPCOM DLL path. Callers do
* not need to free this buffer.
* @status DEPRECATED - Use GRE_GetGREPathWithProperties
*/
extern "C" NS_HIDDEN_(char const *)
GRE_GetXPCOMPath();
/**
* Locate the directory of a compatible GRE as an nsIFile
*
* @param _retval Ordinary XPCOM getter, returns an addrefed interface.
*/
extern "C" NS_HIDDEN_(nsresult)
GRE_GetGREDirectory(nsILocalFile* *_retval);
/**
* Embedding applications which don't need a custom
* directoryserviceprovider may use GRE_Startup to start the XPCOM
* glue and initialize the GRE in one step.
*/
extern "C" NS_HIDDEN_(nsresult)
GRE_Startup();
/**
* Shut down XPCOM and the XPCOM glue in one step.
*/
extern "C" NS_HIDDEN_(nsresult)
GRE_Shutdown();
#endif // XPCOM_GLUE
#endif // nsXPCOMGlue_h__

Просмотреть файл

@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = xpcom
XPIDLSRCS = \
nsIXULAppInfo.idl \
nsIGConfService.idl \
nsIGnomeVFSService.idl \
$(NULL)

Просмотреть файл

@ -0,0 +1,92 @@
/* ***** 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 XUL bootstrap code.
*
* The Initial Developer of the Original Code is
* Benjamin Smedberg <benjamin@smedbergs.us>
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* 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 ***** */
#include "nsISupports.idl"
/**
* A scriptable interface to the nsXULAppAPI structure. See nsXULAppAPI.h for
* a detailed description of each attribute.
*
* @status FROZEN - This interface is frozen for use by embedders and will
* not change in the future.
*/
[scriptable, uuid(a61ede2a-ef09-11d9-a5ce-001124787b2e)]
interface nsIXULAppInfo : nsISupports
{
/**
* @see nsXREAppData.vendor
* @returns an empty string if nsXREAppData.vendor is not set.
*/
readonly attribute ACString vendor;
/**
* @see nsXREAppData.name
*/
readonly attribute ACString name;
/**
* @see nsXREAppData.ID
* @returns an empty string if nsXREAppData.ID is not set.
*/
readonly attribute ACString ID;
/**
* The version of the XUL application. It is different than the
* version of the XULRunner platform. Be careful about which one you want.
*
* @see nsXREAppData.version
* @returns an empty string if nsXREAppData.version is not set.
*/
readonly attribute ACString version;
/**
* The build ID/date of the application. For xulrunner applications,
* this will be different than the build ID of the platform. Be careful
* about which one you want.
*/
readonly attribute ACString appBuildID;
/**
* The version of the XULRunner platform.
*/
readonly attribute ACString platformVersion;
/**
* The build ID/date of gecko and the XULRunner platform.
*/
readonly attribute ACString platformBuildID;
};

Просмотреть файл

@ -41,7 +41,6 @@
#include "nscore.h"
#include "nsIScriptContext.h"
#include "nsBuildID.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsInstall.h"
@ -1856,8 +1855,6 @@ static JSConstDoubleSpec install_constants[] =
{ CHROME_DELAYED, "DELAYED_CHROME" },
{ CHROME_SELECT, "SELECT_CHROME" },
{ NS_BUILD_ID, "buildID" },
{0}
};

Просмотреть файл

@ -69,7 +69,6 @@
#include "nsTopProgressNotifier.h"
#include "nsLoggingProgressNotifier.h"
#include "nsBuildID.h"
#include "nsProcess.h"
/* For Javascript Namespace Access */