Skip to content

Commit

Permalink
Update to the meson build system
Browse files Browse the repository at this point in the history
The meson build system is conceptually simpler and significantly faster.
  • Loading branch information
npmccallum committed Aug 14, 2018
1 parent f19a088 commit 9f69af1
Show file tree
Hide file tree
Showing 56 changed files with 268 additions and 372 deletions.
26 changes: 8 additions & 18 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ are required. In many cases dependencies are platform specific and so the
following sections describe them for the supported platforms.

## Linux:
* Autoconf
* Autoconf archive
* Automake
* Libtool
* Meson
* Ninja
* C compiler
* C Library Development Libraries and Header Files
* [jose](https://github.com/latchset/jose)
Expand All @@ -36,38 +34,30 @@ $ sudo dnf builddep clevis

# Building From Source

## Bootstrapping the Build
To configure the Clevis source code first run autoreconf to generate
the configure script and Makefile.in configuration files:

```
$ autoreconf -si
```

## Configuring the Build
Then run the configure script, which generates the Makefiles:
To configure Clevis, run `meson` which generates the build files:

```
$ ./configure
$ meson build
```

## Compiling
Then compile the code using make:
Then compile the code using `ninja`:

```
$ make -j$(nproc)
$ ninja -C build -j$(nproc)
```

## Installing
Once you've built the Clevis software it can be installed with:

```
$ sudo make install
$ sudo ninja -C build install
```

This will install Clevis to a location determined at configure time.

See the output of ./configure --help for the available options. Typically
See the output of `meson --help` for the available options. Typically
much won't be needed besides providing an alternative --prefix option at
configure time, and maybe DESTDIR at install time if you're packaging for
a distro.
Expand Down
50 changes: 0 additions & 50 deletions Makefile.am

This file was deleted.

121 changes: 0 additions & 121 deletions configure.ac

This file was deleted.

10 changes: 0 additions & 10 deletions doc/Makefile

This file was deleted.

53 changes: 0 additions & 53 deletions doc/clevis-encrypt-http.1.adoc

This file was deleted.

59 changes: 59 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
project('clevis', 'c', license: 'GPL3+', version: '10',
default_options: 'c_std=c99')

libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
bindir = join_paths(get_option('prefix'), get_option('bindir'))

data = configuration_data()
data.set('libexecdir', libexecdir)
data.set('sysconfdir', sysconfdir)
data.set('bindir', bindir)

add_project_arguments(
'-Wall',
'-Wextra',
'-Werror',
'-Wstrict-aliasing',
'-Wchar-subscripts',
'-Wformat-security',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wpointer-arith',
'-Wshadow',
'-Wsign-compare',
'-Wstrict-prototypes',
'-Wtype-limits',
'-Wunused-function',
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
'-Wno-unknown-pragmas',
'-D_POSIX_C_SOURCE=200112L',
'-DBINDIR="' + bindir + '"',
'-DCLEVIS_USER="' + get_option('user') + '"',
'-DCLEVIS_GROUP="' + get_option('group') + '"',
language: 'c'
)

jose = dependency('jose', version: '>=8')
a2x = find_program('a2x', required: false)

bins = []
mans = []

subdir('src')

install_data(bins, install_dir: bindir)

if a2x.found()
foreach m : mans
custom_target(m.split('/')[-1], input: m + '.adoc', output: m.split('/')[-1],
command: [a2x, '-f', 'manpage', '-D', meson.current_build_dir(), '@INPUT@'],
install_dir: join_paths(get_option('mandir'), 'man' + m.split('.')[-1]),
install: true
)
endforeach
else
warning('Will not build man pages due to missing dependencies!')
endif
3 changes: 3 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
option('user', type: 'string', value: 'clevis', description: 'Unprivileged user for secure clevis operations')
option('group', type: 'string', value: 'clevis', description: 'Unprivileged group for secure clevis operations')

Loading

0 comments on commit 9f69af1

Please sign in to comment.