Macintosh Port of Info-Zip's Zip
by Dirk Haase, d_haase@sitec.net
home page:  www.sitec.net/maczip
21. March 1999
================================


Installation -- Notes for the traditional MacOS 8 (or earlier)
		 with Metrowerks CodeWarrior IDE.

First, please read the files "unzip:Install" and "zip:install" of the 
zip and unzip distribution, which describes non-platform specific 
information. 



IDE Compliance

MacZip is developed using CodeWarrior Professional (presently Release 4). 
The most up-to-date projects are only openable by this version of the IDE. 
It is becoming increasingly difficult to provide backward-compatible project 
files, since every release seems to alter the format (why???). In order to 
keep the release package manageable, I have decided to remove the older project 
files (I can't keep them up to date anyway- to do so would require that I 
keep every version of the IDE on my hard disk, clearly not something that 
makes much sense). Therefore, if you are using an older version of CodeWarrior,
you will need to create your own projects. The MacZip sources are fully 
compatible with all versions of CodeWarrior back to version 11 or so, though 
please note Header Compliance, below.

So, for older CodeWarriors, or if you are using Symantec C++, you'll need 
a file called "filelist", which lists the files you need to include to make 
MacZip. Open this file and create a project that includes the files listed. 
It should then work- MacZip requires at least CodeWarrior 11.

With Symantec, I have not done anything in MacZip to address this issue 
specifically, so if you wish to use Symantec, be prepared to encounter some 
initial difficulties getting this essential feature to compile successfully.

MacZip should be compilable with MPW with some changes needed. However, 
for now if you need to use MPW, expect to have to do some work to allow 
MacZip to compile.


Header Compliance

MacZip 1.00 and later is compatible with version 3.0.1 and 3.1 of Apple's 
Universal Headers. 
These headers are supplied with CodeWarrior Pro 2 and 3, and 3.1 will be shipped 
with Release 4. Users of earlier versions of CodeWarrior may need to allow for 
this, depending on exactly which headers they have. The best solution is to 
obtain the newer headers, available free from Apple's website at:

http://developer.apple.com/sdk/

However, if you are using the older headers, you should still find that MacZip 
will compile OK, since where the new constants are undefined. The intention is 
to allow MacZip to be 100% Carbon-compliant as soon as possible, so a move 
to the new headers is both desirable and inevitable. 



You must be familiar with Metrowerks CodeWarrior IDE developement environment.
Steps described here are only suggestions.  Your mileage may vary.

The project files in "unzip:macos", "zip:macos" and "Zip Main Project" are
in Metrowerks Codewarrior Pro 4 format.

Expected folder structure of the project files is:

	Zip & Unzip for Mac
		unzip
		zip
		libmoto_macdev
		izshr
		Zip Main Project
		
If your Compiler version can't read the project files follow these instructions:
(only zip PPC project is described here, 68K zip/unzip should be created 
in same way)



### Installation, Compiling, and Creating applications ###

[1] Unpack the source distribution into the folders (see structure above).

[2] Creating the library file "Zip Lib (PPC)"

a) Start up Metrowerks CodeWarrior IDE

b) File -> New Project
	MacOS
	    C/C++
		Select "Std C Console Multi-Target" or similar
		    [OK]

	Select "Zip & Unzip for Mac:zip:macos:" folder
	Name new project as: "zip" or "unzip"
		    [SAVE]

c) In Finder, select all shared files ".c" and ".h" in the source directory of zip.
    Drag the files into CodeWarrior window under "Sources" above HelloWorld.c.
    Remove from the source list "HelloWorld.c" (of cause) and
    the following files:
    for unzip:
		api.c
		apihelp.c
		funzip.c
		unzipstb.c
		envargs.c
	for zip:
		api.c
		api.h
		mktime.c
	(see filelist for a complete filelist)
	and again, in Finder, select all mac source files below the macos folder	
    Drag the files into CodeWarrior window under "Sources".

    Remove from the file list ALL library files
	(in both sections ANSI and Mac libraries).

d) Project -> Project Settings..
	Select in Project "PPC Project" (in the left-hand selection list)
	Project type: Library
	Library Info: File name: "Zip Lib (PPC)" 
	C/C++ Settings (minimal settings): 
	                disable enums always Int
	                disable Use unsigned Chars
	                disable Map newlines to CR

e) Project -> Make
	Now, you should find the library file as
           "Zip & Unzip for Mac:zip:macos:Zip Lib (PPC)" 


[3] Building the MacZip program using the libraries.

a) Start up Metrowerks CodeWarrior IDE, if not already.

b) File -> New Project
	MacOS
	    C/C++
		Select "MacOS Toolbox Multitarget"
		    [OK]

	Select "Zip Main Project" folder
	Name new project as: MacZip
		    [SAVE]

c) In Finder, select source files in the "Zip Main Project" source directory.
    Drag the selected files into CodeWarrior window under "Sources" above HelloWorld.c.
    Remove from the source list "HelloWorld.c"

d) In Finder, select the library file "Zip & Unzip for Mac:zip:macos:Zip Lib (PPC)"
    and "Zip & Unzip for Mac:unzip:macos:Unzip Lib (PPC)" created in step [2] above. 
    Drag the library into the CodeWarrior window under either ANSI or Mac library
    section. MacZip will need both libraries to build successfully.

e) Project -> Project Settings..
    Select "Project->PPC Project" in the left selection list.
	File name: MacZip
	C/C++ Settings (minimal settings): 
	                disable enums always Int
	                disable Use unsigned Chars
	                disable Map newlines to CR
	Link Order: Drag all Std Libraries to the end.

    Link order of the standard libraries is very important: Link all
    sources first and all standard libraries last.

    Also, increase the memory settings from the default, e.g.,
	Preferred Heap Size (k): 12000
	Minimum Heap Size (k): 1024
	Stack Size (k): 512

    Note that these sizes will depend on the amount of files to be compressed.  
    The above values worked fine in most situations.

