diff --git a/mozilla/build/mac/build_scripts/BuildMozilla.pl b/mozilla/build/mac/build_scripts/BuildMozilla.pl index 260cbd188eb..24ffc05433a 100644 --- a/mozilla/build/mac/build_scripts/BuildMozilla.pl +++ b/mozilla/build/mac/build_scripts/BuildMozilla.pl @@ -44,14 +44,13 @@ $DEBUG = 0; $CARBON = 0; # turn on to build with TARGET_CARBON $PROFILE = 0; $GC_LEAK_DETECTOR = 0; # turn on to use GC leak detection -$INCLUDE_CLASSIC_SKIN = 1; #----------------------------------------------- # configuration variables that affect the manner # of building, but possibly affecting # the outcome. #----------------------------------------------- -$DIST_DIRECTORY = ":mozilla:dist:viewer:"; +$BIN_DIRECTORY = ":mozilla:dist:viewer:"; $ALIAS_SYM_FILES = $DEBUG; $CLOBBER_LIBS = 1; # turn on to clobber existing libs and .xSYM files before diff --git a/mozilla/build/mac/build_scripts/BuildMozillaDebug.pl b/mozilla/build/mac/build_scripts/BuildMozillaDebug.pl index 8d946ceab3e..1c5e30f205a 100644 --- a/mozilla/build/mac/build_scripts/BuildMozillaDebug.pl +++ b/mozilla/build/mac/build_scripts/BuildMozillaDebug.pl @@ -42,16 +42,15 @@ my(%optiondefines); #----------------------------------------------- $DEBUG = 1; $CARBON = 0; # turn on to build with TARGET_CARBON -$PROFILE = 0; +$PROFILE = 1; $GC_LEAK_DETECTOR = 0; # turn on to use GC leak detection -$INCLUDE_CLASSIC_SKIN = 1; #----------------------------------------------- # configuration variables that affect the manner # of building, but possibly affecting # the outcome. #----------------------------------------------- -$DIST_DIRECTORY = ":mozilla:dist:viewer_debug:"; +$BIN_DIRECTORY = ":mozilla:dist:viewer_debug:"; $ALIAS_SYM_FILES = $DEBUG; $CLOBBER_LIBS = 1; # turn on to clobber existing libs and .xSYM files before diff --git a/mozilla/build/mac/build_scripts/CodeWarriorLib.pm b/mozilla/build/mac/build_scripts/CodeWarriorLib.pm index 76fc7918f89..f6d265cf062 100644 --- a/mozilla/build/mac/build_scripts/CodeWarriorLib.pm +++ b/mozilla/build/mac/build_scripts/CodeWarriorLib.pm @@ -27,6 +27,7 @@ Replaces the AppleScript library I. use strict; use Cwd; use Mac::Types; +use Mac::Events; use Mac::AppleEvents; use Mac::AppleEvents::Simple; use Mac::Processes; @@ -38,7 +39,7 @@ use vars qw($VERSION); $VERSION = '1.02'; my($app) = 'CWIE'; -my($scriptDir) = cwd(); +my($scriptDir) = cwd(); # could use $0 for this # 0 == don't switch CWIE to front app in do_event(), 1 == do switch # note: activate() still switches when called @@ -165,6 +166,57 @@ sub build_project ($;$$$) { return($had_errors); } +=pod + +=item appIsRunning() + +=cut +sub _appIsRunning($) +{ + my ($appSignature) = @_; + my ($psi); + my ($found) = 0; + my ($appPSN); + + foreach $psi (values(%Process)) + { + if ($psi->processSignature() eq $appSignature) + { + $appPSN = $psi->processNumber(); + $found = 1; + last; + } + } + + return $found; +} + +=pod + +=item appIsFrontmost() + +=cut +sub _appIsFrontmost($) +{ + my ($appSignature) = @_; + my ($psi); + my ($found) = 0; + my ($appPSN); + + foreach $psi (values(%Process)) + { + if ($psi->processSignature() eq $appSignature) + { + $appPSN = $psi->processNumber(); + $found = 1; + last; + } + } + + return (GetFrontProcess() == $appPSN); +} + + =pod =item activate() @@ -253,12 +305,66 @@ sub activate () { launchAppSpec => $appath, launchControlFlags => launchContinue() + launchNoFileFlags() ); - unless (LaunchApplication($lp)) { - unlink($filepath); - die $^E; - } + + unless (LaunchApplication($lp)) { + unlink($filepath); + die $^E; + } + + # wait for CodeWarrior to show up in the list of processes + while (!_appIsRunning('CWIE')) + { + WaitNextEvent(); + } + + # wait for CodeWarrior to come to the front + while (!_appIsFrontmost('CWIE')) + { + WaitNextEvent(); + } } +=pod + +=item getCodeWarriorPath() + +Returns a file path relative to the CodeWarrior folder + +=cut + +sub getCodeWarriorPath($) +{ + my($subfolder)=@_; + + my($app_path) = _read_appath(":idepath.txt"); + if ($app_path eq "") { die "Error: Failed to get CodeWarrior IDE path\n"; } + + my($codewarrior_root) = $app_path; + $codewarrior_root =~ s/[^:]*$//; + return ($codewarrior_root . $subfolder); +} + + +=pod + +=item getCodeWarriorIDEName() + +Returns the name of the CodeWarrior application + +=cut + +sub getCodeWarriorIDEName() +{ + my($subfolder)=@_; + + my($app_path) = _read_appath(":idepath.txt"); + if ($app_path eq "") { die "Error: Failed to get CodeWarrior IDE path\n"; } + + my(@codewarrior_path) = split(/:/, $app_path); + return pop(@codewarrior_path); +} + + =pod =item quit() diff --git a/mozilla/build/mac/build_scripts/MacCVS.pm b/mozilla/build/mac/build_scripts/MacCVS.pm index 854d59df0e3..ec4fc0530d7 100644 --- a/mozilla/build/mac/build_scripts/MacCVS.pm +++ b/mozilla/build/mac/build_scripts/MacCVS.pm @@ -20,6 +20,8 @@ use File::Basename; @EXPORT = qw( new print checkout); $VERSION = "1.00"; +my($last_error) = 0; + # Architecture: # cvs session object: # name - session name @@ -39,14 +41,25 @@ sub _myDoAppleScript($) { my($script) = @_; my $asresult = MacPerl::DoAppleScript($script); + if ($asresult eq "0") { return 1; } else { - print STDERR "AppleScript error: $asresult\n"; - print STDERR "AppleScript was: \n $script \n"; + my($error_string) = "Unknown error"; + my($error_code) = 0; + + if ($asresult =~ /^\"(.*)\.([0-9]+)\"$/) + { + $error_string = $1; + $error_code = $2; + } + + print STDERR "Error. Script returned '$error_string (error $error_code)\n"; + # print STDERR "AppleScript was: \n $script \n"; + $last_error = $error_code; return 0; } } @@ -95,7 +108,8 @@ sub _useMacCVSLib() # Session object methods # -sub new { +sub new +{ my ( $proto, $session_file) = @_; my $class = ref($proto) || $proto; my $self = {}; @@ -116,10 +130,14 @@ sub new { # makes sure that the session is open # assertSessionOpen() -# returns 1 on failure -sub assertSessionOpen() { +# returns 1 on success +sub assertSessionOpen() +{ my ($self) = shift; _useMacCVSLib() || die "Could not load MacCVSLib\n"; + + $last_error = 0; + my $script = <{session_file}") END_OF_APPLESCRIPT @@ -127,21 +145,25 @@ END_OF_APPLESCRIPT } # prints the cvs object, used mostly for debugging -sub print { +sub print +{ my($self) = shift; + $last_error = 0; print "MacCVS:: name: ", $self->{name}, " session file: ", $self->{session_file}, "\n"; } # checkout( self, module, revision, date) # MacCVS checkout command -# returns 1 on failure -sub checkout +# returns 1 on success. +sub checkout() { my($self, $module, $revision, $date ) = @_; unless( defined ($module) ) { $module = ""; } # get rid of the pesky undefined warnings unless( defined ($revision) ) { $revision = ""; } unless( defined ($date) ) { $date = ""; } + $last_error = 0; + $self->assertSessionOpen() || return 1; my($revstring) = ($revision ne "") ? $revision : "(none)"; @@ -155,6 +177,11 @@ END_OF_APPLESCRIPT return _myDoAppleScript($script); } +sub getLastError() +{ + return $last_error; +} + 1; =pod diff --git a/mozilla/build/mac/build_scripts/Moz.pm b/mozilla/build/mac/build_scripts/Moz.pm index b7affbc17b1..9d5cc768468 100644 --- a/mozilla/build/mac/build_scripts/Moz.pm +++ b/mozilla/build/mac/build_scripts/Moz.pm @@ -37,7 +37,7 @@ use Mac::Processes; use File::Copy; @ISA = qw(Exporter); -@EXPORT = qw(current_directory full_path_to BuildProject BuildProjectClean OpenErrorLog MakeAlias StopForErrors DontStopForErrors InstallFromManifest InstallResources SetBuildNumber SetAgentString SetTimeBomb Delay ActivateApplication IsProcessRunning); +@EXPORT = qw(LaunchCodeWarrior current_directory full_path_to BuildProject BuildProjectClean OpenErrorLog MakeAlias StopForErrors DontStopForErrors InstallFromManifest InstallResources SetBuildNumber SetAgentString SetTimeBomb Delay ActivateApplication IsProcessRunning); @EXPORT_OK = qw(CloseErrorLog UseCodeWarriorLib QUIET); use Cwd; @@ -402,10 +402,11 @@ sub InstallResources($;$;$) } - sub SetBuildNumber - { - - open (OUTPUT, ">:mozilla:config:build_number") || die "could not open buildnumber"; +sub SetBuildNumber($$$) +{ + my($build_num_file, $build_gen_script, $files_to_touch) = @_; + + open (OUTPUT, ">$build_num_file") || die "could not open buildnumber"; open (BDATE, "perl :mozilla:config:bdate.pl|"); @@ -416,10 +417,12 @@ sub InstallResources($;$;$) close (BDATE); close (OUTPUT); - - - system ("perl :mozilla:config:aboutime.pl :mozilla:xpfe:appshell:public:nsBuildID.h :mozilla:config:build_number"); - system ("perl :mozilla:config:aboutime.pl :mozilla:xpfe:browser:resources:locale:en-US:navigator.dtd :mozilla:config:build_number"); + my($file); + foreach $file (@$files_to_touch) + { + print "Writing build number to $file\n"; + system ("perl $build_gen_script $file $build_num_file"); + } } sub SetAgentString @@ -478,6 +481,20 @@ sub Delay($) } +sub GetFileModDate($) +{ + my($filePath)=@_; + my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, + $atime,$mtime,$ctime,$blksize,$blocks) = stat($filePath); + return $mtime; +} + + +sub LaunchCodeWarrior() +{ + # this both launches and writes idepath.txt + CodeWarriorLib::activate(); +} #//-------------------------------------------------------------------------------------------------- #// ActivateApplication @@ -490,29 +507,28 @@ sub ActivateApplication($) my ($appPSN); $found = 0; - + foreach $psi (values(%Process)) { if ($psi->processSignature() eq $appSignature) { $appPSN = $psi->processNumber(); $found = 1; - last; + last; } } - if ($found == 0) + if ($found == 0 || SameProcess($appPSN, GetFrontProcess())) { return; } - + SetFrontProcess($appPSN); while (GetFrontProcess() != $appPSN) { WaitNextEvent(); } - } #//-------------------------------------------------------------------------------------------------- diff --git a/mozilla/build/mac/build_scripts/MozBuildFlags.pm b/mozilla/build/mac/build_scripts/MozBuildFlags.pm index 884f8c232ad..cea7683337c 100644 --- a/mozilla/build/mac/build_scripts/MozBuildFlags.pm +++ b/mozilla/build/mac/build_scripts/MozBuildFlags.pm @@ -61,8 +61,9 @@ my(@build_flags) = my(@options_flags) = ( - ["jar_manifests", 0], # use jar.mn files for resources, not MANIFESTs - ["jars", 0], # build jar files + ["chrome_jars", 1], # build jar files + ["chrome_files", 0], # build chrome files + ["use_jars", 1], # build chrome files ["transformiix", 0], # obsolete? ["mathml", 0], ["svg", 0], @@ -70,7 +71,7 @@ my(@options_flags) = ["ldap", 0], ["xmlextras", 0], ["mailextras", 1], # mail importers - ["xptlink", 0] # xpt linker codewarrior plugin + ["xptlink", 0] # link xpt files using the MPW tool ); @@ -191,9 +192,9 @@ sub SetupBuildParams($$$$$) PropagateAllFlags(\@build_flags); - SetPullFlags($pull); - SetBuildFlags($build); - SetBuildOptions($options); + SetPullFlags($pull); + SetBuildFlags($build); + SetBuildOptions($options); SetOptionDefines($optiondefines); #printHash($build); diff --git a/mozilla/build/mac/build_scripts/MozBuildUtils.pm b/mozilla/build/mac/build_scripts/MozBuildUtils.pm index a2ec98f2456..7c8c597d5b7 100644 --- a/mozilla/build/mac/build_scripts/MozBuildUtils.pm +++ b/mozilla/build/mac/build_scripts/MozBuildUtils.pm @@ -10,21 +10,31 @@ require Exporter; use strict; use Exporter; +use Mac::Events; +use Mac::StandardFile; + use Moz; use vars qw(@ISA @EXPORT); @ISA = qw(Exporter); -@EXPORT = qw(GetDistDirectory BuildOneProject BuildIDLProject AskAndPersistFile DelayFor EmptyTree); +@EXPORT = qw(GetBinDirectory + BuildOneProject + BuildIDLProject + BuildFolderResourceAliases + AskAndPersistFile + DelayFor + EmptyTree + SetupBuildLog); #-------------------------------------------------------------------------------------------------- -# GetDistDirectory +# GetBinDirectory #-------------------------------------------------------------------------------------------------- -sub GetDistDirectory() +sub GetBinDirectory() { - if ($main::DIST_DIRECTORY eq "") { die "Dist directory not set\n"; } - return $main::DIST_DIRECTORY; + if ($main::BIN_DIRECTORY eq "") { die "Dist directory not set\n"; } + return $main::BIN_DIRECTORY; } #-------------------------------------------------------------------------------------------------- @@ -114,7 +124,7 @@ sub BuildOneProject($$$$$) # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); # Put libraries in "Essential Files" folder, Components in "Components" folder my($component_dir) = $component ? "Components:" : "Essential Files:"; @@ -134,6 +144,37 @@ sub BuildOneProject($$$$$) $alias_xSYM ? MakeAlias("$project_dir$target_name.xSYM", "$dist_dir$component_dir") : 0; } + +#//-------------------------------------------------------------------------------------------------- +#// Make resource aliases for one directory +#//-------------------------------------------------------------------------------------------------- + +sub BuildFolderResourceAliases($$) +{ + my($src_dir, $dest_dir) = @_; + + # get a list of all the resource files + opendir(SRCDIR, $src_dir) || die("can't open $src_dir"); + my(@resource_files) = readdir(SRCDIR); + closedir(SRCDIR); + + # make aliases for each one into the dest directory + print("Placing aliases to all files from $src_dir in $dest_dir\n"); + for ( @resource_files ) + { + next if $_ eq "CVS"; + #print(" Doing $_\n"); + if (-l $src_dir.$_) + { + print(" $_ is an alias\n"); + next; + } + my($file_name) = $src_dir . $_; + MakeAlias($file_name, $dest_dir); + } +} + + #//-------------------------------------------------------------------------------------------------- #// DelayFor #// @@ -158,7 +199,9 @@ sub DelayFor($) { print "."; $last_time = $cur_time; - } + } + + WaitNextEvent(); } STDOUT->autoflush(0); @@ -205,4 +248,32 @@ sub EmptyTree($) } +#----------------------------------------------- +# SetupBuildLog +#----------------------------------------------- +sub SetupBuildLog($) +{ + my($timestamped_log) = @_; + + if ($timestamped_log) + { + #Use time-stamped names so that you don't clobber your previous log file! + my $now = localtime(); + while ($now =~ s@:@.@) {} # replace all colons by periods + my $logdir = ":Build Logs:"; + if (!stat($logdir)) + { + print "Creating directory $logdir\n"; + mkdir $logdir, 0777 || die "Couldn't create directory $logdir"; + } + OpenErrorLog("$logdir$now"); + } + else + { + OpenErrorLog("NGLayoutBuildLog"); # Release build + #OpenErrorLog("Mozilla.BuildLog"); # Tinderbox requires that name + } +} + + 1; diff --git a/mozilla/build/mac/build_scripts/MozJar.pm b/mozilla/build/mac/build_scripts/MozJar.pm index a6fbaf1469d..e697409474c 100644 --- a/mozilla/build/mac/build_scripts/MozJar.pm +++ b/mozilla/build/mac/build_scripts/MozJar.pm @@ -20,7 +20,7 @@ use Moz; use vars qw( @ISA @EXPORT ); @ISA = qw(Exporter); -@EXPORT = qw(CreateJarFileFromDirectory WriteOutJarFiles); +@EXPORT = qw(CreateJarFileFromDirectory WriteOutJarFiles SanityCheckJarOptions); #------------------------------------------------------------------------------- @@ -99,6 +99,78 @@ sub CreateJarFileFromDirectory($$$) } +#------------------------------------------------------------------------------- +# SanityCheckJarOptions +# +#------------------------------------------------------------------------------- +sub SanityCheckJarOptions() +{ + if (!$main::options{chrome_jars} && !$main::options{chrome_files}) + { + print "Both \$options{chrome_jars} and \$options{chrome_files} are off. You won't get any chrome.\n"; + return; + } + + if (!$main::options{chrome_jars} && $main::options{use_jars}) + { + print "\$options{chrome_jars} is off but \$options{use_jars} is on. Your build won't run (expects jars, got files).\n"; + return; + } + + if (!$main::options{chrome_files} && !$main::options{use_jars}) + { + print "\$options{chrome_jars} is off but \$options{chrome_files} is on. Your build won't run (expects files, got jars).\n"; + return; + } +} + + +#------------------------------------------------------------------------------- +# printZipContents +# +#------------------------------------------------------------------------------- +sub printZipContents($) +{ + my($zip) = @_; + + my(@members) = $zip->memberNames(); + + print "Zip contains:\n"; + + my($member); + foreach $member (@members) + { + print " $member\n"; + } +} + + +#------------------------------------------------------------------------------- +# safeSaveJarFile +# +# Archive::Zip has a problem where you cannot save a zip file on top of +# an existing zip file that it has open, because it holds references +# into that zip. So we have to save to a temp file, then do a swap. +# +# Note that the zip will become invalid after this operation. +# If you want to do further operations on it, you'll have to reread it. +#------------------------------------------------------------------------------- +sub safeSaveJarFile($$) +{ + my($zip, $full_dest_path) = @_; + + my($temp_file_name) = $full_dest_path."_temp"; + + ($zip->writeToFileNamed($temp_file_name) == Archive::Zip::AZ_OK) || die "Error writing jar to temp file $temp_file_name\n"; + + unlink $full_dest_path; + + (rename $temp_file_name, $full_dest_path) || die "Failed to rename $temp_file_name\n"; + + MacPerl::SetFileInfo("ZIP ", "ZIP ", $full_dest_path); +} + + #------------------------------------------------------------------------------- # addToJarFile # @@ -114,9 +186,9 @@ sub CreateJarFileFromDirectory($$$) # #------------------------------------------------------------------------------- -sub addToJarFile($$$$$$) +sub addToJarFile($$$$$$$) { - my($jar_id, $jar_man_dir, $file_src, $jar_path, $file_jar_path, $jars) = @_; + my($jar_id, $jar_man_dir, $file_src, $jar_path, $file_jar_path, $override, $jars) = @_; # print "addToJarFile with:\n $jar_man_dir\n $file_src\n $jar_path\n $file_jar_path\n"; @@ -141,13 +213,12 @@ sub addToJarFile($$$$$$) } } - if ($main::options{jars}) + if ($main::options{chrome_jars}) { my($zip) = $jars->{$jar_id}; unless ($zip) { die "Can't find Zip entry for $jar_id\n"; } # print "Adding $file_src to jar file $jar_path at $file_jar_path\n"; - my($member) = Archive::Zip::Member->newFromFile($src); unless ($member) { die "Failed to create zip file member $src\n"; } @@ -156,13 +227,51 @@ sub addToJarFile($$$$$$) my($compress) = 1; if ($compress) { $member->desiredCompressionMethod(Archive::Zip::COMPRESSION_DEFLATED); + $member->desiredCompressionLevel(Archive::Zip::COMPRESSION_LEVEL_DEFAULT); # defaults to 6 } else { $member->desiredCompressionMethod(Archive::Zip::COMPRESSION_STORED); } - $zip->addMember($member); + my($old_member) = $zip->memberNamed($file_jar_path); + + if ($override) + { + if ($old_member) + { + # print "Overriding $file_jar_path in jar file $jar_id\n"; + # need to compare mod dates or use the + here + $zip->removeMember($old_member); + } + + $zip->addMember($member); + } + else + { + if ($old_member) + { + #compare dates here + my($member_moddate) = $old_member->lastModTime(); + my($file_moddate) = GetFileModDate($src); + + if ($file_moddate > $member_moddate) + { + print "Updating older file $file_jar_path in $jar_id\n"; + $zip->removeMember($old_member); + $zip->addMember($member); + } + else + { + print "File $file_jar_path in $jar_id is more recent. Not updating.\n"; + } + } + else + { + $zip->addMember($member); + } + } } - else # copy file + + if ($main::options{chrome_files}) # we install raw files too { my($rel_path) = $file_jar_path; $rel_path =~ s|/|:|g; # slash to colons @@ -173,7 +282,37 @@ sub addToJarFile($$$$$$) my($dst) = $target_dir.$dir_name.":".$rel_path; # print "Aliassing $src\n to\n$dst\n"; + if ($override) + { + unlink $dst; MakeAlias($src, $dst); # don't check errors, otherwise we fail on replacement + } + else + { + if (-e $dst) + { + #compare dates here + my($dst_moddate) = GetFileModDate($dst); + my($file_moddate) = GetFileModDate($src); + + if ($file_moddate > $dst_moddate) + { + print "Updating older file $rel_path in $dir_name\n"; + unlink $dst; + MakeAlias($src, $dst); + } + else + { + print "File $file_jar_path in $jar_id is more recent. Not updating.\n"; + } + + } + else + { + MakeAlias($src, $dst); + } + } + } } @@ -186,17 +325,31 @@ sub addToJarFile($$$$$$) sub setupJarFile($$$) { - my($jar_id, $jar_path, $jar_hash) = @_; + my($jar_id, $dest_path, $jar_hash) = @_; # print "Creating jar file $jar_id at $jar_path\n"; - if ($main::options{jars}) + my($jar_file) = $jar_id; + $jar_file =~ s|/|:|g; # slash to colons + my($full_jar_path) = Moz::full_path_to($dest_path.":".$jar_file); + + if ($main::options{chrome_jars}) { my($zip) = $jar_hash->{$jar_id}; if (!$zip) # if we haven't made it already, do so { my($zip) = Archive::Zip->new(); $jar_hash->{$jar_id} = $zip; + + # does the jar file exist already? If so, read it in + if (-e $full_jar_path) + { + print "Reading in jar file $jar_id\n"; + if ($zip->read($full_jar_path) != Archive::Zip::AZ_OK) { die "Failed to re-read $full_jar_path\n"; } + + # printZipContents($zip); + } + } } else @@ -222,7 +375,7 @@ sub closeJarFile($$) # print "Closing jar file $jar_path\n"; - if ($main::options{jars}) + if ($main::options{chrome_jars}) { } @@ -243,7 +396,7 @@ sub WriteOutJarFiles($$) { my($chrome_dir, $jars) = @_; - unless ($main::options{jars}) { return; } + unless ($main::options{chrome_jars}) { return; } my($full_chrome_path) = Moz::full_path_to($chrome_dir); @@ -261,12 +414,13 @@ sub WriteOutJarFiles($$) # ensure the target dirs exist my($path) = $output_path; - $path =~ s/\.jar$//; + $path =~ s/[^:]+$//; mkpath($path); - ($zip->writeToFileNamed($output_path) == Archive::Zip::AZ_OK) || die "Error writing jar $rel_path\n"; - - MacPerl::SetFileInfo("ZIP ", "ZIP ", $output_path); + # unlink $output_path; # remove any existing jar + safeSaveJarFile($zip, $output_path); + # $zip is invalid after this operation, so nuke it here + $jars->{$key} = 0; } } @@ -276,43 +430,48 @@ sub WriteOutJarFiles($$) # # Enter a chrome package into the installed-chrome.txt file #------------------------------------------------------------------------------- -sub registerChromePackage($$$$) +sub registerChromePackage($$$$$$) { - my($jar_file, $file_path, $chrome_dir, $jar_hash) = @_; + my($jar_file, $file_path, $chrome_dir, $jar_hash, $chrome_type, $pkg_name) = @_; my($manifest_subdir) = $jar_file; $manifest_subdir =~ s/:/\//g; my($chrome_entry); - if ($main::options{jars}) { - $chrome_entry = ",install,url,jar:resource:/Chrome/"; - $manifest_subdir.= "!/"; + if ($main::options{use_jars}) { + $chrome_entry = "$chrome_type,install,url,jar:resource:/chrome/$manifest_subdir!/$chrome_type/$pkg_name"; } else { - $chrome_entry = ",install,url,resource:/Chrome/"; - $manifest_subdir =~ s/\.jar$/\//; + $manifest_subdir =~ s/\.jar$//; + $chrome_entry = "$chrome_type,install,url,resource:/chrome/$manifest_subdir/$chrome_type/$pkg_name"; } - # print "Entering $chrome_entry$manifest_subdir in installed-chrome.txt\n"; - - # for now, regiser for content, locale and skin - # we'll get the type from the path soon - my($type) = "content"; + # print "Entering $chrome_entry in installed-chrome.txt\n"; # ensure chrome_dir exists mkpath($chrome_dir); my($inst_chrome) = ${chrome_dir}.":installed-chrome.txt"; + if (open(CHROMEFILE, "<$inst_chrome")) { + while () { + chomp; + if ($_ eq $chrome_entry) { + # $chrome_entry already appears in installed-chrome.txt file + # just update the mod date + my $now = time; + utime($now, $now, $inst_chrome) || die "couldn't touch $inst_chrome"; + print "+++ updating chrome $inst_chrome\n+++\t\t$chrome_entry\n"; + close(CHROMEFILE) || die "error: can't close $inst_chrome: $!"; + return 0; + } + } + close(CHROMEFILE) || die "error: can't close $inst_chrome: $!"; + } open(CHROMEFILE, ">>${inst_chrome}") || die "Failed to open $inst_chrome\n"; - - print(CHROMEFILE "${type}${chrome_entry}${manifest_subdir}\n"); - $type = "locale"; - print(CHROMEFILE "${type}${chrome_entry}${manifest_subdir}\n"); - $type = "skin"; - print(CHROMEFILE "${type}${chrome_entry}${manifest_subdir}\n"); - - close(CHROMEFILE); + print(CHROMEFILE "${chrome_entry}\n"); + close(CHROMEFILE) || die "Failed to close $inst_chrome\n"; + print "+++ adding chrome $inst_chrome\n+++\t\t$chrome_entry\n"; } #------------------------------------------------------------------------------- @@ -325,9 +484,10 @@ sub CreateJarFromManifest($$$) { my($jar_man_path, $dest_path, $jars) = @_; - if ($main::options{jars}) { + if ($main::options{chrome_jars}) { print "Jarring from $jar_man_path\n"; - } else { + } + if ($main::options{chrome_files}) { print "Installing files from $jar_man_path\n"; } @@ -337,7 +497,7 @@ sub CreateJarFromManifest($$$) # if the jars hash is empty, nuke installed-chrome.txt if (! scalar(%$jars)) { - print "Nuking chrome\n"; + print "Nuking installed-chrome.txt\n"; my($installed_chrome) = $dest_path.":installed-chrome.txt"; # unlink $installed_chrome; } @@ -370,20 +530,21 @@ sub CreateJarFromManifest($$$) next; } - if ($line =~/^([\w\d.\-\\\/]+)\:\s*$/) # line start jar file entries + if ($line =~/^([\w\d.\-\_\\\/]+)\:\s*$/) # line start jar file entries { $jar_id = $1; $jar_file = $jar_id; $jar_file =~ s|/|:|g; # slash to colons $full_jar_path = $dest_path.":".$jar_file; - setupJarFile($jar_id, $full_jar_path, $jars); + setupJarFile($jar_id, $dest_path, $jars); } - elsif ($line =~ /^\s+([\w\d.\-\\\/]+)\s*(\([\w\d.\-\\\/]+\))?$\s*/) # jar file entry + elsif ($line =~ /^(\+?)\s+([\w\d.\-\_\\\/]+)\s*(\([\w\d.\-\_\\\/]+\))?$\s*/) # jar file entry { - my($file_dest) = $1; - my($file_src) = $2; + my($override) = ($1 eq "+"); + my($file_dest) = $2; + my($file_src) = $3; if ($file_src) { $file_src = substr($file_src, 1, -1); #strip the () @@ -395,12 +556,14 @@ sub CreateJarFromManifest($$$) if ($jar_file ne "") # if jar is open, add to jar { - if ($file_dest eq "manifest.rdf") # will change to contents.rdf + if ($file_dest =~ /([\w\d.\-\_]+)\/([\w\d.\-\_\\\/]+)contents.rdf/) { - registerChromePackage($jar_file, $file_dest, $dest_path, $jars); + my $chrome_type = $1; + my $pkg_name = $2; + registerChromePackage($jar_file, $file_dest, $dest_path, $jars, $chrome_type, $pkg_name); } - addToJarFile($jar_id, $jar_man_dir, $file_src, $full_jar_path, $file_dest, $jars); + addToJarFile($jar_id, $jar_man_dir, $file_src, $full_jar_path, $file_dest, $override, $jars); } else { diff --git a/mozilla/build/mac/build_scripts/MozillaBuildList.pm b/mozilla/build/mac/build_scripts/MozillaBuildList.pm index bd6f0c2de2c..64fe1ea6d15 100644 --- a/mozilla/build/mac/build_scripts/MozillaBuildList.pm +++ b/mozilla/build/mac/build_scripts/MozillaBuildList.pm @@ -8,7 +8,6 @@ use strict; use vars qw( @ISA @EXPORT ); # perl includes -use Mac::StandardFile; use Mac::Processes; use Mac::Events; use Mac::Files; @@ -52,97 +51,10 @@ sub assertRightDirectory() unless (-e ":mozilla") { my($dir) = cwd(); - print STDERR "NGLayoutBuildList called from incorrect directory: $dir"; + print STDERR "MozillaBuildList called from incorrect directory: $dir"; } } -#//-------------------------------------------------------------------------------------------------- -#// InstallManifestRDF -#//-------------------------------------------------------------------------------------------------- - -sub InstallManifestRDF($$$$) -{ - my($src, $manifest_subdir, $type, $building_jars) = @_; - - my($dist_dir) = getDistDirectory(); - my $chrome_subdir = "Chrome:"; - my $chrome_dir = "$dist_dir" . $chrome_subdir; - - my($manifest_path) = $chrome_dir.$manifest_subdir; - - print "Installing manifest.rdf file in ".$manifest_path."\n"; - - MakeAlias($src, "$manifest_path"); - - open(CHROMEFILE, ">>${chrome_dir}installed-chrome.txt"); - - $manifest_subdir =~ tr(:)(/); - - if ($building_jars) - { - # remove trailing / from subdir - $manifest_subdir =~ s/\/$//; - print(CHROMEFILE "${type},install,url,jar:resource:/Chrome/${manifest_subdir}.jar!/\n"); - } - else - { - print(CHROMEFILE "${type},install,url,resource:/Chrome/${manifest_subdir}\n"); - } - - close(CHROMEFILE); -} - - -#//-------------------------------------------------------------------------------------------------- -#// InstallManifestRDFFiles Install manifest.rdf files and build installed_chrome.txt -#//-------------------------------------------------------------------------------------------------- - -sub InstallManifestRDFFiles() -{ - unless( $main::build{resources} ) { return; } - - my($dist_dir) = getDistDirectory(); - - my $chrome_subdir = "Chrome:"; - my $chrome_dir = "$dist_dir" . $chrome_subdir; - - my($building_jars) = $main::options{jars}; - - # nuke installed-chrome.txt - unlink ${chrome_dir}."installed-chrome.txt"; - - # install manifest RDF files - InstallManifestRDF(":mozilla:extensions:irc:xul:manifest.rdf", "packages:chatzilla:", "content", $building_jars); - InstallManifestRDF(":mozilla:extensions:irc:xul:manifest.rdf", "packages:chatzilla:", "locale", $building_jars); - InstallManifestRDF(":mozilla:extensions:irc:xul:manifest.rdf", "packages:chatzilla:", "skin", $building_jars); - - InstallManifestRDF(":mozilla:extensions:cview:resources:manifest.rdf", "packages:cview:", "content", $building_jars); - InstallManifestRDF(":mozilla:extensions:cview:resources:manifest.rdf", "packages:cview:", "locale", $building_jars); - InstallManifestRDF(":mozilla:extensions:cview:resources:manifest.rdf", "packages:cview:", "skin", $building_jars); - - if ($main::options{transformiix}) - { - my($transformiix_manifest) = ":mozilla:extensions:transformiix:source:examples:mozilla:transformiix:manifest.rdf"; - InstallManifestRDF($transformiix_manifest, "packages:transformiix:", "content", $building_jars); - InstallManifestRDF($transformiix_manifest, "packages:transformiix:", "locale", $building_jars); - InstallManifestRDF($transformiix_manifest, "packages:transformiix:", "skin", $building_jars); - } - - InstallManifestRDF(":mozilla:themes:classic:manifest.rdf", "skins:classic:", "skin", $building_jars); - InstallManifestRDF(":mozilla:themes:blue:manifest.rdf", "skins:blue:", "skin", $building_jars); - InstallManifestRDF(":mozilla:themes:modern:manifest.rdf", "skins:modern:", "skin", $building_jars); - - InstallManifestRDF(":mozilla:xpfe:communicator:resources:content:manifest.rdf", "packages:core:", "content", $building_jars); - InstallManifestRDF(":mozilla:xpfe:global:resources:content:manifest.rdf", "packages:widget-toolkit:", "content", $building_jars); - InstallManifestRDF(":mozilla:mailnews:base:resources:content:manifest.rdf", "packages:messenger:", "content", $building_jars); - - InstallManifestRDF(":mozilla:xpfe:communicator:resources:locale:en-US:manifest.rdf", "locales:en-US:", "locale", $building_jars); - - InstallManifestRDF(":mozilla:l10n:langpacks:en-DE:chrome:en-DE:manifest.rdf", "locales:en-DE:", "locale", $building_jars); - -} - - #//-------------------------------------------------------------------------------------------------- #// Configure Build System #//-------------------------------------------------------------------------------------------------- @@ -150,7 +62,7 @@ sub InstallManifestRDFFiles() my($UNIVERSAL_INTERFACES_VERSION) = 0x0320; -sub _genBuildSystemInfo() +sub GenBuildSystemInfo() { # always rebuild the configuration program. BuildProjectClean(":mozilla:build:mac:tools:BuildSystemInfo:BuildSystemInfo.mcp", "BuildSystemInfo"); @@ -181,20 +93,25 @@ sub _genBuildSystemInfo() sub ConfigureBuildSystem() { #// In the future, we may want to do configurations based on the actual build system itself. - #// _genBuildSystemInfo(); + #// GenBuildSystemInfo(); + # launch codewarrior and write idepath.txt. This is required for getCodeWarriorPath() to work. + LaunchCodeWarrior(); + + SanityCheckJarOptions(); + #// For now, if we discover a newer header file than existed in Universal Interfaces 3.2, #// we'll assume that 3.3 or later is in use. - my($universal_interfaces) = getCodeWarriorPath("MacOS Support:Universal:Interfaces:CIncludes:"); + my($universal_interfaces) = CodeWarriorLib::getCodeWarriorPath("MacOS Support:Universal:Interfaces:CIncludes:"); if (-e ($universal_interfaces . "ControlDefinitions.h")) { $UNIVERSAL_INTERFACES_VERSION = 0x0330; } #// Rename IC SDK folder in the Mac OS Support folder - my($ic_sdk_folder) = getCodeWarriorPath("MacOS Support:ICProgKit2.0.2"); + my($ic_sdk_folder) = CodeWarriorLib::getCodeWarriorPath("MacOS Support:ICProgKit2.0.2"); if( -e $ic_sdk_folder) { - my($new_ic_folder_name) = getCodeWarriorPath("MacOS Support:(ICProgKit2.0.2)"); + my($new_ic_folder_name) = CodeWarriorLib::getCodeWarriorPath("MacOS Support:(ICProgKit2.0.2)"); rename ($ic_sdk_folder, $new_ic_folder_name); # note that CodeWarrior doesn't descnet into folders with () the name print "Mozilla no longer needs the Internet Config SDK to build:\n Renaming the 'ICProgKit2.0.2' folder to '(ICProgKit2.0.2)'\n"; @@ -255,121 +172,6 @@ sub ConfigureBuildSystem() } } - -#----------------------------------------------- -# SetupBuildLog -#----------------------------------------------- -sub SetupBuildLog($) -{ - my($timestamped_log) = @_; - - if ($timestamped_log) - { - #Use time-stamped names so that you don't clobber your previous log file! - my $now = localtime(); - while ($now =~ s@:@.@) {} # replace all colons by periods - my $logdir = ":Build Logs:"; - if (!stat($logdir)) - { - print "Creating directory $logdir\n"; - mkdir $logdir, 0777 || die "Couldn't create directory $logdir"; - } - OpenErrorLog("$logdir$now"); - } - else - { - OpenErrorLog("NGLayoutBuildLog"); # Release build - #OpenErrorLog("Mozilla.BuildLog"); # Tinderbox requires that name - } -} - -#//-------------------------------------------------------------------------------------------------- -#// Check out everything -#//-------------------------------------------------------------------------------------------------- -sub Checkout() -{ - unless ( $main::pull{all} || $main::pull{moz} || $main::pull{runtime} ) { return;} - - # give application activation a chance to happen - WaitNextEvent(); - WaitNextEvent(); - WaitNextEvent(); - - assertRightDirectory(); - my($cvsfile) = AskAndPersistFile("::nglayout.cvsloc"); - my($session) = MacCVS->new( $cvsfile ); - unless (defined($session)) { die "Checkout aborted. Cannot create session file: $session" } - - # activate MacCVS - ActivateApplication('Mcvs'); - - my($nsprpub_tag) = "NSPRPUB_CLIENT_BRANCH"; - my($nss_tab) = "NSS_30_BRANCH"; - my($psm_tag) = "SECURITY_MAC_BRANCH"; - my($secbase_tag) = "SECURITY_CLIENT_BRANCH"; - my($ldapsdk_tag) = "LDAPCSDK_40_BRANCH"; - - #// - #// Checkout commands - #// - if ($main::pull{moz}) - { - $session->checkout("mozilla/nsprpub", $nsprpub_tag) || print "checkout of nsprpub failed\n"; - $session->checkout("mozilla/security/nss", $nss_tab) || print "checkout of security/nss failed\n"; - $session->checkout("mozilla/security/psm", $psm_tag) || print "checkout of security/psm failed\n"; - $session->checkout("mozilla/security/base", $secbase_tag) || print "checkout of security/base failed\n"; - $session->checkout("DirectorySDKSourceC", $ldapsdk_tag) || print "checkout of LDAP C SDK failed\n"; - $session->checkout("SeaMonkeyAll") || - print "MacCVS reported some errors checking out SeaMonkeyAll, but these are probably not serious.\n"; - } - elsif ($main::pull{runtime}) - { - $session->checkout("mozilla/build/mac") || print "checkout failure\n"; - $session->checkout("mozilla/lib/mac/InterfaceLib") || print "checkout failure\n"; - $session->checkout("mozilla/config/mac") || print "checkout failure\n"; - $session->checkout("mozilla/gc") || print "checkout failure\n"; - $session->checkout("mozilla/lib/mac/NSStartup") || print "checkout failure\n"; - $session->checkout("mozilla/lib/mac/NSStdLib") || print "checkout failure\n"; - $session->checkout("mozilla/lib/mac/NSRuntime") || print "checkout failure\n"; - $session->checkout("mozilla/lib/mac/MoreFiles") || print "checkout failure\n"; - $session->checkout("mozilla/lib/mac/MacMemoryAllocator") || print "checkout failure\n"; - $session->checkout("mozilla/nsprpub", $nsprpub_tag) || print "checkout failure\n"; - } -} - - -#//-------------------------------------------------------------------------------------------------- -#// Make resource aliases for one directory -#//-------------------------------------------------------------------------------------------------- - -sub BuildFolderResourceAliases($$) -{ - my($src_dir, $dest_dir) = @_; - - unless ($src_dir =~ m/^$main::BUILD_ROOT.+/) { return; } - - # get a list of all the resource files - opendir(SRCDIR, $src_dir) || die("can't open $src_dir"); - my(@resource_files) = readdir(SRCDIR); - closedir(SRCDIR); - - # make aliases for each one into the dest directory - print("Placing aliases to all files from $src_dir in $dest_dir\n"); - for ( @resource_files ) - { - next if $_ eq "CVS"; - #print(" Doing $_\n"); - if (-l $src_dir.$_) - { - print(" $_ is an alias\n"); - next; - } - my($file_name) = $src_dir . $_; - MakeAlias($file_name, $dest_dir); - } -} - - #//-------------------------------------------------------------------------------------------------- #// Recurse into the skin directories #//-------------------------------------------------------------------------------------------------- @@ -426,7 +228,7 @@ sub InstallSkinFiles($) unless( $main::build{resources} ) { return; } assertRightDirectory(); - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); my($themes_dir) = ":mozilla:themes:".$theme_name; print "Installing skin files from $themes_dir\n"; @@ -443,155 +245,16 @@ sub SetDefaultSkin($) assertRightDirectory(); - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); my($chrome_subdir) = $dist_dir."Chrome"; + print "Setting default skin to $skin\n"; + open(CHROMEFILE, ">>${chrome_subdir}:installed-chrome.txt") || die "Failed to open installed_chrome.txt\n"; print(CHROMEFILE "skin,install,select,$skin\n"); close(CHROMEFILE); } -#//-------------------------------------------------------------------------------------------------- -#// Recurse into the provider directories -#//-------------------------------------------------------------------------------------------------- - -sub ProScanForManifestFiles($$$$$) -{ - ## diff from ScanForManifestFiles() - my($dir, $theme_root, $provider, $theme_name, $dist_dir) = @_; - - opendir(DIR, $dir) or die "Cannot open dir $dir\n"; - my @files = readdir(DIR); - closedir DIR; - - my $file; - - foreach $file (@files) - { - my $filepath = $dir.":".$file; - - if (-d $filepath) - { - # print "Looking for MANIFEST files in $filepath\n"; - ## diff from ScanForManifestFiles() - ProScanForManifestFiles($filepath, $theme_root, $provider, $theme_name, $dist_dir); - } - elsif ($file eq "MANIFEST") - { - # print "Doing manifest file $filepath\n"; - - # Get the dest path from the first line of the file - - open(MANIFEST, $filepath) || die "Could not open file $file"; - # Read in the path if available - my($dest_line) = ; - chomp $dest_line; - close MANIFEST; - - $dest_line =~ s|^#!dest[\t ]+|| || die "No destination line found in $filepath\n"; - - ## diff from ScanForManifestFiles() - my($dest_path) = $dist_dir."chrome:$provider:$theme_name:$dest_line"; - # print " Destination is $dest_path\n"; - - InstallResources($filepath, "$dest_path", 0); - } - } -} - -#//-------------------------------------------------------------------------------------------------- -#// Install Provider files -#//-------------------------------------------------------------------------------------------------- - -sub InstallProviderFiles($$) -{ - ## diff from InstallSkinFiles() - new arg: provider - my($provider, $theme_name) = @_; - - # unless( $main::build{resources} ) { return; } - assertRightDirectory(); - - my($dist_dir) = GetDistDirectory(); - - ## diff from InstallSkinFiles() - my($themes_dir) = ":mozilla:l10n:langpacks:".$theme_name.":chrome:".$theme_name; - - print "Installing $provider files from $themes_dir\n"; - - ## diff from InstallSkinFiles() - ProScanForManifestFiles($themes_dir, $themes_dir, $provider, $theme_name, $dist_dir); -} - -### defaults -#//-------------------------------------------------------------------------------------------------- -#// Recurse into the defaults directories -#//-------------------------------------------------------------------------------------------------- - -sub DefScanForManifestFiles($$$$) -{ - my($dir, $theme_root, $theme_name, $dist_dir) = @_; - - opendir(DIR, $dir) or die "Cannot open dir $dir\n"; - my @files = readdir(DIR); - closedir DIR; - - my $file; - - foreach $file (@files) - { - my $filepath = $dir.":".$file; - - if (-d $filepath) - { - # print "Looking for MANIFEST files in $filepath\n"; - ## diff from ScanForManifestFiles() - DefScanForManifestFiles($filepath, $theme_root, $theme_name, $dist_dir); - } - elsif ($file eq "MANIFEST") - { - # print "Doing manifest file $filepath\n"; - - # Get the dest path from the first line of the file - - open(MANIFEST, $filepath) || die "Could not open file $file"; - # Read in the path if available - my($dest_line) = ; - chomp $dest_line; - close MANIFEST; - - $dest_line =~ s|^#!dest[\t ]+|| || die "No destination line found in $filepath\n"; - - ## diff from ScanForManifestFiles() - my($dest_path) = $dist_dir."defaults:$dest_line:$theme_name"; - # print " Destination is $dest_path\n"; - - InstallResources($filepath, "$dest_path", 0); - } - } -} - -#//-------------------------------------------------------------------------------------------------- -#// InstallLangPackFiles -#//-------------------------------------------------------------------------------------------------- - -sub InstallLangPackFiles($) -{ - my($theme_name) = @_; - - # unless( $main::build{resources} ) { return; } - assertRightDirectory(); - - my($dist_dir) = GetDistDirectory(); - - ## diff from InstallSkinFiles() - my($themes_dir) = ":mozilla:l10n:langpacks:".$theme_name.":defaults"; - - print "Installing default files from $themes_dir\n"; - - ## diff from InstallSkinFiles() - DefScanForManifestFiles($themes_dir, $themes_dir, $theme_name, $dist_dir); -} - #//-------------------------------------------------------------------------------------------------- #// InstallDefaultsFiles #//-------------------------------------------------------------------------------------------------- @@ -603,7 +266,7 @@ sub InstallDefaultsFiles() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); print("--- Starting Defaults copying ----\n"); @@ -663,7 +326,7 @@ sub InstallNonChromeResources() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); print("--- Starting Resource copying ----\n"); @@ -725,6 +388,11 @@ sub InstallNonChromeResources() my($domds_dir) = "$samples_dir" . "rdf:"; InstallResources(":mozilla:rdf:tests:domds:resources:MANIFEST", "$domds_dir"); + # Search - make copies (not aliases) of the various search files + my($searchPlugins) = "${dist_dir}Search Plugins"; + print("--- Starting Search Plugins copying: $searchPlugins\n"); + InstallResources(":mozilla:xpfe:components:search:datasets:MANIFEST", "$searchPlugins", 1); + # QA Menu InstallResources(":mozilla:intl:strres:tests:MANIFEST", "$resource_dir"); @@ -743,7 +411,7 @@ sub InstallComponentFiles() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); print("--- Starting Text Components copying ----\n"); @@ -758,343 +426,6 @@ sub InstallComponentFiles() print("--- Done Text Components copying ----\n"); } - -#//-------------------------------------------------------------------------------------------------- -#// InstallChromeFiles -#//-------------------------------------------------------------------------------------------------- - -sub InstallChromeFiles() -{ - unless( $main::build{resources} ) { return; } - assertRightDirectory(); - - # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project - my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); - - print("--- Starting Chrome copying ----\n"); - - #// - #// Most resources should all go into the chrome dir eventually - #// - my $chrome_subdir = "Chrome:"; - my $chrome_dir = "$dist_dir" . $chrome_subdir; - - my($packages_chrome_dir) = "$chrome_dir" . "packages:"; - my($locales_chrome_dir) = "$chrome_dir" . "locales:"; - - # Second level chrome directories - - my($core_packages_chrome_dir) = "$packages_chrome_dir" . "core:"; - my($messenger_packages_chrome_dir) = "$packages_chrome_dir" . "messenger:"; - my($widgettoolkit_packages_chrome_dir) = "$packages_chrome_dir" . "widget-toolkit:"; - - my($enUS_locales_chrome_dir) = "$locales_chrome_dir" . "en-US:"; - - # Third level chrome directories - - # navigator - my($navigator_core_packages_chrome_dir) = "$core_packages_chrome_dir" . "navigator:"; - my($navigatorContent) = "$navigator_core_packages_chrome_dir" . "content:"; - - my($navigator_enUS_locales_chrome_dir) = "$enUS_locales_chrome_dir" . "navigator:"; - my($navigatorLocale) = "$navigator_enUS_locales_chrome_dir" . "locale:"; - - # global - my($global_widgettoolkit_packages_chrome_dir) = "$widgettoolkit_packages_chrome_dir" . "global:"; - my($globalContent) = "$global_widgettoolkit_packages_chrome_dir" . "content:"; - - my($global_enUS_locales_chrome_dir) = "$enUS_locales_chrome_dir" . "global:"; - my($globalLocale) = "$global_enUS_locales_chrome_dir" . "locale:"; - - # communicator - my($communicator_core_packages_chrome_dir) = "$core_packages_chrome_dir" . "communicator:"; - my($communicatorContent) = "$communicator_core_packages_chrome_dir" . "content:"; - - my($communicator_enUS_locales_chrome_dir) = "$enUS_locales_chrome_dir" . "communicator:"; - my($communicatorLocale) = "$communicator_enUS_locales_chrome_dir" . "locale:"; - - # copy the chrome registry (don't alias it) - copy( ":mozilla:rdf:chrome:build:registry.rdf", "$chrome_dir" . "registry.rdf" ); - - MakeAlias(":mozilla:xpcom:base:xpcom.properties", "$globalLocale"); - - MakeAlias(":mozilla:intl:uconv:src:charsetTitles.properties","$globalLocale"); - - InstallResources(":mozilla:xpfe:browser:resources:content:MANIFEST", "$navigatorContent"); - InstallResources(":mozilla:xpfe:browser:resources:content:mac:MANIFEST", "$navigatorContent"); - InstallResources(":mozilla:xpfe:browser:resources:locale:en-US:MANIFEST", "$navigatorLocale", 0); - - # find - InstallResources(":mozilla:xpfe:components:find:resources:MANIFEST", "$globalContent"); - InstallResources(":mozilla:xpfe:components:find:resources:locale:en-US:MANIFEST", "$globalLocale"); - - # ucth - InstallResources(":mozilla:xpfe:components:ucth:resources:MANIFEST", "$globalContent"); - InstallResources(":mozilla:xpfe:components:ucth:resources:locale:en-US:MANIFEST", "$globalLocale"); - InstallResources(":mozilla:xpfe:components:xfer:resources:MANIFEST", "$globalContent"); - InstallResources(":mozilla:xpfe:components:xfer:resources:locale:en-US:MANIFEST", "$globalLocale"); - - #file picker - InstallResources(":mozilla:xpfe:components:filepicker:res:locale:en-US:MANIFEST", "$globalLocale"); - - # console - InstallResources(":mozilla:xpfe:components:console:resources:content:MANIFEST", "$globalContent", 0); - InstallResources(":mozilla:xpfe:components:console:resources:locale:en-US:MANIFEST", "$globalLocale", 0); - - # autocomplete - InstallResources(":mozilla:xpfe:components:autocomplete:resources:content:MANIFEST", "$globalContent", 0); - - # security - InstallResources(":mozilla:security:base:res:content:MANIFEST", "$communicatorContent"); - InstallResources(":mozilla:security:base:res:locale:en-us:MANIFEST", "$communicatorLocale"); - - # widget-toolkit - InstallResources(":mozilla:xpfe:global:resources:content:MANIFEST", "$globalContent"); - InstallResources(":mozilla:xpfe:global:resources:content:mac:MANIFEST", "$globalContent"); - InstallResources(":mozilla:xpfe:global:resources:locale:en-US:MANIFEST", "$globalLocale", 0); - InstallResources(":mozilla:xpfe:global:resources:locale:en-US:mac:MANIFEST", "$globalLocale", 0); - - # communicator - InstallResources(":mozilla:xpfe:communicator:resources:content:MANIFEST", "$communicatorContent"); - InstallResources(":mozilla:xpfe:communicator:resources:content:mac:MANIFEST", "$communicatorContent"); - InstallResources(":mozilla:xpfe:communicator:resources:locale:en-US:MANIFEST", "$communicatorLocale", 0); - - InstallResources(":mozilla:docshell:base:MANIFEST", "$globalLocale", 0); - - # xpinstall - { - my($xpinstallContent) = "$communicatorContent" . "xpinstall:"; - my($xpinstallLocale) = "$communicatorLocale" . "xpinstall:"; - - InstallResources(":mozilla:xpinstall:res:content:MANIFEST","$xpinstallContent", 0); - #XXX these InstallResources calls should be down below with the rest of the calls - InstallResources(":mozilla:xpinstall:res:locale:en-US:MANIFEST","$xpinstallLocale", 0); - InstallResources(":mozilla:xpinstall:res:content:MANIFEST","$xpinstallContent", 0); - } - - # profile - { - my($profileContent) = "$communicatorContent" . "profile:"; - my($profileLocale) = "$communicatorLocale" . "profile:"; - - #XXX these InstallResourses calls should be down below with the rest of the calls - InstallResources(":mozilla:profile:resources:content:MANIFEST", "$profileContent", 0); - InstallResources(":mozilla:profile:resources:locale:en-US:MANIFEST", "$profileLocale", 0); - InstallResources(":mozilla:profile:pref-migrator:resources:content:MANIFEST", "$profileContent", 0); - InstallResources(":mozilla:profile:pref-migrator:resources:locale:en-US:MANIFEST", "$profileLocale", 0); - } - - - #NECKO - { - my($necko_chrome_dir) = "$chrome_dir" . "necko:"; - my($necko_content_chrome_dir) = "$necko_chrome_dir" . "content:"; - my($necko_locale_chrome_dir) = "$necko_chrome_dir" . "locale:"; - InstallResources(":mozilla:netwerk:resources:content:MANIFEST", "$necko_content_chrome_dir"); - InstallResources(":mozilla:netwerk:resources:locale:en-US:MANIFEST", "$necko_locale_chrome_dir", 0); - } - - # layout locale hack - { - my($layout_locale_hack_dir) = "$communicatorLocale"."layout:"; - mkdir($layout_locale_hack_dir, 0); - InstallResources(":mozilla:layout:html:forms:src:MANIFEST_PROPERTIES", "$layout_locale_hack_dir", 0); - } - - # editor - { - my($editor_core_packages_chrome_dir) = "$core_packages_chrome_dir" . "editor:"; - my($editorContent) = "$editor_core_packages_chrome_dir" . "content:"; - - my($editor_enUS_locales_chrome_dir) = "$enUS_locales_chrome_dir" . "editor:"; - my($editorLocale) = "$editor_enUS_locales_chrome_dir" . "locale:"; - - InstallResources(":mozilla:editor:ui:composer:content:MANIFEST", "$editorContent", 0); - InstallResources(":mozilla:editor:ui:composer:locale:en-US:MANIFEST", "$editorLocale", 0); - InstallResources(":mozilla:editor:ui:dialogs:content:MANIFEST", "$editorContent", 0); - InstallResources(":mozilla:editor:ui:dialogs:locale:en-US:MANIFEST", "$editorLocale", 0); - } - - # mailnews - { - # Messenger is a top level component - my($messenger_chrome_dir) = "$chrome_dir" . "messenger:"; - - my($messenger_packages_chrome_dir) = "$packages_chrome_dir" . "messenger:"; - my($messenger_messenger_packages_chrome_dir) = "$messenger_packages_chrome_dir" . "messenger:"; - my($messengerContent) = "$messenger_messenger_packages_chrome_dir" . "content:"; - - my($messenger_enUS_locales_chrome_dir) = "$enUS_locales_chrome_dir" . "messenger:"; - my($messengerLocale) = "$messenger_enUS_locales_chrome_dir" . "locale:"; - - InstallResources(":mozilla:mailnews:base:resources:content:MANIFEST", "$messengerContent", 0); - InstallResources(":mozilla:mailnews:base:resources:content:mac:MANIFEST", "$messengerContent", 0); - InstallResources(":mozilla:mailnews:base:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - InstallResources(":mozilla:mailnews:base:prefs:resources:content:MANIFEST", "$messengerContent", 0); - InstallResources(":mozilla:mailnews:base:prefs:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - InstallResources(":mozilla:mailnews:base:search:resources:content:MANIFEST", "$messengerContent", 0); - InstallResources(":mozilla:mailnews:base:search:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - InstallResources(":mozilla:mailnews:mime:resources:content:MANIFEST", "$messengerContent", 0); - InstallResources(":mozilla:mailnews:mime:emitters:resources:content:MANIFEST", "$messengerContent", 0); - InstallResources(":mozilla:mailnews:local:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - InstallResources(":mozilla:mailnews:news:resources:content:MANIFEST", "$messengerContent", 0); - InstallResources(":mozilla:mailnews:news:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - - InstallResources(":mozilla:mailnews:imap:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - - InstallResources(":mozilla:mailnews:mime:resources:MANIFEST", "$messengerLocale", 0); - InstallResources(":mozilla:mailnews:mime:cthandlers:resources:MANIFEST", "$messengerLocale", 0); - - # messenger compose resides within messenger - my($messengercomposeContent) = "$messengerContent" . "messengercompose:"; - my($messengercomposeLocale) = "$messengerLocale" . "messengercompose:"; - InstallResources(":mozilla:mailnews:compose:resources:content:MANIFEST", "$messengercomposeContent", 0); - InstallResources(":mozilla:mailnews:compose:resources:locale:en-US:MANIFEST", "$messengercomposeLocale", 0); - InstallResources(":mozilla:mailnews:compose:prefs:resources:content:MANIFEST", "$messengercomposeContent", 0); - InstallResources(":mozilla:mailnews:compose:prefs:resources:locale:en-US:MANIFEST", "$messengercomposeLocale", 0); - - # addressbook resides within messenger - my($addressbookContent) = "$messengerContent" . "addressbook:"; - my($addressbookLocale) = "$messengerLocale" . "addressbook:"; - InstallResources(":mozilla:mailnews:addrbook:resources:content:MANIFEST", "$addressbookContent", 0); - InstallResources(":mozilla:mailnews:addrbook:resources:locale:en-US:MANIFEST", "$addressbookLocale", 0); - InstallResources(":mozilla:mailnews:addrbook:prefs:resources:content:MANIFEST", "$addressbookContent", 0); - InstallResources(":mozilla:mailnews:addrbook:prefs:resources:locale:en-US:MANIFEST", "$addressbookLocale", 0); - InstallResources(":mozilla:mailnews:absync:resources:locale:en-US:MANIFEST","$addressbookLocale", 0); - - # import - InstallResources(":mozilla:mailnews:import:resources:content:MANIFEST", "$messengerContent", 0); - InstallResources(":mozilla:mailnews:import:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - InstallResources(":mozilla:mailnews:import:eudora:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - InstallResources(":mozilla:mailnews:import:text:resources:locale:en-US:MANIFEST", "$messengerLocale", 0); - } - - # bookmarks - { - my($bookmarksContent) = "$communicatorContent"."bookmarks:"; - my($bookmarksLocale) = "$communicatorLocale"."bookmarks:"; - - InstallResources(":mozilla:xpfe:components:bookmarks:resources:MANIFEST-content", "$bookmarksContent"); - InstallResources(":mozilla:xpfe:components:bookmarks:resources:locale:en-US:MANIFEST", "$bookmarksLocale"); - } - - # directory - { - my($directoryContent) = "$communicatorContent"."directory:"; - my($directoryLocale) = "$communicatorLocale"."directory:"; - - InstallResources(":mozilla:xpfe:components:directory:MANIFEST-content", "$directoryContent"); - InstallResources(":mozilla:xpfe:components:directory:locale:en-US:MANIFEST", "$directoryLocale"); - } - - # regViewer - { - my($regviewerContent) = "$communicatorContent"."regviewer:"; - my($regviewerLocale) = "$communicatorLocale"."regviewer:"; - - InstallResources(":mozilla:xpfe:components:regviewer:MANIFEST-content", "$regviewerContent"); - InstallResources(":mozilla:xpfe:components:regviewer:locale:en-US:MANIFEST", "$regviewerLocale"); - } - - # history - { - my($historyContent) = "$communicatorContent"."history:"; - my($historyLocale) = "$communicatorLocale"."history:"; - - InstallResources(":mozilla:xpfe:components:history:resources:MANIFEST-content", "$historyContent"); - InstallResources(":mozilla:xpfe:components:history:resources:locale:en-US:MANIFEST", "$historyLocale"); - } - - # related - { - my($relatedContent) = "$communicatorContent"."related:"; - my($relatedLocale) = "$communicatorLocale"."related:"; - - InstallResources(":mozilla:xpfe:components:related:resources:MANIFEST-content", "$relatedContent"); - InstallResources(":mozilla:xpfe:components:related:resources:locale:en-US:MANIFEST", "$relatedLocale"); - } - - # search - { - my($searchContent) = "$communicatorContent"."search:"; - my($searchLocale) = "$communicatorLocale"."search:"; - my($searchPlugins) = "${dist_dir}Search Plugins"; - - InstallResources(":mozilla:xpfe:components:search:resources:MANIFEST-content", "$searchContent"); - InstallResources(":mozilla:xpfe:components:search:resources:locale:en-US:MANIFEST", "$searchLocale"); - - # Make copies (not aliases) of the various search files - InstallResources(":mozilla:xpfe:components:search:datasets:MANIFEST", "$searchPlugins", 1); - } - - # sidebar - { - my($sidebarContent) = "$communicatorContent"."sidebar:"; - my($sidebarLocale) = "$communicatorLocale"."sidebar:"; - - InstallResources(":mozilla:xpfe:components:sidebar:resources:MANIFEST-content", "$sidebarContent"); - InstallResources(":mozilla:xpfe:components:sidebar:resources:locale:en-US:MANIFEST", "$sidebarLocale"); - } - - # timebomb (aka tmbmb) - { - my($timebombContent) = "$communicatorContent"."timebomb:"; - my($timebombLocale) = "$communicatorLocale"."timebomb:"; - - InstallResources(":mozilla:xpfe:components:timebomb:resources:content:MANIFEST", "$timebombContent"); - InstallResources(":mozilla:xpfe:components:timebomb:resources:locale:en-US:MANIFEST", "$timebombLocale"); - } - - # prefs - { - my($prefContent) = "$communicatorContent"."pref:"; - my($prefLocale) = "$communicatorLocale"."pref:"; - - InstallResources(":mozilla:xpfe:components:prefwindow:resources:content:MANIFEST", "$prefContent", 0); - InstallResources(":mozilla:xpfe:components:prefwindow:resources:content:mac:MANIFEST", "$prefContent", 0); - InstallResources(":mozilla:xpfe:components:prefwindow:resources:locale:en-US:MANIFEST", "$prefLocale", 0); - } - - # wallet - { - my($walletContent) = "$communicatorContent"."wallet:"; - my($walletLocale) = "$communicatorLocale"."wallet:"; - - InstallResources(":mozilla:extensions:wallet:cookieviewer:MANIFEST", "$walletContent", 0); - InstallResources(":mozilla:extensions:wallet:signonviewer:MANIFEST", "$walletContent", 0); - InstallResources(":mozilla:extensions:wallet:walletpreview:MANIFEST", "$walletContent", 0); - InstallResources(":mozilla:extensions:wallet:editor:MANIFEST", "$walletContent", 0); - - InstallResources(":mozilla:extensions:wallet:cookieviewer:MANIFEST_PROPERTIES", "$walletLocale", 0); - InstallResources(":mozilla:extensions:wallet:signonviewer:MANIFEST_PROPERTIES", "$walletLocale", 0); - InstallResources(":mozilla:extensions:wallet:walletpreview:MANIFEST_PROPERTIES", "$walletLocale", 0); - InstallResources(":mozilla:extensions:wallet:editor:MANIFEST_PROPERTIES", "$walletLocale", 0); - InstallResources(":mozilla:extensions:wallet:src:MANIFEST_PROPERTIES", "$walletLocale", 0); - } - - # security - { - my($securityContent) = "$communicatorContent"."security:"; - my($securityLocale) = "$communicatorLocale"."security:"; - - InstallResources(":mozilla:caps:src:MANIFEST_PROPERTIES", "$securityLocale", 0); - } - - # Install skin files - InstallSkinFiles("classic"); # fix me - InstallSkinFiles("blue"); # fix me - InstallSkinFiles("modern"); # fix me - - # install locale provider - InstallProviderFiles("locales", "en-DE"); - # install defaults - InstallLangPackFiles("en-DE"); - - print("--- Chrome copying complete ----\n"); -} - - #//-------------------------------------------------------------------------------------------------- #// MakeNonChromeAliases #//-------------------------------------------------------------------------------------------------- @@ -1127,12 +458,19 @@ sub MakeResourceAliases() sub ProcessJarManifests() { - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); my($chrome_dir) = "$dist_dir"."Chrome"; # a hash of jars passed as context to the following calls my(%jars); + if ($main::build{extensions}) + { + MozJar::CreateJarFromManifest(":mozilla:extensions:irc:jar.mn", $chrome_dir, \%jars); + # cview needs a jar.mn file + # transformiix needs a jar.mn file + } + MozJar::CreateJarFromManifest(":mozilla:caps:src:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:docshell:base:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:editor:jar.mn", $chrome_dir, \%jars); @@ -1147,7 +485,6 @@ sub ProcessJarManifests() MozJar::CreateJarFromManifest(":mozilla:profile:pref-migrator:resources:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:profile:resources:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:rdf:tests:domds:resources:jar.mn", $chrome_dir, \%jars); - MozJar::CreateJarFromManifest(":mozilla:security:base:res:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:themes:blue:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:themes:classic:communicator:mac:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:themes:classic:communicator:search:mac:jar.mn", $chrome_dir, \%jars); @@ -1155,6 +492,10 @@ sub ProcessJarManifests() MozJar::CreateJarFromManifest(":mozilla:themes:classic:global:mac:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:themes:classic:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:themes:classic:navigator:mac:jar.mn", $chrome_dir, \%jars); + MozJar::CreateJarFromManifest(":mozilla:themes:classic:messenger:mac:jar.mn", $chrome_dir, \%jars); + MozJar::CreateJarFromManifest(":mozilla:themes:classic:messenger:addressbook:mac:jar.mn", $chrome_dir, \%jars); + MozJar::CreateJarFromManifest(":mozilla:themes:classic:editor:mac:jar.mn", $chrome_dir, \%jars); + MozJar::CreateJarFromManifest(":mozilla:themes:classic:preview:mac:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:themes:modern:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:xpcom:base:jar.mn", $chrome_dir, \%jars); MozJar::CreateJarFromManifest(":mozilla:xpfe:browser:jar.mn", $chrome_dir, \%jars); @@ -1198,24 +539,13 @@ sub BuildJarFiles() sub MakeLibAliases() { - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); - local(*F); - my($filepath, $appath, $psi) = (':mozilla:build:mac:idepath.txt'); - if (open(F, $filepath)) { - $appath = ; - close(F); - - #// ProfilerLib - if ($main::PROFILE) - { - my($profilerlibpath) = $appath; - $profilerlibpath =~ s/[^:]*$/MacOS Support:Profiler:Profiler Common:ProfilerLib/; - MakeAlias("$profilerlibpath", "$dist_dir"."Essential Files:"); - } - } - else { - print STDERR "Can't find $filepath\n"; + #// ProfilerLib + if ($main::PROFILE) + { + my($profilerlibpath) = CodeWarriorLib::getCodeWarriorPath("MacOS Support:Profiler:Profiler Common:ProfilerLib"); + MakeAlias("$profilerlibpath", "$dist_dir"."Essential Files:"); } } @@ -1266,7 +596,7 @@ sub BuildClientDist() assertRightDirectory(); my $distdirectory = ":mozilla:dist"; # the parent directory in dist, including all the headers - my $dist_dir = GetDistDirectory(); # the subdirectory with the libs and executable. + my $dist_dir = GetBinDirectory(); # the subdirectory with the libs and executable. print("--- Starting Client Dist export ----\n"); @@ -1349,9 +679,12 @@ sub BuildClientDist() #LIBUTIL InstallFromManifest(":mozilla:modules:libutil:public:MANIFEST", "$distdirectory:libutil:"); - # APPFILELOCPROVIDER + # APPFILELOCPROVIDER InstallFromManifest(":mozilla:modules:appfilelocprovider:public:MANIFEST", "$distdirectory:appfilelocprovider:"); + # MPFILELOCPROVIDER + InstallFromManifest(":mozilla:modules:mpfilelocprovider:public:MANIFEST", "$distdirectory:mpfilelocprovider:"); + #SUN_JAVA InstallFromManifest(":mozilla:sun-java:stubs:include:MANIFEST", "$distdirectory:sun-java:"); InstallFromManifest(":mozilla:sun-java:stubs:macjri:MANIFEST", "$distdirectory:sun-java:"); @@ -1421,8 +754,6 @@ sub BuildClientDist() InstallFromManifest(":mozilla:extensions:psm-glue:public:MANIFEST", "$distdirectory:idl:"); InstallFromManifest(":mozilla:extensions:psm-glue:src:MANIFEST", "$distdirectory:include:"); - InstallFromManifest(":mozilla:security:base:public:MANIFEST", "$distdirectory:idl:"); - InstallFromManifest(":mozilla:security:psm:lib:client:MANIFEST", "$distdirectory:security:"); InstallFromManifest(":mozilla:security:psm:lib:protocol:MANIFEST", "$distdirectory:security:"); @@ -1620,14 +951,14 @@ sub BuildDist() ActivateApplication('McPL'); my $distdirectory = ":mozilla:dist"; # the parent directory in dist, including all the headers - my $dist_dir = GetDistDirectory(); # the subdirectory with the libs and executable. + my $dist_dir = GetBinDirectory(); # the subdirectory with the libs and executable. if ($main::CLOBBER_DIST_ALL) { print "Clobbering dist in 5 seconds. Press command-. to stop\n"; DelayFor(5); - print "Clobbering all files inside :mozilla:dist:\n"; + print "\nClobbering all files inside :mozilla:dist:\n"; EmptyTree($distdirectory.":"); } else @@ -1644,8 +975,8 @@ sub BuildDist() mkpath([ ":mozilla:dist:viewer:", ":mozilla:dist:viewer_debug:" ]); #make default plugins folder so that apprunner won't go looking for 3.0 and 4.0 plugins. - mkpath([ ":mozilla:dist:viewer:Plugins", ":mozilla:dist:viewer_debug:Plugins"]); - mkpath([ ":mozilla:dist:client:Plugins", ":mozilla:dist:client_debug:Plugins"]); + mkpath([ ":mozilla:dist:viewer:Plug-ins", ":mozilla:dist:viewer_debug:Plug-ins"]); + #mkpath([ ":mozilla:dist:client:Plugins", ":mozilla:dist:client_debug:Plugins"]); BuildRuntimeDist(); BuildClientDist(); @@ -1680,47 +1011,6 @@ sub BuildStubs() #// Build IDL projects #//-------------------------------------------------------------------------------------------------- -sub getCodeWarriorPath($) -{ - my($subfolder)=@_; - my($filepath, $appath) = (':mozilla:build:mac:idepath.txt'); - if (open(F, $filepath)) { - $appath = ; - close(F); - - my($codewarrior_root) = $appath; - $codewarrior_root =~ s/[^:]*$//; - return ($codewarrior_root . $subfolder); - } else { - print("Can't locate CodeWarrior IDE.\n"); - die; - } -} - -sub getCodeWarriorIDEName() -{ - my($subfolder)=@_; - my($filepath, $appath) = (':mozilla:build:mac:idepath.txt'); - if (open(F, $filepath)) { - $appath = ; - close(F); - - my(@codewarrior_path) = split(/:/, $appath); - return pop(@codewarrior_path); - } else { - print("Can't locate CodeWarrior IDE.\n"); - die; - } -} - -sub getModificationDate($) -{ - my($filePath)=@_; - my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, - $atime,$mtime,$ctime,$blksize,$blocks) = stat($filePath); - return $mtime; -} - sub BuildIDLProjects() { unless( $main::build{idl} ) { return; } @@ -1731,17 +1021,17 @@ sub BuildIDLProjects() if ( $main::build{xpidl} ) { #// see if the xpidl compiler/linker has been rebuilt by comparing modification dates. - my($codewarrior_plugins) = getCodeWarriorPath("CodeWarrior Plugins:"); + my($codewarrior_plugins) = CodeWarriorLib::getCodeWarriorPath("CodeWarrior Plugins:"); my($compiler_path) = $codewarrior_plugins . "Compilers:xpidl"; my($linker_path) = $codewarrior_plugins . "Linkers:xpt Linker"; - my($compiler_modtime) = (-e $compiler_path ? getModificationDate($compiler_path) : 0); - my($linker_modtime) = (-e $linker_path ? getModificationDate($linker_path) : 0); + my($compiler_modtime) = (-e $compiler_path ? GetFileModDate($compiler_path) : 0); + my($linker_modtime) = (-e $linker_path ? GetFileModDate($linker_path) : 0); #// build the IDL compiler itself. BuildProject(":mozilla:xpcom:typelib:xpidl:macbuild:xpidl.mcp", "build all"); #// was the compiler/linker rebuilt? if so, then clobber IDL projects as we go. - if (getModificationDate($compiler_path) > $compiler_modtime || getModificationDate($linker_path) > $linker_modtime) + if (GetFileModDate($compiler_path) > $compiler_modtime || GetFileModDate($linker_path) > $linker_modtime) { $main::CLOBBER_IDL_PROJECTS = 1; print("XPIDL tools have been updated, will clobber all IDL data folders.\n"); @@ -1757,9 +1047,6 @@ sub BuildIDLProjects() BuildIDLProject(":mozilla:xpcom:macbuild:XPCOMIDL.mcp", "xpcom"); - # security base - BuildIDLProject(":mozilla:security:base:macbuild:securityBaseIDL.mcp", "securityBase"); - # necko BuildIDLProject(":mozilla:netwerk:macbuild:netwerkIDL.mcp","necko"); BuildIDLProject(":mozilla:uriloader:macbuild:uriLoaderIDL.mcp", "uriloader"); @@ -1848,7 +1135,7 @@ sub BuildIDLProjects() if ($main::build{xptlink}) { - my($codewarrior_msl) = getCodeWarriorPath("MSL:MSL_C:MSL_MacOS:"); + my($codewarrior_msl) = CodeWarriorLib::getCodeWarriorPath("MSL:MSL_C:MSL_MacOS:"); if ( ! -e $codewarrior_msl . "Lib:PPC:MSL C.PPC MPW(NL).Lib") { print("MSL PPC MPW Lib not found... Let's build it.\n"); BuildProject($codewarrior_msl . "Project:PPC:MSL C.PPC MPW.mcp", "MSL C.PPC MPW"); @@ -2000,11 +1287,11 @@ sub BuildCommonProjects() BuildOneProject(":mozilla:dbm:macbuild:DBM.mcp", "DBM$D.o", 0, 0, 0); #// Static libraries - # Static Lib + # Static Libs BuildOneProject(":mozilla:modules:appfilelocprovider:macbuild:appfilelocprovider.mcp", "appfilelocprovider$D.o", 0, 0, 0); MakeAlias(":mozilla:modules:appfilelocprovider:macbuild:appfilelocprovider$D.o", ":mozilla:dist:appfilelocprovider:"); - - + BuildOneProject(":mozilla:modules:mpfilelocprovider:macbuild:mpfilelocprovider.mcp", "mpfilelocprovider$D.o", 0, 0, 0); + MakeAlias(":mozilla:modules:mpfilelocprovider:macbuild:mpfilelocprovider$D.o", ":mozilla:dist:mpfilelocprovider:"); print("--- Common projects complete ----\n"); } @@ -2122,7 +1409,7 @@ sub BuildSecurityProjects() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my $dist_dir = GetDistDirectory(); # the subdirectory with the libs and executable. + my $dist_dir = GetBinDirectory(); # the subdirectory with the libs and executable. print("--- Starting Security projects ----\n"); @@ -2191,7 +1478,7 @@ sub BuildBrowserUtilsProjects() BuildOneProject(":mozilla:rdf:tests:domds:macbuild:DOMDataSource.mcp", "DOMDataSource$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); print("--- Browser utils projects complete ----\n"); -} # browserutils +} #//-------------------------------------------------------------------------------------------------- @@ -2205,7 +1492,7 @@ sub BuildLayoutProjects() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); print("--- Starting Layout projects ---\n"); @@ -2270,7 +1557,7 @@ sub BuildEditorProjects() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); print("--- Starting Editor projects ----\n"); @@ -2293,7 +1580,7 @@ sub BuildViewerProjects() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); print("--- Starting Viewer projects ----\n"); @@ -2315,7 +1602,7 @@ sub BuildXPAppProjects() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); print("--- Starting XPApp projects ----\n"); @@ -2346,65 +1633,29 @@ sub BuildExtensionsProjects() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); print("--- Starting Extensions projects ----\n"); my($chrome_subdir) = "Chrome:"; my($chrome_dir) = "$dist_dir"."$chrome_subdir"; + my($packages_chrome_dir) = "$chrome_dir" . "packages:"; # Chatzilla - my($packages_chrome_dir) = "$chrome_dir" . "packages:"; - my($chatzilla_packages_chrome_dir) = "$packages_chrome_dir"."chatzilla:"; - my($chatzilla_chatzilla_packages_chrome_dir) = "$chatzilla_packages_chrome_dir"."chatzilla:"; - - my($chatzillaContent) = "$chatzilla_chatzilla_packages_chrome_dir"."content:"; - - my($chatzillaLocale) = "$chatzilla_chatzilla_packages_chrome_dir"."locale:"; - - my($chatzillaSkin) = "$chatzilla_chatzilla_packages_chrome_dir"."skin:"; - - - my($chatzillaContentLibJS) = "$chatzillaContent"."lib:js:"; - my($chatzillaContentLibXul) = "$chatzillaContent"."lib:xul:"; - InstallResources(":mozilla:extensions:irc:js:lib:MANIFEST", "$chatzillaContentLibJS"); InstallResources(":mozilla:extensions:irc:js:lib:MANIFEST_COMPONENTS", "${dist_dir}Components"); - InstallResources(":mozilla:extensions:irc:xul:lib:MANIFEST", "$chatzillaContentLibXul"); - InstallResources(":mozilla:extensions:irc:xul:content:MANIFEST", "$chatzillaContent"); - InstallResources(":mozilla:extensions:irc:xul:skin:MANIFEST", "$chatzillaSkin"); - my($chatzillaSkinImages) = "$chatzillaSkin"."images:"; - InstallResources(":mozilla:extensions:irc:xul:skin:images:MANIFEST", "$chatzillaSkinImages"); - InstallResources(":mozilla:extensions:irc:xul:locale:en-US:MANIFEST", "$chatzillaLocale", 0); - - # XML-RPC (whatever that is) + # XML-RPC InstallFromManifest(":mozilla:extensions:xml-rpc:src:MANIFEST_COMPONENTS", "${dist_dir}Components"); # Component viewer - my($cview_cview_packages_chrome_dir) = "$packages_chrome_dir"."cview:cview:"; - - my($cviewContent) = "$cview_cview_packages_chrome_dir"."content:"; - my($cviewLocale) = "$cview_cview_packages_chrome_dir"."locale:"; - my($cviewSkin) = "$cview_cview_packages_chrome_dir"."skin:"; - - InstallResources(":mozilla:extensions:cview:resources:content:MANIFEST", "$cviewContent"); - InstallResources(":mozilla:extensions:cview:resources:skin:MANIFEST", "$cviewSkin"); - InstallResources(":mozilla:extensions:cview:resources:locale:en-US:MANIFEST", "$cviewLocale", 0); + print "Need to make jar.mn file for cview\n"; # Transformiix if ($main::options{transformiix}) { BuildOneProject(":mozilla:extensions:transformiix:macbuild:transformiix.mcp", "transformiix$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); - my($transformiix_transformiix_packages_chrome_dir) = "$packages_chrome_dir"."transformiix:transformiix:"; - - my($transformiixContent) = "$transformiix_transformiix_packages_chrome_dir"."content:"; - my($transformiixLocale) = "$transformiix_transformiix_packages_chrome_dir"."locale:"; - my($transformiixSkin) = "$transformiix_transformiix_packages_chrome_dir"."skin:"; - - InstallResources(":mozilla:extensions:transformiix:source:examples:mozilla:transformiix:content:MANIFEST", "$transformiixContent"); - InstallResources(":mozilla:extensions:transformiix:source:examples:mozilla:transformiix:skin:MANIFEST", "$transformiixSkin"); - InstallResources(":mozilla:extensions:transformiix:source:examples:mozilla:transformiix:locale:en-US:MANIFEST", "$transformiixLocale", 0); + print "Need to make a jar.mn file for transformiix\n"; } # LDAP Client @@ -2430,7 +1681,7 @@ sub BuildExtensionsProjects() sub ImportXMLProject($$) { my ($xml_path, $project_path) = @_; - my ($codewarrior_ide_name) = getCodeWarriorIDEName(); + my ($codewarrior_ide_name) = CodeWarriorLib::getCodeWarriorIDEName(); my $ascript = < $project_modtime) { print("MRJPlugin.mcp is out of date, reimporting from MRJPlugin.xml.\n"); @@ -2465,13 +1716,13 @@ sub BuildPluginsProjects() # Build MRJPlugin BuildProject($project_path, "MRJPlugin"); # Build MRJPlugin.jar (if Java tools exist) - my($linker_path) = getCodeWarriorPath("CodeWarrior Plugins:Linkers:Java Linker"); + my($linker_path) = CodeWarriorLib::getCodeWarriorPath("CodeWarrior Plugins:Linkers:Java Linker"); if (-e $linker_path) { print("CodeWarrior Java tools detected, building MRJPlugin.jar.\n"); BuildProject($project_path, "MRJPlugin.jar"); } # Copy MRJPlugin, MRJPlugin.jar to appropriate plugins folder. - my($plugin_dist) = GetDistDirectory() . "Plugins:"; + my($plugin_dist) = GetBinDirectory() . "Plug-ins:"; MakeAlias($plugin_path . "MRJPlugin", $plugin_dist); MakeAlias($plugin_path . "MRJPlugin.jar", $plugin_dist); } @@ -2487,7 +1738,6 @@ sub BuildMailNewsProjects() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; - my($dist_dir) = GetDistDirectory(); print("--- Starting MailNews projects ----\n"); @@ -2499,15 +1749,15 @@ sub BuildMailNewsProjects() BuildOneProject(":mozilla:mailnews:imap:macbuild:msgimap.mcp", "MsgImap$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:mailnews:news:macbuild:msgnews.mcp", "MsgNews$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:mailnews:addrbook:macbuild:msgAddrbook.mcp", "MsgAddrbook$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); - BuildOneProject(":mozilla:mailnews:absync:macbuild:AbSync.mcp", "AbSyncSvc$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); + BuildOneProject(":mozilla:mailnews:absync:macbuild:AbSync.mcp", "AbSyncSvc$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:mailnews:mime:macbuild:mime.mcp", "Mime$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:mailnews:mime:emitters:macbuild:mimeEmitter.mcp", "mimeEmitter$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:mailnews:mime:cthandlers:vcard:macbuild:vcard.mcp", "vcard$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); - BuildOneProject(":mozilla:mailnews:mime:cthandlers:smimestub:macbuild:smime.mcp", "smime$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); - BuildOneProject(":mozilla:mailnews:mime:cthandlers:signstub:macbuild:signed.mcp", "signed$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); + BuildOneProject(":mozilla:mailnews:mime:cthandlers:smimestub:macbuild:smime.mcp", "smime$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); + BuildOneProject(":mozilla:mailnews:mime:cthandlers:signstub:macbuild:signed.mcp", "signed$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); # BuildOneProject(":mozilla:mailnews:mime:cthandlers:calendar:macbuild:calendar.mcp", "calendar$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:mailnews:import:macbuild:msgImport.mcp", "msgImport$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); - BuildOneProject(":mozilla:mailnews:import:text:macbuild:msgImportText.mcp", "msgImportText$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); + BuildOneProject(":mozilla:mailnews:import:text:macbuild:msgImportText.mcp", "msgImportText$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); BuildOneProject(":mozilla:mailnews:import:eudora:macbuild:msgImportEudora.mcp", "msgImportEudora$D.shlb", 1, $main::ALIAS_SYM_FILES, 1); print("--- MailNews projects complete ----\n"); @@ -2533,7 +1783,7 @@ sub BuildMozilla() } # copy command line documents into the Apprunner folder and set correctly the signature - my($dist_dir) = GetDistDirectory(); + my($dist_dir) = GetBinDirectory(); my($cmd_file_path) = ":mozilla:xpfe:bootstrap:"; my($cmd_file) = ""; @@ -2622,23 +1872,81 @@ sub BuildProjects() # activate CodeWarrior ActivateApplication('McPL'); - if ($main::options{jar_manifests}) - { - MakeNonChromeAliases(); # Defaults, JS components etc. - - BuildJarFiles(); - } - else - { - MakeResourceAliases(); - # this builds installed_chrome.txt - InstallManifestRDFFiles(); - } + MakeNonChromeAliases(); # Defaults, JS components etc. + BuildJarFiles(); # Set the default skin to be classic SetDefaultSkin("classic/1.0"); } + +#//-------------------------------------------------------------------------------------------------- +#// checkOutModule. Takes variable number of args; first two are required +#//-------------------------------------------------------------------------------------------------- +sub checkOutModule +{ + my($session, $module, $revision, $date) = @_; + + my($result) = $session->checkout($module, $revision, $date); + + # result of 1 is success + if ($result) { return; } + + my($checkout_err) = $session->getLastError(); + if ($checkout_err == 708) { + die "Checkout was cancelled"; + } elsif ($checkout_err == 711) { + print "Checkout of '$module' failed\n"; + } +} + +#//-------------------------------------------------------------------------------------------------- +#// Check out everything +#//-------------------------------------------------------------------------------------------------- +sub Checkout() +{ + unless ( $main::pull{all} || $main::pull{moz} || $main::pull{runtime} ) { return;} + + assertRightDirectory(); + my($cvsfile) = AskAndPersistFile("::mozilla_session_path.txt"); + my($session) = MacCVS->new( $cvsfile ); + unless (defined($session)) { die "Checkout aborted. Cannot create session file: $session" } + + # activate MacCVS + ActivateApplication('Mcvs'); + + my($nsprpub_tag) = "NSPRPUB_CLIENT_BRANCH"; + my($nss_tab) = "NSS_30_BRANCH"; + my($psm_tag) = "SECURITY_MAC_BRANCH"; + my($ldapsdk_tag) = "LDAPCSDK_40_BRANCH"; + + #// + #// Checkout commands + #// + if ($main::pull{moz}) + { + checkOutModule($session, "mozilla/nsprpub", $nsprpub_tag); + #checkOutModule($session, "mozilla/security/nss", $nss_tab); + #checkOutModule($session, "mozilla/security/psm", $psm_tag); + #checkOutModule($session, "DirectorySDKSourceC", $ldapsdk_tag); + #checkOutModule($session, "SeaMonkeyAll"); + } + elsif ($main::pull{runtime}) + { + checkOutModule($session, "mozilla/build/mac"); + checkOutModule($session, "mozilla/lib/mac/InterfaceLib"); + checkOutModule($session, "mozilla/config/mac"); + checkOutModule($session, "mozilla/gc"); + checkOutModule($session, "mozilla/lib/mac/NSStartup"); + checkOutModule($session, "mozilla/lib/mac/NSStdLib"); + checkOutModule($session, "mozilla/lib/mac/NSRuntime"); + checkOutModule($session, "mozilla/lib/mac/MoreFiles"); + checkOutModule($session, "mozilla/lib/mac/MacMemoryAllocator"); + checkOutModule($session, "mozilla/nsprpub", $nsprpub_tag); + } +} + + #//-------------------------------------------------------------------------------------------------- #// RunBuild #//-------------------------------------------------------------------------------------------------- @@ -2661,8 +1969,13 @@ sub RunBuild($$) unless ($do_build) { return; } - if (!$main::DEBUG) { - SetBuildNumber(); + if (!$main::DEBUG) + { + my(@gen_files) = ( + ":mozilla:xpfe:appshell:public:nsBuildID.h", + ":mozilla:xpfe:browser:resources:locale:en-US:navigator.dtd" + ); + SetBuildNumber(":mozilla:config:build_number", ":mozilla:config:aboutime.pl", \@gen_files); } chdir($main::MOZ_SRC);