Samba 2.0.7pre readline patch (2nd rev)
samba-technical at thewrittenword.com
samba-technical at thewrittenword.com
Fri Apr 14 06:27:15 GMT 2000
On Wed, Mar 29, 2000 at 11:50:28PM +1000, Michael Ju. Tokarev wrote:
> Just one correction/suggestion.
>
> If you add -lncurses or -ltermcap or something to LIBS and add -lreadline
> also, _all_ executables will depend on it and will load all this on startup.
> I already suggested to create another variable, e.g. "TERMLIBS",
> and add all this to here, not to LIBS/LDFLAGS.
Ok, done. I've attached a patch below. This adds TERMLIBS and
TERMLDFLAGS and introduces a new configure option, --with-readline=DIR
to specify an alternate location for the readline libraries (so you
don't have to set CPPFLAGS/LDFLAGS).
In addition, I've fixed the following.
1. There is no AC_MSG_CHECKING for the --with-sambabook option
so "yes" or "no" get displayed on a line by themselves.
2. configure output:
checking if large file support can be enabled
no
really should be
checking if large file support can be enabled... no
3. HAVE_LIBREADLINE appears twice in source/includes/config.h.in
4. Got rid of knowledge of the autoconf variables
$ac_cv_header_readline_h and $ac_cv_header_readline_readline_h.
Just run AC_CHECK_HEADERS twice.
I hope these can make it in on time for 2.0.7. It's against CVS as of
a few hours ago.
--
albert chin (china at thewrittenword.com)
-- snip snip
--- source/include/config.h.in.orig Thu Apr 13 23:52:18 2000
+++ source/include/config.h.in Thu Apr 13 23:52:24 2000
@@ -145,7 +145,6 @@
#undef SIZEOF_INO_T
#undef SIZEOF_OFF_T
#undef STAT_STATVFS64
-#undef HAVE_LIBREADLINE
#undef HAVE_KERNEL_OPLOCKS
#undef HAVE_IRIX_SPECIFIC_CAPABILITIES
#undef HAVE_INT16_FROM_RPC_RPC_H
--- source/Makefile.in.orig Thu Apr 13 21:29:38 2000
+++ source/Makefile.in Fri Apr 14 00:30:00 2000
@@ -14,6 +14,9 @@
LDFLAGS=@LDFLAGS@
AWK=@AWK@
+TERMLDFLAGS=@TERMLDFLAGS@
+TERMLIBS=@TERMLIBS@
+
INSTALLCMD=@INSTALL@
VPATH=@srcdir@
@@ -377,7 +380,7 @@
bin/smbclient: $(CLIENT_OBJ) bin/.dummy
@echo Linking $@
- @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(LIBS)
+ @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS)
bin/smbspool: $(CUPS_OBJ) bin/.dummy
@echo Linking $@
@@ -449,11 +452,11 @@
bin/smbwrapper. at SHLIBEXT@: $(PICOBJS)
@echo Linking shared library $@
- @$(LD) @LDSHFLAGS@ -o $@ $(PICOBJS) $(LIBS)
+ @$(LD) @LDSHFLAGS@ -o $@ $(TERMLDFLAGS) $(TERMLIBS) $(PICOBJS) $(LIBS)
bin/smbwrapper.32. at SHLIBEXT@: $(PICOBJS32)
@echo Linking shared library $@
- @$(LD) -32 @LDSHFLAGS@ -o $@ $(PICOBJS32) $(LIBS)
+ @$(LD) -32 @LDSHFLAGS@ -o $@ $(PICOBJS32) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS)
bin/smbsh: $(SMBSH_OBJ) bin/.dummy
@echo Linking $@
--- source/configure.in.orig Thu Apr 13 21:29:05 2000
+++ source/configure.in Fri Apr 14 01:29:13 2000
@@ -202,8 +202,8 @@
esac
AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
AC_CHECK_HEADERS(sys/security.h security/pam_appl.h)
-AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h)
-AC_CHECK_HEADERS(readline/history.h sys/capability.h syscall.h sys/syscall.h)
+AC_CHECK_HEADERS(stropts.h poll.h)
+AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h glob.h)
# For experimental utmp support
@@ -310,11 +310,67 @@
###############################################
# test for where we get readline() from
-if test "$ac_cv_header_readline_h" = "yes" ||
- test "$ac_cv_header_readline_readline_h" = "yes"; then
- AC_CHECK_LIB(readline,readline)
-fi
+# Readline included by default unless explicitly asked not to
+test "${with_readline+set}" != "set" && with_readline=yes
+
+AC_MSG_CHECKING(whether to use readline)
+AC_ARG_WITH(readline,
+[ --with-readline[=DIR] Look for readline include/libs in DIR
+ --without-readline Don't include readline support],
+[ case "$with_readline" in
+ yes)
+ AC_MSG_RESULT(yes)
+
+ AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
+ AC_CHECK_HEADERS(readline/history.h)
+
+ AC_CHECK_HEADERS(readline.h readline/readline.h,[
+ for termlib in ncurses curses termcap terminfo termlib; do
+ AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
+ done
+ AC_CHECK_LIB(readline, readline,
+ [TERMLIBS="-lreadline $TERMLIBS"
+ AC_DEFINE(HAVE_LIBREADLINE)
+ break], [TERMLIBS=], $TERMLIBS)])
+ ;;
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *)
+ AC_MSG_RESULT(yes)
+
+ # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
+ # alternate readline path
+ _ldflags=${LDFLAGS}
+ _cppflags=${CPPFLAGS}
+
+ # Add additional search path
+ LDFLAGS="-L$with_readline/lib $LDFLAGS"
+ CPPFLAGS="-I$with_readline/include $CPPFLAGS"
+
+ AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
+ AC_CHECK_HEADERS(readline/history.h)
+
+ AC_CHECK_HEADERS(readline.h readline/readline.h,[
+ for termlib in ncurses curses termcap terminfo termlib; do
+ AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
+ done
+ AC_CHECK_LIB(readline, readline,
+ [TERMLDFLAGS="-L$with_readline/lib"
+ TERMCPPFLAGS="-I$with_readline/include"
+ CPPFLAGS="-I$with_readline/include $CPPFLAGS"
+ TERMLIBS="-lreadline $TERMLIBS"
+ AC_DEFINE(HAVE_LIBREADLINE)
+ break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
+
+ LDFLAGS=$_ldflags
+ ;;
+ esac],
+ AC_MSG_RESULT(no)
+)
+AC_SUBST(TERMLIBS)
+AC_SUBST(TERMLDFLAGS)
# The following test taken from the cvs sources
# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
@@ -1570,6 +1626,7 @@
################################################
# include Using Samba O'Reilly book
+AC_MSG_CHECKING(whether to install Using Samba book)
AC_ARG_WITH(sambabook,
[ --with-sambabook=DIR Where to put Using Samba book ($ac_default_prefix/swat/using_samba) (default)
--without-sambabook Don't install Using Samba book],
@@ -1783,7 +1840,7 @@
# If we don't have all of these then disable large
# file support.
#
-echo "checking if large file support can be enabled"
+AC_MSG_CHECKING(if large file support can be enabled)
AC_TRY_COMPILE([
#if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
#include <sys/types.h>
@@ -1794,10 +1851,10 @@
[int i],
samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
- echo "yes"
+ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
else
- echo "no"
+ AC_MSG_RESULT(no)
fi
echo "checking configure summary"
More information about the samba-technical
mailing list