chiark / gitweb /
tree-wide: beautify remaining copyright statements
[elogind.git] / man / meson.build
index ea1227f2cf559e8b27ebe27630259ca776cb3054..671b7b36656aad62a5fa8b37aa8622d619801b07 100644 (file)
@@ -1,3 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1+
+#
+# Copyright © 2017 Zbigniew Jędrzejewski-Szmek
+
 # This is lame, I know, but meson has no other include mechanism
 subdir('rules')
 
@@ -11,6 +15,7 @@ want_html = want_html != 'false' and xsltproc.found()
 xsltproc_flags = [
         '--nonet',
         '--xinclude',
+        '--maxdepth', '9000',
         '--stringparam', 'man.output.quietly', '1',
         '--stringparam', 'funcsynopsis.style', 'ansi',
         '--stringparam', 'man.authors.section.enabled', '0',
@@ -33,7 +38,7 @@ xslt_cmd = [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags
 man_pages = []
 html_pages = []
 source_xml_files = []
-foreach tuple : manpages
+foreach tuple : xsltproc.found() ? manpages : []
         stem = tuple[0]
         section = tuple[1]
         aliases = tuple[2]
@@ -52,7 +57,7 @@ foreach tuple : manpages
 
         mandirn = join_paths(get_option('mandir'), 'man' + section)
 
-        if condition == '' or conf.get(condition, false)
+        if condition == '' or conf.get(condition) == 1
                 p1 = custom_target(
                         man,
                         input : xml,
@@ -73,7 +78,12 @@ foreach tuple : manpages
                                 output : htmlalias,
                                 command : ['ln', '-fs', html, '@OUTPUT@'])
                         if want_html
-                                dst = join_paths(docdir, 'html', htmlalias)
+#if 0 /// This must be configurable in elogind
+#                                 dst = join_paths(docdir, 'html', htmlalias)
+#else
+                                  dst = get_option('htmldir')
+                                  dst = dst != '' ? dst: join_paths(docdir, 'html', htmlalias)
+#endif // 0
                                 cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
                                 meson.add_install_script('sh', '-c', cmd)
                                 p2 += [link]
@@ -120,8 +130,8 @@ elogind_index_xml = custom_target(
         output : 'elogind.index.xml',
         command : [make_man_index_py, '@OUTPUT@'] + nonindex_xml_files)
 
-foreach tuple : [['elogind.directives', '7', elogind_directives_xml],
-                 ['elogind.index',      '7', elogind_index_xml]]
+foreach tuple : want_man or want_html ? [['elogind.directives', '7', elogind_directives_xml],
+                                         ['elogind.index',      '7', elogind_index_xml]] : []
         stem = tuple[0]
         section = tuple[1]
         xml = tuple[2]