diff --git a/mozilla/build/mac/build_scripts/BuildMozilla.pl b/mozilla/build/mac/build_scripts/BuildMozilla.pl index f7d87d7b3b3..cc1f1bd73dc 100644 --- a/mozilla/build/mac/build_scripts/BuildMozilla.pl +++ b/mozilla/build/mac/build_scripts/BuildMozilla.pl @@ -100,4 +100,4 @@ $MOZ_SRC = cwd(); my($do_checkout) = 0; my($do_build) = 1; -RunBuild($do_checkout, $do_build, "Mozilla opt build prefs"); +RunBuild($do_checkout, $do_build, "MozillaBuildFlags.txt", "Mozilla opt build prefs"); diff --git a/mozilla/build/mac/build_scripts/BuildMozillaDebug.pl b/mozilla/build/mac/build_scripts/BuildMozillaDebug.pl index c90c976b96f..a9002c6f419 100644 --- a/mozilla/build/mac/build_scripts/BuildMozillaDebug.pl +++ b/mozilla/build/mac/build_scripts/BuildMozillaDebug.pl @@ -103,4 +103,4 @@ $MOZ_SRC = cwd(); my($do_checkout) = 0; my($do_build) = 1; -RunBuild($do_checkout, $do_build, "Mozilla debug build prefs"); +RunBuild($do_checkout, $do_build, "MozillaBuildFlags.txt", "Mozilla debug build prefs"); diff --git a/mozilla/build/mac/build_scripts/Moz.pm b/mozilla/build/mac/build_scripts/Moz.pm index b74efbba622..5e5bba5c5fb 100644 --- a/mozilla/build/mac/build_scripts/Moz.pm +++ b/mozilla/build/mac/build_scripts/Moz.pm @@ -148,7 +148,7 @@ sub OpenErrorLog($) { $log_file = full_path_to($log_file); - open(ERROR_LOG, ">$log_file") || die "Can't open logfile, check the file path.\n"; + open(ERROR_LOG, ">$log_file") || die "Error: Can't open $log_file\n"; MacPerl::SetFileInfo("CWIE", "TEXT", $log_file); $log_file =~ m/.+:(.+)/; @@ -474,6 +474,18 @@ sub RedirectOutputToFile($) { my($log_file) = @_; + # ensure that folders in the path exist + my($logdir) = ""; + my($logfile) = $log_file; + + if ($log_file =~ /(.+?:)([^:]+)$/) # ? for non-greedy match + { + $logdir = $1; + $logfile = $2; + + mkpath($logdir); + } + print "Output is now being redirected to the file '$log_file'\n"; open(STDOUT, "> $log_file") || die "Can't redirect stdout"; diff --git a/mozilla/build/mac/build_scripts/MozBuildUtils.pm b/mozilla/build/mac/build_scripts/MozBuildUtils.pm index bfb174fd457..5dd5b687df5 100644 --- a/mozilla/build/mac/build_scripts/MozBuildUtils.pm +++ b/mozilla/build/mac/build_scripts/MozBuildUtils.pm @@ -11,6 +11,7 @@ use strict; use Exporter; use Cwd; +use File::Path; use Mac::Events; use Mac::StandardFile; @@ -302,16 +303,22 @@ sub ScanForManifestFiles($$$$) #----------------------------------------------- # SetupBuildLog #----------------------------------------------- -sub SetupBuildLog($) +sub SetupBuildLog($$) { - my($timestamped_log) = @_; + my($logfile_path, $timestamped_log) = @_; - my $logdir = ":Build Logs:"; - if (! -d $logdir) + my($logdir) = ""; + my($logfile) = $logfile_path; + + if ($logfile_path =~ /(.+?:)([^:]+)$/) # ? for non-greedy match { - mkdir $logdir, 0777 || die "Couldn't create directory $logdir"; + $logdir = $1; + $logfile = $2; + + print "got log file settings '$logdir' '$logfile'\n"; + mkpath($logdir); } - + if ($timestamped_log) { #Use time-stamped names so that you don't clobber your previous log file! @@ -321,7 +328,7 @@ sub SetupBuildLog($) } else { - OpenErrorLog("${logdir}Mozilla build log"); + OpenErrorLog("${logdir}${logfile}"); } } diff --git a/mozilla/build/mac/build_scripts/MozPrefs.pm b/mozilla/build/mac/build_scripts/MozPrefs.pm index e63c62721d0..86cef39b207 100644 --- a/mozilla/build/mac/build_scripts/MozPrefs.pm +++ b/mozilla/build/mac/build_scripts/MozPrefs.pm @@ -84,10 +84,11 @@ sub WriteDefaultPrefsFile($) % buildfrom nglayout % where to start the build % % Lines which specify the location of the files used to store paths -% to the CodeWarrior IDE, and the MacCVS Pro session file. Examples: +% to the CodeWarrior IDE, and the MacCVS Pro session file. Note quoting +% of paths containing whitespace. Examples: % % filepath idepath ::codewarrior.txt -% filepath sessionpath :sessionpath.txt +% filepath sessionpath ":Some folder:MacCVS session path.txt" % % Lines which modify the build settings like %main::DEBUG. % Any lines which do not match either of the above are assumed @@ -180,12 +181,16 @@ sub ReadPrefsFile($$$$$) next; } - if ($line =~ /^\s*(\w+)\s+(\w+)\s+([^\s]+)\s*/) + if (($line =~ /^\s*(\w+)\s+(\w+)\s+\"(.+)\"\s*/) || + ($line =~ /^\s*(\w+)\s+(\w+)\s+\'(.+)\'\s*/) || + ($line =~ /^\s*(\w+)\s+(\w+)\s+([^\s]+)\s*/)) { my($array_name) = $1; my($option_name) = $2; my($option_value) = $3; + # print "Read '$array_name' '$option_name' '$option_value'\n"; + if ($array_name eq "pull") { HandlePrefSet($pull_flags, $option_name, $option_value, "Pull"); diff --git a/mozilla/build/mac/build_scripts/MozillaBuildFlags.txt b/mozilla/build/mac/build_scripts/MozillaBuildFlags.txt new file mode 100644 index 00000000000..bc8313db8ed --- /dev/null +++ b/mozilla/build/mac/build_scripts/MozillaBuildFlags.txt @@ -0,0 +1,53 @@ +#------------------------------------------------------------------------------- +# These 3 lists are the 'master lists' to control what gets built. +# +# Ordering in these arrays is important; it has to reflect the order in +# which the build occurs. +# +# Setting containing spaces must be quoted with double quotes. +#------------------------------------------------------------------------------- + +pull_flags +all 1 + +build_flags +all 1 +dist 0 +xpidl 0 +idl 0 +stubs 0 +runtime 0 +common 0 +imglib 0 +necko 0 +security 0 +browserutils 0 +intl 0 +nglayout 0 +editor 0 +viewer 0 +xpapp 0 +extensions 0 +plugins 0 +mailnews 0 +apprunner 0 +resources 0 + +options_flags +chrome_jars 1 +chrome_files 0 +use_jars 1 +transformiix 0 +mathml 0 +svg 0 +mng 1 +ldap 0 +xmlextras 0 +mailextras 1 +xptlink 0 + +filepath_flags +idepath ":Build IDE Path.txt" +sessionpath ":Build session path.txt" +buildlogfilepath ":Build Logs:Mozilla build log.txt" +scriptlogfilepath ":Build Logs:Mozilla script log.txt" diff --git a/mozilla/build/mac/build_scripts/MozillaBuildList.pm b/mozilla/build/mac/build_scripts/MozillaBuildList.pm index 58b128ad667..27bea0f908b 100644 --- a/mozilla/build/mac/build_scripts/MozillaBuildList.pm +++ b/mozilla/build/mac/build_scripts/MozillaBuildList.pm @@ -1976,16 +1976,10 @@ sub Checkout() #//-------------------------------------------------------------------------------------------------- #// RunBuild #//-------------------------------------------------------------------------------------------------- -sub RunBuild($$$) +sub RunBuild($$$$) { - my($do_pull, $do_build, $build_prefs) = @_; + my($do_pull, $do_build, $build_flags_file, $build_prefs) = @_; - # setup the build log - SetupBuildLog($main::USE_TIMESTAMPED_LOGS); - - StopForErrors(); - #DontStopForErrors(); - # if we are pulling, we probably want to do a full build, so clear the build progress if ($do_pull) { ClearBuildProgress(); @@ -1997,11 +1991,15 @@ sub RunBuild($$$) \%main::options, \%main::optiondefines, \%main::filepaths, - "MozillaBuildFlags.txt", + $build_flags_file, $build_prefs); + # setup the build log + SetupBuildLog($main::filepaths{"buildlogfilepath"}, $main::USE_TIMESTAMPED_LOGS); + StopForErrors(); + if ($main::LOG_TO_FILE) { - RedirectOutputToFile("Mozilla script log"); + RedirectOutputToFile($main::filepaths{"scriptlogfilepath"}); } # run a pre-build check to see that the tools etc are in order @@ -2015,7 +2013,9 @@ sub RunBuild($$$) # create generated headers ConfigureBuildSystem(); - + + die; + chdir($main::MOZ_SRC); BuildDist(); diff --git a/mozilla/build/mac/build_scripts/PullMozilla.pl b/mozilla/build/mac/build_scripts/PullMozilla.pl index 7f4da2700e1..d2d4d0c0d44 100644 --- a/mozilla/build/mac/build_scripts/PullMozilla.pl +++ b/mozilla/build/mac/build_scripts/PullMozilla.pl @@ -48,4 +48,4 @@ $MOZ_SRC = cwd(); my($do_checkout) = 1; my($do_build) = 0; -RunBuild($do_checkout, $do_build, "Pull prefs"); +RunBuild($do_checkout, $do_build, "MozillaBuildFlags.txt", "Pull prefs");