CVS update: samba/source/client

Jeremy Allison jallison at cthulhu.engr.sgi.com
Fri Sep 18 17:45:54 GMT 1998


Hi all,

I'm afraid someone broke the build. We've already
had one complaint on samba-dom about it.

Here's a (gentle :-) pointer to using autoconf :-).

You can't just put things like (from include/includes.h)

---------cut here----------
/* This is the naughty bit.  Autoconf should declare these symbols if
   it finds that GNU Readline is installed.  */

#define HAVE_LIBREADLINE
#define HAVE_READLINE_READLINE_H
#define HAVE_READLINE_HISTORY_H
---------end cut--------------

Into the code without writing the autoconf tests,
especially when you turn the code *on* by default :-).

The build now only works on Linux and other GNU
systems with readline natively installed.

To fix this (as most of the correct tests are
in the code) I added the following to configure.in
to test for the existance of the readline header
files:

AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
AC_CHECK_HEADERS(readline/history.h)

Then to back this up added into include/config.h.in the
lines :

/* Define if you have the <history.h> header file.  */
#undef HAVE_HISTORY_H
/* Define if you have the <readline.h> header file.  */
#undef HAVE_READLINE_H
/* Define if you have the <readline/history.h> header file.  */
#undef HAVE_READLINE_HISTORY_H
/* Define if you have the <readline/readline.h> header file.  */
#undef HAVE_READLINE_READLINE_H

This now means the correct defines are detected at configure
time.

Finally, to check for the existance of the readline 
library, knowing that the function call readline()
exists within it, I added to configure.in :

###############################################
# 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)
  AC_DEFINE(HAVE_LIBREADLINE)
fi

Hope this helps other autoconf users in Samba.

Cheers,

	Jeremy.




-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------


More information about the samba-ntdom mailing list