This commit is contained in:
atotic 1998-06-11 03:58:24 +00:00
Родитель e72c096f61
Коммит 7c2e91b35c
4 изменённых файлов: 583 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,114 @@
#!perl -w
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
#
#
# nglayout build script (debug)
#
use NGLayoutBuildList;
use Cwd;
use Moz;
# configuration variables
$DEBUG = 1;
$pull{all} = 0;
$pull{lizard} = 0;
$pull{xpcom} = 0;
$pull{imglib} = 0;
$pull{netlib} = 0;
$pull{nglayout} = 0;
$pull{mac} = 0;
$build{all} = 0;
$build{dist} = 0;
$build{projects}= 0;
#
# UI
#
@choices = ("pull_and_build_all",
"pull_all",
"build_all",
"pull_nglayout",
"build_dist",
"build_projects");
#damn, this does not work on
if (0)
{
@pick = MacPerl::Pick("What would you like to do?", @choices);
$pull{all} = 0;
$build{all} = 1;
foreach $i (@pick)
{
if ($i eq "pull_and_build_all")
{
$pull{all} = 1;
$build{all} = 1;
}
elsif ($i eq "pull_all")
{
$pull{all} = 1;
}
elsif ($i eq "build_all")
{
$build{all} = 1;
}
elsif ($i eq "build_dist")
{
$build{dist} = 1;
}
elsif ($i eq "build_projects")
{
$build{projects} = 1;
}
}
}
else
{
$pull{all} = 1;
$build{all} = 0;
}
if ($pull{all})
{
foreach $k (keys(%pull))
{
$pull{$k} = 1;
}
}
if ($build{all})
{
foreach $k (keys(%build))
{
$build{$k} = 1;
}
}
# do the work
# you should not have to edit anything bellow
chdir("::::");
$MOZ_SRC = cwd();
OpenErrorLog(":::BuildLog");
Checkout();
chdir($MOZ_SRC);
BuildDist();
chdir($MOZ_SRC);
BuildProjects();

198
build/mac/MacCVS.pm Normal file
Просмотреть файл

@ -0,0 +1,198 @@
#!perl -w
package MacCVS;
# package Mac::Apps::MacCVS; this should really be the name of the package
# but due to our directory hierarchy in mozilla, I am not doing it
require 5.004;
require Exporter;
use strict;
use vars qw($VERSION @ISA @EXPORT $MacCVSLib);
use Mac::StandardFile;
use Moz;
use Cwd;
use Exporter;
use File::Basename;
@ISA = qw(Exporter);
@EXPORT = qw( new print checkout);
$VERSION = "1.00";
# Architecture:
# cvs session object:
# name - session name
# session_file - session file
#
# globals
# $MacCVSLib - location of MacCVS applescript library
#
#
#
# utility routines
#
# just like Mac::DoAppleScript, 1 is success, 0 is failure
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";
return 0;
}
}
# _useMacCVSLib
# returns 1 on success
# Search the include path for the file called MacCVSLib
sub _useMacCVSLib()
{
unless ( defined($MacCVSLib) )
{
my($libname) = "MacCVSLib";
# try the directory we were run from
my($c) = dirname($0) . ":" . $libname;
if ( -e $c)
{
$MacCVSLib = $c;
}
else
{
# now search the include directories
foreach (@INC)
{
unless ( m/^Dev:Pseudo/ ) # This is some bizarre MacPerl special-case directory
{
$c = $_ . $libname;
if (-e $c)
{
$MacCVSLib = $c;
last;
}
}
}
}
if (! (-e $MacCVSLib))
{
print STDERR "MacCVS lib could not be found! $MacCVSLib";
return 0;
}
}
return 1;
}
#
# Session object methods
#
sub new {
my ( $proto, $session_file) = @_;
my $class = ref($proto) || $proto;
my $self = {};
if ( defined($session_file) && ( -e $session_file) )
{
$self->{"name"} = basename( $session_file );
$self->{"session_file"} = $session_file;
bless $self, $class;
return $self;
}
else
{
print STDERR "MacCVS->new cvs file < $session_file > does not exist\n";
return;
}
}
# makes sure that the session is open
# assertSessionOpen()
# returns 1 on failure
sub assertSessionOpen() {
my ($self) = shift;
_useMacCVSLib() || die "Could not load MacCVSLib\n";
my $script = <<END_OF_APPLESCRIPT;
tell (load script file "$MacCVSLib") to OpenSession("$self->{session_file}")
END_OF_APPLESCRIPT
return _myDoAppleScript($script);
}
# prints the cvs object, used mostly for debugging
sub print {
my($self) = shift;
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 {
my($self, $module, $revision, $date ) = @_;
unless( defined ($module) ) { $module = ""; } # get rid of the pesky undefined warnings
unless( defined ($revision) ) { $revision = ""; }
unless( defined ($date) ) { $date = ""; }
$self->assertSessionOpen() || return 1;
my $script = <<END_OF_APPLESCRIPT;
tell (load script file "$MacCVSLib") to Checkout given sessionName:"$self->{name}", module:"$module", revision:"$revision", date:"$date"
END_OF_APPLESCRIPT
return _myDoAppleScript($script);
}
1;
=pod
=head1 NAME
MacCVS - Interface to MacCVS
=head1 SYNOPSIS
use MacCVS;
$session = MacCVS->new( <session_file_path>) || die "cannot create session";
$session->checkout([module] [revision] [date]) || die "Could not check out";
=head1 DESCRIPTION
This is a MacCVS interface for talking to MacCVS Pro client.
MacCVSSession is the class used to manipulate the session
=item new
MacCVS->new( <cvs session file path>);
Creates a new session. Returns undef on failure.
=item checkout( <module> [revision] [date] )
cvs checkout command. Revision and date are optional
returns 0 on failure
=cut
=head1 SEE ALSO
=over
=item MacCVS Home Page
http://www.maccvs.org/
=back
=head1 AUTHORS
Aleks Totic atotic@netscape.com
=cut
__END__

Двоичные данные
build/mac/MacCVSLib Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,271 @@
#!perl -w
package NGLayoutBuildList;
require 5.004;
require Exporter;
use strict;
use vars qw(@ISA @EXPORT $IMGLIB_BRANCH $distlist);
use MacCVS;
use Mac::StandardFile;
use Cwd;
use Moz;
@ISA = qw(Exporter);
@EXPORT = qw( Checkout BuildDist );
# NGLayoutBuildList builds the nglayout project
# it is configured by setting the following variables in the caller:
# Usage:
# caller variables that affect behaviour:
# DEBUG : 1 if we are building a debug version
# 3-part build process: checkout, dist, and build_projects
#
# declarations
#
$IMGLIB_BRANCH = "MODULAR_IMGLIB_BRANCH";
#
# Utility routines
#
# pickWithMemoryFile stores the information about the user pick inside
# the file $session_storage
sub _pickWithMemoryFile($)
{
my ($sessionStorage) = @_;
my $cvsfile;
if (( -e $sessionStorage) &&
open( SESSIONFILE, $sessionStorage ))
{
# Read in the path if available
$cvsfile = <SESSIONFILE>;
chomp $cvsfile;
close SESSIONFILE;
if ( ! -e $cvsfile )
{
print STDERR "$cvsfile has disappeared\n";
undef $cvsfile;
}
}
unless (defined ($cvsfile))
{
# prompt user for the file name, and store it
print "Choose a CVS session file in file dialog box:\n"; # no way to display a prompt?
my $macFile = StandardGetFile( 0, "McvD");
if ( $macFile->sfGood() )
{
$cvsfile = $macFile->sfFile();
# save the choice if we can
if ( open (SESSIONFILE, ">" . $sessionStorage))
{
printf SESSIONFILE $cvsfile, "\n";
close SESSIONFILE;
}
else
{
print STDERR "Could not open storage file\n";
}
}
}
return $cvsfile;
}
# assert that we are in the correct directory for the build
sub _assertRightDirectory()
{
unless (-e ":mozilla")
{
my($dir) = cwd();
print STDERR "NGLayoutBuildList called from incorrect directory: $dir";
}
}
#
# MAIN ROUTINES
#
sub Checkout()
{
_assertRightDirectory();
my($cvsfile) = _pickWithMemoryFile("::nglayout.cvsloc");
my($session) = MacCVS->new( $cvsfile );
unless (defined($session)) { die "Checkout aborted. Cannot create session file: $session" }
if ($main::pull{lizard})
{
$session->checkout("mozilla/LICENSE") || die "checkout failure";
$session->checkout("mozilla/LEGAL") || die "checkout failure";
$session->checkout("mozilla/config") || die "checkout failure";
$session->checkout("mozilla/lib/liblayer") || die "checkout failure";
$session->checkout("mozilla/modules/zlib") || die "checkout failure";
$session->checkout("mozilla/modules/libutil") || die "checkout failure";
$session->checkout("mozilla/nsprpub") || die "checkout failure";
$session->checkout("mozilla/sun-java") || die "checkout failure";
$session->checkout("mozilla/nav-java") || die "checkout failure";
$session->checkout("mozilla/js") || die "checkout failure";
$session->checkout("mozilla/modules/security/freenav") || die "checkout failure";
$session->checkout("mozilla/modules/libpref") || die "checkout failure";
}
if ($main::pull{xpcom})
{
$session->checkout("mozilla/modules/libreg ") || die "checkout failure";
$session->checkout("mozilla/xpcom") || die "checkout failure";
}
if ($main::pull{imglib})
{
$session->checkout("mozilla/jpeg ", $IMGLIB_BRANCH) || die "checkout failure";
$session->checkout("mozilla/modules/libutil", $IMGLIB_BRANCH) || die "checkout failure";
$session->checkout("mozilla/modules/libimg", $IMGLIB_BRANCH) || die "checkout failure";
}
if ($main::pull{netlib})
{
$session->checkout("mozilla/lib/xp ") || die "checkout failure";
$session->checkout("mozilla/network") || die "checkout failure";
$session->checkout("mozilla/include") || die "checkout failure";
}
if ($main::pull{nglayout})
{
$session->checkout("mozilla/base ") || die "checkout failure";
$session->checkout("mozilla/dom") || die "checkout failure";
$session->checkout("mozilla/gfx") || die "checkout failure";
$session->checkout("mozilla/htmlparser") || die "checkout failure";
$session->checkout("mozilla/layout") || die "checkout failure";
$session->checkout("mozilla/view") || die "checkout failure";
$session->checkout("mozilla/webshell") || die "checkout failure";
$session->checkout("mozilla/widget") || die "checkout failure";
}
if ($main::pull{mac})
{
$session->checkout("mozilla/build/mac ") || die "checkout failure";
$session->checkout("mozilla/cmd/macfe") || die "checkout failure";
$session->checkout("mozilla/lib/mac/MacMemoryAllocator") || die "checkout failure";
$session->checkout("mozilla/lib/mac/NSStdLib") || die "checkout failure";
$session->checkout("mozilla/lib/mac/MoreFiles") || die "checkout failure";
$session->checkout("mozilla/lib/mac/NSRuntime") || die "checkout failure";
}
}
# builds the dist directory
sub BuildDist()
{
unless ( $main::build{dist} ) { return;}
_assertRightDirectory();
my($distlist) = [
#INCLUDE
[":mozilla:config:mac:MANIFEST", ":mozilla:dist:config:"],
[":mozilla:include:MANIFEST", ":mozilla:dist:include:"],
[":mozilla:cmd:macfe:pch:MANIFEST", ":mozilla:dist:include:"],
#NSPR
[":mozilla:nsprpub:pr:include:MANIFEST", ":mozilla:dist:nspr:"],
[":mozilla:nsprpub:pr:src:md:mac:MANIFEST", ":mozilla:dist:nspr:mac:"],
[":mozilla:nsprpub:lib:ds:MANIFEST", ":mozilla:dist:nspr:"],
[":mozilla:nsprpub:lib:libc:include:MANIFEST", ":mozilla:dist:nspr:"],
[":mozilla:nsprpub:lib:msgc:include:MANIFEST", ":mozilla:dist:nspr:"],
#JPEG
[":mozilla:jpeg:MANIFEST", ":mozilla:dist:jpeg:"],
#LIBREG
[":mozilla:modules:libreg:include:MANIFEST", ":mozilla:dist:libreg:"],
#XPCOM
[":mozilla:xpcom:src:MANIFEST", ":mozilla:dist:xpcom:"],
#ZLIB
[":mozilla:modules:zlib:src:MANIFEST", ":mozilla:dist:zlib:"],
#LIBUTIL
[":mozilla:modules:libutil:public:MANIFEST", ":mozilla:dist:libutil:"],
#SUN_JAVA
[":mozilla:sun-java:stubs:include:MANIFEST", ":mozilla:dist:sun-java:"],
[":mozilla:sun-java:stubs:macjri:MANIFEST", ":mozilla:dist:sun-java:"],
#NAV_JAVA
[":mozilla:nav-java:stubs:include:MANIFEST", ":mozilla:dist:nav-java:"],
[":mozilla:nav-java:stubs:macjri:MANIFEST", ":mozilla:dist:nav-java:"],
#JS
[":mozilla:js:src:MANIFEST", ":mozilla:dist:js:"],
#SECURITY_freenav
[":mozilla:modules:security:freenav:MANIFEST", ":mozilla:dist:security:"],
#LIBPREF
[":mozilla:modules:libpref:public:MANIFEST", ":mozilla:dist:libpref:"],
#LIBIMAGE
[":mozilla:modules:libimg:png:MANIFEST", ":mozilla:dist:libimg:"],
[":mozilla:modules:libimg:src:MANIFEST", ":mozilla:dist:libimg:"],
[":mozilla:modules:libimg:public:MANIFEST", ":mozilla:dist:libimg:"],
#NETWORK
[":mozilla:network:cache:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:client:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:cnvts:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:cstream:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:main:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:mimetype:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:util:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:about:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:certld:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:dataurl:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:file:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:ftp:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:gopher:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:http:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:js:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:mailbox:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:marimba:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:nntp:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:pop3:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:remote:MANIFEST", ":mozilla:dist:network:"],
[":mozilla:network:protocol:smtp:MANIFEST", ":mozilla:dist:network:"],
#BASE
#XP
#error still not exported
];
foreach $a (@$distlist)
{
print "InstallFromManifest $a->[0] $a->[1]\n";
InstallFromManifest( $a->[0], $a->[1]);
}
}
# builds all projects
# different targets controlled by $main::build
sub BuildProjects()
{
unless( $main::build{projects} ) { 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)" : "";
Moz::BuildProject(":mozilla:lib:mac:NSStdLib:NSStdLib.mcp", "Stub Library");
Moz::BuildProject(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator.mcp", "Stub Library");
Moz::BuildProject(":mozilla:cmd:macfe:projects:client:Navigator.mcp", "Stub Library");
Moz::BuildProject(":mozilla:lib:mac:NSRuntime:NSRuntime.mcp");
Moz::BuildProject(":mozilla:cmd:macfe:restext:NavStringLibPPC.mcp");
Moz::BuildProject(":mozilla:lib:mac:MoreFiles:build:MoreFilesPPC.prj");
if ( $D )
{
Moz::BuildProject(":mozilla:nsprpub:macbuild:NSPR20PPCDebug.mcp");
Moz::BuildProject(":mozilla:dbm:macbuild:DBMPPCDebug.mcp");
}
else
{
Moz::BuildProject(":mozilla:nsprpub:macbuild:NSPR20PPC.mcp");
Moz::BuildProject(":mozilla:dbm:macbuild:DBMPPC.mcp");
}
Moz::BuildProject(":mozilla:lib:mac:MacMemoryAllocator:MemAllocator.mcp", "PPC Shared Library$D");
Moz::BuildProject(":mozilla:lib:mac:NSStdLib:NSStdLib.mcp", "PPC Shared Library");
Moz::BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "PPC Shared Library$D");
if ( $D )
{
Moz::BuildProject(":mozilla:xpcom:macbuild:xpcomPPCDebug.mcp");
}
else
{
Moz::BuildProject(":mozilla:xpcom:macbuild:xpcomPPC.mcp");
}
Moz::BuildProject(":mozilla:jpeg:macbuild:JPEG.mcp", "PPC Shared Library$D");
}