OS don't have AF_LOCAL - in smbldap.c svn r5522

Doug VanLeuven roamdad at sonic.net
Sun Mar 13 07:09:36 GMT 2005


Doug VanLeuven wrote:

> Gerald (Jerry) Carter wrote:
>
>> Doug VanLeuven wrote:
>>
>> | Thanks.  That worked.  My file of diffs for AIX
>> | to patch against the releases just keeps slowly growing :-)
>>
>> Got bug ID numbers ?  The only one I found was
>>
>>     https://bugzilla.samba.org/bug/1649
>
Perhaps someone will find this useful.
I like to run the tests.  It was time consuming to manually re-edit 
Makefile after configure on AIX.
This patch changes libbigballofmud to a static library and no warnings 
or errors.
Not all compilers take a space between -L lib though modern ones do.
Runs on linux & AIX.
I don't have access to Solaris.

Regards, Doug

-------------- next part --------------
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 5782)
+++ Makefile.in	(working copy)
@@ -508,8 +508,8 @@
 		   $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_GET_SET_OBJ) \
 		   $(SECRETS_OBJ) 
 
-# This shared library is intended for linking with unit test programs
-# to test Samba internals.  It's called libbigballofmud.so to
+# This static library is intended for linking with unit test programs
+# to test Samba internals.  It's called libbigballofmud.a to
 # discourage casual usage.
 
 LIBBIGBALLOFMUD_MAJOR = 0
@@ -996,19 +996,10 @@
 	@echo Linking libsmbclient non-shared library $@
 	@-$(AR) -rc $@ $(LIBSMBCLIENT_PICOBJS)
 
-# This is probably wrong for anything other than the GNU linker. 
-bin/libbigballofmud. at SHLIBEXT@: $(LIBBIGBALLOFMUD_PICOBJS)
-	@echo Linking bigballofmud shared library $@
-	@$(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_PICOBJS) $(LIBS) \
-		$(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
-		@SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR)
-	ln -snf libbigballofmud.so bin/libbigballofmud.so.0
+bin/libbigballofmud.a: $(LIBBIGBALLOFMUD_PICOBJS)
+	@echo Linking bigballofmud non-shared library $@
+	@-$(AR) -rc $@ $(LIBBIGBALLOFMUD_PICOBJS)
 
-# It would be nice to build a static bigballofmud too, but when I try
-# I get linker errors about dl_open and similar things.  I'm not sure if
-# it can be fixed or if they just can't be called from a static
-# library.
-
 libsmbclient: $(LIBSMBCLIENT)
 
 bin/librpc_lsarpc. at SHLIBEXT@: $(RPC_LSA_OBJ)
@@ -1258,22 +1249,24 @@
 	@echo Linking $@
 	@$(CC) $(FLAGS) -o $@ $(DYNEXP) $(TDBDUMP_OBJ)
 
-bin/t_strcmp at EXEEXT@: bin/libbigballofmud. at SHLIBEXT@ torture/t_strcmp.o
-	$(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) torture/t_strcmp.o -L ./bin -lbigballofmud
+bin/t_strcmp at EXEEXT@: bin/libbigballofmud.a torture/t_strcmp.o
+	$(CC) $(FLAGS) -o $@ $(LIBS) torture/t_strcmp.o -L./bin -lbigballofmud
 
-bin/t_strstr at EXEEXT@: bin/libbigballofmud. at SHLIBEXT@ torture/t_strstr.o
-	$(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) torture/t_strstr.o -L ./bin -lbigballofmud
+bin/t_strstr at EXEEXT@: bin/libbigballofmud.a torture/t_strstr.o
+	$(CC) $(FLAGS) -o $@ $(LIBS) torture/t_strstr.o -L./bin -lbigballofmud
 
-bin/t_stringoverflow at EXEEXT@: bin/libbigballofmud. at SHLIBEXT@ torture/t_stringoverflow.o
-	$(CC) $(FLAGS) -o $@ $(DYNEXP) torture/t_stringoverflow.o -L./bin -lbigballofmud
+bin/t_stringoverflow at EXEEXT@: bin/libbigballofmud.a torture/t_stringoverflow.o
+	$(CC) $(FLAGS) -o $@ $(LIBS) torture/t_stringoverflow.o -L./bin -lbigballofmud
 
-bin/t_doschar at EXEEXT@: bin/libbigballofmud. at SHLIBEXT@ torture/t_doschar.o
-	$(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) torture/t_doschar.o -L ./bin -lbigballofmud
-bin/t_push_ucs2 at EXEEXT@: bin/libbigballofmud. at SHLIBEXT@ torture/t_push_ucs2.o
-	$(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) torture/t_push_ucs2.o -L ./bin -lbigballofmud
+bin/t_doschar at EXEEXT@: bin/libbigballofmud.a torture/t_doschar.o
+	$(CC) $(FLAGS) -o $@ $(LIBS) torture/t_doschar.o -L./bin -lbigballofmud
 
+bin/t_push_ucs2 at EXEEXT@: bin/libbigballofmud.a torture/t_push_ucs2.o
+	$(CC) $(FLAGS) -o $@ $(LIBS) torture/t_push_ucs2.o -L./bin -lbigballofmud
+
 bin/t_snprintf at EXEEXT@: lib/snprintf.c
 	$(CC) $(FLAGS) -o $@ $(DYNEXP) -DTEST_SNPRINTF lib/snprintf.c -lm
+
 install: installbin installman installscripts installdat installswat installmodules @INSTALLCLIENT@
 
 install-everything: install installmodules
@@ -1533,12 +1526,7 @@
 ######################################################################
 # Samba Testing Framework
 
-# FIXME: LD_LIBRARY_PATH is not portable, but in the absence of
-# libtool I don't know a better way to do it.  Perhaps we should fix
-# libbigballofmud to link statically?
-
 check: check-programs
-	LD_LIBRARY_PATH="`pwd`/bin:$$LD_LIBRARY_PATH" \
 	PATH="`pwd`/bin:$$PATH" \
 	python stf/standardcheck.py; \
 	if test -n "$(PYTHON)"; then \
@@ -1548,4 +1536,4 @@
 # These are called by the test suite and need to be built before
 # running it.  For the time being we don't build all of BIN_PROGS,
 # because they're not all needed.
-check-programs: bin/t_strcmp bin/t_strstr bin/t_push_ucs2 bin/smbcontrol bin/t_snprintf
+check-programs: bin/libbigballofmud.a bin/t_strcmp bin/t_strstr bin/t_push_ucs2 bin/smbcontrol bin/t_snprintf


More information about the samba-technical mailing list