2 ## Process this file with autoconf to produce a configure script.
4 # Autoconf and automake setup
6 AC_INIT(yp2, 0.0.1, marc@indexdata.dk)
8 AC_CONFIG_HEADERS(src/config.hpp)
10 AC_CONFIG_SRCDIR(configure.ac)
11 AC_CONFIG_AUX_DIR(config)
13 ##AC_PREFIX_DEFAULT(`pwd`/install)
17 # Checks for programs.
26 # Use C++ compilers only for tests
29 # Checks for libraries.
30 AC_CHECK_LIB(boost_thread, main, [],[
31 AC_MSG_NOTICE([boost thread library not found.])
32 AC_MSG_ERROR([Install libboost-thread-dev (or similar)])
35 AC_CHECK_LIB(boost_date_time, main, [],[
36 AC_MSG_NOTICE([boost date_time library not found.])
37 AC_MSG_ERROR([Install libboost-date-time-dev (or similar)])
40 AC_CHECK_LIB(boost_program_options, main, [],[
41 AC_MSG_NOTICE([boost program options library not found.])
42 AC_MSG_ERROR([Install libboost-program-options-dev (or similar)])
45 AC_CHECK_HEADER(boost/test/auto_unit_test.hpp,,[
46 AC_MSG_NOTICE([boost test unit header not found.])
47 AC_MSG_ERROR([Install libboost-test-dev (or similar)])
50 AC_MSG_CHECKING([whether boost_unit_test_framework works])
52 LIBS="$LIBS -lboost_unit_test_framework"
54 #define BOOST_AUTO_TEST_MAIN
55 #include <boost/test/auto_unit_test.hpp>
56 BOOST_AUTO_UNIT_TEST( test )
67 AC_MSG_NOTICE([Boost unit test framework does not appear to work])
68 AC_MSG_ERROR([Consult config.log for details])
72 YAZPP_INIT(threads,1.0)
73 if test -z "$YAZPPLIB"; then
74 AC_MSG_ERROR([YAZ++ development libraries missing])
82 AC_ARG_WITH(xslt,[[ --with-xslt[=PREFIX] use libxslt in PREFIX]],xsltdir=$withval)
83 if test "$xsltdir" = "yes" -o "$xsltdir" = "default"; then
84 for d in /usr /usr/local; do
85 if test -x $d/bin/xslt-config; then
90 if test "$xsltdir" != "no"; then
91 AC_MSG_CHECKING(for libXSLT)
92 if test -x $xsltdir/bin/xslt-config; then
93 XSLT_LIBS=`$xsltdir/bin/xslt-config --libs`
94 XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags`
95 XSLT_VER=`$xsltdir/bin/xslt-config --version`
96 AC_MSG_RESULT($XSLT_VER)
97 AC_DEFINE([HAVE_XSLT],[1],
98 [Define to 1 if you have libxslt installed])
100 AC_MSG_RESULT(Not found)
101 if test "$xsltdir" = "default"; then
102 AC_MSG_WARN([Libxslt development libraries not found.])
104 AC_MSG_ERROR([libxslt development libraries not found.]) fi
109 # Checks for header files.
113 AC_CHECK_HEADERS(sys/select.h sys/socket.h iostream list vector stdexcept)
114 AC_CHECK_HEADERS(boost/thread/mutex.hpp \
115 boost/date_time/posix_time/posix_time.hpp \
116 boost/test/auto_unit_test.hpp)
118 # Checks for typedefs, structures, and compiler characteristics.
120 ##AC_CHECK_SIZEOF(int)
121 ##AC_CHECK_SIZEOF(long int)
124 # Checks for library functions.
139 "------------------------------------------------------------------------
142 Source code location: ${srcdir}
143 CPP Preprocessor flags: ${CPPFLAGS}
145 CXX Compiler flags: ${CXXFLAGS}
146 Linker flags: ${LDFLAGS}
148 Host System Type: ${host}
149 Install path: ${prefix}
150 Automake: ${AUTOMAKE}
152 ------------------------------------------------------------------------"