--- configure
+++ configure
@@ -8898,6 +8898,7 @@
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDL 1
+#define HAVE_DLOPEN 1
 _ACEOF
 
   LIBS="-ldl $LIBS"
@@ -10586,6 +10587,7 @@
 
 DLINCLDIR=.
 
+if test "$ac_cv_lib_dl_dlopen" != yes; then
 # the dlopen() function means we might want to use dynload_shlib.o. some
 # platforms, such as AIX, have dlopen(), but don't want to use it.
 for ac_func in dlopen
@@ -10598,6 +10600,7 @@
 
 fi
 done
+fi
 
 
 # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
@@ -10609,7 +10612,7 @@
 then
 	case $ac_sys_system/$ac_sys_release in
 	AIX*) # Use dynload_shlib.c and dlopen() if we have it; otherwise dynload_aix.c
-	if test "$ac_cv_func_dlopen" = yes
+	if test "$ac_cv_func_dlopen" = yes -o "$ac_cv_lib_dl_dlopen" = yes
 	then DYNLOADFILE="dynload_shlib.o"
 	else DYNLOADFILE="dynload_aix.o"
 	fi
@@ -10622,7 +10625,7 @@
 	*)
 	# use dynload_shlib.c and dlopen() if we have it; otherwise stub
 	# out any dynamic loading
-	if test "$ac_cv_func_dlopen" = yes
+	if test "$ac_cv_func_dlopen" = yes -o "$ac_cv_lib_dl_dlopen" = yes
 	then DYNLOADFILE="dynload_shlib.o"
 	else DYNLOADFILE="dynload_stub.o"
 	fi
