dc68833917107ac1ba4a923ef31c9b6715282499
[yazpp-moved-to-github.git] / configure.in
1 AC_INIT(configure.in)
2 AM_INIT_AUTOMAKE("yaz++",0.7.13)
3
4 AC_PROG_CC
5 AC_PROG_CPP
6 AC_PROG_CXX
7 AC_HEADER_STDC
8 AM_DISABLE_SHARED
9 AM_PROG_LIBTOOL
10
11 YAZ_INIT(threads,2.0.12)
12
13 AC_CHECK_FUNCS(setrlimit getrlimit gettimeofday)
14 dnl
15 dnl ----- libXSLT
16 AC_SUBST(XSLT_LIBS)
17 AC_SUBST(XSLT_CFLAGS)
18 xsltdir=yes
19 AC_ARG_WITH(xslt, [  --with-xslt[=PREFIX]      use libxslt in PREFIX],[xsltdir=$withval])
20 if test "$xsltdir" = "yes"; then
21         for d in /usr /usr/local; do
22                 if test -x $d/bin/xslt-config; then
23                         xsltdir=$d
24                 fi
25         done
26 fi
27 if test "$xsltdir" != "no"; then
28         AC_MSG_CHECKING(for libXSLT)
29         if test -x $xsltdir/bin/xslt-config; then
30                 XSLT_LIBS=`$xsltdir/bin/xslt-config --libs`
31                 XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags`
32                 XSLT_VER=`$xsltdir/bin/xslt-config --version`
33                 AC_MSG_RESULT($XSLT_VER)
34                 AC_DEFINE(HAVE_XSLT)
35         else
36                 AC_MSG_RESULT(Not found)
37         fi
38 fi
39
40 dnl
41 dnl ----- DOCBOOK DTD
42 AC_SUBST(DTD_DIR)
43 AC_ARG_WITH(dtd, [  --with-dtd[=DIR]          use docbookx.dtd in DIR],
44 [
45    if test -f "$withval/docbookx.dtd"; then
46       DTD_DIR=$withval
47    fi
48 ],[
49    AC_MSG_CHECKING(for docbookx.dtd)
50    for d in /usr/share/sgml/docbook/dtd/xml/4.1.2 \
51          /usr/share/sgml/docbook/xml-dtd-4.1.2* \
52          /usr/share/sgml/docbook/xml-dtd-4.1 \
53          /usr/share/sgml/docbook/dtd/xml/4.0 \
54             /usr/lib/sgml/dtd/docbook-xml 
55    do
56      if test -f $d/docbookx.dtd; then
57        AC_MSG_RESULT($d)
58        DTD_DIR=$d
59        break
60      fi
61    done
62    if test -z "$DTD_DIR"; then
63       AC_MSG_RESULT(Not found)
64    fi
65 ])
66 AC_SUBST(DSSSL_DIR)
67 AC_ARG_WITH(dsssl,[  --with-dsssl[=DIR]        use DSSSL in DIR/{html,print}/docbook.dsl],
68 [
69    if test -f "$withval/html/docbook.dsl"; then
70       DSSSL_DIR=$withval
71    fi
72 ],[
73    AC_MSG_CHECKING(for docbook.dsl)
74    for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
75             /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
76             /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh 
77    do
78      if test -f $d/html/docbook.dsl; then
79        AC_MSG_RESULT($d)
80        DSSSL_DIR=$d
81        break
82      fi
83    done
84    if test -z "$DSSSL_DIR"; then
85       AC_MSG_RESULT(Not found)
86    fi
87 ])
88 dnl 
89
90 AC_ARG_ENABLE(zoom,[  --disable-zoom          disable ZOOM (for old C++ compilers)],[enable_zoom=$enableval],[enable_zoom=yes])
91 AM_CONDITIONAL(ZOOM, test $enable_zoom = "yes")
92
93 AC_SUBST(YAZPP_SRC_ROOT)
94 AC_SUBST(YAZPP_BUILD_ROOT)
95 YAZPP_SRC_ROOT=`cd ${srcdir}; pwd`
96 YAZPP_BUILD_ROOT=`pwd`
97
98 AC_OUTPUT([
99         Makefile
100         src/Makefile
101         include/Makefile
102         include/yaz++/Makefile
103         include/yaz++/proxy/Makefile
104         proxy/Makefile
105         zlint/Makefile
106         yaz++-config
107         zoom/Makefile
108         doc/Makefile
109         doc/yaz++.xml
110         doc/yazprint.dsl doc/yazphp.dsl doc/yazhtml.dsl
111         doc/tkl.xsl
112         etc/Makefile
113 ],[sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz++-config >src/yaz++-config && chmod +x yaz++-config src/yaz++-config])