Commit 3c909fe9 authored by Emmanuele Bassi's avatar Emmanuele Bassi

build: Clean up configuration options

Drop the Autotool-isms, and use something more in line with what Meson
expects for configuration options.
parent 9db74a03
......@@ -55,9 +55,8 @@ sanitycheck MESON 'meson'
sanitycheck MESONTEST 'mesontest'
sanitycheck NINJA 'ninja' 'ninja-build'
enable_docs='-Denable-gtk-doc=false'
enable_man='-Denable-man=false'
enable_introspection=''
enable_docs='-Ddocs=false'
enable_introspection='-Dintrospection=true'
while (($# > 0)); do
case "${1%%=*}" in
......@@ -71,12 +70,10 @@ while (($# > 0)); do
--libdir) read_arg libdir "$@" || shift;;
--mandir) read_arg mandir "$@" || shift;;
--includedir) read_arg includedir "$@" || shift;;
--enable-gtk-doc) enable_docs='-Denable-gtk-doc=true';;
--disable-gtk-doc) enable_docs='-Denable-gtk-doc=false';;
--enable-man) enable_man='-Denable-man=true';;
--disable-man) enable_man='-Denable-man=false';;
--enable-introspection) enable_introspection='';;
--disable-introspection) enable_introspection='-Ddisable_introspection=true';;
--enable-gtk-doc) enable_docs='-Ddocs=true';;
--disable-gtk-doc) enable_docs='-Ddocs=false';;
--enable-introspection) enable_introspection='-Dintrospection=true';;
--disable-introspection) enable_introspection='-Dintrospection=false';;
*) echo -e "\e[1;33mINFO\e[0m: Ignoring unknown option '$1'";;
esac
shift
......@@ -138,7 +135,8 @@ echo " libdir:...... ${libdir}"
echo " mandir:...... ${mandir}"
echo " includedir:.. ${includedir}"
echo " additional:.."
echo " - ${enable_docs} ${enable_man} ${enable_introspection}"
echo " - docs: ${enable_docs}"
echo " - introspection: ${enable_introspection}"
exec ${MESON} \
--prefix=${prefix} \
......@@ -151,7 +149,6 @@ exec ${MESON} \
--mandir=${mandir} \
--default-library shared \
${enable_docs} \
${enable_man} \
${enable_introspection} \
${builddir} \
${srcdir}
......
......@@ -39,7 +39,7 @@ gnome.gtkdoc('json-glib',
install: true)
xsltproc = find_program('xsltproc', required: false)
if get_option('enable-man') and xsltproc.found()
if xsltproc.found()
xlstproc_flags = [
'--nonet',
'--stringparam', 'man.output.quietly', '1',
......
......@@ -85,7 +85,7 @@ pkgg.generate(libraries: [ json_lib ],
requires: 'gio-2.0')
gir = find_program('g-ir-scanner', required: false)
build_gir = gir.found() and get_option('enable-introspection')
build_gir = gir.found() and get_option('introspection')
if build_gir
gir_args = [
'--quiet',
......
......@@ -164,6 +164,6 @@ subdir('json-glib')
subdir('po')
if get_option('enable-gtk-doc')
if get_option('docs')
subdir('doc')
endif
option('enable-introspection',
option('introspection',
type: 'boolean', value: true,
description: 'Whether to generate introspection data (requires gobject-introspection)')
option('enable-gtk-doc',
description: 'Build the introspection data (requires gobject-introspection)')
option('docs',
type: 'boolean', value: false,
description: 'Whether to generate the API reference (requires gtk-doc)')
option('enable-man',
type: 'boolean', value: false,
description: 'Whether to generate man pages (requires xsltproc)')
description: 'Build the API reference and man pages (requires gtk-doc and xsltproc)')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment