2 dnl (c) Index Data 1994-2000
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.24 2000-03-14 09:06:11 adam Exp $
5 AC_INIT(include/yaz/yaz-version.h)
6 AM_INIT_AUTOMAKE(yaz, 1.6)
8 dnl ------ Checking programs
14 dnl ----- yaz-comp: The Yaz Compiler
18 AC_ARG_ENABLE(comp,[ --disable-comp use old encoders, i.e. disable the YAZ ASN.1 Compiler], , enable_comp=yes)
19 if test "$enable_comp" = "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)
56 AC_CHECK_FUNCS(vsnprintf)
59 AC_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available])
60 if test "$enable_tcpd" = "yes"; then
61 AC_MSG_CHECKING(for working tcpd.h)
63 LIBS="$LIBS -lwrap -lnsl"
64 AC_TRY_LINK([#include <syslog.h>
66 int allow_severity = LOG_INFO;
67 int deny_severity = LOG_WARNING;],
68 [struct request_info request_info; int i;
69 i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0)
70 if test "$tcpd_ok" = "0"; then
75 AC_DEFINE(HAVE_TCPD_H)
81 if test "$ac_cv_header_stdc" = "no"; then
82 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
86 AC_ARG_ENABLE(threads, [ --disable-threads disable threads],[enable_threads=$enableval],[enable_threads=yes])
87 if test "$enable_threads" = "yes"; then
88 AC_CHECK_LIB(pthread,main)
89 AC_MSG_CHECKING(for working POSIX Threads)
90 AC_TRY_LINK([#include <pthread.h>
91 int func(void *p) { return 0; }
94 int r = pthread_create (&pthread_id, 0, func, 0);],
95 thread_ok=yes,thread_ok=no)
96 if test "$thread_ok" = "yes"; then
98 AC_DEFINE(HAVE_PTHREAD_H)
105 SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest"
106 AC_SUBST(SUBDIRS_VAR)
110 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)