2 dnl (c) Index Data 1994-2000
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.21 2000-03-01 11:15:31 adam Exp $
5 AC_INIT(include/yaz/yaz-version.h)
6 AM_INIT_AUTOMAKE(yaz, 1.6)
8 dnl ------ Checking programs
13 AC_CHECK_PROGS(have_sgml2txt,sgml2txt,no)
14 AC_CHECK_PROGS(have_sgml2latex,sgml2latex,no)
15 AC_CHECK_PROGS(have_sgml2html,sgml2html,no)
16 if test "$have_sgml2txt" = "no" -o "$have_sgml2latex" = "no" -o "$have_sgml2html" = "no"; then
22 dnl ----- YC: The Yaz Compiler
26 AC_ARG_ENABLE(yc,[ --disable-yc use old encoders, i.e. disable YAZ ASN.1 Compiler], , enable_yc=yes)
27 if test "$enable_yc" = "yes"; then
30 ILLLIB=../ill/libill.a
31 ASN_MAKEFILES="z39.50/Makefile ill/Makefile"
32 cp -f include/yaz/z-proto.h include/yaz/proto.h
37 ASN_MAKEFILES="asn/Makefile"
38 cp -f include/yaz/prt-proto.h include/yaz/proto.h
43 AC_CHECK_FUNC(connect)
44 if test "$ac_cv_func_connect" = "no"; then
45 AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
47 if test "$checkBoth" = "1"; then
49 LIBS="$LIBS -lsocket -lnsl"
50 AC_CHECK_FUNC(accept, , [LIBS=$oldLibs])
52 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
54 dnl ------ GNU Readline
55 AC_CHECK_LIB(readline, readline, [LIBS="$LIBS -lreadline"])
56 if test "$ac_cv_lib_readline_readline" = "no"; then
57 AC_CHECK_LIB(readline, readline, [LIBS="$LIBS -lreadline -ltermcap"])
59 AC_CHECK_LIB(history, add_history, [LIBS="$LIBS -lhistory"])
60 if test "$ac_cv_lib_readline_readline" = "yes"; then
61 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
65 AC_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available])
66 if test "$enable_tcpd" = "yes"; then
67 AC_MSG_CHECKING(for working tcpd.h)
69 LIBS="$LIBS -lwrap -lnsl"
70 AC_TRY_LINK([#include <syslog.h>
72 int allow_severity = LOG_INFO;
73 int deny_severity = LOG_WARNING;],
74 [struct request_info request_info; int i;
75 i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0)
76 if test "$tcpd_ok" = "0"; then
81 AC_DEFINE(HAVE_TCPD_H)
87 if test "$ac_cv_header_stdc" = "no"; then
88 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
92 AC_ARG_ENABLE(threads, [ --enable-threads enable threads if available])
93 if test "$enable_threads" = "yes"; then
94 AC_CHECK_HEADERS(pthread.h threads.h)
95 AC_CHECK_FUNC(pthread_mutex_lock)
96 if test "$ac_cv_func_pthread_mutex_lock" = "no"; then
97 AC_CHECK_LIB(pthread, main)
102 SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest $DOCMODULE"
103 AC_SUBST(SUBDIRS_VAR)
107 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)