Compiling the ThinAir library There are currently three makefiles included with the ThinAir source code. These makefiles are each designed to be used with a different compiler/make combination. In order to use them on your system, some adjustments may need to be made. The currently supported configurations are: makefile Borland C++ (4.52)/Borland Make makefile.nmk MS Visual C++ (4.2)/NMake makefile.gpp Gnu C++ (2.7.2)/Gnu Make If you are using one of the supported compilers, you should not need to change anything except for the directory definitions. You may need to change these to point to the appropriate directories in your system. If you are using a different version of one of the supported compilers, you may need to change the directories in the appropriate makefile to point to the right places in your system. In addition, you may need to modify the environ.h file to take advantage of features of your compiler or to turn off features if you are using an older version. If you are using a compiler and make system I am not yet supporting, you should pick the one that appears closest to the syntax of your makefiles and begin making changes until you can compile. See the "Quick Overview of makefiles" below for more details. If you are not using one of the compilers I currently support, the odds are very good that you will also need to make changes to the environ.h file. This file acts as a configuration utility for the source code. Any compiler dependencies that were needed by the code, are macroed in this file. See the "Quick Overview of environ.h" below for more details. If you have gone through this file and tried your best and still can't make it work, contact me at gwadej@anomaly.org. I will do what I can to help. Quick Overview of makefiles I have attempted to make the makefiles consistant in layout to simplify porting to a new environment. Unfortunately, I have not yet developed a standardized format that allows easy conversion to all of the compilers I will support. I start off every makefile with a set of macroes which may get you most of the way there for many compilers. In the first section, I name the tools. Throughout the makefile these macros will be used whereever the program name is needed. Factoring the name out means you (and I) only have to change it in one place. Likewise, important directory names are macroed in the next section. Compiler and linker options come next. I've broken these options into pieces to make them a little easier to follow. The final set of configuration macros defines the library name. This solved a little naming mess I found when porting from a DOS library to a Unix library. The next section describes the dependencies for the various products the makefile will produce. You should only need to change these if your object files have a different naming convention or if you decided to compile into another directory. I follow that with the implicit rules for compiling .cpp files and such. Following that are a few explicit rules for building the SHA object file, the library itself, and the test program. I end the makefile with a set of useful pseudo-targets to make general maintenance easier. In converting to a new environment, you should choose the makefile closest to the format your make uses. Then start by making changes to just the macroes at the beginning of tht makefile. If you're lucky, this is all you will need. If your compiler syntax is very different, you may need to change the implicit and explicit rules. Unfortunately, I can't help you much there. Each compiler is different. Quick Overview of environ.h The first set of definitions you need to understand define which C++ features are supported by your compiler. These definitions are as follows: _DYNAMIC_CAST - Supports the new-style casts dynamic_cast<> and const_cast<> _STRING_CLASS - Supports a C++ standard string class _DIFFERING_RETURNS_ALLOWED - Allows derived classes to overload member functions that only differ in return type if the return type is inherited from the class returned by the base class's member function. _HAS_BINARY - Supports binary files as different than text files. _HAS_BOOL - Supports the new bool, true, and false keywords. _ANSI_CPP_HEADERS - Uses the new C++ standard header files (no trailing .h on standard library headers. _HAS_EXPLICIT - Supports the new explicit keyword. _HAS_INT64 - Supports a non-standard 64-bit integer type. The C++ standard committee decided to change the names of the C++ standard headers (by dropping the trailing .h). In order to isolate this difference in the source code, the following defines were created: _STRING_HEADER - Header for the standard string class. _IOSTREAM_HEADER - Header for the iostream classes. _IOMANIP_HEADER - Header for the iostream manipulators. _FSTREAM_HEADER - Header for the fstream classes. _STRSTREAM_HEADER - Header for the strstream classes _VECTOR_HEADER - Header for the STL vector class. _ALGO_HEADER - Header for the STL generic algorithms Some of the differences between C++ version are handled by these macros that expand to the proper behavior based on the definitions above. _STRING - The name of the string class. DYNACAST(type) - If _DYNAMIC_CAST is defined this evaluates to the new style dynamic_cast, otherwise it's an old-style cast. CONSTCAST(type) - If _DYNAMIC_CAST is defined this evaluates to the new style const_cast, otherwise it's an old-style cast. DIFFRET(base,deriv) - If _DIFFERING_RETURNS_ALLOWED is defined this macro evaluates to deriv, otherwise it's base. EXPLICIT - If _HAS_EXPLICIT is defined it evaluates to explicit, otherwise it vanishes. If _HAS_INT64 is defined the typedef Int64 should be declared as the 64-bit integer type.