[json-glib] build: Clean up configuration options



commit 3c909fe908360031ccda9444d18c0dfcac600222
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Sep 12 09:18:21 2017 +0100

    build: Clean up configuration options
    
    Drop the Autotool-isms, and use something more in line with what Meson
    expects for configuration options.

 configure             | 19 ++++++++-----------
 doc/meson.build       |  2 +-
 json-glib/meson.build |  2 +-
 meson.build           |  2 +-
 meson_options.txt     | 11 ++++-------
 5 files changed, 15 insertions(+), 21 deletions(-)
---
diff --git a/configure b/configure
index 67947eb..5fe09a6 100755
--- a/configure
+++ b/configure
@@ -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}
diff --git a/doc/meson.build b/doc/meson.build
index e2c871c..678853e 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -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',
diff --git a/json-glib/meson.build b/json-glib/meson.build
index b229ad8..2cc566c 100644
--- a/json-glib/meson.build
+++ b/json-glib/meson.build
@@ -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',
diff --git a/meson.build b/meson.build
index 59ee0b1..8351f1c 100644
--- a/meson.build
+++ b/meson.build
@@ -164,6 +164,6 @@ subdir('json-glib')
 
 subdir('po')
 
-if get_option('enable-gtk-doc')
+if get_option('docs')
   subdir('doc')
 endif
diff --git a/meson_options.txt b/meson_options.txt
index 6c078cb..edaab56 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,9 +1,6 @@
-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)')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]