r=cls
Enable packaging on OS/2
This commit is contained in:
mkaply%us.ibm.com 2001-05-22 22:05:15 +00:00
parent 7b22982d7c
commit 4537052a5e
2 changed files with 49 additions and 6 deletions

View File

@ -91,6 +91,9 @@ include $(topsrcdir)/config/rules.mk
GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE)
OSPACKAGE = unix
MOZILLA_BIN = $(DIST)/bin/mozilla-bin
ifeq ($(OS_ARCH),IRIX)
STRIP_FLAGS = -f
endif
@ -98,10 +101,16 @@ ifeq ($(OS_ARCH),BeOS)
STRIP_FLAGS = -g
PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "mozilla-bin"
endif
ifeq ($(OS_ARCH),OS2)
STRIP = lxlite.exe
STRIP_FLAGS = -u
MOZILLA_BIN = $(DIST)/bin/mozilla$(BIN_SUFFIX)
OSPACKAGE = os2
endif
all export libs install:: $(TARGETS)
$(PACKAGE): $(DIST)/bin/mozilla-bin
$(PACKAGE): $(MOZILLA_BIN)
@rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $@ $(EXCLUDE_LIST)
# NOTE: this must be a cp now that dist links into the tree so that we
# do not strip the binaries actually in the tree.
@ -145,7 +154,7 @@ endif
@echo "Compressing..."
cd $(DIST); $(MAKE_PACKAGE)
dist: $(DIST)/bin/mozilla-bin
dist: $(MOZILLA_BIN)
ifndef MOZ_PKG_DEST
@echo "Please define MOZ_PKG_DEST first. It must be an absolute path to a dir outside the source tree. It should be empty (files might get deleted without warning)."
@echo "Other options (not required):"
@ -155,7 +164,7 @@ else
@if [ ! -d $(MOZ_PKG_DEST) ]; then mkdir $(MOZ_PKG_DEST); fi
@cd $(MOZ_PKG_DEST); rm -rf bin $(MOZ_PKG_APPNAME) $(PACKAGE)
@echo "Creating distribution tarball in $(MOZ_PKG_DEST)..."
$(PERL) $(srcdir)/pkgcp.pl --source $(DEPTH)/dist --destination $(MOZ_PKG_DEST) --file $(srcdir)/packages-unix --os unix --flat
$(PERL) $(srcdir)/pkgcp.pl --source $(DEPTH)/dist --destination $(MOZ_PKG_DEST) --file $(srcdir)/packages-$(OSPACKAGE) --os $(OSPACKAGE) --flat
@cd $(MOZ_PKG_DEST); mv bin $(MOZ_PKG_APPNAME)
ifneq ($(MOZ_PKG_APPNAME),mozilla)
@echo "Creating start script $(MOZ_PKG_APPNAME)..."

View File

@ -52,7 +52,7 @@ $line = ""; # line being processed
$srcdir = ""; # root directory being copied from
$destdir = ""; # root directory being copied to
$package = ""; # file listing files to copy
$os = ""; # os type (MacOS, MSDOS, Unix)
$os = ""; # os type (MacOS, MSDOS, Unix, OS/2)
$verbose = 0; # shorthand for --debug 1
$lineno = 0; # line # of package file for error text
$debug = 0; # controls amount of debug output
@ -253,6 +253,7 @@ sub do_copyfile
my ($srcpath) = ""; # source file directory path
my ($srcname) = ""; # source file name
my ($srcsuffix) = ""; # source file name suffix
my ($curdir) = getcwd; # need current dir on OS/2 to switch back
($debug >= 2) && print "do_copyfile():\n";
@ -302,6 +303,14 @@ sub do_copyfile
$destpath =~ s/\//\\/g;
$srcdir =~ s/\//\\/g;
$PD = "\\";
} elsif ( $os eq "OS2") {
#Don't Look! Seriously...
$destpath =~ s/\\/\//g;
$srcdir =~ s/\\/\//g;
$PD = "/";
$destpath =~ s/$srcdir$PD//g;
$destpath = "$srcdir$PD$destpath";
$PD = "\\";
} else {
$destpath =~ s/$srcdir$PD//;
}
@ -316,11 +325,24 @@ sub do_copyfile
}
}
#Ensure correct directory
if ($os eq "OS2") {
chdir($saved_cwd);
}
# create the destination path if it doesn't exist
if (! -d "$destpath" ) {
($debug >= 5) && print " mkpath($destpath)\n";
#OS2 hack. Sorry... Chop off "/"
if ($os eq "OS2" ) {
chop($destpath);
}
mkpath ($destpath, 0, 0755) ||
die "Error: mkpath() failed: $!. Exiting...\n";
# Put "/" back for copying...
if ($os eq "OS2") {
$destpath = "$destpath/";
}
}
# path exists, source and destination known, time to copy
@ -351,6 +373,10 @@ sub do_copyfile
} else {
warn "Error: file $srcpath$srcname$srcsuffix is not a file or is not readable ($package, $component, $lineno).\n";
}
#Resetting dir...
if ($os eq "OS2") {
chdir($curdir);
}
}
@ -371,6 +397,10 @@ sub do_wildcard
if ($os eq "MacOS") {
warn "Warning: globbing on Mac not supported.\nWorkaround is to copy entire directory.\n";
@list = <$entry>;
elsif ( $os eq "OS2"){
#warn "Warning: globbing on OS/2 not supported.\nWorkaround is to copy entire directory.\n";
@list = $entry;
chop($list[0]);
} else {
@list = glob($entry); # expand it
}
@ -509,7 +539,7 @@ sub check_arguments
$exitval += 4;
}
# check OS == {mac|unix|dos}
# check OS == {mac|unix|dos|os2}
if ($os eq "") {
print "Error: OS type (--os) not specified.\n";
$exitval += 8;
@ -525,6 +555,10 @@ sub check_arguments
$os = "Unix"; # can be anything but MacOS, MSDOS, or VMS
$PD = "/";
fileparse_set_fstype ($os);
} elsif ( $os =~ /os2/i) {
$os = "OS2";
$PD = "/";
fileparse_set_fstype($os);
} else {
print "Error: OS type \"$os\" unknown.\n";
$exitval += 16;
@ -596,7 +630,7 @@ NOTE: Source and destination directories must be absolute paths.
destination directory.
Required.
-o, --os [dos|mac|unix]
-o, --os [dos|mac|unix|os2]
Specifies which type of system this is. Used for parsing
file specifications from the package file.
Required.