diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2017-05-10 14:07:37 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2017-05-10 14:07:37 +0100 |
commit | 2d120f4bbd8caa82994658ab0689600cd6386d05 (patch) | |
tree | 6ad8628def12e2746ce2c5dd70b4fee3023e8ebd /configure | |
parent | 8122b447e5c85a7addfc19827232d5cfe85b4eba (diff) | |
download | appstream-glib-2d120f4bbd8caa82994658ab0689600cd6386d05.tar.gz |
build: Improve build-api wrapper for Meson (#166)
Add all the existing options, and allow calling the configure script
without a builddir.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 59 |
1 files changed, 47 insertions, 12 deletions
@@ -6,7 +6,6 @@ # Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php) # Build API variables: -# buildapi-variable-require-builddir # Little helper function for reading args from the commandline. # it automatically handles -a b and -a=b variants, and returns 1 if @@ -56,10 +55,6 @@ sanitycheck() { sanitycheck MESON 'meson' sanitycheck NINJA 'ninja' 'ninja-build' -enable_docs='-Denable-gtk-doc=false' -enable_man='-Denable-man=false' -enable_introspection='' - while (($# > 0)); do case "${1%%=*}" in --prefix) read_arg prefix "$@" || shift;; @@ -74,12 +69,20 @@ while (($# > 0)); do --includedir) read_arg includedir "$@" || shift;; --enable-gtk-doc) enable_docs='-Denable-gtk-doc=true';; --disable-gtk-doc) enable_docs='-Denable-gtk-doc=false';; - --enable-stemmer) enable_docs='-Denable-stemmer=true';; - --disable-stemmer) enable_docs='-Denable-stemmer=false';; - --enable-dep11) enable_docs='-Denable-dep11=true';; - --disable-dep11) enable_docs='-Denable-dep11=false';; + --enable-stemmer) enable_stemmer='-Denable-stemmer=true';; + --disable-stemmer) enable_stemmer='-Denable-stemmer=false';; + --enable-dep11) enable_dep11='-Denable-dep11=true';; + --disable-dep11) enable_dep11='-Denable-dep11=false';; --enable-man) enable_man='-Denable-man=true';; --disable-man) enable_man='-Denable-man=false';; + --enable-rpm) enable_rpm='-Denable-rpm=true';; + --disable-rpm) enable_rpm='-Denable-rpm=false';; + --enable-alpm) enable_alpm='-Denable-alpm=true';; + --disable-alpm) enable_alpm='-Denable-alpm=false';; + --enable-builder) enable_builder='-Denable-builder=true';; + --disable-builder) enable_builder='-Denable-builder=false';; + --enable-fonts) enable_fonts='-Denable-fonts=true';; + --disable-fonts) enable_fonts='-Denable-fonts=false';; --enable-introspection) enable_introspection='';; --disable-introspection) enable_introspection='-Ddisable_introspection=true';; *) echo -e "\e[1;33mINFO\e[0m: Ignoring unknown option '$1'";; @@ -102,17 +105,34 @@ test -z ${includedir} && includedir=${prefix}/include # The source directory is the location of this file srcdir=$(dirname $0) +# The build directory is the current location +builddir=`pwd` + +# If we're calling this file from the source directory then +# we automatically create a build directory and ensure that +# both Meson and Ninja invocations are relative to that +# location +if [[ -f "${builddir}/meson.build" ]]; then + mkdir -p _build + builddir="${builddir}/_build" + NINJA_OPT="-C ${builddir}" +fi + # Wrapper Makefile for Ninja cat > Makefile <<END # Generated by configure; do not edit all: - CC="\$(CC)" CXX="\$(CXX)" ${NINJA} + CC="\$(CC)" CXX="\$(CXX)" ${NINJA} ${NINJA_OPT} install: - DESTDIR="\$(DESTDIR)" ${NINJA} install + DESTDIR="\$(DESTDIR)" ${NINJA} ${NINJA_OPT} install + +check: + ${MESONTEST} ${NINJA_OPT} END + echo "Summary:" echo " meson:....... ${MESON}" echo " ninja:....... ${NINJA}" @@ -127,7 +147,15 @@ echo " libdir:...... ${libdir}" echo " mandir:...... ${mandir}" echo " includedir:.. ${includedir}" echo " additional:.." -echo " - ${enable_docs} ${enable_man} ${enable_introspection}" +echo " - docs: ${enable_docs:-default}" +echo " - man: ${enable_man:-default}" +echo " - introspection: ${enable_introspection:-default}" +echo " - stemmer: ${enable_stemmer:-default}" +echo " - DEP-11: ${enable_dep11:-default}" +echo " - RPM: ${enable_rpm:-default}" +echo " - fonts: ${enable_fonts:-default}" +echo " - alpm: ${enable_alpm:-default}" +echo " - builder: ${enable_builder:-default}" exec ${MESON} \ --prefix=${prefix} \ @@ -142,6 +170,13 @@ exec ${MESON} \ ${enable_docs} \ ${enable_man} \ ${enable_introspection} \ + ${enable_stemmer} \ + ${enable_dep11} \ + ${enable_rpm} \ + ${enable_alpm} \ + ${enable_builder} \ + ${enable_fonts} \ + ${builddir} \ ${srcdir} # vim: ai ts=8 noet sts=2 ft=sh |