TQSL/tqsllib
==================

TQSL is the TrustedQSL application suite and tqsllib is the 
TrustedQSL library. These are the two major components of the
TrustedQSL project:

http://sourceforge.net/projects/trustedqsl/

===================================================================
Contents

1) Prerequisites

2) Building the Library under Linux/Unix

3) Building the Library under Mac OS X

4) Building the Library under Windows.

===================================================================

1) Prerequisites

The TQSL applications depend upon the tqsllib library. First you
should build and install that library and its prerequisites.

The TrustedQSL library depends on several other libraries:

OpenSSL (http://www.openssl.org/) - OpenSSL 1.0.1e was used for TQSL 1.14.
expat 1.x XML parser library (http://expat.sourceforge.net/) - expat 2.1.0
zlib (http://zlib.net/) zlib 1.2.7
Berkeley DB (http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html) - BDb 5.3.21
wxWidgets (http://wxwidgets.org/downloads) - wxWidgets 2.8.12.
curl - (http://curl.haxx.se/download.html) - curl 7.29.0

Most Unix and unix-like workstations will have these available. For
those systems that do not, the packages are easily built. Instructions
for building under the Windows environment are given below under
"Building under Windows."

In the instructions that follow, the versions of other packages
that were used to build the tqsllib package as of the date this
document was last updated are given in parentheses.

===================================================================

2) Building under Linux/Unix

The quick answer:

From the parent directory 
cmake .
make
make install

That will install the library and applications under /usr/local. It
also will install the needed header files under /usr/local/include.
Configuration and help files will be installed in /usr/local/share.

You can change the install location via:
cmake -DCMAKE_INSTALL_PREFIX=/foo/bar .

By default, only a shared version of the library is built.
CMake option TQSLLIB_STATIC can be set to cause a static library to be
built, either by using 'cmake -i' or by adding '-DTQSLLIB_STATIC=YES'
to the cmake command above.

If you installed the tqsllib library or its dependent libraries
in locations that configure can't find, you'll need to specify
those locations to cmake. For example, you can define the location for
the Berkeley Database headers using BDB_PREFIX. (That points to the top-level
directory, with /include for headers and /lib for libraries assumed below
it.)

===================================================================

3) Building under Mac OS X

You'll need to have the Mac developer's tools, Xcode 1.5, installed.

This is done in much the same manner as building under Linux/Unix, above.

You will need to download and compile Berkeley DB 5.3 or later. The version
of Berkeley DB shipped with OS X (as of 10.8) is out of date.

You also may not want to install the library into system directories:

cmake -DBDB_PREFIX=$HOME/bdb -DCMAKE_INSTALL_PREFIX=$HOME/tqsllib .
make
sudo make install

To build a universal binary with compatibility from MacOS 10.4 upwards,
use the following shell script:

#!/bin/sh
# 
# Adjust this to where you've installed wxWidgets
#
PATH=$HOME/wx/bin:$PATH
#
# Adjust this to where you've installed Berkeley DB 5.x
#
bdb=$HOME/bdb
arch_flags="-arch ppc -arch i386"
#
# You need to download and install the OSX 10.4 universal SDK
# to build a universal binary. gcc 4.0 is also needed.
#
sdk="/Developer/SDKs/MacOSX10.4u.sdk"
ver_min="10.4"

cmake  \
    -DCMAKE_BUILD_TYPE=Debug \
    -DCMAKE_OSX_ARCHITECTURES="ppc;i386" \
    -DCMAKE_LINKER=/usr/bin/gcc-4.0 \
    -DCMAKE_CXX_COMPILER=/usr/bin/c++-4.0 \
    -DCMAKE_C_COMPILER=/usr/bin/gcc-4.0 \
    -DBDB_PREFIX=$bdb \
    -DCMAKE_OSX_SYSROOT=$sdk \
    -DCMAKE_CXX_FLAGS=" -I $HOME/bdb/include  -I /usr/include/c++/4.0.0 \
        -I $sdk/System/Library/Frameworks/Carbon.framework/Headers \
	-isysroot $sdk  -mmacosx-version-min=$ver_min \
	-fno-stack-protector $arch_flags"  \
    -DCMAKE_C_FLAGS=" -I $HOME/bdb/include  -I /usr/include/c++/4.0.0 \
        -I $sdk/System/Library/Frameworks/Carbon.framework/Headers \
	-isysroot $sdk  -mmacosx-version-min=$ver_min \
	-fno-stack-protector $arch_flags"  \
    -DCMAKE_EXE_LINKER_FLAGS=" -Wl,-syslibroot,$sdk \
	-mmacosx-version-min=$ver_min  $arch_flags " \
    -DCMAKE_SHARED_LINKER_FLAGS=" -Wl,-syslibroot,$sdk \
	-mmacosx-version-min=$ver_min $arch_flags " \
        $* .
make

The build will result in the directory apps/tqsl.app, which contains the
complete Mac OS X application. You can simply move that folder to your
system's Applications folder or the location of your choice, then launch
the application from Finder.
If you want to distribute the built application:

./osx_createdmg.sh

will make TrustedQSL-2.0.dmg, a Mac distributable disk image
containing the TrustedQSL applications folder and document files.

===================================================================

4) Building under Windows

See file WindowsBuildSetup.txt in the top-level directory for details
on how to set up MSVC to compile TQSL.
