aboutsummaryrefslogtreecommitdiff
path: root/doc/guide-meson.build
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2024-09-01 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2024-09-10 08:00:00 +0000
commit7fb6beed01bc1a59438b8b2a9b34b2dba296e553 (patch)
tree2f6ae951c4d94d331e29e348e6ffd9846687be33 /doc/guide-meson.build
parentaa3e91322cbc651bb130ec8636b28d676979d4fe (diff)
downloadpam-7fb6beed01bc1a59438b8b2a9b34b2dba296e553.tar.gz
pam-7fb6beed01bc1a59438b8b2a9b34b2dba296e553.tar.bz2
pam-7fb6beed01bc1a59438b8b2a9b34b2dba296e553.zip
meson: build Linux-PAM using meson
On my non-representative hardware, the full build using autotools (./autogen.sh && CFLAGS=-O2 ./configure && make -j`nproc` && make -j`nproc` install) takes about 45 seconds. On the same hardware, the full build using meson (meson setup -Doptimization=2 dir && meson compile -C dir && meson install -C dir) takes just about 7.5 seconds.
Diffstat (limited to 'doc/guide-meson.build')
-rw-r--r--doc/guide-meson.build90
1 files changed, 90 insertions, 0 deletions
diff --git a/doc/guide-meson.build b/doc/guide-meson.build
new file mode 100644
index 00000000..e29d16e2
--- /dev/null
+++ b/doc/guide-meson.build
@@ -0,0 +1,90 @@
+# -*- mode: meson -*-
+
+guide = fs.name(meson.current_source_dir()).to_upper()
+name = 'Linux-PAM_' + guide
+
+xml = files(name + '.xml')
+
+if guide == 'SAG'
+ toc_max_depth = '2'
+else
+ toc_max_depth = '3'
+endif
+
+
+run_command(
+ [prog_xmllint,
+ '--noent',
+ '--nonet',
+ '--noout',
+ '--xinclude',
+ '--relaxng', docbook_rng,
+ xml],
+ check: true,
+)
+
+
+html = custom_target(
+ input: xml,
+ output: name + '.html',
+ command: [
+ prog_xsltproc,
+ '-o', '@OUTPUT@',
+ '--nonet',
+ '--xinclude',
+ '--stringparam', 'generate.toc', 'book toc',
+ '--stringparam', 'section.autolabel', '1',
+ '--stringparam', 'section.label.includes.component.label', '1',
+ '--stringparam', 'toc.max.depth', toc_max_depth,
+ txt_stylesheet,
+ '@INPUT@',
+ ],
+)
+
+custom_target(
+ input: html,
+ output: name + '.txt',
+ command: [
+ redir_exe,
+ '@INPUT@',
+ '@OUTPUT@',
+ browser,
+ ],
+ install: true,
+ install_dir: docdir,
+ install_tag: 'doc',
+)
+
+
+fop = custom_target(
+ input: xml,
+ output: name + '.fop',
+ command: [
+ prog_xsltproc,
+ '-o', '@OUTPUT@',
+ '--nonet',
+ '--xinclude',
+ '--stringparam', 'generate.toc', 'book toc',
+ '--stringparam', 'section.autolabel', '1',
+ '--stringparam', 'section.label.includes.component.label', '1',
+ '--stringparam', 'toc.max.depth', toc_max_depth,
+ pdf_stylesheet,
+ '@INPUT@',
+ ],
+)
+
+custom_target(
+ input: fop,
+ output: name + '.pdf',
+ command: [
+ prog_fop,
+ '@INPUT@',
+ '@OUTPUT@',
+ ],
+ install: true,
+ install_dir: pdfdir,
+ install_tag: 'doc',
+)
+
+
+subdir('html')