888b3126b47126198e893561357f08efad9261b7
[yazpp-moved-to-github.git] / configure.in
1 AC_INIT(configure.in)
2 AM_INIT_AUTOMAKE("yaz++",0.7.8)
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.10)
12
13 AC_CHECK_FUNCS(setrlimit getrlimit)
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                 LIBS="$XSLT_LIBS $LIBS"
32                 XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags`
33                 XSLT_VER=`$xsltdir/bin/xslt-config --version`
34                 AC_MSG_RESULT($XSLT_VER)
35                 AC_DEFINE(HAVE_XSLT)
36         else
37                 AC_MSG_RESULT(Not found)
38         fi
39 fi
40
41 dnl
42 dnl ----- DOCBOOK DTD
43 AC_SUBST(DTD_DIR)
44 AC_ARG_WITH(dtd, [  --with-dtd[=DIR]          use docbookx.dtd in DIR],
45 [
46    if test -f "$withval/docbookx.dtd"; then
47       DTD_DIR=$withval
48    fi
49 ],[
50    AC_MSG_CHECKING(for docbookx.dtd)
51    for d in /usr/share/sgml/docbook/dtd/xml/4.1.2 \
52          /usr/share/sgml/docbook/xml-dtd-4.1.2* \
53          /usr/share/sgml/docbook/xml-dtd-4.1 \
54          /usr/share/sgml/docbook/dtd/xml/4.0 \
55             /usr/lib/sgml/dtd/docbook-xml 
56    do
57      if test -f $d/docbookx.dtd; then
58        AC_MSG_RESULT($d)
59        DTD_DIR=$d
60        break
61      fi
62    done
63    if test -z "$DTD_DIR"; then
64       AC_MSG_RESULT(Not found)
65    fi
66 ])
67 AC_SUBST(DSSSL_DIR)
68 AC_ARG_WITH(dsssl,[  --with-dsssl[=DIR]        use DSSSL in DIR/{html,print}/docbook.dsl],
69 [
70    if test -f "$withval/html/docbook.dsl"; then
71       DSSSL_DIR=$withval
72    fi
73 ],[
74    AC_MSG_CHECKING(for docbook.dsl)
75    for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
76             /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
77             /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh 
78    do
79      if test -f $d/html/docbook.dsl; then
80        AC_MSG_RESULT($d)
81        DSSSL_DIR=$d
82        break
83      fi
84    done
85    if test -z "$DSSSL_DIR"; then
86       AC_MSG_RESULT(Not found)
87    fi
88 ])
89 dnl 
90
91 AC_ARG_ENABLE(zoom,[  --disable-zoom          disable ZOOM (for old C++ compilers)],[enable_zoom=$enableval],[enable_zoom=yes])
92 AM_CONDITIONAL(ZOOM, test $enable_zoom = "yes")
93
94 AC_SUBST(YAZPP_SRC_ROOT)
95 AC_SUBST(YAZPP_BUILD_ROOT)
96 YAZPP_SRC_ROOT=`cd ${srcdir}; pwd`
97 YAZPP_BUILD_ROOT=`pwd`
98
99 AC_OUTPUT([
100         Makefile
101         src/Makefile
102         include/Makefile
103         include/yaz++/Makefile
104         yaz++-config
105         zoom/Makefile
106         doc/Makefile
107         doc/yaz++.xml
108         doc/yazprint.dsl doc/yazphp.dsl doc/yazhtml.dsl
109         doc/tkl.xsl
110         etc/Makefile
111 ],[sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz++-config >src/yaz++-config && chmod +x yaz++-config src/yaz++-config])