summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry LARONDE <tlaronde@kergis.com>2024-03-24 18:37:37 +0000
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-03-24 18:37:37 +0000
commitb060c750f309c72636269bdcc1676b745e6760d1 (patch)
treeb7f4d2803ab68c847d78296e29c52632ad21c101
parenteb47cc29d45c86e5b1c4235fca7498811203d1b0 (diff)
Meson: align settables to autotools ones. Fix discrepancy.
-rw-r--r--Makefile.am2
-rw-r--r--meson.build38
-rw-r--r--meson_options.txt2
3 files changed, 35 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 63a9c60..392bb83 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,4 +43,4 @@ ChangeLog:
dist-hook: ChangeLog INSTALL
-EXTRA_DIST = README.md meson.build
+EXTRA_DIST = README.md meson.build meson_options.txt
diff --git a/meson.build b/meson.build
index 5b38853..891fdcd 100644
--- a/meson.build
+++ b/meson.build
@@ -1,25 +1,51 @@
+# meson_options.txt extends built-in options. To see all the options,
+# built-in and added, run:
+#
+# PAGER=less meson configure
+#
project('xorg-sgml-doctools',
version: '1.12',
- meson_version: '>= 0.49.0',
+ meson_version: '>= 0.58.0',
license: 'MIT'
)
-datarootdir = get_option('prefix') / get_option('datadir')
-sgmlrootdir = datarootdir / 'sgml'
-sgmlx11dir = sgmlrootdir / 'X11'
-sgmldbsdir = sgmlx11dir / 'dbs'
+# To pass CI, autotools and meson have to generate the exact same
+# xorg-sgml-doctools.pc.
+# The CI doesn't change the datarootdir or datadir, so our default
+# setting of datarootdir: '${prefix}/share' can be passed as is
+# (if the user has set another value, it's not in the CI, and his
+# value will be used; we are talking only about the pkgconfig
+# syntax compatible default of the value that will cause no problem
+# with pkgconfig).
+# So this can be passed without ado for pkgconfig as is, setting in
+# the same spirit sgmlrootdir to '${datarootdir}/sgml' (sgmlrootdir is
+# not settable even with autotools).
+# We will replace the magic strings after.
+#
+datarootdir = get_option('datarootdir')
pc_conf = configuration_data({
'prefix': get_option('prefix'),
- 'datarootdir': '${prefix}/share',
+ 'datarootdir': datarootdir,
'sgmlrootdir': '${datarootdir}/sgml',
'PACKAGE_VERSION': meson.project_version()
})
+
+# pkgconfigdir is set from datadir (M.I. stuff).
+#
configure_file(input: 'xorg-sgml-doctools.pc.in',
output: 'xorg-sgml-doctools.pc',
install_dir: get_option('datadir') / 'pkgconfig',
configuration: pc_conf)
+# Now that the pkgconfig file problem is passed, we replace the
+# magic strings.
+#
+datarootdir = datarootdir.replace('${prefix}', get_option('prefix'))
+sgmlrootdir = datarootdir / 'sgml'
+sgmlx11dir = sgmlrootdir / 'X11'
+sgmldbsdir = sgmlx11dir / 'dbs'
+
sgmlx11_files = [
'defs.ent',
'xorg.css',
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..8c7c809
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,2 @@
+option('datarootdir', type: 'string', value: '${prefix}/share',
+ description: 'read-only arch.-independent data root')