2 dnl (c) Index Data 1994-1999
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.10 1999-06-08 13:11:55 adam Exp $
5 AC_INIT(include/yaz-version.h)
7 dnl ------ Checking programs
13 dnl ----- YC: The Yaz Compiler
15 AC_ARG_WITH(yc,[ --with-yc compile using YC: The Yaz Compiler], [YCDIR=$withval],[YCDIR=""])
16 if test "$YCDIR" = "yes"; then
18 cp -f include/z-proto.h include/proto.h
21 cp -f include/prt-proto.h include/proto.h
26 AC_CHECK_FUNC(connect)
27 if test "$ac_cv_func_connect" = "no"; then
28 AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
30 if test "$checkBoth" = "1"; then
32 LIBS="$LIBS -lsocket -lnsl"
33 AC_CHECK_FUNC(accept, , [LIBS=$oldLibs])
35 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
37 dnl ------ GNU Readline
38 AC_CHECK_LIB(readline, readline, [LIBS="$LIBS -lreadline"])
39 AC_CHECK_LIB(history, add_history, [LIBS="$LIBS -lhistory"])
40 if test "$ac_cv_lib_readline_readline" = "yes"; then
41 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
45 AC_MSG_CHECKING(for working tcpd.h)
48 AC_TRY_LINK([#include <syslog.h>
50 int allow_severity = LOG_INFO;
51 int deny_severity = LOG_WARNING;],
52 [struct request_info request_info; int i;
53 i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0)
54 if test "$tcpd_ok" = "0"; then
59 AC_DEFINE(HAVE_TCPD_H)
64 if test "$ac_cv_header_stdc" = "no"; then
65 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
69 AC_ARG_ENABLE(threads, [ --enable-threads enable threads if available],
70 [threads_ok=$enableval], [threads_ok=no])
71 if test "$threads_ok" = "yes"; then
72 AC_CHECK_HEADERS(pthread.h threads.h)
73 AC_CHECK_FUNC(pthread_mutex_lock)
74 if test "$ac_cv_func_pthread_mutex_lock" = "no"; then
75 AC_CHECK_LIB(pthread, main)
81 AC_OUTPUT(Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile zutil/Makefile comstack/Makefile client/Makefile server/Makefile ztest/Makefile retrieval/Makefile ccl/Makefile lib/Makefile rfc1006/Makefile)