diff --git a/mozilla/build/mac/BuildNGLayout.pl b/mozilla/build/mac/BuildNGLayout.pl index 5557e0064b6..bc158f88e1d 100644 --- a/mozilla/build/mac/BuildNGLayout.pl +++ b/mozilla/build/mac/BuildNGLayout.pl @@ -75,9 +75,24 @@ $options{mng} = 1; $options{ldap} = 0; $options{xmlextras} = 0; -$options{jar_manifests} = 1; # use jar.mn files for resources, not MANIFESTs -$options{jars} = 1; # build jar files -$options{chrome_files} = 0; # install files in chrome as well as making jar files. +# -------------------------- Chrome and jar-related options ----------------------------------------- + +$options{jar_manifests} = 1; # use jar.mn files for resources, not MANIFESTs. This must be ON, + # unless you want to use the obsolete (and probably bitrotted) + # MANIFEST files to install resources. + + +# These two options determine whether you get jar files, or loose files in chrome. +# Either one or both option must be turned on. + +$options{chrome_jars} = 1; # build jar files +$options{chrome_files} = 0; # install regular files in chrome + +$options{use_jars} = 1; # This option determines whether chrome comes out of jars + # or regular files at runtime (by affecting installed-chrome.txt). + # If 1, $options{chrome_jars} must be 1. + +# ------------------------ End chrome and jar-related options ---------------------------------------- # Don't change these (where should they go?) $optiondefines{mathml}{MOZ_MATHML} = 1; diff --git a/mozilla/build/mac/BuildNGLayoutDebug.pl b/mozilla/build/mac/BuildNGLayoutDebug.pl index 88451e19bd6..18c723ed00c 100644 --- a/mozilla/build/mac/BuildNGLayoutDebug.pl +++ b/mozilla/build/mac/BuildNGLayoutDebug.pl @@ -29,123 +29,137 @@ use NGLayoutBuildList; use Cwd; use Moz; -$DEBUG = 1; -$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; +$DEBUG = 1; +$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; -$pull{all} = 0; -$pull{moz} = 0; -$pull{runtime} = 0; +$pull{all} = 0; +$pull{moz} = 0; +$pull{runtime} = 0; -$build{all} = 1; # Turn off to do individual builds, or to do "most" -$build{most} = 0; # Turn off to do individual builds -$build{dist} = 0; -$build{dist_runtime} = 0; # Implied by $build{dist} -$build{xpidl} = 0; +$build{all} = 1; # Turn off to do individual builds, or to do "most" +$build{most} = 0; # Turn off to do individual builds +$build{dist} = 0; +$build{dist_runtime} = 0; # Implied by $build{dist} +$build{xpidl} = 0; $build{idl} = 0; -$build{stubs} = 0; -$build{runtime} = 0; -$build{common} = 0; -$build{imglib} = 0; -$build{necko} = 0; +$build{stubs} = 0; +$build{runtime} = 0; +$build{common} = 0; +$build{imglib} = 0; +$build{necko} = 0; $build{security} = 0; -$build{browserutils} = 0; -$build{intl} = 0; -$build{nglayout} = 0; -$build{editor} = 0; -$build{viewer} = 0; -$build{xpapp} = 0; -$build{extensions} = 1; -$build{plugins} = 0; -$build{mailnews} = 0; -$build{apprunner} = 0; -$build{resources} = 1; +$build{browserutils} = 0; +$build{intl} = 0; +$build{nglayout} = 0; +$build{editor} = 0; +$build{viewer} = 0; +$build{xpapp} = 0; +$build{extensions} = 1; +$build{plugins} = 0; +$build{mailnews} = 0; +$build{apprunner} = 0; +$build{resources} = 1; -$build{xptlink} = 0; +$build{xptlink} = 0; -$options{transformiix} = 0; -$options{mathml} = 0; -$options{svg} = 0; -$options{mng} = 1; -$options{ldap} = 0; -$options{xmlextras} = 0; +$options{transformiix} = 0; +$options{mathml} = 0; +$options{svg} = 0; +$options{mng} = 1; +$options{ldap} = 0; +$options{xmlextras} = 0; -$options{jar_manifests} = 1; # use jar.mn files for resources, not MANIFESTs -$options{jars} = 1; # build jar files -$options{chrome_files} = 0; # install files in chrome as well as making jar files. +# -------------------------- Chrome and jar-related options ----------------------------------------- +$options{jar_manifests} = 1; # use jar.mn files for resources, not MANIFESTs. This must be ON, + # unless you want to use the obsolete (and probably bitrotted) + # MANIFEST files to install resources. + + +# These two options determine whether you get jar files, or loose files in chrome. +# Either one or both option must be turned on. + +$options{chrome_jars} = 1; # build jar files +$options{chrome_files} = 0; # install regular files in chrome + +$options{use_jars} = 1; # This option determines whether chrome comes out of jars + # or regular files at runtime (by affecting installed-chrome.txt). + # If 1, $options{chrome_jars} must be 1. + +# ------------------------ End chrome and jar-related options ---------------------------------------- # Don't change these (where should they go?) -$optiondefines{mathml}{MOZ_MATHML} = 1; -$optiondefines{svg}{MOZ_SVG} = 1; +$optiondefines{mathml}{MOZ_MATHML} = 1; +$optiondefines{svg}{MOZ_SVG} = 1; #----------------------------------------------- # configuration variables that affect the manner # of building, but possibly affecting # the outcome. #----------------------------------------------- -$ALIAS_SYM_FILES = $DEBUG; -$CLOBBER_LIBS = 1; # turn on to clobber existing libs and .xSYM files before - # building each project +$ALIAS_SYM_FILES = $DEBUG; +$CLOBBER_LIBS = 1; # turn on to clobber existing libs and .xSYM files before + # building each project # The following two options will delete all dist files (if you have $build{dist} turned on), # but leave the directory structure intact. -$CLOBBER_DIST_ALL = 1; # turn on to clobber all aliases/files inside dist (headers/xsym/libs) -$CLOBBER_DIST_LIBS = 0; # turn on to clobber only aliases/files for libraries/sym files in dist -$CLOBBER_IDL_PROJECTS = 0; # turn on to clobber all IDL projects. +$CLOBBER_DIST_ALL = 1; # turn on to clobber all aliases/files inside dist (headers/xsym/libs) +$CLOBBER_DIST_LIBS = 0; # turn on to clobber only aliases/files for libraries/sym files in dist +$CLOBBER_IDL_PROJECTS = 0; # turn on to clobber all IDL projects. #----------------------------------------------- # configuration variables that are preferences for the build style, # and do not affect what is built. #----------------------------------------------- $CodeWarriorLib::CLOSE_PROJECTS_FIRST - = 1; - # 1 = close then make (for development), - # 0 = make then close (for tinderbox). -$USE_TIMESTAMPED_LOGS = 1; + = 1; + # 1 = close then make (for development), + # 0 = make then close (for tinderbox). +$USE_TIMESTAMPED_LOGS = 1; #----------------------------------------------- # END OF CONFIG SWITCHES #----------------------------------------------- if ($pull{all}) { - foreach $k (keys(%pull)) - { - $pull{$k} = 1; - } + foreach $k (keys(%pull)) + { + $pull{$k} = 1; + } } if ($build{all}) { - foreach $k (keys(%build)) - { - $build{$k} = 1; - } + foreach $k (keys(%build)) + { + $build{$k} = 1; + } } if ($build{most}) { ### Just uncomment/comment to get the ones you want (if "most" is selected). -# $build{dist} = 1; -# $build{dist_runtime}= 1; - $build{xpidl} = 1; # build idl compiler - $build{idl} = 1; - $build{stubs} = 1; - $build{runtime} = 1; - $build{common} = 1; - $build{imglib} = 1; - $build{necko} = 1; +# $build{dist} = 1; +# $build{dist_runtime}= 1; + $build{xpidl} = 1; # build idl compiler + $build{idl} = 1; + $build{stubs} = 1; + $build{runtime} = 1; + $build{common} = 1; + $build{imglib} = 1; + $build{necko} = 1; $build{security} = 1; - $build{browserutils} = 1; - $build{intl} = 1; - $build{nglayout} = 1; - $build{editor} = 1; - $build{viewer} = 1; - $build{xpapp} = 1; - $build{extensions} = 1; - $build{plugins} = 1; - $build{mailnews} = 1; - $build{apprunner} = 1; - $build{resources} = 1; + $build{browserutils} = 1; + $build{intl} = 1; + $build{nglayout} = 1; + $build{editor} = 1; + $build{viewer} = 1; + $build{xpapp} = 1; + $build{extensions} = 1; + $build{plugins} = 1; + $build{mailnews} = 1; + $build{apprunner} = 1; + $build{resources} = 1; } # do the work @@ -156,21 +170,21 @@ $MOZ_SRC = cwd(); if ($USE_TIMESTAMPED_LOGS) { - #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"); + #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 + OpenErrorLog("NGLayoutBuildLog"); # Release build + #OpenErrorLog("Mozilla.BuildLog"); # Tinderbox requires that name } Moz::StopForErrors(); diff --git a/mozilla/build/mac/MozJar.pm b/mozilla/build/mac/MozJar.pm index 77531eca5e7..940bd9676f6 100644 --- a/mozilla/build/mac/MozJar.pm +++ b/mozilla/build/mac/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); #------------------------------------------------------------------------------- @@ -98,6 +98,39 @@ sub CreateJarFileFromDirectory($$$) MacPerl::SetFileInfo("ZIP ", "ZIP ", $jarpath); } + +#------------------------------------------------------------------------------- +# SanityCheckJarOptions +# +#------------------------------------------------------------------------------- +sub SanityCheckJarOptions() +{ + if (! $main::options{jar_manifests}) + { + print "\$options{jar_manifests} is off, which means you are using obsolete MANIFEST files to install chrome resources.\n"; + return; + } + + 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 # @@ -186,7 +219,7 @@ 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"; } @@ -276,7 +309,7 @@ sub setupJarFile($$$) $jar_file =~ s|/|:|g; # slash to colons my($full_jar_path) = Moz::full_path_to($dest_path.":".$jar_file); - if ($main::options{jars}) + if ($main::options{chrome_jars}) { my($zip) = $jar_hash->{$jar_id}; if (!$zip) # if we haven't made it already, do so @@ -318,7 +351,7 @@ sub closeJarFile($$) # print "Closing jar file $jar_path\n"; - if ($main::options{jars}) + if ($main::options{chrome_jars}) { } @@ -339,7 +372,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); @@ -382,7 +415,7 @@ sub registerChromePackage($$$$$$) my($chrome_entry); - if ($main::options{jars}) { + if ($main::options{use_jars}) { $chrome_entry = "$chrome_type,install,url,jar:resource:/chrome/$manifest_subdir!/$chrome_type/$pkg_name"; } else { $manifest_subdir =~ s/\.jar$/\//; @@ -427,9 +460,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"; } diff --git a/mozilla/build/mac/NGLayoutBuildList.pm b/mozilla/build/mac/NGLayoutBuildList.pm index 81e25d7e9e4..eb841901c18 100644 --- a/mozilla/build/mac/NGLayoutBuildList.pm +++ b/mozilla/build/mac/NGLayoutBuildList.pm @@ -253,7 +253,7 @@ sub InstallManifestRDFFiles() my $chrome_subdir = "Chrome:"; my $chrome_dir = "$dist_dir" . $chrome_subdir; - my($building_jars) = $main::options{jars}; + my($building_jars) = 0; # $main::options{chrome_jars}; # nuke installed-chrome.txt unlink ${chrome_dir}."installed-chrome.txt"; @@ -337,6 +337,8 @@ sub ConfigureBuildSystem() # launch codewarrior and write idepath.txt 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:"); @@ -621,6 +623,8 @@ sub SetDefaultSkin($) my($dist_dir) = _getDistDirectory(); 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); @@ -1364,7 +1368,7 @@ sub ProcessJarManifests() sub BuildJarFiles() { - unless( $main::build{resources} && $main::options{jars} ) { return; } + unless( $main::build{resources} ) { return; } _assertRightDirectory(); print("--- Starting JAR building ----\n"); diff --git a/mozilla/build/mac/PullNGlayout.pl b/mozilla/build/mac/PullNGlayout.pl index 011bb8b801b..4702fab0e8b 100644 --- a/mozilla/build/mac/PullNGlayout.pl +++ b/mozilla/build/mac/PullNGlayout.pl @@ -36,10 +36,10 @@ $pull{runtime} = 0; if ($pull{all}) { - foreach $k (keys(%pull)) - { - $pull{$k} = 1; - } + foreach $k (keys(%pull)) + { + $pull{$k} = 1; + } } # you should not have to edit anything bellow