Describe recent ZOOM changes.
[yaz-moved-to-github.git] / configure.in
index db3dbea..c596f72 100644 (file)
@@ -1,8 +1,8 @@
-dnl YAZ Toolkit, Index Data 1994-2004
+dnl YAZ Toolkit, Index Data 1994-2005
 dnl See the file LICENSE for details.
-dnl $Id: configure.in,v 1.145 2004-05-19 05:28:06 oleg Exp $
+dnl $Id: configure.in,v 1.186 2005-09-16 21:44:23 adam Exp $
 AC_INIT(include/yaz/yaz-version.h)
-AM_INIT_AUTOMAKE(yaz, 2.0.21)
+AM_INIT_AUTOMAKE(yaz, 2.1.9)
 AM_MAINTAINER_MODE
 dnl
 AC_SUBST(READLINE_LIBS)
@@ -15,10 +15,20 @@ test -z "$YACC" && AC_MSG_WARN([GNU bison not found])
 AC_PROG_INSTALL
 AM_DISABLE_SHARED
 AM_PROG_LIBTOOL
-AC_PATH_PROG(pkgconfig, pkg-config, NONE)
+AC_PATH_PROG(pkgconfigpath, pkg-config, NONE)
 dnl
 YAZ_DOC
 dnl 
+dnl
+dnl ------ Headers
+AC_CHECK_HEADERS(dirent.h fnmatch.h wchar.h locale.h langinfo.h pwd.h sys/poll.h sys/select.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/un.h sys/wait.h unistd.h)
+AC_HEADER_STDC
+if test "$ac_cv_header_stdc" = "no"; then
+       AC_MSG_WARN(Your system doesn't seem to support ANSI C)
+fi
+dnl ----- Types
+AC_CHECK_TYPES([long long])
+dnl
 dnl ----- Sockets
 checkBoth=0
 AC_CHECK_FUNC(connect)
@@ -30,18 +40,18 @@ if test "$checkBoth" = "1"; then
        LIBS="$LIBS -lsocket -lnsl"
        AC_CHECK_FUNC(accept, , [LIBS=$oldLibs])
 fi
-AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
+AC_CHECK_FUNC(gethostbyname, ,[AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])])
 dnl
 dnl ------ OpenSSL
+AC_SUBST(SSL_CFLAGS)
 openssl=no
-AC_ARG_WITH(openssl, [  --with-openssl[=PREFIX] OpenSSL library in PREFIX], [openssl=$withval])
-USE_SSL=0
+AC_ARG_WITH(openssl, [  --with-openssl[=PREFIX]   OpenSSL library in PREFIX], [openssl=$withval])
 SSL_CFLAGS=""
 SSL_LIBPATH=""
 if test "$openssl" != "no"; then
        sslver=no
        if test "$openssl" != "yes"; then
-               if test "$pkgconfig" != "NONE"; then
+               if test -x $openssl/bin/pkg-config; then
                        if $openssl/bin/pkg-config --exists openssl; then
                                SSL_CFLAGS=`$openssl/bin/pkg-config --cflags openssl`
                                LIBS="$LIBS `$openssl/bin/pkg-config --libs openssl`"
@@ -53,11 +63,11 @@ if test "$openssl" != "no"; then
                        SSL_LIBPATH="-L$openssl/lib"
                fi
        else
-               if test "$pkgconfig" != "NONE"; then
-                       if $pkgconfig --exists openssl; then
-                               SSL_CFLAGS=`$pkgconfig --cflags openssl`
-                               LIBS="$LIBS `$pkgconfig --libs openssl`"
-                               sslver=`$pkgconfig --modversion openssl`
+               if test "$pkgconfigpath" != "NONE"; then
+                       if $pkgconfigpath --exists openssl; then
+                               SSL_CFLAGS=`$pkgconfigpath --cflags openssl`
+                               LIBS="$LIBS `$pkgconfigpath --libs openssl`"
+                               sslver=`$pkgconfigpath --modversion openssl`
                        fi
                fi
                if test "$sslver" = "no"; then
@@ -79,12 +89,15 @@ if test "$openssl" != "no"; then
                fi
                CPPFLAGS="$xCPPFLAGS"
        fi
+       AC_MSG_CHECKING([for SSL])
        if test "$sslver" != "no"; then
-               CFLAGS="$CFLAGS -DHAVE_OPENSSL_SSL_H=1 $SSL_CFLAGS"
-               USE_SSL=1
+               SSL_CFLAGS="-DHAVE_OPENSSL_SSL_H=1 $SSL_CFLAGS"
+               AC_MSG_RESULT([$sslver])
+       else
+               SSL_CFLAGS=""
+               AC_MSG_RESULT([None])
+               AC_MSG_ERROR([OpenSSL development libraries missing])
        fi
-       AC_MSG_CHECKING([for SSL])
-       AC_MSG_RESULT($sslver)
 fi
 dnl
 dnl ------ GNU Readline
@@ -103,24 +116,18 @@ if test "$ac_cv_lib_readline_readline" = "yes"; then
        #include <stdio.h>
        #include <readline/readline.h>
        ],[
-        static void f()
-        {
                 rl_attempted_completion_over = 0;
-        }
         ],AC_DEFINE(HAVE_READLINE_COMPLETION_OVER))
         AC_TRY_LINK([
        #include <stdio.h>
        #include <readline/readline.h>
        ],[
-        static void f()
-        {
                 rl_completion_matches (0, 0);
-        }
-        ],AC_DEFINE(HAVE_READLINE_RL_COMPLETION_MATCHES))
+        ],[AC_DEFINE(HAVE_READLINE_RL_COMPLETION_MATCHES)])
         LIBS=$xLIBS
 fi
 dnl ------ iconv
-AC_ARG_WITH(iconv, [  --with-iconv[=PREFIX]   iconv library in PREFIX])
+AC_ARG_WITH(iconv, [  --with-iconv[=PREFIX]     iconv library in PREFIX])
 if test "$with_iconv" != "no"; then
         AC_MSG_CHECKING(for iconv)
        oldLIBS="$LIBS"
@@ -132,7 +139,7 @@ if test "$with_iconv" != "no"; then
         AC_TRY_LINK([
                #include <iconv.h>
        ],[
-               static void f() {iconv_t t = iconv_open("", ""); }
+               iconv_t t = iconv_open("", "");
        ],[
                AC_DEFINE(HAVE_ICONV_H)
                AC_MSG_RESULT(yes)
@@ -141,7 +148,7 @@ if test "$with_iconv" != "no"; then
                AC_TRY_LINK([
                        #include <iconv.h>
                ],[
-                       static void f() {iconv_t t = iconv_open("", ""); }
+                       iconv_t t = iconv_open("", "");
                ],[
                        AC_DEFINE(HAVE_ICONV_H)
                        AC_MSG_RESULT(yes)
@@ -153,7 +160,7 @@ if test "$with_iconv" != "no"; then
        ])
 fi
 dnl ------ various functions
-AC_CHECK_FUNCS(vsnprintf gettimeofday poll strerror_r dprintf)
+AC_CHECK_FUNCS(vsnprintf gettimeofday poll strerror_r localtime_r usleep fopen64)
 if test "$ac_cv_func_poll" = "yes"; then
         AC_CHECK_HEADERS(sys/poll.h)
 fi
@@ -206,10 +213,11 @@ extern int accept(int, struct sockaddr *, size_t t *);
 ])
 AC_MSG_RESULT($ac_cv_check_socklen_t)
 AC_DEFINE_UNQUOTED(YAZ_SOCKLEN_T,$ac_cv_check_socklen_t)
+AC_DEFINE(YAZ_USE_NEW_LOG)
 dnl
 dnl ------ tcpd
 AC_ARG_ENABLE(tcpd,[  --enable-tcpd[=PREFIX]  enable TCP wrapper for server if available])
-if test "$enable_tcpd" != "" && test "$enable_tcpd" != "no"; then
+if test "$enable_tcpd" -a "$enable_tcpd" != "no"; then
        oldLibs=$LIBS
        oldCPPFLAGS=$CPPFLAGS
        if test "$enable_tcpd" != "yes"; then
@@ -227,6 +235,7 @@ if test "$enable_tcpd" != "" && test "$enable_tcpd" != "no"; then
        tcpd_ok=1, tcpd_ok=0)
        if test "$tcpd_ok" = "0"; then
                AC_MSG_RESULT(no)
+               AC_MSG_ERROR([tcpd development libraries missing])
                LIBS=$oldLibs
                CPPFLAGS=$oldCPPFLAGS
        else
@@ -235,17 +244,9 @@ if test "$enable_tcpd" != "" && test "$enable_tcpd" != "no"; then
        fi
 fi
 dnl
-dnl ------ Headers
-AC_CHECK_HEADERS(fnmatch.h wchar.h locale.h langinfo.h)
-AC_STDC_HEADERS
-if test "$ac_cv_header_stdc" = "no"; then
-       AC_MSG_WARN(Your system doesn't seem to support ANSI C)
-fi
-dnl
-AC_SUBST(LIBTHREAD)
-AC_SUBST(CFLAGSTHREADS)
+AC_SUBST(THREAD_CFLAGS)
 HAVETHREADS=0
-CFLAGSTHREADS=""
+THREAD_CFLAGS=""
 LIBTHREAD=""
 dnl
 dnl ------ GNU threads
@@ -258,11 +259,11 @@ if test "$enable_pth" = "yes"; then
                AC_CHECK_HEADERS(pth.h)
                if test "$ac_cv_header_pth_h" = "yes"; then
                        LIBTHREAD="-lpth"
-                       CFLAGSTHREADS="-DYAZ_GNU_THREADS=1"
+                       THREAD_CFLAGS="-DYAZ_GNU_THREADS=1"
                        HAVETHREADS=1
                fi
        fi      
-       LIBS=$OLIBS
+       LIBS="$OLIBS $LIBTHREAD"
 fi
 dnl
 dnl ------ POSIX Threads
@@ -281,7 +282,7 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then
        if test "$thread_ok" = "yes"; then
                AC_MSG_RESULT(yes)
                LIBTHREAD="-lpthread"
-               CFLAGSTHREADS="-DYAZ_POSIX_THREADS=1 -D_REENTRANT"
+               THREAD_CFLAGS="-DYAZ_POSIX_THREADS=1 -D_REENTRANT"
                HAVETHREADS=1
        else
                CC="$CC -pthread"
@@ -293,7 +294,7 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then
                        thread_ok=yes,thread_ok=no)
                if test "$thread_ok" = "yes"; then
                        AC_MSG_RESULT([yes,BSD])
-                       CFLAGSTHREADS="-pthread -DYAZ_POSIX_THREADS=1 -D_REENTRANT"
+                       THREAD_CFLAGS="-pthread -DYAZ_POSIX_THREADS=1 -D_REENTRANT"
                        LIBTHREAD="-pthread"
                        HAVETHREADS=1
                fi
@@ -302,16 +303,15 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then
                AC_MSG_RESULT(no)
        fi
        CC=$OCC
-       LIBS=$OLIBS
+       LIBS="$OLIBS $LIBTHREAD"
 fi
-AM_CONDITIONAL(ISTHR, test $HAVETHREADS = "1")
 dnl
 dnl ----- libXML2
 AC_SUBST(XML2_LIBS)
 AC_SUBST(XML2_CFLAGS)
-xml2dir=yes
-AC_ARG_WITH(xml2, [  --with-xml2[=PREFIX]    use libxml2 in PREFIX],[xml2dir=$withval])
-if test "$xml2dir" = "yes"; then
+xml2dir=default
+AC_ARG_WITH(xml2, [  --with-xml2[=PREFIX]      use libxml2 in PREFIX],[xml2dir=$withval])
+if test "$xml2dir" = "yes" -o "$xml2dir" = "default"; then
        for d in /usr /usr/local; do
                if test -x $d/bin/xml2-config; then
                        xml2dir=$d
@@ -328,7 +328,13 @@ if test "$xml2dir" != "no"; then
                AC_MSG_RESULT($XML2_VER)
                AC_DEFINE(HAVE_XML2)
        else
-               AC_MSG_RESULT(Not found)
+               AC_MSG_RESULT([Not found])
+               if test "$xml2dir" = "default"; then
+                       AC_MSG_WARN([Libxml2 development libraries not found.])
+                       AC_MSG_WARN([YAZ will NOT support SRW/SRU.])
+               else
+                       AC_MSG_ERROR([libXML2 development libraries not found.])
+               fi
        fi
 fi
 dnl
@@ -362,10 +368,10 @@ zoom/Makefile
 doc/Makefile
 doc/yaz.xml
 doc/yazhtml.dsl
-doc/yazphp.dsl
 doc/yazprint.dsl
 doc/tkl.xsl
 doc/yazhtml.xsl
 etc/Makefile
 yaz-config
+Doxyfile
 ],[sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz-config > util/yaz-config && chmod +x yaz-config util/yaz-config])