2001-07-10 02:49:55 +04:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
2001-07-12 16:31:43 +04:00
|
|
|
#################################################################
|
|
|
|
# Rest of program
|
|
|
|
|
2002-04-01 08:43:40 +04:00
|
|
|
# get requirements from the same dir as the script
|
|
|
|
use FindBin;
|
|
|
|
push @INC, $FindBin::Bin;
|
|
|
|
|
|
|
|
require GenerateManifest;
|
|
|
|
import GenerateManifest;
|
2001-07-10 02:49:55 +04:00
|
|
|
use Getopt::Long;
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
$win32 = ($^O eq "MSWin32") ? 1 : 0; # ActiveState Perl
|
|
|
|
if ($win32) {
|
|
|
|
$moz = "$ENV{'MOZ_SRC'}/mozilla";
|
2001-07-12 16:31:43 +04:00
|
|
|
if ($ENV{'MOZ_DEBUG'}) {
|
|
|
|
$chrome = "$moz/dist/WIN32_D.OBJ/Embed/tmpchrome";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$chrome = "$moz/dist/WIN32_O.OBJ/Embed/tmpchrome";
|
|
|
|
}
|
2001-07-10 02:49:55 +04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$moz = "~/mozilla";
|
2001-07-12 16:31:43 +04:00
|
|
|
$chrome = "$moz/dist/Embed/tmpchrome";
|
2001-07-10 02:49:55 +04:00
|
|
|
}
|
|
|
|
|
2001-07-12 16:31:43 +04:00
|
|
|
$verbose = 0;
|
2001-07-10 02:49:55 +04:00
|
|
|
$locale = "en-US";
|
|
|
|
|
2001-07-12 16:31:43 +04:00
|
|
|
GetOptions('verbose!' => \$verbose,
|
|
|
|
'mozpath=s' => \$moz,
|
|
|
|
'manifest=s' => \$manifest,
|
2001-07-10 02:49:55 +04:00
|
|
|
'chrome=s' => \$chrome,
|
|
|
|
'locale=s' => \$locale,
|
|
|
|
'help' => \$showhelp);
|
|
|
|
|
2001-07-12 16:31:43 +04:00
|
|
|
if ($win32) {
|
|
|
|
# Fix those pesky backslashes
|
|
|
|
$moz =~ s/\\/\//g;
|
|
|
|
$chrome =~ s/\\/\//g;
|
|
|
|
}
|
|
|
|
|
2001-07-10 02:49:55 +04:00
|
|
|
if ($showhelp) {
|
2001-07-12 16:31:43 +04:00
|
|
|
print STDERR "Embedding manifest generator.\n",
|
2001-07-10 02:49:55 +04:00
|
|
|
"Usage:\n",
|
|
|
|
" -help Show this help.\n",
|
2001-07-12 16:31:43 +04:00
|
|
|
" -manifest <file> Specify the input manifest.\n",
|
2001-07-10 02:49:55 +04:00
|
|
|
" -mozpath <path> Specify the path to Mozilla.\n",
|
|
|
|
" -chrome <path> Specify the path to the chrome.\n",
|
2001-07-12 16:31:43 +04:00
|
|
|
" -locale <value> Specify the locale to use. (e.g. en-US)\n",
|
|
|
|
" -verbose Print extra information\n";
|
2001-07-10 02:49:55 +04:00
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
2001-07-12 16:31:43 +04:00
|
|
|
if ($manifest eq "") {
|
|
|
|
die("Error: No input manifest file was specified.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($verbose) {
|
|
|
|
print STDERR "Mozilla path = \"$moz\"\n",
|
|
|
|
"Chrome path = \"$chrome\"\n",
|
|
|
|
"Manifest file = \"$manifest\"\n";
|
|
|
|
}
|
|
|
|
|
2002-03-14 17:53:55 +03:00
|
|
|
GenerateManifest($moz, $manifest, $chrome, $locale, *STDOUT, "/", $verbose);
|
2001-07-12 16:31:43 +04:00
|
|
|
|
|
|
|
exit 0;
|