Windows: use Boost 1.59, msvc 14.0
[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.60])
6 AC_INIT([metaproxy],
7 m4_esyscmd([. ./IDMETA; echo $VERSION|tr -d '\n']),
8 [metaproxy-help@indexdata.dk])
9
10 AC_CONFIG_HEADERS([src/config.hpp])
11
12 AC_CONFIG_SRCDIR([configure.ac]) 
13 AC_CONFIG_AUX_DIR([config])
14 AC_CANONICAL_SYSTEM
15
16 AM_INIT_AUTOMAKE([1.9])
17
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 # Default language to use for tests (some tests may switch to C++)
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([dl],[dlopen])
36 AC_CHECK_LIB([m],[main])
37
38 AC_CHECK_FUNCS([localtime_r getrlimit])
39
40 USEMARCON_INIT
41
42 ## YAZPP checks
43 YAZPP_INIT([threads],[1.6.0])
44 if test -z "$YAZPPLIB"; then
45     AC_MSG_ERROR([YAZ++ development libraries missing])
46 fi
47 CPPFLAGS="$YAZPPINC $CPPFLAGS"
48 AC_MSG_CHECKING([if YAZ is version 5.13.0 or later])
49 AC_COMPILE_IFELSE(
50         [AC_LANG_PROGRAM([[#include <yaz/yaz-version.h>]],
51                          [[
52 #if YAZ_VERSIONL < 0x50D00
53 #error too old
54 #endif
55 ]])],
56         [AC_MSG_RESULT([yes])],
57         [AC_MSG_RESULT([no])
58          AC_MSG_ERROR([newer version of YAZ required])]
59 )
60 YAZ_DOC
61
62 ID_BOOST([system thread test regex],[1.33])
63 if test -z "${BOOST_THREAD_LIB}"; then
64     AC_MSG_ERROR([Boost thread development libraries required])
65 fi
66 if test -z "${BOOST_TEST_LIB}"; then
67     AC_MSG_ERROR([Boost unit test framework libraries required])
68 fi
69 if test -z "${BOOST_REGEX_LIB}"; then
70     AC_MSG_ERROR([Boost regex development libraries required])
71 fi
72
73 case $YAZPPINC in
74   *YAZ_HAVE_XSLT=1*) ;;
75   *) AC_MSG_ERROR([YAZ not compiled with Libxslt support]) ;;
76 esac
77
78 AC_CHECK_HEADERS([sys/select.h sys/socket.h])
79
80 if test -d ${srcdir}/.git; then
81     SHA1=`git show --pretty=format:%H|head -1`
82 else
83     SHA1=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'`
84 fi
85 AC_DEFINE_UNQUOTED([VERSION_SHA1], "$SHA1", [SHA-1 from Git])
86
87 AC_OUTPUT([
88         metaproxy-config
89         Doxyfile
90         Makefile
91         include/Makefile include/metaproxy/Makefile
92         src/Makefile
93         xml/Makefile
94         xml/schema/Makefile
95         xml/xslt/Makefile
96         doc/Makefile
97         doc/local0.ent
98         doc/common/Makefile
99         doc/common/print.dsl
100         etc/Makefile
101 ],[
102         sed s%echo_source=yes%echo_source=no%g < metaproxy-config > src/metaproxy-config && chmod +x metaproxy-config src/metaproxy-config
103         diff doc/local.ent doc/local0.ent >/dev/null 2>/dev/null \
104                 || cp doc/local0.ent doc/local.ent
105 ])
106
107 echo \
108 "------------------------------------------------------------------------
109
110   Package:                    ${PACKAGE}
111   Version:                    ${VERSION}
112   Source code location:       ${srcdir}
113   CPP Preprocessor:           ${CPP}
114   CPP Preprocessor flags:     ${CPPFLAGS}
115   CXX Compiler:               ${CXX}
116   CXX Compiler flags:         ${CXXFLAGS}
117   Linker flags:               ${LDFLAGS}
118   Linked libs:                ${LIBS}
119   Host System Type:           ${host}
120   Install path:               ${prefix}
121   Automake:                   ${AUTOMAKE}
122   Archiver:                   ${AR}
123   Ranlib:                     ${RANLIB}
124   Boost Version:              ${BOOST_VERSION}               
125   Boost Include:              ${BOOST_CPPFLAGS}               
126   Boost linker flags:         ${BOOST_LDFLAGS}               
127   Boost Libs:                 ${BOOST_DATE_TIME_LIB} ${BOOST_THREAD_LIB}               
128   YAZPP Version:              ${YAZPPVERSION}
129   YAZPP Include:              ${YAZPPINC}
130   YAZPP La Lib:               ${YAZPPLALIB}
131   YAZPP Lib:                  ${YAZPPLIB}
132   Bugreport:                  ${PACKAGE_BUGREPORT}
133
134 ------------------------------------------------------------------------"
135 dnl Local Variables:
136 dnl mode:shell-script
137 dnl sh-indentation: 2
138 dnl sh-basic-offset: 4
139 dnl End: