2 dnl (c) Index Data 1994-2000
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.18 2000-02-29 15:52:33 adam Exp $
5 AC_INIT(include/yaz/yaz-version.h)
6 AM_INIT_AUTOMAKE(yaz, 1.6)
8 dnl ------ Checking programs
14 dnl ----- YC: The Yaz Compiler
18 AC_ARG_ENABLE(yc,[ --enable-yc compile using YAZ' ASN.1 Compiler], , enable_yc=yes)
19 if test "$enable_yc" = "yes"; then
22 ILLLIB=../ill/libill.a
23 ASN_MAKEFILES="z39.50/Makefile ill/Makefile"
24 cp -f include/yaz/z-proto.h include/yaz/proto.h
29 ASN_MAKEFILES="asn/Makefile"
30 cp -f include/yaz/prt-proto.h include/yaz/proto.h
35 AC_CHECK_FUNC(connect)
36 if test "$ac_cv_func_connect" = "no"; then
37 AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
39 if test "$checkBoth" = "1"; then
41 LIBS="$LIBS -lsocket -lnsl"
42 AC_CHECK_FUNC(accept, , [LIBS=$oldLibs])
44 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
46 dnl ------ GNU Readline
47 AC_CHECK_LIB(readline, readline, [LIBS="$LIBS -lreadline"])
48 if test "$ac_cv_lib_readline_readline" = "no"; then
49 AC_CHECK_LIB(readline, readline, [LIBS="$LIBS -lreadline -ltermcap"])
51 AC_CHECK_LIB(history, add_history, [LIBS="$LIBS -lhistory"])
52 if test "$ac_cv_lib_readline_readline" = "yes"; then
53 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
57 AC_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available])
58 if test "$enable_tcpd" = "yes"; then
59 AC_MSG_CHECKING(for working tcpd.h)
61 LIBS="$LIBS -lwrap -lnsl"
62 AC_TRY_LINK([#include <syslog.h>
64 int allow_severity = LOG_INFO;
65 int deny_severity = LOG_WARNING;],
66 [struct request_info request_info; int i;
67 i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0)
68 if test "$tcpd_ok" = "0"; then
73 AC_DEFINE(HAVE_TCPD_H)
79 if test "$ac_cv_header_stdc" = "no"; then
80 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
84 AC_ARG_ENABLE(threads, [ --enable-threads enable threads if available])
85 if test "$enable_threads" = "yes"; then
86 AC_CHECK_HEADERS(pthread.h threads.h)
87 AC_CHECK_FUNC(pthread_mutex_lock)
88 if test "$ac_cv_func_pthread_mutex_lock" = "no"; then
89 AC_CHECK_LIB(pthread, main)
94 SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest"
99 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)