Change start log message to 'metaproxy start'
[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])
39
40 USEMARCON_INIT
41
42 ## YAZPP checks
43 YAZPP_INIT([threads],[1.3.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 4.2.32 or later])
49 AC_COMPILE_IFELSE(
50         [AC_LANG_PROGRAM([[#include <yaz/yaz-version.h>]],
51                          [[
52 #if YAZ_VERSIONL < 0x40220
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([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 xml_avail=false
74 xslt_avail=false
75 YAZ_LIBXML2([xml_avail=true])
76 if $xml_avail; then
77     YAZ_LIBXSLT([xslt_avail=true])
78 else
79     AC_MSG_ERROR([Libxml2 development files not found])
80 fi
81 if $xslt_avail; then
82     :
83 else
84     AC_MSG_ERROR([Libxslt development files not found])
85 fi
86
87 AC_CHECK_HEADERS([sys/select.h sys/socket.h])
88
89 if test -d ${srcdir}/.git; then
90     SHA1=`git show --pretty=format:%H|head -1`
91 else
92     SHA1=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'`
93 fi
94 AC_DEFINE_UNQUOTED([VERSION_SHA1], "$SHA1", [SHA-1 from Git])
95
96 AC_OUTPUT([
97         metaproxy-config
98         Doxyfile
99         Makefile
100         include/Makefile include/metaproxy/Makefile
101         src/Makefile
102         xml/Makefile
103         xml/schema/Makefile
104         xml/xslt/Makefile
105         doc/Makefile
106         doc/local.ent
107         doc/common/Makefile
108         doc/common/print.dsl
109         etc/Makefile
110 ],[
111         sed s%echo_source=yes%echo_source=no%g < metaproxy-config > src/metaproxy-config && chmod +x metaproxy-config src/metaproxy-config
112
113 ])
114
115 echo \
116 "------------------------------------------------------------------------
117
118   Package:                    ${PACKAGE}
119   Version:                    ${VERSION}
120   Source code location:       ${srcdir}
121   CPP Preprocessor:           ${CPP}
122   CPP Preprocessor flags:     ${CPPFLAGS}
123   CXX Compiler:               ${CXX}
124   CXX Compiler flags:         ${CXXFLAGS}
125   Linker flags:               ${LDFLAGS}
126   Linked libs:                ${LIBS}
127   Host System Type:           ${host}
128   Install path:               ${prefix}
129   Automake:                   ${AUTOMAKE}
130   Archiver:                   ${AR}
131   Ranlib:                     ${RANLIB}
132   Boost Version:              ${BOOST_VERSION}               
133   Boost Include:              ${BOOST_CPPFLAGS}               
134   Boost linker flags:         ${BOOST_LDFLAGS}               
135   Boost Libs:                 ${BOOST_DATE_TIME_LIB} ${BOOST_THREAD_LIB}               
136   YAZPP Version:              ${YAZPPVERSION}
137   YAZPP Include:              ${YAZPPINC}
138   YAZPP La Lib:               ${YAZPPLALIB}
139   YAZPP Lib:                  ${YAZPPLIB}
140   Bugreport:                  ${PACKAGE_BUGREPORT}
141
142 ------------------------------------------------------------------------"
143 dnl Local Variables:
144 dnl mode:shell-script
145 dnl sh-indentation: 2
146 dnl sh-basic-offset: 4
147 dnl End: