[sclug] Staticly link smbclient

pieter claassen pieter at claassen.co.uk
Tue May 6 15:28:51 UTC 2008


Good try but the same problem still exists.

BTW> other than apt-get install libsmbclient-dev, how does this help  
me to compiled smbclient statically? it seems this package contains  
mostly sample code for writing your own smb stuff.

I tried using ./configure --enable-static=yes and make LDFLAGS="-static"

I noticed during the make that the output from make is:

Using FLAGS =  -O -D_SAMBA_BUILD_ -I/home/pieter/dev/samba-3.0.24/ 
source/popt -I/home/pieter/dev/samba-3.0.24/source/iniparser/src - 
Iinclude -I/home/pieter/dev/samba-3.0.24/source/include -I/home/pieter/ 
dev/samba-3.0.24/source/tdb  -I. -DHAVE_CONFIG_H  - 
D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/home/ 
pieter/dev/samba-3.0.24/source -D_SAMBA_BUILD_
       LIBS = -lcrypt -lresolv -lresolv -lnsl -ldl
       LDSHFLAGS = -shared -Wl,-Bsymbolic
       LDFLAGS = -static
       PIE_CFLAGS = -fPIE
       PIE_LDFLAGS = -pie
....

lib/system.o: In function `sys_gethostbyname':
system.c:(.text+0x9a7): warning: Using 'gethostbyname' in statically  
linked applications requires at runtime the shared libraries from the  
glibc version used for linking

....

Linking libsmbclient non-shared library bin/libsmbclient.a
Linking libsmbclient shared library bin/libsmbclient.so
....

It looks like it is trying.

Cheers,
Pieter



On May 6, 2008, at 4:50 PM, J.Mann wrote:

>
> On Tue, May 06, 2008 at 03:36:15PM +0200, pieter claassen wrote:
>> I am trying to link smbclient statically and I have tried:
>> 1. ./configure; make LDFLAGS="-static"
>
> I think you are looking for:
>
>  ./configure --enable-static=yes
>
> See "./configure --help" for more options.
>
>
>> 2. edited the Makefile and added -static to the bin/smbclient target
>
> Manually editing Autoconf managed Makefiles should be a last
> resort :-)
>
>
>> Any ideas?
>
> If you are on a Debian box, the "libsmbclient-dev" package will  
> provide
> you with the static libraries.
>
> Regards,
> Jon Mann.
>
>

pieter claassen
pieter at claassen.co.uk






More information about the Sclug mailing list