2 dnl (c) Index Data 1994-2000
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.16 2000-02-28 11:20:05 adam Exp $
5 AC_INIT(include/yaz/yaz-version.h)
6 AM_INIT_AUTOMAKE(yaz, 1.6)
7 AM_CONFIG_HEADER(include/yaz/config.h)
9 dnl ------ Checking programs
15 dnl ----- YC: The Yaz Compiler
19 AC_ARG_ENABLE(yc,[ --enable-yc compile using YAZ' ASN.1 Compiler], , enable_yc=yes)
20 if test "$enable_yc" = "yes"; then
23 ILLLIB=../ill/libill.a
24 ASN_MAKEFILES="z39.50/Makefile ill/Makefile"
25 cp -f include/yaz/z-proto.h include/yaz/proto.h
30 ASN_MAKEFILES="asn/Makefile"
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 if test "$ac_cv_lib_readline_readline" = "no"; then
50 AC_CHECK_LIB(readline, readline, [LIBS="$LIBS -lreadline -ltermcap"])
52 AC_CHECK_LIB(history, add_history, [LIBS="$LIBS -lhistory"])
53 if test "$ac_cv_lib_readline_readline" = "yes"; then
54 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
58 AC_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available])
59 if test "$enable_tcpd" = "yes"; then
60 AC_MSG_CHECKING(for working tcpd.h)
62 LIBS="$LIBS -lwrap -lnsl"
63 AC_TRY_LINK([#include <syslog.h>
65 int allow_severity = LOG_INFO;
66 int deny_severity = LOG_WARNING;],
67 [struct request_info request_info; int i;
68 i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0)
69 if test "$tcpd_ok" = "0"; then
74 AC_DEFINE(HAVE_TCPD_H)
80 if test "$ac_cv_header_stdc" = "no"; then
81 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
85 AC_ARG_ENABLE(threads, [ --enable-threads enable threads if available])
86 if test "$enable_threads" = "yes"; then
87 AC_CHECK_HEADERS(pthread.h threads.h)
88 AC_CHECK_FUNC(pthread_mutex_lock)
89 if test "$ac_cv_func_pthread_mutex_lock" = "no"; then
90 AC_CHECK_LIB(pthread, main)
95 SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest"
100 AC_OUTPUT(Makefile util/Makefile odr/Makefile z39.50/Makefile asn/Makefile ill/Makefile zutil/Makefile comstack/Makefile ccl/Makefile tab/Makefile retrieval/Makefile server/Makefile include/Makefile include/yaz/Makefile lib/Makefile client/Makefile ztest/Makefile doc/Makefile)