2001-07-09 22:49:55 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
2001-07-12 12:31:43 +00:00
|
|
|
#################################################################
|
|
|
|
# Rest of program
|
|
|
|
|
2002-04-01 04:43:40 +00:00
|
|
|
# get requirements from the same dir as the script
|
2002-10-22 04:25:08 +00:00
|
|
|
if ($^O ne "cygwin") {
|
|
|
|
# we'll be pulling in some stuff from the script directory
|
|
|
|
require FindBin;
|
|
|
|
import FindBin;
|
2002-04-01 04:43:40 +00:00
|
|
|
push @INC, $FindBin::Bin;
|
2002-10-22 04:25:08 +00:00
|
|
|
}
|
2002-04-01 04:43:40 +00:00
|
|
|
|
|
|
|
require GenerateManifest;
|
|
|
|
import GenerateManifest;
|
2001-07-09 22:49:55 +00:00
|
|
|
use Getopt::Long;
|
|
|
|
|
|
|
|
# Configuration
|
2002-10-22 04:25:08 +00:00
|
|
|
$win32 = 0;
|
|
|
|
$darwin = 0;
|
|
|
|
for ($^O) {
|
|
|
|
if (/((MS)?win32)|cygwin/i) {
|
|
|
|
$win32 = 1;
|
|
|
|
}
|
|
|
|
elsif (/darwin/i) {
|
|
|
|
$darwin = 1;
|
|
|
|
}
|
|
|
|
}
|
2001-07-09 22:49:55 +00:00
|
|
|
if ($win32) {
|
|
|
|
$moz = "$ENV{'MOZ_SRC'}/mozilla";
|
2001-07-12 12:31:43 +00:00
|
|
|
if ($ENV{'MOZ_DEBUG'}) {
|
|
|
|
$chrome = "$moz/dist/WIN32_D.OBJ/Embed/tmpchrome";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$chrome = "$moz/dist/WIN32_O.OBJ/Embed/tmpchrome";
|
|
|
|
}
|
2001-07-09 22:49:55 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$moz = "~/mozilla";
|
2001-07-12 12:31:43 +00:00
|
|
|
$chrome = "$moz/dist/Embed/tmpchrome";
|
2001-07-09 22:49:55 +00:00
|
|
|
}
|
|
|
|
|
2001-07-12 12:31:43 +00:00
|
|
|
$verbose = 0;
|
2001-07-09 22:49:55 +00:00
|
|
|
$locale = "en-US";
|
2002-04-25 21:25:59 +00:00
|
|
|
$platform = "en-unix";
|
2001-07-09 22:49:55 +00:00
|
|
|
|
2001-07-12 12:31:43 +00:00
|
|
|
GetOptions('verbose!' => \$verbose,
|
|
|
|
'mozpath=s' => \$moz,
|
|
|
|
'manifest=s' => \$manifest,
|
2001-07-09 22:49:55 +00:00
|
|
|
'chrome=s' => \$chrome,
|
|
|
|
'locale=s' => \$locale,
|
|
|
|
'help' => \$showhelp);
|
|
|
|
|
2001-07-12 12:31:43 +00:00
|
|
|
if ($win32) {
|
|
|
|
# Fix those pesky backslashes
|
|
|
|
$moz =~ s/\\/\//g;
|
|
|
|
$chrome =~ s/\\/\//g;
|
2002-04-25 21:25:59 +00:00
|
|
|
$platform = "en-win";
|
|
|
|
}
|
2002-04-25 21:35:40 +00:00
|
|
|
elsif ($darwin) {
|
2002-04-25 21:25:59 +00:00
|
|
|
$platform = "en-mac"
|
2001-07-12 12:31:43 +00:00
|
|
|
}
|
|
|
|
|
2001-07-09 22:49:55 +00:00
|
|
|
if ($showhelp) {
|
2001-07-12 12:31:43 +00:00
|
|
|
print STDERR "Embedding manifest generator.\n",
|
2001-07-09 22:49:55 +00:00
|
|
|
"Usage:\n",
|
|
|
|
" -help Show this help.\n",
|
2001-07-12 12:31:43 +00:00
|
|
|
" -manifest <file> Specify the input manifest.\n",
|
2001-07-09 22:49:55 +00:00
|
|
|
" -mozpath <path> Specify the path to Mozilla.\n",
|
|
|
|
" -chrome <path> Specify the path to the chrome.\n",
|
2001-07-12 12:31:43 +00:00
|
|
|
" -locale <value> Specify the locale to use. (e.g. en-US)\n",
|
|
|
|
" -verbose Print extra information\n";
|
2001-07-09 22:49:55 +00:00
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
2001-07-12 12:31:43 +00: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-04-25 21:25:59 +00:00
|
|
|
GenerateManifest($moz, $manifest, $chrome, $locale, $platform, *STDOUT, "/", $verbose);
|
2001-07-12 12:31:43 +00:00
|
|
|
|
|
|
|
exit 0;
|