2 dnl (c) Index Data 1994-1999
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.11 1999-06-09 14:23:58 adam Exp $
5 AC_INIT(include/yaz-version.h)
7 dnl ------ Checking programs
13 dnl ----- YC: The Yaz Compiler
15 AC_ARG_ENABLE(yc,[ --enable-yc compile using YAZ' ASN.1 Compiler (YC)])
16 if test "$enable_yc" = "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_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available])
46 if test "$enable_tcpd" = "yes"; then
47 AC_MSG_CHECKING(for working tcpd.h)
50 AC_TRY_LINK([#include <syslog.h>
52 int allow_severity = LOG_INFO;
53 int deny_severity = LOG_WARNING;],
54 [struct request_info request_info; int i;
55 i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0)
56 if test "$tcpd_ok" = "0"; then
61 AC_DEFINE(HAVE_TCPD_H)
67 if test "$ac_cv_header_stdc" = "no"; then
68 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
72 AC_ARG_ENABLE(threads, [ --enable-threads enable threads if available])
73 if test "$enable_threads" = "yes"; then
74 AC_CHECK_HEADERS(pthread.h threads.h)
75 AC_CHECK_FUNC(pthread_mutex_lock)
76 if test "$ac_cv_func_pthread_mutex_lock" = "no"; then
77 AC_CHECK_LIB(pthread, main)
83 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)