From 7e7c258e0b281acf99b3f538cd46f42ce5dfa486 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 29 Jun 2001 23:30:01 +0000 Subject: These changes cause the libsmbclient stuff to always build a non-shared library and to build a shared library only for the four OSes that we currently like. I will probably add HP/UX and AIX support based on the CUPS stuff soon ... (This used to be commit 9585529455ae4a3e9b4dafc5f16286fabb052809) --- source3/Makefile.in | 16 ++++++++-------- source3/configure.in | 8 +++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/source3/Makefile.in b/source3/Makefile.in index 0801efb5ec..5b362d37a6 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -83,7 +83,7 @@ MPROGS = @MPROGS@ WINBIND_PROGS = nsswitch/pam_winbind.so nsswitch/libnss_winbind.so bin/winbindd bin/wbinfo PROGS = $(PROGS1) $(PROGS2) $(MPROGS) bin/nmblookup bin/make_printerdef bin/pdbedit @WINBIND_TARGETS@ TORTURE_PROGS = bin/smbtorture bin/msgtest bin/masktest bin/locktest bin/locktest2 -SHLIBS = bin/libsmbclient.so +SHLIBS = bin/libsmbclient SCRIPTS = $(srcdir)/script/smbtar $(srcdir)/script/addtosmbpass $(srcdir)/script/convert_smbpasswd @@ -610,13 +610,13 @@ bin/smbwrapper.32.@SHLIBEXT@: $(PICOBJS32) @echo Linking shared library $@ @$(LD) -32 @LDSHFLAGS@ -o $@ $(PICOBJS32) $(LIBS) -bin/libsmbclient.so: $(LIBSMBCLIENT_PICOBJS) - @echo Linking libsmbclient shared library $@ - -$(LD) @LDSHFLAGS@ -o $@ $(LIBSMBCLIENT_PICOBJS) $(LIBS) # Anything else? - -client/testsmbc: client/testsmbc.o bin/libsmbclient.so - @echo Linking testsmbc - -$(CC) $(CFLAGS) -o $@ client/testsmbc.o -Lbin -lsmbclient +bin/libsmbclient: $(LIBSMBCLIENT_PICOBJS) + -if [ @BLDSHARED@ ]; then \ + echo Linking libsmbclient shared library $@.@SHLIBEXT@; \ + $(LD) @LDSHFLAGS@ -o $@.@SHLIBEXT@ $(LIBSMBCLIENT_PICOBJS) $(LIBS); \ + fi + @echo Linking libsmbclient non-shared library $@.a + -$(AR) -rc $@.a $(LIBSMBCLIENT_PICOBJS) bin/smbsh: $(SMBSH_OBJ) bin/.dummy @echo Linking $@ diff --git a/source3/configure.in b/source3/configure.in index 0d59ee50e2..231c1e1e09 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -15,6 +15,7 @@ AC_SUBST(WRAP) AC_SUBST(WRAP32) AC_SUBST(PICFLAG) AC_SUBST(SHLIBEXT) +AC_SUBST(BLDSHARED) # compile with optimisation and without debugging by default CFLAGS="-O ${CFLAGS}" @@ -607,17 +608,22 @@ HOST_OS="$host_os" LDSHFLAGS="-shared" PICFLAG="" SHLIBEXT="so" +BLDSHARED="false" # and these are for particular systems case "$host_os" in - *linux*) AC_DEFINE(LINUX);; + *linux*) AC_DEFINE(LINUX) + BLDSHARED="true" + ;; *solaris*) AC_DEFINE(SUNOS5) LDSHFLAGS="-G" + BLDSHARED="true" ;; *sunos*) AC_DEFINE(SUNOS4) LDSHFLAGS="" ;; *bsd*) LDSHFLAGS="-shared -Bshareable" + BLDSHARED="true" ;; *irix*) AC_DEFINE(IRIX) case "$host_os" in -- cgit