From c7fd848a51fd53d8cf003d892efdb01e2b7efc0e Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 16 Dec 2019 10:42:09 +0100 Subject: [PATCH] build: add an empty config.sh This helper script will contain variables with results of configure checks, so other scripts can source it. Source it automatically in test-functions.sh, so every test can already make use of it. --- .gitignore | 1 + config.sh.in | 20 ++++++++++++++++++++ configure.ac | 1 + tests/test-functions.sh | 3 +++ 4 files changed, 25 insertions(+) create mode 100644 config.sh.in diff --git a/.gitignore b/.gitignore index ee7e3cf9e..54e5b0ec2 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ Makefile.in /config.h /config.h.in /config.log +/config.sh /config.status /config.sub /configure diff --git a/config.sh.in b/config.sh.in new file mode 100644 index 000000000..061871a3c --- /dev/null +++ b/config.sh.in @@ -0,0 +1,20 @@ +#!/bin/bash - +# (C) Copyright 2019 Red Hat Inc. +# @configure_input@ +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# This shell script contains the results of some configure checks, +# mostly used in other shell scripts. diff --git a/configure.ac b/configure.ac index f7ff742a5..1b8f6a837 100644 --- a/configure.ac +++ b/configure.ac @@ -116,6 +116,7 @@ AC_CONFIG_FILES([Makefile common/qemuopts/Makefile common/utils/Makefile common/windows/Makefile + config.sh docs/Makefile gnulib/lib/Makefile gnulib/tests/Makefile diff --git a/tests/test-functions.sh b/tests/test-functions.sh index 565c4208d..446b20fe7 100755 --- a/tests/test-functions.sh +++ b/tests/test-functions.sh @@ -33,6 +33,9 @@ export LANG=C # parameters, so we eval those to define the variables. while [ $# -ge 1 ]; do eval "$1"; shift; done +# Configure check results. +source $abs_top_builddir/config.sh + # Skip if $SKIP_ environment variable is set. # Every test should call this function first. skip_if_skipped () -- 2.24.1