[patch] hide libsmbclient's private symbols

Gerald (Jerry) Carter jerry at samba.org
Mon Jul 2 20:43:33 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James,

> The rules might look like this for a gcc-based toolchain. The only
> problem remaining is how to express the DSO version number in a generic
> way.
> 
> DSO_EXPORTS = -Wl,--version-script,exports/`basename $@ |\
>	sed -e/@SHLIBEXT@/syms/`
> SHLD_DSO = $(SHLD) $(LDSHFLAGS) $(DSO_EXPORTS) \
>	@SONAMEFLAG@`basename $@`.$(XXXXXX_MAJOR)
>
> bin/libsmbclient. at SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ)
>    @echo Linking libsmbclient shared library $@
>    @$(SHLD_DSO) $(LIBSMBCLIENT_OBJ) $(LIBS) $(KRB5LIBS) \
>     $(LDAP_LIBS) $(NSCD_LIBS)

I poked around and the only thing I could think of was
was to store the library versions outside of the Makefile
and read them from the file. For example,

  DSO_EXPORTS = -Wl,--version-script,exports/`basename $@ |\
	sed -e/@SHLIBEXT@/syms/`
  SONAME_VER = `grep $@ $(srcdir)/library-versions | cut -d: -t2`
  SHLD_DSO = $(SHLD) $(LDSHFLAGS) $(DSO_EXPORTS) \
	@SONAMEFLAG@`basename $@`.$(SONAME_VER)

and library-versions.in looks like

  # Makefile_target:major:minor
  bin/libsmbclient. at SHLIBEXT@:0:1

How about that?



cheers, jerry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGiWN1IR7qMdg1EfYRAqOPAJ9BE/KUbfIyOGIaev4QTjfeE3XFyQCfYRXj
9cpEHlWdrz8HoJL4I1Sp4pc=
=Znez
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list