Bug 295494 - Add support for extension chrome.manifest to make-jars r=darin a=shaver

This commit is contained in:
bsmedberg%covad.net 2005-06-01 11:59:09 +00:00
Родитель 2803cf4ac5
Коммит 3e11be4331
5 изменённых файлов: 92 добавлений и 59 удалений

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

@ -45,7 +45,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = lightning MODULE = lightning
export XPI_NAME = lightning export XPI_NAME = lightning
XPI_INSTALL_EXTRAS = $(srcdir)/chrome.manifest DIST_FILES = chrome.manifest install.rdf
XPI_PKGNAME = lightning XPI_PKGNAME = lightning
DIRS = ../../db/sqlite3/src ../../storage \ DIRS = ../../db/sqlite3/src ../../storage \

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

@ -507,6 +507,43 @@ DEFINES += \
endif endif
endif endif
# Flags passed to make-jars.pl
MAKE_JARS_FLAGS = \
-s $(srcdir) -t $(topsrcdir) -z $(ZIP) -p $(MOZILLA_DIR)/config/preprocessor.pl \
-f $(MOZ_CHROME_FILE_FORMAT) \
$(NULL)
ifdef NO_JAR_AUTO_REG
MAKE_JARS_FLAGS += -a
endif
ifdef USE_EXTENSION_MANIFEST
MAKE_JARS_FLAGS += -e
endif
ifeq ($(OS_TARGET),WIN95)
MAKE_JARS_FLAGS += -l
endif
ifneq (,$(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
MAKE_JARS_FLAGS += -x
endif
ifdef CROSS_COMPILE
MAKE_JARS_FLAGS += -o $(OS_ARCH)
endif
TAR_CREATE_FLAGS = -cvhf
ifeq ($(OS_ARCH),BSD_OS)
TAR_CREATE_FLAGS = -cvLf
endif
ifeq ($(OS_ARCH),OS2)
TAR_CREATE_FLAGS = -cvf
endif
# #
# Personal makefile customizations go in these optional make include files. # Personal makefile customizations go in these optional make include files.
# #
@ -835,6 +872,10 @@ ifdef relativesrcdir
LOCALE_SRCDIR = $(call EXPAND_LOCALE_SRCDIR,$(relativesrcdir)) LOCALE_SRCDIR = $(call EXPAND_LOCALE_SRCDIR,$(relativesrcdir))
endif endif
ifdef LOCALE_SRCDIR
MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR)
endif
# #
# Add BUILD_ID to set of DEFINES # Add BUILD_ID to set of DEFINES
# #

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

@ -1,6 +1,6 @@
#!/perl #!/perl
# make-jars [-f] [-v] [-l] [-x] [-d <chromeDir>] [-s <srcdir>] [-t <topsrcdir>] [-c <localedir>] [-z zipprog] [-o operating-system] < <jar.mn> # make-jars [-f] [-v] [-l] [-x] [-a] [-e] [-d <chromeDir>] [-s <srcdir>] [-t <topsrcdir>] [-c <localedir>] [-z zipprog] [-o operating-system] < <jar.mn>
my $cygwin_mountprefix = ""; my $cygwin_mountprefix = "";
if ($^O eq "cygwin") { if ($^O eq "cygwin") {
@ -49,7 +49,7 @@ foreach my $arg (@ARGV) {
} }
my $defines = join(' ', @ARGV[ $ddindex .. $#ARGV ]); my $defines = join(' ', @ARGV[ $ddindex .. $#ARGV ]);
getopts("d:s:t:c:f:avlD:o:p:xz:"); getopts("d:s:t:c:f:avlD:o:p:xz:e:");
my $baseFilesDir = "."; my $baseFilesDir = ".";
if (defined($::opt_s)) { if (defined($::opt_s)) {
@ -112,6 +112,11 @@ if (defined($::opt_a)) {
$autoreg = 0; $autoreg = 0;
} }
my $useExtensionManifest = 0;
if (defined($::opt_e)) {
$useExtensionManifest = 1;
}
my $preprocessor = ""; my $preprocessor = "";
if (defined($::opt_p)) { if (defined($::opt_p)) {
$preprocessor = $::opt_p; $preprocessor = $::opt_p;
@ -322,7 +327,7 @@ sub UniqIt
chomp; chomp;
delete $lines{$_}; delete $lines{$_};
} }
close(FILE); close(FILE);
} }
unless (open(FILE, ">>$manifest")) { unless (open(FILE, ">>$manifest")) {
@ -528,10 +533,13 @@ start:
} elsif (/^\%\s+(.*)$/) { } elsif (/^\%\s+(.*)$/) {
my $path = $1; my $path = $1;
my $jarpath = $jarfile;
$jarpath = "chrome/".$jarfile if $useExtensionManifest;
if ($fileformat eq "flat" || $fileformat eq "symlink") { if ($fileformat eq "flat" || $fileformat eq "symlink") {
$path =~ s|\%|$jarfile/$0|; $path =~ s|\%|$jarpath/$1|;
} else { } else {
$path =~ s|\%|jar:$jarfile.jar!/$1|; $path =~ s|\%|jar:$jarpath.jar!/$1|;
} }
push @manifestLines, $path; push @manifestLines, $path;
@ -539,12 +547,16 @@ start:
# end with blank line # end with blank line
last; last;
} else { } else {
UniqIt("$chromeDir/$jarfile.manifest", @manifestLines); my $manifest = "$chromeDir/$jarfile.manifest";
my $manifest = "$chromeDir/../chrome.manifest" if $useExtensionManifest;
UniqIt($manifest, @manifestLines);
JarIt($chromeDir, $jarfile, $args, $overrides); JarIt($chromeDir, $jarfile, $args, $overrides);
goto start; goto start;
} }
} }
UniqIt("$chromeDir/$jarfile.manifest", @manifestLines); my $manifest = "$chromeDir/$jarfile.manifest";
$manifest = "$chromeDir/../chrome.manifest" if $useExtensionManifest;
UniqIt($manifest, @manifestLines);
JarIt($chromeDir, $jarfile, $args, $overrides); JarIt($chromeDir, $jarfile, $args, $overrides);
} elsif (/^\s*\#.*$/) { } elsif (/^\s*\#.*$/) {

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

@ -1582,24 +1582,6 @@ endif # SDK_BINARY
JAR_MANIFEST := $(srcdir)/jar.mn JAR_MANIFEST := $(srcdir)/jar.mn
ifneq (,$(filter flat symlink,$(MOZ_CHROME_FILE_FORMAT)))
_JAR_REGCHROME_DISABLE_JAR=1
else
_JAR_REGCHROME_DISABLE_JAR=0
endif
ifdef NO_JAR_AUTO_REG
_JAR_AUTO_REG=-a
endif
ifdef LOCALE_SRCDIR
_JAR_LOCALE_SOURCE = -c $(LOCALE_SRCDIR)
endif
ifeq ($(OS_TARGET),WIN95)
_NO_FLOCK=-l
endif
chrome:: chrome::
$(MAKE) realchrome $(MAKE) realchrome
+$(LOOP_OVER_MOZ_DIRS) +$(LOOP_OVER_MOZ_DIRS)
@ -1613,12 +1595,8 @@ ifndef NO_DIST_INSTALL
$(PERL) $(MOZILLA_DIR)/config/preprocessor.pl $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \ $(PERL) $(MOZILLA_DIR)/config/preprocessor.pl $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
$(JAR_MANIFEST) | \ $(JAR_MANIFEST) | \
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-jars.pl \ $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-jars.pl \
$(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \ -d $(FINAL_TARGET)/chrome \
$(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(_NO_FLOCK) $(_JAR_AUTO_REG) \ $(MAKE_JARS_FLAGS) -- "$(XULPPFLAGS) $(DEFINES) $(ACDEFINES)"; \
-f $(MOZ_CHROME_FILE_FORMAT) -d $(FINAL_TARGET)/chrome \
$(_JAR_LOCALE_SOURCE) \
-s $(srcdir) -t $(topsrcdir) -z $(ZIP) -p $(MOZILLA_DIR)/config/preprocessor.pl -- \
"$(XULPPFLAGS) $(DEFINES) $(ACDEFINES)"; \
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-chromelist.pl \ $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-chromelist.pl \
$(FINAL_TARGET)/chrome $(JAR_MANIFEST) $(_NO_FLOCK); \ $(FINAL_TARGET)/chrome $(JAR_MANIFEST) $(_NO_FLOCK); \
fi fi
@ -1632,31 +1610,13 @@ ifndef NO_INSTALL
$(PERL) $(MOZILLA_DIR)/config/preprocessor.pl $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \ $(PERL) $(MOZILLA_DIR)/config/preprocessor.pl $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
$(JAR_MANIFEST) | \ $(JAR_MANIFEST) | \
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-jars.pl \ $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-jars.pl \
$(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \ -d $(DESTDIR)$(mozappdir)/chrome \
$(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(_NO_FLOCK) $(_JAR_AUTO_REG) \ $(MAKE_JARS_FLAGS) -- "$(XULPPFLAGS) $(DEFINES) $(ACDEFINES)"; \
-f $(MOZ_CHROME_FILE_FORMAT) -d $(DESTDIR)$(mozappdir)/chrome \
$(_JAR_LOCALE_SOURCE) \
-s $(srcdir) -t $(topsrcdir) -z $(ZIP) -p $(MOZILLA_DIR)/config/preprocessor.pl -- \
"$(XULPPFLAGS) $(DEFINES) $(ACDEFINES)"; \
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-chromelist.pl \ $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-chromelist.pl \
$(DESTDIR)$(mozappdir)/chrome $(JAR_MANIFEST) $(_NO_FLOCK); \ $(DESTDIR)$(mozappdir)/chrome $(JAR_MANIFEST) $(_NO_FLOCK); \
fi fi
endif endif
ifneq ($(XPI_PKGNAME),)
INSTALL_RDF ?= $(srcdir)/install.rdf
libs realchrome::
@if test -f $(INSTALL_RDF); then \
echo "Packaging $(XPI_PKGNAME).xpi..."; \
$(INSTALL) $(IFLAGS1) $(XPI_INSTALL_EXTRAS) $(INSTALL_RDF) $(FINAL_TARGET); \
cd $(FINAL_TARGET); \
$(ZIP) -qr ../$(XPI_PKGNAME).xpi *; \
else \
echo "$(INSTALL_RDF) not found; not packaging $(XPI_PKGNAME).xpi"; \
fi
endif
ifneq ($(DIST_FILES),) ifneq ($(DIST_FILES),)
libs:: $(DIST_FILES) libs:: $(DIST_FILES)
@$(EXIT_ON_ERROR) \ @$(EXIT_ON_ERROR) \
@ -1677,6 +1637,33 @@ libs:: $(DIST_CHROME_FILES)
done done
endif endif
ifneq ($(XPI_PKGNAME),)
libs realchrome::
@echo "Packaging $(XPI_PKGNAME).xpi..."
cd $(FINAL_TARGET) && $(ZIP) -qr ../$(XPI_PKGNAME).xpi *
endif
ifdef INSTALL_EXTENSION_ID
ifndef XPI_NAME
$(error XPI_NAME must be set for INSTALL_EXTENSION_ID)
endif
libs::
$(RM) -rf "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)"
$(NSINSTALL) -D "$(DIST)/bin/extensions/$(INSTALL_EXTENSION_ID)"
cd $(FINAL_TARGET) && tar $(TAR_CREATE_FLAGS) - * | (cd "../../bin/extensions/$(INSTALL_EXTENSION_ID)" && tar -xf -)
install::
$(NSINSTALL) -D "$(DESTDIR)$(mozappdir)/$(INSTALL_EXTENSION_ID)"
cd $(FINAL_TARGET) && tar $(TAR_CREATE_FLAGS) - * | (cd "$(DESTDIR)$(mozappdir)/extensions/$(INSTALL_EXTENSION_ID) && tar -xf -)
endif
ifneq (,$(filter flat symlink,$(MOZ_CHROME_FILE_FORMAT)))
_JAR_REGCHROME_DISABLE_JAR=1
else
_JAR_REGCHROME_DISABLE_JAR=0
endif
REGCHROME = $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \ REGCHROME = $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \
$(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \ $(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \
$(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(FINAL_TARGET)/chrome/installed-chrome.txt \ $(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(FINAL_TARGET)/chrome/installed-chrome.txt \

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

@ -65,12 +65,6 @@ PACKAGE = $(PKG_BASENAME)$(PKG_SUFFIX)
MAKE_PACKAGE = $(error What is a $(MOZ_PKG_FORMAT) package format?); MAKE_PACKAGE = $(error What is a $(MOZ_PKG_FORMAT) package format?);
TAR_CREATE_FLAGS = -cvhf
ifeq ($(OS_ARCH),BSD_OS)
TAR_CREATE_FLAGS = -cvLf
endif
CREATE_FINAL_TAR = tar -c --owner=0 --group=0 --numeric-owner --mode="go-w" -f CREATE_FINAL_TAR = tar -c --owner=0 --group=0 --numeric-owner --mode="go-w" -f
UNPACK_TAR = tar -x UNPACK_TAR = tar -x
@ -190,7 +184,6 @@ endif
ifeq ($(OS_ARCH),OS2) ifeq ($(OS_ARCH),OS2)
STRIP = $(srcdir)/os2/strip.cmd STRIP = $(srcdir)/os2/strip.cmd
STRIP_FLAGS = STRIP_FLAGS =
TAR_CREATE_FLAGS = -cvf
PLATFORM_EXCLUDE_LIST = ! -name "*.ico" PLATFORM_EXCLUDE_LIST = ! -name "*.ico"
endif endif