[patch] hide libsmbclient's private symbols

Gerald (Jerry) Carter jerry at samba.org
Mon Jul 2 21:01:54 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)

I just realized why this won't work.  On some platforms
the @SONAMEFLAG@ just becomes '#' and comments out the remainder
of the line.

SO this is good:

  SHLD_DSO = $(SHLD) $(LDSHFLAGS) $(DSO_EXPORTS)

but you have to add the @SONAMEFLAG@ last in the list
I still like moving the major and minor numbers of the
Makefile thought.  What do you think?



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

iD8DBQFGiWfCIR7qMdg1EfYRAv/0AKCMajZ8dRwrjcK94PMiUQfrdk3eagCeNr6R
n1zg65KSc9Fa5mXEyf1AyKQ=
=ucqG
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list