]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
configure: Add base check for dynmodules parameter to prevent impossible build attemp...
authorThomas D <whissi@whissi.de>
Tue, 5 Jan 2016 15:39:07 +0000 (16:39 +0100)
committerThomas D <whissi@whissi.de>
Tue, 5 Jan 2016 15:39:07 +0000 (16:39 +0100)
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

index b205ef7eb3cefdc34f3f65092863fe55a644a338..9155c8be8189d01578deada2d1c2dc16efcf591d 100644 (file)
@@ -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"