From 8a32d90dcd99465e8784a18fda0ae0c79a5aaf43 Mon Sep 17 00:00:00 2001 From: Thomas D Date: Tue, 5 Jan 2016 17:42:38 +0100 Subject: [PATCH] configure: Add base check for modules parameter to prevent impossible build attempts due to invalid values We didn't validate modules parameter values which allowed build failures if a module was removed (or the user just passed an invalid value). Now we will do a base check by checking for the existence of the module's source dir. This will allow us to catch errors like that and show a meaningful error message if necessary. Same implementation like for dynmodules parameter (introduced with commit 09acf5464f18268f898e6a4b5a96af53ed9f523d). --- configure.ac | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 9155c8be8..89fb023d5 100644 --- a/configure.ac +++ b/configure.ac @@ -299,12 +299,19 @@ PDNS_CHECK_SQLITE3 AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"]) for a in $modules; do - moduledirs="$moduledirs ${a}backend" + AC_MSG_CHECKING([whether we can build module "${a}"]) + if [[ -d "$srcdir/modules/${a}backend" ]]; then + AC_MSG_RESULT([yes]) + moduledirs="$moduledirs ${a}backend" - for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do - moduleobjects="$moduleobjects ../modules/${a}backend/$b" - done - modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`" + for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do + moduleobjects="$moduleobjects ../modules/${a}backend/$b" + done + modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`" + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Do not know how to build module "$a", "$srcdir/modules/${a}backend" doesn't exist! Please review --with-modules parameter for supported values.]) + fi done for a in $dynmodules; do -- 2.40.0