2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([libisds], [0.2.1], [petr.pisar@atlas.cz])
6 AM_INIT_AUTOMAKE(libisds, 0.2.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 AC_CHECK_DECLS([CURLOPT_TIMEOUT_MS], [],
59 AC_MSG_WARN([Your libcurl does not support subsecond timeout resolution.
60 Consider upgrade to 7.16.2 version.]),
61 [[#include <curl/curl.h>]])
62 AC_CHECK_DECLS([CURLOPT_USERNAME], [],
63 AC_MSG_WARN([Your libcurl does not support separate username and password.
64 Your ISDS username could not contain colon.
65 Consider upgrade to 7.19.1 version.]),
66 [[#include <curl/curl.h>]])
67 AC_CHECK_DECLS([CURLOPT_SSLCERTTYPE], [],
68 AC_MSG_WARN([Your libcurl does not support client certificate format
69 declaration (PEM vs. DER).
70 Consider upgrade to 7.9.3 version.]),
71 [[#include <curl/curl.h>]])
72 AC_CHECK_DECLS([CURLOPT_CRLFILE], [],
73 AC_MSG_WARN([Your libcurl does not support certificate revocation list
75 Consider upgrade to 7.19.0 version.]),
76 [[#include <curl/curl.h>]])
77 AC_CHECK_DECLS([CURLOPT_KEYPASSWD], [], [], [[#include <curl/curl.h>]])
78 AC_CHECK_DECLS([CURLOPT_SSLKEYPASSWD], [], [], [[#include <curl/curl.h>]])
80 #TODO: Determine minimal version
81 AM_PATH_LIBGCRYPT([1:1.4.0])
83 # GPGME is compiled with large file support by default. We need to follow not
86 #TODO: Determine minimal version
90 AC_CHECK_LIB([expat], [XML_ExpatVersionInfo],
93 # Verify minimal version. See src/phys.c: init_expat()
97 expat_min_version="${expat_min_major}.${expat_min_minor}.${expat_min_micro}"
98 AC_MSG_CHECKING([for expat library version >= ${expat_min_version}])
101 [#define MIN_MAJOR ${expat_min_major}
102 #define MIN_MINOR ${expat_min_minor}
103 #define MIN_MICRO ${expat_min_micro}
105 [[#if (XML_MAJOR_VERSION < MIN_MAJOR) || \
106 (XML_MAJOR_VERSION == MIN_MAJOR && XML_MINOR_VERSION < MIN_MINOR) || \
107 (XML_MAJOR_VERSION == MIN_MAJOR && XML_MINOR_VERSION == MIN_MINOR && \
108 XML_MICRO_VERSION < MIN_MICRO)
109 #error "Expat library is too old"
111 AC_MSG_RESULT([yes]),
112 AC_MSG_FAILURE([Upgrade your expat to ${expat_min_version}])
116 # Do not consider compiler warnings as errors
117 # This harms libxml configure test
118 AC_ARG_ENABLE(fatalwarnings, [AS_HELP_STRING([--disable-fatalwarnings],
119 [Do not consider compiler warnings as errors])])
120 AS_IF([test "$enable_fatalwarnings" = "no"], , CFLAGS="${CFLAGS} -Werror")
123 # Checks for header files.
124 AC_CHECK_HEADERS([fcntl.h locale.h stdint.h stdlib.h string.h unistd.h])
126 # Checks for typedefs, structures, and compiler characteristics.
131 # Checks for library functions.
135 AC_CHECK_FUNCS([localtime_r memset munmap setlocale strdup strerror])
138 CFLAGS="${CFLAGS} -std=c99 -Wall"
140 AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in client/Makefile
141 test/Makefile test/online/Makefile libisds.pc])
143 #AC_CONFIG_SUBDIRS([src])