chiark / gitweb /
Prep v239: Add man/custom-entities.ent.in, we now need it.
[elogind.git] / man / meson.build
index d5e4e90890f333ad65679cf9a7d023a60e9e1d7e..d5895eb2fc8352df8fb8deb962c1e03a3b149458 100644 (file)
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: LGPL-2.1+
+
 # This is lame, I know, but meson has no other include mechanism
 subdir('rules')
 
@@ -24,17 +26,15 @@ custom_man_xsl = files('custom-man.xsl')
 custom_html_xsl = files('custom-html.xsl')
 xslt_cmd = [xsltproc, '-o', '@OUTPUT0@'] + xsltproc_flags
 
-#if 0 /// UNNEEDED by elogind
-# custom_entities_ent = configure_file(
-#         input : 'custom-entities.ent.in',
-#         output : 'custom-entities.ent',
-#         configuration : conf)
-#endif // 0
+custom_entities_ent = configure_file(
+        input : 'custom-entities.ent.in',
+        output : 'custom-entities.ent',
+        configuration : conf)
 
 man_pages = []
 html_pages = []
 source_xml_files = []
-foreach tuple : manpages
+foreach tuple : xsltproc.found() ? manpages : []
         stem = tuple[0]
         section = tuple[1]
         aliases = tuple[2]
@@ -74,7 +74,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]
@@ -121,8 +126,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]