[RFC][PATCH] Using VFS modules on FreeBSD (was: Re: Modified skel.c file)

Rainer Link link at foo.fh-furtwangen.de
Mon Mar 4 06:48:02 GMT 2002


Ries van twisk wrote:

> here is the complete patch to get a working VFS system.
> I tested both skel.so and audit.so.
> The block.so example loads succesfully but I didn't really test it out
> since I have not clue what it really does....
> 
> This patch also includes the patches found on www.openantivirus.org in
> the samba-vscan project created by Rainer Link.

Actually, you can't currently use VFS modules on a FreeBSD system, as
configure checks if libdl is available and vfs.c depends on HAVE_LIBDL.
But on FreeBSD (at least 4.5) dlopen and such are part of libc and not
part of an own lib. Attached is a small patch for configure.in, which
"fixes" this issue (it's just a q&d hack I did after sb complained for
being not able to use my vscan-samba stuff on his FBSD system). Comments
welcome.

cheers, Rainer

-- 
Rainer Link  | Student of Computer Networking                        
link at suse.de | University of Applied Sciences, Furtwangen, Germany    
rainer.w3.to | http://www.computer-networking.de/
-------------- next part --------------
--- configure.in.orig	Thu Feb  7 03:56:47 2002
+++ configure.in	Sun Mar  3 21:00:35 2002
@@ -452,8 +452,21 @@
 
 ############################################
 # we need libdl for PAM and the new VFS code
-AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
-	AC_DEFINE(HAVE_LIBDL)])
+# dlopen et al are defined in libc on FreeBSD, on Linux
+# and probably others it's in an own lib
+# that's just a quick hack (rainer at openantivirus.org, 3/3/2002)
+    
+case "$host_os" in
+ *bsd*)
+        AC_CHECK_LIB(c, dlopen, [LIBS="$LIBS -lc";
+                AC_DEFINE(HAVE_LIBDL)])
+ ;; 
+ *) 
+        AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
+                AC_DEFINE(HAVE_LIBDL)])
+ ;;
+esac
+
 
 ############################################
 # check if the compiler can do immediate structures


More information about the samba-technical mailing list