2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([libisds], [0.3.1], [petr.pisar@atlas.cz])
6 AM_INIT_AUTOMAKE(libisds, 0.3.1)
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])])
34 AM_CONDITIONAL([BUILD_ONLINE_TEST],
35 [test "$enable_test" = "yes" -a "$enable_online_test" = "yes"])
38 AM_GNU_GETTEXT_VERSION([0.17])
39 AM_GNU_GETTEXT([external])
42 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],
43 [Compile in debugging mode])])
44 AS_IF([test "$enable_debug" = "yes"],
46 dnl AC_SUBST(DEBUG_CFLAGS)
47 AC_DEFINE([ENABLE_DEBUG], [1],
48 [Define if you want include debugging code])
52 # Checks for libraries.
53 #TODO: Verify minimal version. libxml2-2.6.26 is just a guess.
54 AM_PATH_XML2([2.6.26])
57 LIBCURL_CHECK_CONFIG()
58 cppflags_orig="$CPPFLAGS"
59 CPPFLAGS="${CPPFLAGS} ${LIBCURL_CPPFLAGS}"
60 AC_CHECK_DECLS([CURLOPT_TIMEOUT_MS], [],
61 AC_MSG_WARN([Your libcurl does not support subsecond timeout resolution.
62 Consider upgrade to 7.16.2 version.]),
63 [[#include <curl/curl.h>]])
64 AC_CHECK_DECLS([CURLOPT_USERNAME], [],
65 AC_MSG_WARN([Your libcurl does not support separate username and password.
66 Your ISDS username could not contain colon.
67 Consider upgrade to 7.19.1 version.]),
68 [[#include <curl/curl.h>]])
69 AC_CHECK_DECLS([CURLOPT_SSLCERTTYPE], [],
70 AC_MSG_WARN([Your libcurl does not support client certificate format
71 declaration (PEM vs. DER).
72 Consider upgrade to 7.9.3 version.]),
73 [[#include <curl/curl.h>]])
74 AC_CHECK_DECLS([CURLOPT_CRLFILE], [],
75 AC_MSG_WARN([Your libcurl does not support certificate revocation list
77 Consider upgrade to 7.19.0 version.]),
78 [[#include <curl/curl.h>]])
79 AC_CHECK_DECLS([CURLOPT_KEYPASSWD], [], [], [[#include <curl/curl.h>]])
80 AC_CHECK_DECLS([CURLOPT_SSLKEYPASSWD], [], [], [[#include <curl/curl.h>]])
81 CPPFLAGS="$cppflags_orig"
83 #TODO: Determine minimal version
84 AM_PATH_LIBGCRYPT([1:1.4.0])
86 # GPGME is compiled with large file support by default. We need to follow not
89 #TODO: Determine minimal version
93 AC_CHECK_LIB([expat], [XML_ExpatVersionInfo],
96 # Verify minimal version. See src/phys.c: init_expat()
100 expat_min_version="${expat_min_major}.${expat_min_minor}.${expat_min_micro}"
101 AC_MSG_CHECKING([for expat library version >= ${expat_min_version}])
104 [#define MIN_MAJOR ${expat_min_major}
105 #define MIN_MINOR ${expat_min_minor}
106 #define MIN_MICRO ${expat_min_micro}
108 [[#if (XML_MAJOR_VERSION < MIN_MAJOR) || \
109 (XML_MAJOR_VERSION == MIN_MAJOR && XML_MINOR_VERSION < MIN_MINOR) || \
110 (XML_MAJOR_VERSION == MIN_MAJOR && XML_MINOR_VERSION == MIN_MINOR && \
111 XML_MICRO_VERSION < MIN_MICRO)
112 #error "Expat library is too old"
114 AC_MSG_RESULT([yes]),
115 AC_MSG_FAILURE([Upgrade your expat to ${expat_min_version}])
119 # Do not consider compiler warnings as errors
120 # This harms libxml configure test
121 AC_ARG_ENABLE(fatalwarnings, [AS_HELP_STRING([--disable-fatalwarnings],
122 [Do not consider compiler warnings as errors])])
123 AS_IF([test "$enable_fatalwarnings" = "no"], , CFLAGS="${CFLAGS} -Werror")
126 # Checks for header files.
127 AC_CHECK_HEADERS([fcntl.h locale.h stdint.h stdlib.h string.h unistd.h])
129 # Checks for typedefs, structures, and compiler characteristics.
134 # Checks for library functions.
138 AC_CHECK_FUNCS([localtime_r memset munmap setlocale strdup strerror])
141 CFLAGS="${CFLAGS} -std=c99 -Wall"
143 AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in client/Makefile
144 test/Makefile test/online/Makefile libisds.pc])
146 #AC_CONFIG_SUBDIRS([src])