Skip to content
Stephen Orso edited this page Apr 30, 2018 · 8 revisions

WikiCMake Scripts

HOWTO: Common Changes

A quick reference exists to provide targeted information for the following maintenance activities:

  • Add a source file
  • Add an executable or library
  • Add a header test
  • Add a runtest case

While it is a good idea to have a general understanding of how CMake is used to configure a build of Hercules, the HOWTO should allow you to complete quickly these additions.

Supported Target Systems

The CMake build scripts for Hercules supports the compilation of Hercules on the following systems:

  • Windows 64-bit or newer using Visual Studio 2008 or newer.
  • GNU/Linux systems, such as Debian, Fedora, and Leap using GNU Make
  • Other UNIX-like systems, including FreeBSD and Solaris, using BSD Make
  • macOS using Xcode or Xcode Command Line Tools.

The Ninja build tool is supported in all environments. On Windows, the Visual Studio 2017 Build Tools may be used, and the JOM build tool may be used in place of the NMake or MSBuild build tool.

Systems Known to be Unsupported

NetBSD: A number of changes are needed to enable builds of Hercules on NetBSD. These are under investigation.

OpenBSD: OpenBSD does not support Thread-Level Storage (TLS). SoftFloat-3a For Hercules requires TLS.

Supported Build Tools

Single-Configuration Builds

Multiple-Configuration Builds

External Packages

Hercules uses the following external packages. SoftFloat-3a For Hercules is required. All others are optional, and if omitted, certain Hercules capabilities will not be included. Build options exist to use previously-built external packages, and a build option allows multiple Hercules builds to share external package builds. Absent options, external packages are built in the Hercules build directory.

  • SoftFloat-3a: Required. The build scripts will clone and build SoftFloat-3a For Hercules from the Hercules-390 github project if needed, or it will use a previously built SoftFloat-3a For Hercules.
  • BZip: Not required. Default: if the version of the BZip2 development library is at least as new as the version in the Hercules-390 project, it is used. If BZip2 is not installed or is older than that in the Hercules-390 project, the project repository for BZip2 is cloned and built during the Hercules build. Build options exist to force use of the system-installed BZip2.
  • Zlib: Not required. Default: if the version of the Zlib development library is at least as new as the version in the Hercules-390 project, it is used. If Zlib is not installed or is older than that in the Hercules-390 project, the project repository for Zlib is cloned and built during the Hercules build. Build options exist to force use of the system-installed Zlib.
  • PCRE (Windows only): Optional for Windows, and not required for UNIX-like target systems. PCRE provides regular expression support to the Hercules Automatic Operator, which allows regular expressions in message definitions. If Zlib is not installed or is older than that in the Hercules-390 project, the project repository for Zlib is cloned and built during the Hercules build. Build options exist to force use of the system-installed Zlib.

The CMake Scripts

The CMake build scripts include the following:

  • CMakeLists.txt files in each of three directories
  • CMake scripts in subdirectory CMake with file extension .cmake, organized as follows:
    • Common functions (Herc0x.cmake)
    • Build options definition and syntax edits (Herc1x.cmake)
    • Probes of the target system, userland, and c compiler (Herc2x.cmake)
    • Set compiler-specific options (Herc3x.cmake)
    • Create CMake targets for external packages (Herc41_CreateTargets.cmake)
    • Create CMake targets for Hercules (herc6x.cmake)
  • A set of c sample programs used to test compiler and system properties, also in subdirectory CMake.
  • Two configuration prototype files with file extension .in, in CMake.

Comments within the build scripts are detailed and authoritative for the operation of each script. The links above provide overview information about each script group and its members.


This Wiki page Copyright © 2018 by Stephen R. Orso. This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

Clone this wiki locally