50e8a78094f9ececa7f7b693e3cdac3c989da8c9
[metaproxy-moved-to-github.git] / configure.ac
1 ## -*- Autoconf -*-
2 ## Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.57)
5 AC_INIT(yp2, 0.0.1, marc@indexdata.dk)
6 AM_CONFIG_HEADER(src/config.hpp)
7
8
9 AC_CONFIG_SRCDIR(configure.ac) 
10 AC_CONFIG_AUX_DIR(config)
11 AC_CANONICAL_SYSTEM
12 ##AC_PREFIX_DEFAULT(`pwd`/install) 
13
14 AM_INIT_AUTOMAKE
15
16
17 # Checks for programs.
18 AC_PROG_CXX
19 AC_PROG_INSTALL
20 AC_PROG_LN_S
21 AC_PROG_MAKE_SET
22 AC_PROG_RANLIB
23 AM_PROG_LIBTOOL
24
25 # Use C++ compilers only for tests
26 AC_LANG(C++)
27
28 # Checks for libraries.
29 ##AC_CHECK_LIB(ibrary, main)
30 AC_CHECK_LIB(boost_thread, main, [],[
31         AC_MSG_ERROR([boost thread library not found. Install libboost-thread-dev (or similar)])
32 ])
33
34 ## AC_CHECK_LIB(boost_unit_test_framework, [], [],[
35 ##      AC_MSG_ERROR([boost unit test library not found. Install libboost-test-dev (or similar)])
36 ## ])
37
38 ## YAZPP checks
39 YAZPP_INIT(threads,1.0)
40 if test -z "$YAZPPLIB"; then
41         AC_MSG_ERROR([YAZ++ development libraries missing])
42 fi
43 ##YAZ_DOC
44
45 ## libxslt checks
46 AC_SUBST(XSLT_LIBS)
47 AC_SUBST(XSLT_CFLAGS)
48 xsltdir=default
49 AC_ARG_WITH(xslt,[[  --with-xslt[=PREFIX]    use libxslt in PREFIX]],xsltdir=$withval)
50 if test "$xsltdir" = "yes" -o "$xsltdir" = "default"; then
51         for d in /usr /usr/local; do
52                 if test -x $d/bin/xslt-config; then
53                         xsltdir=$d
54                 fi
55         done
56 fi
57 if test "$xsltdir" != "no"; then
58         AC_MSG_CHECKING(for libXSLT)
59         if test -x $xsltdir/bin/xslt-config; then
60                 XSLT_LIBS=`$xsltdir/bin/xslt-config --libs`
61                 XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags`
62                 XSLT_VER=`$xsltdir/bin/xslt-config --version`
63                 AC_MSG_RESULT($XSLT_VER)
64                 AC_DEFINE([HAVE_XSLT],[1],
65                 [Define to 1 if you have libxslt installed])
66         else
67                 AC_MSG_RESULT(Not found)
68                 if test "$xsltdir" = "default"; then
69                         AC_MSG_WARN([Libxslt development libraries not found.])
70                 else
71                         AC_MSG_ERROR([libxslt development libraries not found.])                fi
72         fi
73 fi
74
75
76 # Checks for header files.
77 ##AC_HEADER_STDC
78 ##AC_HEADER_STDCXX
79 ##AC_HEADER_SYS_WAIT
80 ##AC_HEADER_TIME 
81 AC_CHECK_HEADERS(boost/thread/mutex.hpp)
82
83
84
85 # Checks for typedefs, structures, and compiler characteristics.
86 ##AC_TYPE_SIZE_T 
87 ##AC_CHECK_SIZEOF(int)
88 ##AC_CHECK_SIZEOF(long int)
89
90
91 # Checks for library functions.
92
93 AC_CONFIG_FILES([
94         Doxyfile
95         Makefile
96         src/Makefile
97 ])
98
99 AC_OUTPUT
100
101
102 # postamble
103
104 echo \
105 "------------------------------------------------------------------------
106 Configuration:
107
108   Source code location:       ${srcdir}
109   CPP Preprocessor flags:     ${CPPFLAGS}
110   CXX Compiler:               ${CXX}
111   CXX Compiler flags:         ${CXXFLAGS}
112   Linker flags:               ${LDFLAGS}
113   Linked libs:                ${LIBS}
114   Host System Type:           ${host}
115   Install path:               ${prefix}
116
117 ------------------------------------------------------------------------"