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.
18 # Enable example clients
19 AC_ARG_ENABLE(example, [AS_HELP_STRING([--enable-example],
20 [Build library usage examples])])
21 AM_CONDITIONAL([BUILD_EXAMPLE], [test "$enable_example" = "yes"])
24 AC_ARG_ENABLE(test, [AS_HELP_STRING([--enable-test],
25 [Enable internal library tests])])
26 AM_CONDITIONAL([BUILD_TEST], [test "$enable_test" = "yes"])
29 AC_ARG_ENABLE(online-test, [AS_HELP_STRING([--enable-online-test],
30 [Enable on-line internal library tests])])
31 AM_CONDITIONAL([BUILD_ONLINE_TEST],
32 [test "$enable_test" = "yes" -a "$enable_online_test" = "yes"])
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 AC_CHECK_DECLS([CURLOPT_TIMEOUT_MS], [],
56 AC_MSG_WARN([Your libcurl does not support subsecond timeout resolution.
57 Consider upgrade to 7.16.2 version.]),
58 [[#include <curl/curl.h>]])
59 AC_CHECK_DECLS([CURLOPT_USERNAME], [],
60 AC_MSG_WARN([Your libcurl does not support separate username and password.
61 Your ISDS username could not contain colon.
62 Consider upgrade to 7.19.1 version.]),
63 [[#include <curl/curl.h>]])
64 AC_CHECK_DECLS([CURLOPT_SSLCERTTYPE], [],
65 AC_MSG_WARN([Your libcurl does not support client certificate format
66 declaration (PEM vs. DER).
67 Consider upgrade to 7.9.3 version.]),
68 [[#include <curl/curl.h>]])
69 AC_CHECK_DECLS([CURLOPT_CRLFILE], [],
70 AC_MSG_WARN([Your libcurl does not support certificate revocation list
72 Consider upgrade to 7.19.0 version.]),
73 [[#include <curl/curl.h>]])
74 AC_CHECK_DECLS([CURLOPT_KEYPASSWD], [], [], [[#include <curl/curl.h>]])
75 AC_CHECK_DECLS([CURLOPT_SSLKEYPASSWD], [], [], [[#include <curl/curl.h>]])
77 #TODO: Determine minimal version
78 AM_PATH_LIBGCRYPT([1:1.4.0])
80 # GPGME is compiled with large file support by default. We need to follow not
83 #TODO: Determine minimal version
87 AC_CHECK_LIB([expat], [XML_ExpatVersionInfo],
90 # Verify minimal version. See src/phys.c: init_expat()
94 expat_min_version="${expat_min_major}.${expat_min_minor}.${expat_min_micro}"
95 AC_MSG_CHECKING([for expat library version >= ${expat_min_version}])
98 [#define MIN_MAJOR ${expat_min_major}
99 #define MIN_MINOR ${expat_min_minor}
100 #define MIN_MICRO ${expat_min_micro}
102 [[#if (XML_MAJOR_VERSION < MIN_MAJOR) || \
103 (XML_MAJOR_VERSION == MIN_MAJOR && XML_MINOR_VERSION < MIN_MINOR) || \
104 (XML_MAJOR_VERSION == MIN_MAJOR && XML_MINOR_VERSION == MIN_MINOR && \
105 XML_MICRO_VERSION < MIN_MICRO)
106 #error "Expat library is too old"
108 AC_MSG_RESULT([yes]),
109 AC_MSG_FAILURE([Upgrade your expat to ${expat_min_version}])
113 # Do not consider compiler warnings as errors
114 # This harms libxml confgure test
115 AC_ARG_ENABLE(fatalwarnings, [AS_HELP_STRING([--disable-fatalwarnings],
116 [Do not consider compiler warnings as errors])])
117 AS_IF([test "$enable_fatalwarnings" = "no"], , CFLAGS="${CFLAGS} -Werror")
120 # Checks for header files.
121 AC_CHECK_HEADERS([fcntl.h locale.h stdint.h stdlib.h string.h unistd.h])
123 # Checks for typedefs, structures, and compiler characteristics.
128 # Checks for library functions.
132 AC_CHECK_FUNCS([localtime_r memset munmap setlocale strdup strerror])
135 CFLAGS="${CFLAGS} -std=c99 -Wall"
137 AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in client/Makefile
138 test/Makefile test/online/Makefile libisds.pc])
140 #AC_CONFIG_SUBDIRS([src])