
Rezilla, resource forks editor for the Macintosh, is an Open Source project. It means that, though usually distributed to the users as an application ready to run under the MacOSX system, its source code is also available: it is currently hosted on the SourceForge site.
This file gives detailed instructions to help compiling the binary from sources. It corresponds to version 1.1 of Rezilla.
The Download section above explains where one can find Rezilla's source code distribution (see here for instance).
Rezilla is written in C++. It is built using Metrowerks CodeWarrior and relies on the PowerPlant design framework which is part of the Mac version of CodeWarrior.
A CodeWarrior project file is provided together with Rezilla's source code: it has been created with CodeWarrior Pro 9. The corresponding version of PowerPlant is 2.2.2.
Rezilla's hexadecimal editing capacity is based on the WASTE text engine. You will need to link against the WASTE library in order to compile Rezilla. This library can be found in various places on the Internet (see on its home page or on the Wikipedia). It is also part of the CodeWarrior Pro distribution, so, if you have CodeWarrior Pro, you certainly have a WASTE distribution: inside CodeWarrior's hierarchy, it is usually found in /CodeWarrior/MacOS Support/(Third Party Support)/WASTE Distribution. Currently, Rezilla uses version 2.1b1 of the WASTE library.
Starting with version 1.0.7, the source distribution of Rezilla also provides XCode project files for those who would prefer using Apple's Developer Tools rather than CodeWarrior. There are two project files: Rezilla.xcode for XCode 1.5 and Rezilla.xcodeproj for XCode 2.0 or greater.
In any case, whether you use CodeWarrior or XCode, you will need the PowerPlant framework if you want to build Rezilla from source. Since January 2006, PowerPlant has become an Open Source project; it is available on the SourceForge site at the following address: http://sourceforge.net/projects/open-powerplant.
The next two sections give specific instructions in order to build Rezilla in the CodeWarrior or in the XCode environments respectively. If you encounter any problem while compiling Rezilla, don't hesitate to ask on the Rezilla Users mailing list.
There is nothing special about building Rezilla using the CodeWarrior's project file (Rezilla.mcp), provided you have a standard installation of CodeWarrior Pro 9. The only point is to verify that the search paths are correctly set on your machine.
These search paths are specified in CodeWarrior via Source Trees. There is, in fact, only one Source Tree you have to declare: launch CodeWarrior, go to the Preferences and select Source Trees. In the corresponding panel, create a Source Tree named Waste and let it point to the folder where your Waste library is located (/CodeWarrior Folder/CodeWarrior/MacOS Support/(Third Party Support)/WASTE Distribution). The other paths used by Rezilla's project are relative to the predefined {Compiler}, {Project} and {OS X Volume} source trees which are automatically set by CodeWarrior, so you should not have to worry about them.
If this is not done already, open now the Rezilla.mcp project. This project contains three targets:
In order to build any of the targets, select the Make command in the Project menu. The built products will be written in a subfolder called Output and located at the same level as the Rezilla.mcp project file:
Note that, most of the time, the Finder does not display the .app extension and you'll probably see Rezilla_D and Rezilla respectively as the name of the application: it is a bundled application, that is to say it looks like a single file but it is in fact a folder containing all the necessary resources.
The CodeWarrior project has user defined actions which take care of copying all the necessary elements to their final destination inside the bundle: this includes the auxiliary files (those which are not generated automatically by the compiler). If the Output folder does not exist already, CodeWarrior will create one while compiling the targets and will also create the bundled structure inside. Provided you do not change the arhitecture of the source files as found in the source distribution or as retrieved directly from the CVS directory at SourceForge, the CodeWarrior project will know where to find the required items.
It is easy to open the bundle and look what is inside: click on the icon of the application while maintaining the Control key pressed and select Open the Package in the contextual menu which appears after the click. Internally here is how the package should be organised:
Rezilla.app
Contents
Info.plist
PkgInfo
MacOS
Rezilla
Resources
Rezilla.rsrc
RezillaTemplates.rsrc
RezillaDocs.icns
Rezilla.icns
Images
rzil_aeteeditor.gif
rezilla_logo.gif
... etc.
English.lproj
InfoPlist.strings
Localizable.strings
Errors.strings
RezillaHelp
index.html
1.html
2.html
3.html
4.html
... etc.
French.lproj
InfoPlist.strings
Localizable.strings
Errors.strings
RezillaHelp
index.html
1.html
2.html
3.html
4.html
... etc.
It is crucial, in particular, that the file RezillaTemplates.rsrc be present in the Rezilla.app/Contents/Resources subfolder. If it is not there, you'll have to copy it manually from the Rezilla_Rsrc folder in Rezilla's source distribution otherwise Rezilla won't function properly.
XCode is Apple's development environment. It is part of the Developer Tools. In Rezilla's source code distribution (version 1.0.7 or greater), you will find two project files corresponding to two different versions of XCode: this is because the format of the project files and the environment have been substantially modified between version 1.5 and 2.0 of XCode. Furthermore internally they do not run the same compiler: the 1.5 version (project file Rezilla.xcode) uses version 3.3 of the GNU gcc compiler while the other (project file Rezilla.xcodeproj) uses the 4.0 version of this compiler.
Compiling Rezilla with XCode is fairly simple once you have successfully taken the following two steps:
The easiest way to do so is to create Source Trees (just like we did in the previous section with CodeWarrior): call Preferences in the XCode menu and select the Source Trees panel. In this panel you should define two Source Trees:
/Users/bernardo/CodeWarrior_9.0/CodeWarrior
/Users/bernardo/CodeWarrior_9.0/CodeWarrior/MacOS Support/(Third Party Support)/WASTE_2.1b1
You can now set the search paths for each target: select a target and call the Inspector window for this target (with the Info button in the tool bar or with the Info command in the File menu). There you must select the Build panel and find the Search Paths item in the Settings popup. There are four kinds of search paths:
Thanks to the source trees defined above, they can simply be defined like this:
HEADER_SEARCH_PATHS = "/Developer/Headers/FlatCarbon
\"${CodeWarrior}/MacOS Support/PowerPlant/\"
${Waste}
${CodeWarrior}/MSL/MSL_C++/MSL_Common/Include/"
LIBRARY_SEARCH_PATHS = "\"${Waste}\"
/Volumes/ib2/Devel_BD/Rezilla/RezillaSource/build"
FRAMEWORK_SEARCH_PATHS = /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks
REZ_SEARCH_PATHS = "/Developer/Headers/FlatCarbon ${SRCROOT}/Rezilla_Src"
In XCode 2.0 or above, you have two configurations: Debug and Release. You must define the search trees separately for both configurations.
The CodeWarrior compiler and the XCode compiler (gcc) present some differences concerning the way they parse the C/C++ syntax. This implies that a few instructions which used to compile with CodeWarrior could raise an error with gcc. In order to get PowerPlant to compile with XCode, a few minor changes are thus necessary: this is just a matter of modifying a few instructions in the PowerPlant source code. These modifications are described on Apple's developers web site in the document Make Changes to PowerPlant.
This document (Make Changes to PowerPlant) explains precisely which modifications are necessary. They concern only the following files:
There are also modifications for the LDebugStream.cp and the LCommanderTree.cp files but you can simply ignore them since these files are not incorporated in Rezilla's project.
The same document explains how to make a header file to build a precompiled header with XCode. You do not have to worry about this, such a file has been created for you in Rezilla's sources and is automatically compiled by XCode (file PP_Xcode.h inside the /Rezilla_Src/Prefix subfolder).
Note that all the Rezilla source files have been written with a strict syntax which is accepted both by CodeWarrior and XCode.
When the problems above have been solved, just open the project file, select the target you want and call the Build command (with the Build button in the tool bar of the main project window or from the Build menu). Like with the CodeWarrior project, you should build the Regex_Lib target first. There is a dependency among the targets which ensures that this is the case.
There is nothing special to do to install the necessary files inside the application's bundle: the XCode project takes care not only of compiling and building the executable but also of copying the various elements to their final location inside the bundle.
After the build process completed succesfully, the product will be found in the build folder found at the same level as the XCode project:
Last updated 2006-11-01 15:24:09