2 dnl (c) Index Data 1994-1999
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.14 1999-12-16 23:36:19 adam Exp $
5 AC_INIT(include/yaz/yaz-version.h)
7 dnl ------ Checking programs
15 AC_ARG_WITH(build-root, [ --with-buildroot RPM Build root],[build_root=$withval],[build_root=""])
17 dnl ----- YC: The Yaz Compiler
21 AC_ARG_ENABLE(yc,[ --enable-yc compile using YAZ' ASN.1 Compiler], , enable_yc=yes)
22 if test "$enable_yc" = "yes"; then
26 cp -f include/yaz/z-proto.h include/yaz/proto.h
31 cp -f include/yaz/prt-proto.h include/yaz/proto.h
36 AC_CHECK_FUNC(connect)
37 if test "$ac_cv_func_connect" = "no"; then
38 AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
40 if test "$checkBoth" = "1"; then
42 LIBS="$LIBS -lsocket -lnsl"
43 AC_CHECK_FUNC(accept, , [LIBS=$oldLibs])
45 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
47 dnl ------ GNU Readline
48 AC_CHECK_LIB(readline, readline, [LIBS="$LIBS -lreadline"])
49 AC_CHECK_LIB(history, add_history, [LIBS="$LIBS -lhistory"])
50 if test "$ac_cv_lib_readline_readline" = "yes"; then
51 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
55 AC_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available])
56 if test "$enable_tcpd" = "yes"; then
57 AC_MSG_CHECKING(for working tcpd.h)
59 LIBS="$LIBS -lwrap -lnsl"
60 AC_TRY_LINK([#include <syslog.h>
62 int allow_severity = LOG_INFO;
63 int deny_severity = LOG_WARNING;],
64 [struct request_info request_info; int i;
65 i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0)
66 if test "$tcpd_ok" = "0"; then
71 AC_DEFINE(HAVE_TCPD_H)
77 if test "$ac_cv_header_stdc" = "no"; then
78 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
82 AC_ARG_ENABLE(threads, [ --enable-threads enable threads if available])
83 if test "$enable_threads" = "yes"; then
84 AC_CHECK_HEADERS(pthread.h threads.h)
85 AC_CHECK_FUNC(pthread_mutex_lock)
86 if test "$ac_cv_func_pthread_mutex_lock" = "no"; then
87 AC_CHECK_LIB(pthread, main)
93 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 ill/Makefile)