Building MacCTC from Scratch
This is instructions for building MacCTC for PowerPC from Scratch (i.e.
without using an existing Project file). Whereas I have managed to build
MacCTC for 68k, don't have it off pat. It is a struggle everytime, so I
am in no position to provide instructions. There is a Think C++ 7.0 project
file in the source archive.
It may not be necessary to follow these instructions in every particular,
but you diverge from it at your own risk. You are strongly recommended
to follow this instruction precisely to begin with and only make modifications
once you have a correctly building and running Project.
This operation can be used to get started, or to get restarted if your
project has got corrupted and is crashing all the time. When this happens,
it needs rebuilding from scratch.
Obtain Components
The following software components are necessary to build MacCTC:-
-
CTClib: The general purpose crypto library.
-
MacCTC Source Kit: Addition MacCTC specific code.
-
Symantec C++ version 8.5: From Symantec
Corporation (You have to buy this.)
N.B. MacCTC is currently built with Symantec C. However due
to Symantec ceasing to develop this product, I am likely to switch to CodeWarrior
sometime.[1]
CTClib and MacCTC are available for
download.
Installing Symantec C++
The installation is quite straight forward. However to slight modifications
to the factory set-up are recommended before going any further:-
Edit CDialogText.cp
This file is found the folder Sym C++ for Power Mac:THINK Class Library
2.0:Dialog Classes. In it there is a non-standard reference to "inherited:".
Edit this to read "CEditText:". This prevents a compilation error
when compiling is strict ANSI mode.
Replace <assert.h>
This is optional as it may disrupt building other applications with Symantec
C++. However it is recommended if practical, as otherwise the program
exits silently on an assert failure, making debugging in this case very
difficult.
Copy the assert.h from the MacCTC source archive over
Sym C++ for Power Mac:Standard Libraries:Headers and Source:C
headers:assert.h
Increase the Memory Allocation
Symantec Project Manager has a suggested memory allocation of about
8Mb. My experience is this is not really adequate. I recommend increasing
the preferred memory allocation to 16Mb, or even 20Mb.
Adjust the editor tabulation
This is advisable if the identation of the code is to appear the same as
it does on the CTC developers machines:-
-
From the Edit menu, select Preferences....
-
Select the Editor sub panel.
-
In the Tabs: box type "3".
-
Click on Okay
Generate project folder
Expand the MacCTC source archive into this folder. Generate a sub-folder
for the CTClib archive and expand the CTClib archive into this folder.
You should take only the following folders.[2]
ctcalg,
ctccpa, ctcfyi (keywords.c only),
ctckey,
ctclib, ctcpka, ctcusr,
ctcutl,
export & include
Create New Project
Use Symantec Project Manager to create a new project:-
-
Check you are in the right folder. (This needs to be your pregenerated
to project folder so that the right Visual Architect file is used.)
-
Given the project an appropriate name e.g. MacCTC.(pi)[3]
-
Select VA Application as Project Model:
Preliminary Adjustment
-
Create to new source groups CTC and GUI
-
Add the source files in the MacCTC source folder including the
files in the InternetConfig sub-folder into the GUIgroup.
-
Add all the source files from the CTClib sub-folders ctcalg, ctccpa,
ctckey, ctclib, ctcpka, ctcusr &
ctcutl to CTC group.
Change Options
N.B. This is very important as the application may fail in strange
ways with in appropriate options.
Modifications which are not necessary but merely recommended are marked
as optional. You are recommend to start with the standard set and check
everything is OK before diverging at all.
-
Firstly select Factory Settings
-
In Project sub-panel
-
(Optional) Set Compact Project when closing
-
Set Always check file dates
-
In Project Type sub-panel
-
Set Creator to "MCTC"
-
(optional) Clear Always ask for destination
-
(optional) Set Destination to "MacCTC-PPC" in the project
folder.
-
In Application sub-panel
-
In Application Settings sub-sub-panel
-
(optional) Increase Minimum Partition to (say) 1.5Mb
-
(optional) Increase Preferred Partition to (say) 2Mb
-
In Merge 680x0 Application sub-sub-panel
-
Set Merge 680x0 Application check-box
-
Use Select Application... button to select 68K Res Stub
-
In PowerPC C: sub-panel:
-
Select ANSI Settings
-
Check Require Prototypes
-
Uncheck Enum are always ints[4]
-
N.B. Do NOT enable optimisation.[5]
-
In PowerPC C++: sub-panel:
-
Select ANSI Settings
-
Uncheck Run-Time Type Identification
-
Uncheck Enum are always ints[4]
You are now ready to compile and run.
Notes:
[1]
I have bought Code-Warrior, however I have not had the time to get it up
and running especially with the TCL (Think Class Library). There are CW
ports for these but installing them is not entirely straight forward.
[2]
There is more than one variant of some of the include files. It is important
not to have the wrong files anywhere in the project hierarchy of the compiler
may pick-up the wrong one.
[3]By
convention the last letter of project file names is the greek letter Pi,
(<alt>-p) but this cannot be represented in HTML.
[4]With
Enums are always ints set Symantec C miscalculates the size of
some ToolBox structures and various odd behaviour results. Most notably
window's scroll bars appear in the wrong place and don't move when the
window is resized.
[5]The
optimiser takes a few liberties, notably making invalid assumptions about
unsigned values. This can cause some multiple precision operations
to malfunction seriously (up to and including O/S crashes). As these are
the only really time critical operations in the system, there is no point
in using the optimiser on anything.
webmaster@bifroest.demon.co.uk