anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

INSTALL (6326B)


      1 Installation Instructions
      2 *************************
      3 
      4 GNU Anastasis is built with Meson and Ninja.  The ‘configure’ script in
      5 this directory is *not* generated by Autoconf: it is a small hand-written
      6 wrapper around ‘meson setup’.  It therefore supports only the options
      7 documented below — any other option is silently ignored.
      8 
      9 
     10 Basic Installation
     11 ==================
     12 
     13    When building from a git checkout, first run:
     14 
     15      ./bootstrap
     16 
     17 This initialises the git submodules (notably ‘contrib/gana’, which
     18 supplies the generated error codes) and installs the uncrustify
     19 pre-commit hook.  It is not needed when building from a distribution
     20 tarball.
     21 
     22    Then the usual three commands:
     23 
     24      ./configure
     25      make
     26      make install
     27 
     28 ‘configure’ runs ‘meson setup build’ and writes a ‘Makefile’ that
     29 forwards to ‘ninja -C build’.  Using it is optional; you can drive Meson
     30 directly instead:
     31 
     32      meson setup build
     33      ninja -C build
     34      meson install -C build
     35 
     36    Note that ‘configure’ deletes and re-creates the build directory.  Run
     37 it for the initial setup or when changing options; for ordinary rebuilds
     38 just run ‘make’.
     39 
     40    ‘configure’ records its arguments in ‘config.status’, and running that
     41 script repeats the same configuration.
     42 
     43 
     44 Running the Test Suite
     45 ======================
     46 
     47    The package must be installed before the tests can run, because the
     48 test harness locates the installed binaries through the ANASTASIS_PREFIX
     49 environment variable:
     50 
     51      make install
     52      make check
     53 
     54 A PostgreSQL server (see README for the required version) must be
     55 running and reachable for the database and integration tests.
     56 
     57    Two groups of tests are excluded from ‘make check’ and have their own
     58 targets:
     59 
     60      make installcheck
     61      make integrationtests
     62 
     63    Tests are grouped into Meson suites, so a subset can be run directly:
     64 
     65      meson test -C build --suite stasis
     66      meson test -C build test_anastasis_crypto
     67 
     68 
     69 Installation Names
     70 ==================
     71 
     72    By default ‘make install’ installs under ‘/usr/local’.  Use ‘--prefix’
     73 to change this:
     74 
     75      ./configure --prefix=$HOME/anastasis
     76 
     77    The following directory options are accepted and forwarded to Meson.
     78 Each takes the form ‘--NAME=DIRECTORY’:
     79 
     80      prefix          exec_prefix     bindir          sbindir
     81      libexecdir      sysconfdir      sharedstatedir  localstatedir
     82      runstatedir     libdir          includedir      oldincludedir
     83      datarootdir     datadir         infodir         localedir
     84      mandir          docdir          htmldir         dvidir
     85      pdfdir          psdir
     86 
     87    Two further options control the build layout rather than the
     88 installation layout:
     89 
     90      --srcdir=DIR         the source directory (default: ‘.’ or ‘..’)
     91      --mesonbuilddir=DIR  the build directory (default: ‘build’)
     92 
     93 
     94 Optional Features
     95 =================
     96 
     97    ‘configure’ accepts the following ‘--enable-’ options.  All of them
     98 default to disabled.
     99 
    100      --enable-coverage
    101           Build with coverage instrumentation (Meson’s ‘b_coverage’).
    102 
    103      --enable-logging=LEVEL
    104           Set the logging level.  LEVEL is one of ‘yes’, ‘no’, ‘verbose’
    105           or ‘veryverbose’.  Only ‘no’ currently changes the build: it
    106           compiles logging out entirely via GNUNET_CULL_LOGGING.  The
    107           two verbose levels are accepted but presently have no effect.
    108 
    109           Beware that ‘--disable-logging’ does *not* turn logging off;
    110           write ‘--enable-logging=no’ for that.
    111 
    112      --enable-only-doc
    113           Build the documentation only, skipping all C targets.
    114 
    115      --enable-install-rpath
    116           Record an rpath pointing at the install prefix in the installed
    117           binaries.
    118 
    119    There are no ‘--with-’ options.
    120 
    121    Meson understands one option that ‘configure’ does not forward,
    122 ‘disable-doc’.  To build without documentation, configure with Meson
    123 directly:
    124 
    125      meson setup build -Ddisable-doc=true
    126 
    127 
    128 Compilers and Options
    129 =====================
    130 
    131    Compilers, tools and flags are set by passing ‘VARIABLE=VALUE’ on the
    132 ‘configure’ command line:
    133 
    134      ./configure CC=clang CFLAGS=-O2
    135 
    136 The recognised variables are:
    137 
    138      tools   AR AS BISON CC CXX CPP FLEX INSTALL LD LDCONFIG LEX MAKE
    139              MAKEINFO RANLIB TEXI2DVI YACC CHGRP CHMOD CHOWN MKNOD RM
    140              NINJA MESON
    141      flags   ARFLAGS BISONFLAGS CFLAGS CXXFLAGS CPPFLAGS FLEXFLAGS
    142              INSTALLFLAGS LDFLAGS LDCONFIGFLAGS LFLAGS MAKEFLAGS
    143              MAKEINFOFLAGS RANLIBFLAGS TEXI2DVIFLAGS YACCFLAGS
    144              CHGRPFLAGS CHMODFLAGS CHOWNFLAGS MKNODFLAGS
    145      other   INSTALL_DATA INSTALL_PROGRAM INSTALL_SCRIPT
    146 
    147 ‘MESON’ and ‘NINJA’ are useful when those tools are not on the default
    148 path.  Most of the rest are inherited from the wrapper’s generic template
    149 and have no effect on a Meson build; ‘CC’, ‘CXX’, ‘CFLAGS’, ‘CPPFLAGS’
    150 and ‘LDFLAGS’ are the ones that matter.
    151 
    152 
    153 Compiling For Multiple Architectures
    154 ====================================
    155 
    156    Meson always builds out of tree, so several build directories can
    157 coexist.  Give each one its own build and install directory:
    158 
    159      ./configure --mesonbuilddir=build-debug --prefix=/opt/anastasis-debug
    160 
    161 Each ‘configure’ run overwrites the top-level ‘Makefile’, so ‘make’ always
    162 drives whichever build directory was configured last.  To work with
    163 several at once, use ninja directly: ‘ninja -C build-debug’.
    164 
    165    ‘configure’ has no ‘--build’, ‘--host’ or ‘--target’ options — the
    166 Autoconf spellings are silently ignored, and passing them will *not*
    167 produce a cross build.  To cross-compile, invoke Meson directly with a
    168 cross file:
    169 
    170      meson setup build --cross-file my-cross-file.txt
    171      ninja -C build
    172 
    173 
    174 Other ‘make’ Targets
    175 ====================
    176 
    177    The generated ‘Makefile’ also provides:
    178 
    179      make clean          remove the build outputs
    180      make uninstall      remove the installed files
    181      make dist           create a distribution tarball
    182      make format         reformat the sources with uncrustify
    183      make distclean      remove ‘Makefile’ and ‘config.status’
    184 
    185 
    186 ‘configure’ Invocation
    187 ======================
    188 
    189    Run ‘./configure --help’ for a generated summary of the options
    190 described above.