From 09acf5464f18268f898e6a4b5a96af53ed9f523d Mon Sep 17 00:00:00 2001 From: Thomas D Date: Tue, 5 Jan 2016 16:39:07 +0100 Subject: [PATCH] configure: Add base check for dynmodules parameter to prevent impossible build attempts due to invalid values We didn't validate dynmodules parameter values which allows build failures like > [...] > Making all in geobackend > /bin/sh: line 20: cd: geobackend: No such file or directory > Makefile:499: recipe for target 'all-recursive' failed > make[2]: *** [all-recursive] Error 1 which happens for example if a dynamic 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. Reference: https://github.com/PowerDNS/pdns/issues/3171 --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b205ef7eb..9155c8be8 100644 --- a/configure.ac +++ b/configure.ac @@ -308,7 +308,14 @@ for a in $modules; do done for a in $dynmodules; do - moduledirs="$moduledirs ${a}backend" + AC_MSG_CHECKING([whether we can build dynamic module "${a}"]) + if [[ -d "$srcdir/modules/${a}backend" ]]; then + AC_MSG_RESULT([yes]) + moduledirs="$moduledirs ${a}backend" + 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-dynmodules parameter for supported values.]) + fi done LDFLAGS="$RELRO_LDFLAGS $LDFLAGS" -- 2.40.0