fixed build system except make d ist which still fails
[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
32 ## YAZPP checks
33 YAZPP_INIT(threads,1.0)
34 if test -z "$YAZPPLIB"; then
35         AC_MSG_ERROR([YAZ++ development libraries missing])
36 fi
37 ##YAZ_DOC
38
39 ## libxslt checks
40 AC_SUBST(XSLT_LIBS)
41 AC_SUBST(XSLT_CFLAGS)
42 xsltdir=default
43 AC_ARG_WITH(xslt,[[  --with-xslt[=PREFIX]    use libxslt in PREFIX]],xsltdir=$withval)
44 if test "$xsltdir" = "yes" -o "$xsltdir" = "default"; then
45         for d in /usr /usr/local; do
46                 if test -x $d/bin/xslt-config; then
47                         xsltdir=$d
48                 fi
49         done
50 fi
51 if test "$xsltdir" != "no"; then
52         AC_MSG_CHECKING(for libXSLT)
53         if test -x $xsltdir/bin/xslt-config; then
54                 XSLT_LIBS=`$xsltdir/bin/xslt-config --libs`
55                 XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags`
56                 XSLT_VER=`$xsltdir/bin/xslt-config --version`
57                 AC_MSG_RESULT($XSLT_VER)
58                 AC_DEFINE([HAVE_XSLT],[1],
59                 [Define to 1 if you have libxslt installed])
60         else
61                 AC_MSG_RESULT(Not found)
62                 if test "$xsltdir" = "default"; then
63                         AC_MSG_WARN([Libxslt development libraries not found.])
64                 else
65                         AC_MSG_ERROR([libxslt development libraries not found.])                fi
66         fi
67 fi
68
69
70 # Checks for header files.
71 ##AC_HEADER_STDC
72 ##AC_HEADER_STDCXX
73 ##AC_HEADER_SYS_WAIT
74 ##AC_HEADER_TIME 
75 AC_CHECK_HEADERS(boost/thread/mutex.hpp)
76
77
78
79 # Checks for typedefs, structures, and compiler characteristics.
80 ##AC_TYPE_SIZE_T 
81 ##AC_CHECK_SIZEOF(int)
82 ##AC_CHECK_SIZEOF(long int)
83
84
85 # Checks for library functions.
86
87 AC_CONFIG_FILES([
88         Doxyfile
89         Makefile
90         src/Makefile
91 ])
92
93 AC_OUTPUT
94
95
96 # postamble
97
98 echo \
99 "------------------------------------------------------------------------
100 Configuration:
101
102   Source code location:       ${srcdir}
103   CPP Preprocessor flags:     ${CPPFLAGS}
104   CXX Compiler:               ${CXX}
105   CXX Compiler flags:         ${CXXFLAGS}
106   Linker flags:               ${LDFLAGS}
107   Linked libs:                ${LIBS}
108   Host System Type:           ${host}
109   Install path:               ${prefix}
110
111 ------------------------------------------------------------------------"