From: Thomas D Date: Tue, 5 Jan 2016 16:42:38 +0000 (+0100) Subject: configure: Add base check for modules parameter to prevent impossible build attempts... X-Git-Tag: dnsdist-1.0.0-alpha2~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3172%2Fhead;p=thirdparty%2Fpdns.git 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). --- diff --git a/configure.ac b/configure.ac index 9155c8be81..89fb023d56 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