Little patch for configure&readline

Michael Ju. Tokarev mjt at tls.msk.ru
Sun Feb 13 17:19:24 GMT 2000


Hi!

Here is a little patch for 2.0.7pre1.
It corrects very strange dependance: if libreadline is installed
on the system, each samba daemon will depend on this library (if it
is a shared one).  This is very surprizing -- why smbd shoud depend
on libreadline.so.xxx !?

In configure, there is a test like "AC_CHECK_LIB(readline,readline)",
that, if readline is available, places "-lreadline" into LIBS variable,
and that var will be used by all the link commands in Makefile.
I'v created separate variable (READLINE_LIBS), changed
that AC_CHECK_LIB so that it uses that variable, and added it to Makefile.in.
Now, all stuff that should be linked against libreadline, should include
addition $(READLINE_LIBS) before usual $(LIBS) statement.

The same issue, I think, is about other libraries used in samba.
There should be some groups of libraries for different purposes,
READLINE_LIBS as an example.  So that, for example, make_smbcodepage
will not depend on libcrypt (and libreadline :).

This is a minor issue...

And another one around for configure.
If we not using largefiles (like on linux glibc2.1), there is no need to check
if read64 etc exists (all those tests can be placed inside one big if..fi
statement); analogously, if we does not asked for smbwrapper, there is no
need to see all of "stub" functions like _read, __read etc, and all that
tests can also be inside one big if..fi.
This speeds up configure script -- it takes about the same time as a build
process now...

Thanks!

Michael.

====== Patch: cut here (there may be some problems with TAB chars in Makefile.in patch) ======
--- configure.in.orig   Sat Jan 29 05:42:32 2000
+++ configure.in        Sun Feb 13 20:00:34 2000
@@ -299,11 +299,13 @@
 
 ###############################################
 # test for where we get readline() from
+DEADLINE_LIBS=
 if test "$ac_cv_header_readline_h" = "yes" ||
    test "$ac_cv_header_readline_readline_h" = "yes"; then
-  AC_CHECK_LIB(readline,readline)
+  AC_CHECK_LIB(readline,readline, [READLINE_LIBS=-lreadline;
+       AC_DEFINE(HAVE_LIBREADLINE)])
 fi
-
+AC_SUBST(READLINE_LIBS)
 
 # The following test taken from the cvs sources
 # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
--- Makefile.in.orig    Thu Jan 27 00:02:52 2000
+++ Makefile.in Sun Feb 13 20:02:18 2000
@@ -8,6 +8,7 @@
 mandir=@mandir@
 
 LIBS=@LIBS@
+READLINE_LIBS=@READLINE_LIBS@
 CC=@CC@
 CFLAGS=@CFLAGS@
 CPPFLAGS=@CPPFLAGS@
@@ -376,7 +377,7 @@
 
 bin/smbclient: $(CLIENT_OBJ) bin/.dummy
 	@echo Linking $@
-	@$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(LIBS)
+	@$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(READLINE_LIBS) $(LIBS)
 
 bin/smbspool: $(CUPS_OBJ) bin/.dummy
 	@echo Linking $@


More information about the samba-technical mailing list