BUILD NOTES
static site checker
https://ssc.lu/
(c) 2020-2022 Dylan Harris


Introduction
============
SSC can be built from various unii using CMake, or with Visual Studios
2017 / 2019 / 2022 under Windows. I have built & tested it under x64 in
selected OSs on intel/amd architecture.


Libraries
=========

Common dependencies
-------------------
You need boost version 1.75 or better (https://boost.org), a recent
version of the ICU libraries (https://icu-project.org/), & Microsoft's
GSL library (https://github.com/Microsoft/GSL). Most unii and mock
unii have these available as packages.

You may need to set these environment variables:
- BOOST: if you're not using your operating system's packaged flavour
  of boost, then set BOOST to your boost source root directory (CMake
  may welcome BOOST_LIBRARYDIR & BOOST_INCLUDEDIR being set
  appropriately);
- ICU_ROOT: similarly, if you're not using your operating system's
  packaged ICU, set ICU_ROOT to your ICU library source root directory;
- GSL: set it to your GSL root directory.

hunspell
--------
Building SSC under unii, including macos, requires a development
installation of hunspell (https://hunspell.github.io/). You may need to
set these environment variables:
- HUNSPELL_INCLUDE to point to the hunspell include directory
- HUNSPELL_LIB to point to the hunspell library directory
- HUNSPELL_VERSION, the actual library name (such as "hunspell-1.7.so")

Once you've got them, you can run cmake from the project root
directory.

winspell
--------
The Windows build, by default, uses the native Windows spellchecker,
although, except for Windows 11, that doesn't seem to work so well in
multilingual contexts.

Building
========

Windows
-------
To build from Visual Studio, navigate to recipe/tea, open the
appropriate .sln file, then build. Only Visual Studios 2017 / 2019 /
2022, 64 bit, have been built & tested, for intel Windows 8.1, 10 & 11.
I've not built ssc using CMake under Windows.

Unii & mock Unii
----------------
You will need CMake 3.12 or better. On Linux, you will also need
lsb-release. From the home ssc directory, compile a normal release
build thus:
cmake .
make
ctest
make install

For a debug build:
cmake -DCMAKE_BUILD_TYPE=Debug .
make
ctest
make install

If everything works correctly, then everything will be built, a series
of tests run, with a final result at the very end saying no failures.
Having said that, given SSC is alpha, don't be too surprised to see
some warnings or some final test errors. Note in particular that
complaints about being unable to find or copy files during testing are
not of concern, these come from scripts that set up or tear down
individual tests, and the standard commands used sometimes complain if
they can't find files they're supposed to delete, which is a bit silly
given that means things are already in the desired state.

The following have been successfully built as x64 amd/intel, although
not always under all versions of ssc:
Linux: Ubuntu 20.04 / 22.04, SuSE tumbleweed, Alma Linux 9
OpenBSD: 7.1 / 7.0 / 6.9 / 6.8
MacOS: Monterey, Big Sur, Catalina, Mojave, High Sierra

Note: Use clang if possible, gcc takes a wee while.


Linux
-----
CMake seems poor at spotting rather obvious things such as standard boost
library distributions under Linux, so it's hit and miss as to whether it will
build. I've had success with Centos 8 and Ubuntu 20.04.


OpenBSD
-------
I've only tested the amd64 build under 7.0 and 6.9 (and, with older versions
of ssc, 6.8). I have made some cursory tests with 7.1, but not yet done things
properly, mostly because life got in the way.

The versions of boost and cmake supplied in packages work.

You will need to increase significantly the available memory setting in
login.conf for the build account, if you have not done so already.

Openbsd 6.8 offers hunspell 1.6, so if you use that version, you will need to
set the HUNSPELL_VERSION environment variable appropriately.
