Bifroest Mr. Tines MacCTC CTCjava Manual Pages
Bifroest Mr. Tines CTC Home CTClib MacCTC CTCjava Manual


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:-
  1. CTClib: The general purpose crypto library.
  2. MacCTC Source Kit: Addition MacCTC specific code.
  3. Symantec C++ version 8.5: From Symantec Corporation (You have to buy this.)

  4. 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:-
  1. From the Edit menu, select Preferences....
  2. Select the Editor sub panel.
  3. In the Tabs: box type "3".
  4. 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:-

Preliminary Adjustment

  1. Create to new source groups CTC and GUI
  2. Add the source files in the MacCTC source folder including the files in the InternetConfig sub-folder into the GUIgroup.
  3. 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.

  1. Firstly select Factory Settings
  2. In Project sub-panel
    1. (Optional) Set Compact Project when closing
    2. Set Always check file dates
  3. In Project Type sub-panel
    1. Set Creator to "MCTC"
    2. (optional) Clear Always ask for destination
    3. (optional) Set Destination to "MacCTC-PPC" in the project folder.
  4. In Application sub-panel
    1. In Application Settings sub-sub-panel
      1. (optional) Increase Minimum Partition to (say) 1.5Mb
      2. (optional) Increase Preferred Partition to (say) 2Mb
    2. In Merge 680x0 Application sub-sub-panel
      1. Set Merge 680x0 Application check-box
      2. Use Select Application... button to select 68K Res Stub
  5. In PowerPC C: sub-panel:
    1. Select ANSI Settings
    2. Check Require Prototypes
    3. Uncheck Enum are always ints[4]
    4. N.B. Do NOT enable optimisation.[5]
  6. In PowerPC C++: sub-panel:
    1. Select ANSI Settings
    2. Uncheck Run-Time Type Identification
    3. 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