summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2022-01-06 23:03:15 +0100
committerFilipe Coelho <falktx@falktx.com>2022-01-07 19:26:48 +0000
commit61a708f2c6873881ae36fa2f01b38a15bfc3f681 (patch)
treee75d4205118006f712f7341bfb61f57183de1473
parent634972948f7a59d4e825eb8dfba3e934d8e13f2c (diff)
downloadjack2-61a708f2c6873881ae36fa2f01b38a15bfc3f681.tar.gz
Allow optional build of jack-example-tools
wscript: Add option `--example-tools` to allow optional build of executables and libraries provided by jack-example-tools (defaults to True). It can be used as `--example-tools=yes|no` or `--no-example-tools` or plain `--example-tools`. Based on the new option, set the configuration environment variable `HAVE_JACK_EXAMPLE_TOOLS` which is used throughout the configuration and build steps to include the `example-clients`, `tools` and `tests` subdirectories. man/wscript: Provide the `HAVE_JACK_EXAMPLE_TOOLS` build environment variable to the `fill_template` script as second argument. Remove unused imports. man/fill_template: Change the behavior of the script to only create all man pages if the second argument to the script is `True` (the jack-example-tools are being built), else only create the man page for jackd.
-rw-r--r--man/fill_template10
-rw-r--r--man/wscript9
-rw-r--r--wscript19
3 files changed, 24 insertions, 14 deletions
diff --git a/man/fill_template b/man/fill_template
index 8f147457..368cb1b0 100644
--- a/man/fill_template
+++ b/man/fill_template
@@ -2,6 +2,10 @@
d=""
[ -z "$SOURCE_DATE_EPOCH" ] || d=--date=@$SOURCE_DATE_EPOCH
-for i in *.0 ; do
- sed -e "s/!VERSION!/${1}/g" -e "s/!DATE!/`date $d '+%B %Y'`/g" < ${i} > ${i%%0}1
-done
+if [ "$2" == "True" ]; then
+ for i in *.0 ; do
+ sed -e "s/!VERSION!/${1}/g" -e "s/!DATE!/`date $d '+%B %Y'`/g" < ${i} > ${i%%0}1
+ done
+else
+ sed -e "s/!VERSION!/${1}/g" -e "s/!DATE!/`date $d '+%B %Y'`/g" < jackd.0 > jackd.1
+fi
diff --git a/man/wscript b/man/wscript
index def57078..52270c33 100644
--- a/man/wscript
+++ b/man/wscript
@@ -1,11 +1,10 @@
#! /usr/bin/python3
# encoding: utf-8
-import re
-import os
-
def build(bld):
- bld.exec_command('cd man ; sh fill_template %s' % bld.env['JACK_VERSION'])
+ bld.exec_command('cd man ; sh fill_template {} {}'.format(
+ bld.env['JACK_VERSION'],
+ bld.env['HAVE_JACK_EXAMPLE_TOOLS'])
+ )
bld.install_files(bld.env['MANDIR'], bld.path.ant_glob('*.1'))
-
diff --git a/wscript b/wscript
index b7d8c925..a597cc1c 100644
--- a/wscript
+++ b/wscript
@@ -134,6 +134,12 @@ def options(opt):
'celt',
help='Build with CELT')
celt.add_function(check_for_celt)
+ opt.add_auto_option(
+ 'example-tools',
+ help='Build with jack-example-tools',
+ conf_dest='BUILD_JACK_EXAMPLE_TOOLS',
+ default=True,
+ )
# Suffix _PKG to not collide with HAVE_OPUS defined by the option.
opus = opt.add_auto_option(
@@ -296,9 +302,9 @@ def configure(conf):
else:
conf.env['SYSTEMD_USER_UNIT_DIR'] = None
-
- conf.recurse('example-clients')
- conf.recurse('tools')
+ if conf.env['HAVE_JACK_EXAMPLE_TOOLS']:
+ conf.recurse('example-clients')
+ conf.recurse('tools')
# test for the availability of ucontext, and how it should be used
for t in ['gp_regs', 'uc_regs', 'mc_gregs', 'gregs']:
@@ -839,13 +845,14 @@ def build(bld):
build_drivers(bld)
- bld.recurse('example-clients')
- bld.recurse('tools')
+ if bld.env['HAVE_JACK_EXAMPLE_TOOLS']:
+ bld.recurse('example-clients')
+ bld.recurse('tools')
if bld.env['IS_LINUX'] or bld.env['IS_FREEBSD']:
bld.recurse('man')
bld.recurse('systemd')
- if not bld.env['IS_WINDOWS']:
+ if not bld.env['IS_WINDOWS'] and bld.env['HAVE_JACK_EXAMPLE_TOOLS']:
bld.recurse('tests')
if bld.env['BUILD_JACKDBUS']:
bld.recurse('dbus')