Version 1.3.8
[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],[1.3.8],[metaproxy-help@indexdata.dk])
7
8 AC_CONFIG_HEADERS([src/config.hpp])
9
10 AC_CONFIG_SRCDIR([configure.ac]) 
11 AC_CONFIG_AUX_DIR([config])
12 AC_CANONICAL_SYSTEM
13
14 AM_INIT_AUTOMAKE([1.9])
15
16 AC_PROG_CXX
17 AC_PROG_CXXCPP
18 AC_PROG_INSTALL
19 AC_PROG_LN_S
20 AC_PROG_MAKE_SET
21 AC_PROG_RANLIB
22 AM_PROG_LIBTOOL
23
24 # Default language to use for tests (some tests may switch to C++)
25 AC_LANG([C])
26
27 if test "$enable_shared" = "yes"; then
28     AC_DEFINE([HAVE_DL_SUPPORT],[1],
29         [Define to 1 if you have shared module support])
30 fi
31
32 # Checks for libraries.
33 AC_CHECK_LIB([dl],[dlopen])
34 AC_CHECK_LIB([m],[main])
35
36 AC_CHECK_FUNCS([localtime_r])
37
38 ## YAZPP checks
39 YAZPP_INIT([threads],[1.2.7])
40 if test -z "$YAZPPLIB"; then
41     AC_MSG_ERROR([YAZ++ development libraries missing])
42 fi
43 YAZ_DOC
44 CPPFLAGS="$YAZPPINC $CPPFLAGS"
45
46 ID_BOOST([thread test regex],[1.33])
47 if test -z "${BOOST_THREAD_LIB}"; then
48     AC_MSG_ERROR([Boost thread development libraries required])
49 fi
50 if test -z "${BOOST_TEST_LIB}"; then
51     AC_MSG_ERROR([Boost unit test framework libraries required])
52 fi
53 if test -z "${BOOST_REGEX_LIB}"; then
54     AC_MSG_ERROR([Boost regex development libraries required])
55 fi
56
57 xml_avail=false
58 xslt_avail=false
59 YAZ_LIBXML2([xml_avail=true])
60 if $xml_avail; then
61     YAZ_LIBXSLT([xslt_avail=true])
62 else
63     AC_MSG_ERROR([Libxml2 development files not found])
64 fi
65 if $xslt_avail; then
66     :
67 else
68     AC_MSG_ERROR([Libxslt development files not found])
69 fi
70
71 AC_CHECK_HEADERS([sys/select.h sys/socket.h])
72
73 if test -d ${srcdir}/.git; then
74     SHA1=`git show --pretty=format:%H|head -1`
75 else
76     SHA1=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'`
77 fi
78 AC_DEFINE_UNQUOTED([VERSION_SHA1], "$SHA1", [SHA-1 from Git])
79
80 AC_CONFIG_FILES([
81         metaproxy-config
82         Doxyfile
83         Makefile
84         include/Makefile include/metaproxy/Makefile
85         src/Makefile
86         xml/Makefile
87         xml/schema/Makefile
88         xml/xslt/Makefile
89         doc/Makefile
90         doc/local.ent
91         doc/common/Makefile
92         doc/common/print.dsl
93         etc/Makefile
94 ],[
95         sed s%echo_source=yes%echo_source=no%g < metaproxy-config > src/metaproxy-config && chmod +x metaproxy-config src/metaproxy-config
96
97 ])
98
99 AC_OUTPUT
100
101
102 # postamble
103
104
105 echo \
106 "------------------------------------------------------------------------
107
108   Package:                    ${PACKAGE}
109   Version:                    ${VERSION}
110   Source code location:       ${srcdir}
111   CPP Preprocessor:           ${CPP}
112   CPP Preprocessor flags:     ${CPPFLAGS}
113   CXX Compiler:               ${CXX}
114   CXX Compiler flags:         ${CXXFLAGS}
115   Linker flags:               ${LDFLAGS}
116   Linked libs:                ${LIBS}
117   Host System Type:           ${host}
118   Install path:               ${prefix}
119   Automake:                   ${AUTOMAKE}
120   Archiver:                   ${AR}
121   Ranlib:                     ${RANLIB}
122   Boost Version:              ${BOOST_VERSION}               
123   Boost Include:              ${BOOST_CPPFLAGS}               
124   Boost linker flags:         ${BOOST_LDFLAGS}               
125   Boost Libs:                 ${BOOST_DATE_TIME_LIB} ${BOOST_THREAD_LIB}               
126   YAZPP Version:              ${YAZPPVERSION}
127   YAZPP Include:              ${YAZPPINC}
128   YAZPP La Lib:               ${YAZPPLALIB}
129   YAZPP Lib:                  ${YAZPPLIB}
130   Bugreport:                  ${PACKAGE_BUGREPORT}
131
132 ------------------------------------------------------------------------"
133 dnl Local Variables:
134 dnl mode:shell-script
135 dnl sh-indentation: 2
136 dnl sh-basic-offset: 4
137 dnl End: