found better way to set $LIBS with boost libs flags in a general way
[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.59)
6 AC_INIT([metaproxy],[1.0.9],[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 ##AC_PREFIX_DEFAULT(`pwd`/install) 
14
15 AM_INIT_AUTOMAKE([1.8])
16
17 # Checks for programs.
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 # Use C++ compilers only for tests
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
37
38 # check for Boost C++ development libs and headers
39 AX_BOOST_BASE(1.33)
40 AX_BOOST_DATE_TIME(1.33)
41 AX_BOOST_PROGRAM_OPTIONS(1.33)
42 AX_BOOST_THREAD(1.33)
43 AX_BOOST_UNIT_TEST_FRAMEWORK(1.33)
44
45 LIBS="$LIBS\
46 $BOOST_DATE_TIME_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB"; 
47
48 if test "$ax_cv_boost_base" = "no"; then
49    AC_MSG_ERROR([install libboost-dev or similar])
50 fi
51 if test "$ax_cv_boost_date_time" = "no"; then
52    AC_MSG_ERROR([install libboost-date-time-dev or similar])
53 fi
54 if test "$ax_cv_boost_program_options" = "no"; then
55    AC_MSG_ERROR([install libboost-program-options-dev or similar])
56 fi
57 if test "$ax_cv_boost_thread" = "no"; then
58    AC_MSG_ERROR([install libboost-thread-dev or similar])
59 fi
60 if test "$ax_cv_boost_unit_test_framework" = "no"; then
61    AC_MSG_ERROR([install libboost-test-dev or similar])
62 fi
63     
64
65 ## YAZPP checks
66 YAZPP_INIT(threads,1.0.2)
67 if test -z "$YAZPPLIB"; then
68         AC_MSG_ERROR([YAZ++ development libraries missing])
69 fi
70 YAZ_DOC
71
72 # Checks for header files.
73 ##AC_HEADER_STDC
74 ##AC_HEADER_SYS_WAIT
75 ##AC_HEADER_TIME 
76 AC_CHECK_HEADERS(sys/select.h sys/socket.h iostream list vector stdexcept)
77
78 # Checks for typedefs, structures, and compiler characteristics.
79 ##AC_TYPE_SIZE_T 
80 ##AC_CHECK_SIZEOF(int)
81 ##AC_CHECK_SIZEOF(long int)
82
83
84 # Checks for library functions.
85
86 AC_CONFIG_FILES([
87         Doxyfile
88         Makefile
89         src/Makefile
90         src/Jamfile
91         xml/Makefile
92         xml/schema/Makefile
93         xml/xslt/Makefile
94         doc/Makefile
95         doc/local.ent
96         doc/common/Makefile
97         doc/common/print.dsl
98         etc/Makefile
99 ])
100
101 AC_OUTPUT
102
103
104 # postamble
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   YAZPP Version:              ${YAZPPVERSION}
125   YAZPP Include:              ${YAZPPINC}
126   YAZPP La Lib:               ${YAZPPLALIB}
127   YAZPP Lib:                  ${YAZPPLIB}
128   Bugreport:                  ${PACKAGE_BUGREPORT}
129
130 ------------------------------------------------------------------------"