Named routes for filter virt_db. Example in etc/config2.xml
[metaproxy-moved-to-github.git] / configure.ac
1 ## -*- Autoconf -*-
2 ## Process this file with autoconf to produce a configure script.
3
4 # Autoconf and automake setup
5 AC_PREREQ(2.57)
6 AC_INIT(yp2, 0.0.1, adam@indexdata.dk)
7
8 AC_CONFIG_HEADERS(src/config.hpp)
9
10 AC_CONFIG_SRCDIR(configure.ac) 
11 AC_CONFIG_AUX_DIR(config)
12 AC_CANONICAL_SYSTEM
13 ##AC_PREFIX_DEFAULT(`pwd`/install) 
14
15 AM_INIT_AUTOMAKE(1.8)
16
17 # Checks for programs.
18 AC_PROG_CXX
19 AC_PROG_CXXCPP
20 AC_PROG_INSTALL
21 AC_PROG_LN_S
22 AC_PROG_MAKE_SET
23 AC_PROG_RANLIB
24 AM_PROG_LIBTOOL
25
26 # Use C++ compilers only for tests
27 AC_LANG(C++)
28
29 if test "$enable_shared" = "yes"; then
30         AC_DEFINE([HAVE_DL_SUPPORT],[1],
31                 [Define to 1 if you have shared module support])
32 fi
33
34 # Checks for libraries.
35 AC_CHECK_LIB(boost_thread, main, [],[
36         AC_MSG_NOTICE([boost thread library not found.])
37         AC_MSG_ERROR([Install libboost-thread-dev (or similar)])
38 ])
39
40 AC_CHECK_LIB(boost_date_time, main, [],[
41         AC_MSG_NOTICE([boost date_time library not found.])
42         AC_MSG_ERROR([Install libboost-date-time-dev (or similar)])
43 ])
44
45 AC_CHECK_LIB(boost_program_options, main, [],[
46         AC_MSG_NOTICE([boost program options library not found.])
47         AC_MSG_ERROR([Install libboost-program-options-dev (or similar)])
48 ])
49
50 AC_CHECK_HEADER(boost/test/auto_unit_test.hpp,,[
51         AC_MSG_NOTICE([boost test unit header not found.])
52         AC_MSG_ERROR([Install libboost-test-dev (or similar)])
53 ])
54
55 AC_MSG_CHECKING([whether boost_unit_test_framework works])
56 OLIBS=$LIBS
57 LIBS="$LIBS -lboost_unit_test_framework"
58 AC_TRY_LINK([
59 #define BOOST_AUTO_TEST_MAIN
60 #include <boost/test/auto_unit_test.hpp> 
61 BOOST_AUTO_UNIT_TEST( test )
62 {
63  BOOST_CHECK(true);
64 }
65 ],[],
66 [
67         AC_MSG_RESULT([yes])
68         LIBS=$OLIBS
69 ],
70 [
71         AC_MSG_RESULT([no])
72         AC_MSG_NOTICE([Boost unit test framework does not appear to work])
73         AC_MSG_ERROR([Consult config.log for details])
74 ])
75
76 ## YAZPP checks
77 YAZPP_INIT(threads,1.0)
78 if test -z "$YAZPPLIB"; then
79         AC_MSG_ERROR([YAZ++ development libraries missing])
80 fi
81 ##YAZ_DOC
82
83 ## libxslt checks
84 AC_SUBST(XSLT_LIBS)
85 AC_SUBST(XSLT_CFLAGS)
86 xsltdir=default
87 AC_ARG_WITH(xslt,[[  --with-xslt[=PREFIX]    use libxslt in PREFIX]],xsltdir=$withval)
88 if test "$xsltdir" = "yes" -o "$xsltdir" = "default"; then
89         for d in /usr /usr/local; do
90                 if test -x $d/bin/xslt-config; then
91                         xsltdir=$d
92                 fi
93         done
94 fi
95 if test "$xsltdir" != "no"; then
96         AC_MSG_CHECKING(for libXSLT)
97         if test -x $xsltdir/bin/xslt-config; then
98                 XSLT_LIBS=`$xsltdir/bin/xslt-config --libs`
99                 XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags`
100                 XSLT_VER=`$xsltdir/bin/xslt-config --version`
101                 AC_MSG_RESULT($XSLT_VER)
102                 AC_DEFINE([HAVE_XSLT],[1],
103                 [Define to 1 if you have libxslt installed])
104         else
105                 AC_MSG_RESULT(Not found)
106                 if test "$xsltdir" = "default"; then
107                         AC_MSG_WARN([Libxslt development libraries not found.])
108                 else
109                         AC_MSG_ERROR([libxslt development libraries not found.])                fi
110         fi
111 fi
112
113
114 # Checks for header files.
115 ##AC_HEADER_STDC
116 ##AC_HEADER_SYS_WAIT
117 ##AC_HEADER_TIME 
118 AC_CHECK_HEADERS(sys/select.h sys/socket.h iostream list vector stdexcept)
119 AC_CHECK_HEADERS(boost/thread/mutex.hpp \ 
120                  boost/date_time/posix_time/posix_time.hpp \
121                  boost/test/auto_unit_test.hpp)
122
123 # Checks for typedefs, structures, and compiler characteristics.
124 ##AC_TYPE_SIZE_T 
125 ##AC_CHECK_SIZEOF(int)
126 ##AC_CHECK_SIZEOF(long int)
127
128
129 # Checks for library functions.
130
131 AC_CONFIG_FILES([
132         Doxyfile
133         Makefile
134         src/Makefile
135         src/Jamfile
136 ])
137
138 AC_OUTPUT
139
140
141 # postamble
142
143 echo \
144 "------------------------------------------------------------------------
145 Configuration:
146
147   Source code location:       ${srcdir}
148   CPP Preprocessor flags:     ${CPPFLAGS}
149   CXX Compiler:               ${CXX}
150   CXX Compiler flags:         ${CXXFLAGS}
151   Linker flags:               ${LDFLAGS}
152   Linked libs:                ${LIBS}
153   Host System Type:           ${host}
154   Install path:               ${prefix}
155   Automake:                   ${AUTOMAKE}
156
157 ------------------------------------------------------------------------"