Examples Documentation Contact Downloads

Cross-Platform Autoconfiguration

To facilitate compilation and installation of your software on a diverse set of platforms, most open source software ships with a configure script to autodetect platform-sepcific quirks and installation paths to include in the build process. Grace does not use GNU autoconf for this, it ships with its own set of scripts that are a bit less invasive on the workflow of your build.

Invoking the Configure Script

You can see the optional flags for the configure script as it is built by calling it with the --help flag:

$ ./configure --help
Usage: ./configure [--quiet]             Quiet mode [-q]
                   [--prefix p]          Set root install-prefix
                   [--exec-prefix p]     Set executable install-prefix
                   [--lib-prefix p]      Set library install-prefix
                   [--conf-prefix p]     Set configuration install-prefix
                   [--include-prefix p]  Set include-files install-prefix
                   [--homedir]           Set up for instalation in homedir.

Without flags, the script defaults to installation in the /usr/local hierarchy. When building for a system package, a typical set of flags would be: --prefix=/usr --lib-prefix=/usr/lib64 --conf-prefix=/etc/conf.

Recreating From configure.in

The configure.in file is a simple list of checks the configure script is supposed to go through. This is what it looks like in a default project created through grace mkproject:

cxx
grace
pthread
libsocket
libdl
libcrypt

Use grace mkconfigure on the command line to recreate the configure script:

$ grace mkconfigure
BASEDIR=/usr/local/lib/grace-configure
including cxx
including grace
including pthread
including libsocket
including libdl
including libcrypt

Adding extra libraries

You can add any of the following to configure.in to include extra grace-related libraries to your project:

  • gracepcre for libgrace-pcre
  • gracessl for libgrace-ssl
  • dbfile for libdbfile
  • querido for libquerido

Augmenting Flags

You can force grace mkconfigure to add extra flags to a definition that ends up in makeinclude by adding a line starting with a @, followed by the definition. For instance, to add -g to the CXXFLAGS variable, configure.in should look like this:

cxx
grace
pthread
libsocket
libdl
libcrypt
@CXXFLAGS=-g

Previous Chapter Table of Contents