--- a/configure	2019-08-02 18:04:50.000000000 +0200
+++ b/configure	2020-02-28 06:31:30.424895061 +0100
@@ -1479,6 +1479,8 @@
   ;;
   --enable-capstone=system) capstone="system"
   ;;
+  --enable-capstone=internal) capstone="internal"
+  ;;
   --with-git=*) git="$optarg"
   ;;
   --enable-git-update) git_update=yes
@@ -4604,6 +4606,21 @@
 fi
 
 ##########################################
+cat > $TMPC << EOF
+#include <dlfcn.h>
+#include <stdlib.h>
+int main(int argc, char **argv) { return dlopen("libc.so", RTLD_NOW) != NULL; }
+EOF
+if compile_prog "" "" ; then
+  :
+elif compile_prog "" "-ldl" ; then
+  LIBS="-ldl $LIBS"
+  libs_qga="-ldl $libs_qga"
+else
+  error_exit "libdl check failed"
+fi
+
+##########################################
 # spice probe
 if test "$spice" != "no" ; then
   cat > $TMPC << EOF
