I've just spent a whole day trying to make this work. Arrrrghhh.
#get samba v3 source
cd ~/downloads
curl -O ftp://ftp.samba.org/.../samba-3.0.25pre1.tar.gz
#extract source
gunzip < samba-3.0.25pre1.tar.gz | tar xvf -
cd samba-3.0.25pre1/source
./configure
#patch Makefile
patch -b Makefile -
27,28c27,30
< LDSHFLAGS=-bundle -flat_namespace -undefined suppress -Wl,-search_paths_first
< WINBIND_NSS_LDSHFLAGS=-mbundle -flat_namespace -undefined suppress -Wl,-search_paths_first
---
> #LDSHFLAGS=-bundle -flat_namespace -undefined suppress -Wl,-search_paths_first
> LDSHFLAGS=-dynamiclib -fno-common -current_version 3.0 -compatibility_version 3.0 -fvisibility=hidden
> #WINBIND_NSS_LDSHFLAGS=-mbundle -flat_namespace -undefined suppress -Wl,-search_paths_first
> WINBIND_NSS_LDSHFLAGS=-dynamiclib -fno-common -current_version 3.0 -compatibility_version 3.0 -fvisibility=hidden
^D
#check that it compiled properly (look for DYLIB not BUNDLE)
otool -hv bin/libsmbclient.dylib
#install dynamic library
cp includes/libsmbclient.h /usr/local/samba/lib/libsmbclient.h
cp bin/libsmbclient.a /usr/local/samba/lib/libsmbclient.a
cp bin/libsmbclient.dylib /usr/local/samba/lib/libsmbclient.dylib
#make sure that it knows where it is installed (an odd mac thing!)
install_name_tool \
-id /usr/local/samba/lib/libsmbclient.dylib \
/usr/local/samba/lib/libsmbclient.dylib
#install Filesys::SmbClient module
perl -MCPAN -eshell
cpan> look Filesys::SmbClient
sh% perl Makefile.PL
libsmbclient.h [/usr/local/samba/include]
libsmbclient.dylib [/usr/local/samba/lib/]
test [no]
debugging [no]
sh% make
sh% make install
sh% exit
cpan> exit
#make sure loadable modules know where shared lib is - may not be necessary
#install_name_tool \
# -change bin/libsmbclient.dylib \
# /usr/local/samba/lib/libsmbclient.dylib \
# /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/Filesys/SmbClient/SmbClient.bundle