Skip to content

Building with Autotools

dsboger edited this page Jul 20, 2016 · 10 revisions

Building with Autotools

Requirements

  • autoconf >= 2.69, automake >= 1.15 and gettext >= 0.19.7 (may work with older versions, but not tested)
  • D compiler executable is in the $PATH (currently, only dmd is supported out of the box. ldc from git master also works and there is a workaround to build with latest stable release LDC 1.0.0. See #387 for more information)
  • pkg-config
  • gtkd-3 and vted-3 (both shared libraries and "headers") built with the same compiler that will be used to build Terminix (instructions to build these below)

Building Terminix

In order to build terminix with autotools, issue the following commands:

$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

Some parameters may be added to these commands:

  • ./configure accepts a --prefix=/path/to/prefix parameter (defaults to /usr/local)
  • the compiler detection may be overridden by passing DC=compiler to the make command (The DMD-compatible wrapper must be used, i.e. DC=ldmd to use the ldc compiler).
  • compiler flags may be passed in variable DCFLAGS. Default value is -O. A release version of Terminix can be built with command make DCFLAGS='-O -inline -release -version=StdLoggerDisableTrace'
  • it is possible to specify the installation root to make install in variable DESTDIR (defaults to /).

Building GtkD Shared libraries

GtkD tarball comes with a handmade Makefile, so building and installing it can be done with the following commands:

$ make DC='dmd' DCFLAGS='-O -release -inline' shared-libs shared-gstreamer shared-vte
$ make prefix=/path/to/prefix DESTDIR=/path/to/install \
                      install-shared install-shared-gstreamer install-shared-vte \
                      install-headers install-headers-gstreamer install-headers-vte

These commands install all the shared libraries, although Terminix only requires the gtkd and vted ones (headers for these are also required). Please, refer to the GtkD README for the dependencies and further details.

The command above builds GtkD with dmd, but it also can be built with DC='ldc' (this is the default if no DC is informed)

If the system already contains GtkD libraries compiled with another D compiler, it is necessary to add a suffix to the installed files to avoid conflicts. It may be done by changing the makefile with the following command run from GtkD top directory:

sed -i 's#-$(MAJOR)#-$(MAJOR)-dmd#g' GNUmakefile

This way, libraries gtkd-3-dmd and vted-3-dmd will be generated.

Generating Source Tarball

It is possible to create a source distribution tarball by calling make dist after the ./configure step. This will create a terminix-<version>.tar.gz archive that can be used to build Terminix without autotools. Just extract the contents and run the well known ./configure; make; make install commands from the extracted directory.

Maintenance of Autotools Support

As changes in the Terminix tree occur, it may be necessary to adjust the autotools support accordingly. If no new files are added to the tree, maintaining autotools files means simply bumping versions in file configure.ac. Also, the following file additions do not require any additional maintenance:

  • .d files under source/
  • .json color schemes under data/schemes/
  • .css stylesheets under data/resources/css/
  • .ui GtkBuilder files under data/resources/ui/
  • icons under data/resources/icons/
  • icons under data/icons
  • translation files under po/

Other files must be analyzed on a case-by-case basis.

Clone this wiki locally