2 dnl (c) Index Data 1994-2000
3 dnl See the file LICENSE for details.
4 dnl $Id: configure.in,v 1.27 2000-05-02 19:32:15 adam Exp $
5 AC_INIT(include/yaz/yaz-version.h)
6 AM_INIT_AUTOMAKE(yaz, 1.7)
8 AC_SUBST(READLINE_LIBS)
9 dnl ------ Checking programs
16 dnl ----- yaz-comp: The Yaz Compiler
20 AC_ARG_ENABLE(comp,[ --disable-comp use old encoders, i.e. disable the YAZ ASN.1 Compiler], , enable_comp=yes)
21 if test "$enable_comp" = "yes"; then
24 ILLLIB=../ill/libill.la
25 ASN_MAKEFILES="z39.50/Makefile ill/Makefile"
31 ASN_MAKEFILES="asn/Makefile"
34 AC_MSG_CHECKING(whether proto.h needs to be generated)
35 yaz_include=${srcdir}/include/yaz
36 if test -r ${yaz_include}/proto.h && cmp -s ${yaz_include}/$HFILE ${yaz_include}/proto.h; then
40 cp -f ${yaz_include}/$HFILE ${yaz_include}/proto.h
45 AC_CHECK_FUNC(connect)
46 if test "$ac_cv_func_connect" = "no"; then
47 AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1)
49 if test "$checkBoth" = "1"; then
51 LIBS="$LIBS -lsocket -lnsl"
52 AC_CHECK_FUNC(accept, , [LIBS=$oldLibs])
54 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
56 dnl ------ GNU Readline
58 AC_CHECK_LIB(readline, readline, [READLINE_LIBS="$READLINE_LIBS -lreadline"])
59 if test "$ac_cv_lib_readline_readline" = "no"; then
60 AC_CHECK_LIB(readline, readline, [READLINE_LIBS="$READLINE_LIBS -lreadline -ltermcap"])
62 AC_CHECK_LIB(history, add_history, [READLINE_LIBS="$READLINE_LIBS -lhistory"])
63 if test "$ac_cv_lib_readline_readline" = "yes"; then
64 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
67 AC_CHECK_FUNCS(vsnprintf)
70 AC_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available])
71 if test "$enable_tcpd" = "yes"; then
72 AC_MSG_CHECKING(for working tcpd.h)
74 LIBS="$LIBS -lwrap -lnsl"
75 AC_TRY_LINK([#include <syslog.h>
77 int allow_severity = LOG_INFO;
78 int deny_severity = LOG_WARNING;],
79 [struct request_info request_info; int i;
80 i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0)
81 if test "$tcpd_ok" = "0"; then
86 AC_DEFINE(HAVE_TCPD_H)
92 if test "$ac_cv_header_stdc" = "no"; then
93 AC_MSG_WARN(Your system doesn't seem to support ANSI C)
97 AC_ARG_ENABLE(threads, [ --disable-threads disable threads],[enable_threads=$enableval],[enable_threads=yes])
98 if test "$enable_threads" = "yes"; then
99 AC_CHECK_LIB(pthread,main)
100 AC_MSG_CHECKING(for working POSIX Threads)
101 AC_TRY_LINK([#include <pthread.h>
102 int func(void *p) { return 0; }
104 pthread_t pthread_id;
105 int r = pthread_create (&pthread_id, 0, func, 0);],
106 thread_ok=yes,thread_ok=no)
107 if test "$thread_ok" = "yes"; then
109 AC_DEFINE(HAVE_PTHREAD_H)
110 AC_DEFINE(_REENTRANT)
116 SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest"
117 AC_SUBST(SUBDIRS_VAR)
121 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)