2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([libisds], [0.5], [petr.pisar@atlas.cz])
6 AM_INIT_AUTOMAKE(libisds, 0.5)
7 AC_CONFIG_SRCDIR([src/isds.c])
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CONFIG_HEADERS([config.h])
11 # Checks for programs.
16 # For libtool < 1.9b (Debian lenny).
17 # AC_PROG_LIBTOOL has been obsoleted by LT_INIT
21 # Enable example clients
22 AC_ARG_ENABLE(example, [AS_HELP_STRING([--enable-example],
23 [Build library usage examples])])
24 AM_CONDITIONAL([BUILD_EXAMPLE], [test "$enable_example" = "yes"])
27 AC_ARG_ENABLE(test, [AS_HELP_STRING([--enable-test],
28 [Enable internal library tests])])
29 AM_CONDITIONAL([BUILD_TEST], [test "$enable_test" = "yes"])
32 AC_ARG_ENABLE(online-test, [AS_HELP_STRING([--enable-online-test],
33 [Enable on-line internal library tests])])
35 AM_GNU_GETTEXT_VERSION([0.17])
36 AM_GNU_GETTEXT([external])
39 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],
40 [Compile in debugging mode])])
41 AS_IF([test "$enable_debug" = "yes"],
43 dnl AC_SUBST(DEBUG_CFLAGS)
44 AC_DEFINE([ENABLE_DEBUG], [1],
45 [Define if you want include debugging code])
49 # Checks for libraries.
50 #TODO: Verify minimal version. libxml2-2.6.26 is just a guess.
51 AM_PATH_XML2([2.6.26])
54 LIBCURL_CHECK_CONFIG()
55 AS_IF([test -z "$LIBCURL"],
56 AC_MSG_WARN([libcurl disabled or not found. Network features will be
59 cppflags_orig="$CPPFLAGS"
60 CPPFLAGS="${CPPFLAGS} ${LIBCURL_CPPFLAGS}"
61 AC_CHECK_DECLS([CURLOPT_TIMEOUT_MS], [],
62 AC_MSG_WARN([Your libcurl does not support subsecond timeout resolution.
63 Consider upgrade to 7.16.2 version.]),
64 [[#include <curl/curl.h>]])
65 AC_CHECK_DECLS([CURLOPT_USERNAME], [],
66 AC_MSG_WARN([Your libcurl does not support separate username and password.
67 Your ISDS username could not contain colon.
68 Consider upgrade to 7.19.1 version.]),
69 [[#include <curl/curl.h>]])
70 AC_CHECK_DECLS([CURLOPT_SSLCERTTYPE], [],
71 AC_MSG_WARN([Your libcurl does not support client certificate format
72 declaration (PEM vs. DER).
73 Consider upgrade to 7.9.3 version.]),
74 [[#include <curl/curl.h>]])
75 AC_CHECK_DECLS([CURLOPT_CRLFILE], [],
76 AC_MSG_WARN([Your libcurl does not support certificate revocation list
78 Consider upgrade to 7.19.0 version.]),
79 [[#include <curl/curl.h>]])
80 AC_CHECK_DECLS([CURLINFO_REDIRECT_URL], [],
81 AC_MSG_ERROR([Your libcurl does not support getting redirected URL.
82 You must upgrade to 7.18.2 version.]),
83 [[#include <curl/curl.h>]])
84 AC_CHECK_DECLS([CURLOPT_KEYPASSWD], [], [], [[#include <curl/curl.h>]])
85 AC_CHECK_DECLS([CURLOPT_SSLKEYPASSWD], [], [], [[#include <curl/curl.h>]])
86 CPPFLAGS="$cppflags_orig"
88 AM_CONDITIONAL([BUILD_CURL], [test -n "$LIBCURL"])
90 dnl On-line tests requires libcurl
91 AM_CONDITIONAL([BUILD_ONLINE_TEST],
92 [test -n "$LIBCURL" -a "$enable_test" = "yes" \
93 -a "$enable_online_test" = "yes"])
95 #TODO: Determine minimal version
96 AM_PATH_LIBGCRYPT([1:1.4.0])
98 # GPGME is compiled with large file support by default. We need to follow not
101 #TODO: Determine minimal version
105 AC_CHECK_LIB([expat], [XML_ExpatVersionInfo],
107 AC_SUBST(EXPAT_LIBS))
108 # Verify minimal version. See src/phys.c: init_expat()
112 expat_min_version="${expat_min_major}.${expat_min_minor}.${expat_min_micro}"
113 AC_MSG_CHECKING([for expat library version >= ${expat_min_version}])
116 [#define MIN_MAJOR ${expat_min_major}
117 #define MIN_MINOR ${expat_min_minor}
118 #define MIN_MICRO ${expat_min_micro}
120 [[#if (XML_MAJOR_VERSION < MIN_MAJOR) || \
121 (XML_MAJOR_VERSION == MIN_MAJOR && XML_MINOR_VERSION < MIN_MINOR) || \
122 (XML_MAJOR_VERSION == MIN_MAJOR && XML_MINOR_VERSION == MIN_MINOR && \
123 XML_MICRO_VERSION < MIN_MICRO)
124 #error "Expat library is too old"
126 AC_MSG_RESULT([yes]),
127 AC_MSG_FAILURE([Upgrade your expat to ${expat_min_version}])
131 # Do not consider compiler warnings as errors
132 # This harms libxml configure test
133 AC_ARG_ENABLE(fatalwarnings, [AS_HELP_STRING([--disable-fatalwarnings],
134 [Do not consider compiler warnings as errors])])
135 AS_IF([test "$enable_fatalwarnings" = "no"], , CFLAGS="${CFLAGS} -Werror")
138 # Checks for header files.
139 AC_CHECK_HEADERS([fcntl.h locale.h stdint.h stdlib.h string.h unistd.h])
141 # Checks for typedefs, structures, and compiler characteristics.
146 # Checks for library functions.
150 AC_CHECK_FUNCS([localtime_r memset munmap setlocale strdup strerror])
153 CFLAGS="${CFLAGS} -std=c99 -Wall"
155 AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in client/Makefile
156 test/Makefile test/simline/Makefile test/online/Makefile
159 #AC_CONFIG_SUBDIRS([src])