e: Problem to use VFS modules

root root at samba.org
Mon May 14 05:19:18 GMT 2001

This debate certainly is interesting!

> > - tell us if the system has the capabilities we need
> libtool --features | grep "enable shared"

I probably should have been more explicit. We need the following
features from the OS:

1) shared libraries

2) the ability to dlopen() the libraries at runtime with a given (not
   OS mandated) path

3) the ability to find functions in the shared libraries with dlsym()

4) functions in the shared libraries need to be able to access global
   symbols in the main executable

5) functions in shared libraries need to be able to access functions
   from other shared libraries that have been previously loaded (so we
   can chain loadable modules)

I know that this list of features restricts what OSes we can support
dynamic loading on, but that's OK.

> libtool --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c foo.c
> this creates foo.lo

I assume we can use -o to say where to put the object file? We would
like to place it in subdirectories under the direction of the Makefile
(we don't use recursive makefiles). If the compiler doesn't support
this then a shell wrapper would be fine.

> > - combine several object files into a shared lib
> libtool --mode=link $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
> foo.lo bar.lo ... -o libbaz.la -rpath $(libdir)
> Then, at install time:
> libtool --mode=install install -c libbaz.la $(libdir)/libbaz.la

The separation of build and install would be a pain for Samba. I know
this is needed for relinking of executables, and is needed for
archives that need ranlib, but is there any need for this separation
given the restricted use we are making of shared libs in Samba? We
never do compile time linking of these libraries into Samba (they are
only ever accessed by dlopen/dlsym) and we don't ever want non shared
libraries so ranlib isn't an issue.

> If you want to get this library linked into a program, you'd have to
> add:
> libtool --mode=link $(CC) ... x.o y.o -o prog libfoo.la
> And use libtool to install the program:
> libtool --mode-install install prog $(bindir)/prog

Luckily we don't want to do that, otherwise the packaging would indeed
be a bit of a pain as Mike points out.

Cheers, Tridge

More information about the samba-technical mailing list