Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/install-dependencies
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/bin/sh -ex

case "${DISTRO}" in
ubuntu:focal)
export DEBIAN_FRONTEND=noninteractive
apt clean
apt update
apt -y install gcc pkg-config libjose-dev jose libhttp-parser-dev \
systemd gcovr curl socat iproute2 asciidoc git python3-pip ninja-build
apt remove -y meson
pip3 install --upgrade meson
;;

debian:*|ubuntu:*)
export DEBIAN_FRONTEND=noninteractive
apt clean
Expand Down
34 changes: 29 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,45 @@ add_project_arguments('-DVERSION="'+meson.project_version() + '"', language : 'c

jose = dependency('jose', version: '>=8')
a2x = find_program('a2x', required: false)
compiler = meson.get_compiler('c')
compiler = meson.get_compiler('c', native : true)

if meson.is_cross_build()
compiler = meson.get_compiler('c', native : false)
endif

message(compiler.version())
message(compiler.get_id())

http_lib = []
if compiler.has_header('llhttp.h', args: '-I/usr/local/include')

inc_dir = meson.get_external_property('inc_dir', '-I/usr/local/include')
lib_dir = meson.get_external_property('lib_dir','/usr/local/lib')

if meson.is_cross_build()
message('----------------')
message('*** THIS IS A CROSS BUILD ***')
message('Compiler version :'+ compiler.version())
message('Compiler ID :' + compiler.get_id())
message('Library search directory :'+ lib_dir)
message('Include directory :' + inc_dir)
message('----------------')
endif

if compiler.has_header('llhttp.h', args: inc_dir)
http_lib = 'llhttp'
add_project_arguments('-DUSE_LLHTTP', language: 'c')
else
if not compiler.has_header('http_parser.h', args: '-I/usr/local/include')
if not compiler.has_header('http_parser.h', args: inc_dir)
error('neither llhttp nor http-parser devel files found.')
endif

http_lib = 'http_parser'
endif

if host_machine.system() == 'freebsd'
http_parser = compiler.find_library(http_lib, dirs : '/usr/local/lib')
else
http_parser = compiler.find_library(http_lib)
http_parser = compiler.find_library(http_lib, dirs: [lib_dir])
endif

licenses = ['COPYING']
Expand All @@ -82,7 +104,9 @@ units = []
subdir('doc')
subdir('src')
subdir('units')
subdir('tests')
if not meson.is_cross_build()
subdir('tests')
endif

install_data(libexecbins, install_dir: libexecdir)
install_data(bins, install_dir: bindir)
Expand Down