Common lib
[yazpp-moved-to-github.git] / configure.in
1 AC_INIT(configure.in)
2 AM_INIT_AUTOMAKE("yaz++", 0.3)
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)
12
13 dnl
14 dnl ----- DOCBOOK DTD
15 AC_SUBST(DTD_DIR)
16 AC_ARG_WITH(dtd, [  --with-dtd[=DIR]        Use docbookx.dtd in DIR],
17 [
18    if test -f "$withval/docbookx.dtd"; then
19       DTD_DIR=$withval
20    fi
21 ],[
22    AC_MSG_CHECKING(for docbookx.dtd)
23    for d in /usr/share/sgml/docbook/dtd/xml/4.1.2 \
24          /usr/share/sgml/docbook/xml-dtd-4.1.2* \
25          /usr/share/sgml/docbook/xml-dtd-4.1 \
26          /usr/share/sgml/docbook/dtd/xml/4.0 \
27             /usr/lib/sgml/dtd/docbook-xml 
28    do
29      if test -f $d/docbookx.dtd; then
30        AC_MSG_RESULT($d)
31        DTD_DIR=$d
32        break
33      fi
34    done
35    if test -z "$DTD_DIR"; then
36       AC_MSG_RESULT(Not found)
37    fi
38 ])
39 AC_SUBST(DSSSL_DIR)
40 AC_ARG_WITH(dsssl,[  --with-dsssl[=DIR]      Use DSSSL in DIR/{html,print}/docbook.dsl],
41 [
42    if test -f "$withval/html/docbook.dsl"; then
43       DSSSL_DIR=$withval
44    fi
45 ],[
46    AC_MSG_CHECKING(for docbook.dsl)
47    for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \
48             /usr/share/sgml/docbook/dsssl-stylesheets-1.* \
49             /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh 
50    do
51      if test -f $d/html/docbook.dsl; then
52        AC_MSG_RESULT($d)
53        DSSSL_DIR=$d
54        break
55      fi
56    done
57    if test -z "$DSSSL_DIR"; then
58       AC_MSG_RESULT(Not found)
59    fi
60 ])
61 dnl 
62
63
64 AC_SUBST(YAZPP_SRC_ROOT)
65 AC_SUBST(YAZPP_BUILD_ROOT)
66 YAZPP_SRC_ROOT=`cd ${srcdir}; pwd`
67 YAZPP_BUILD_ROOT=`pwd`
68
69 if test -f ${srcdir}/src/yaz++-config.in; then
70         rm ${srcdir}/src/yaz++-config.in
71 fi
72 sed s%yaz_echo_source=yes%yaz_echo_source=no%g < ${srcdir}/yaz++-config.in >${srcdir}/src/yaz++-config.in
73 AC_OUTPUT([
74         Makefile
75         src/Makefile
76         include/Makefile
77         include/yaz++/Makefile
78         yaz++-config
79         src/yaz++-config
80         zoom/Makefile
81         lib/Makefile
82         doc/Makefile
83         doc/yaz++.xml
84         doc/yazprint.dsl doc/yazphp.dsl doc/yazhtml.dsl
85 ],[chmod +x yaz++-config src/yaz++-config])