PR149: Used wrong class loader.
[cacao.git] / m4 / dl.m4
index 1dcc4e4a84695a878f3c12d9f2300adec101c82e..5b05b1d63564f99263700114be0293be8fc030c6 100644 (file)
--- a/m4/dl.m4
+++ b/m4/dl.m4
@@ -36,7 +36,16 @@ AC_MSG_RESULT(${ENABLE_DL})
 
 if test x"${ENABLE_DL}" = "xyes"; then
     AC_CHECK_HEADERS([dlfcn.h],, [AC_MSG_ERROR(cannot find dlfcn.h)])
-    AC_CHECK_LIB([dl], [dlopen],, [AC_MSG_ERROR(cannot find libdl)])
+
+    case "${OS_DIR}" in
+        freebsd | netbsd )
+            dnl There is no libdl on FreeBSD, and NetBSD (see PR96).
+            ;;
+        *)
+            AC_CHECK_LIB([dl], [dlopen],, [AC_MSG_ERROR(cannot find libdl)])
+            ;;
+    esac
+    
     AC_CHECK_FUNCS([dlclose])
     AC_CHECK_FUNCS([dlerror])
     AC_CHECK_FUNCS([dlopen])