Fix typo in configure.ac comment
[libisds.git] / configure.ac
blob1b64148512c5fbe1b2df621a3b4e35c348790751
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ([2.63])
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.
12 AC_PROG_CC
13 AC_PROG_CPP
14 #AC_PROG_MAKE_SET
15 LT_INIT
16 # For libtool < 1.9b (Debian lenny).
17 # AC_PROG_LIBTOOL has been obsoleted by LT_INIT
18 AC_PROG_LIBTOOL
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"])
26 # Enable tests
27 AC_ARG_ENABLE(test, [AS_HELP_STRING([--enable-test],
28                               [Enable internal library tests])])
29 AM_CONDITIONAL([BUILD_TEST], [test "$enable_test" = "yes"])
31 # Enable on-line test
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"])
37 # Enable gettext
38 AM_GNU_GETTEXT_VERSION([0.17])
39 AM_GNU_GETTEXT([external])
41 # Enable debug
42 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],
43                         [Compile in debugging mode])])
44 AS_IF([test "$enable_debug" = "yes"],
45       CFLAGS="${CFLAGS} -g"
46       dnl AC_SUBST(DEBUG_CFLAGS)
47       AC_DEFINE([ENABLE_DEBUG], [1],
48                 [Define if you want include debugging code])
49       )
52 # Checks for libraries.
53 #TODO: Verify minimal version. libxml2-2.6.26 is just a guess.
54 AM_PATH_XML2([2.6.26])
56 # Checks for CURL 
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
74                  declaration.
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
84 # to break ABI.
85 AC_SYS_LARGEFILE
86 #TODO: Determine minimal version
87 AM_PATH_GPGME()
89 # Check for expat
90 AC_CHECK_LIB([expat], [XML_ExpatVersionInfo],
91              EXPAT_LIBS=-lexpat
92              AC_SUBST(EXPAT_LIBS))
93 # Verify minimal version. See src/phys.c: init_expat()
94 expat_min_major="2"
95 expat_min_minor="0"
96 expat_min_micro="0"
97 expat_min_version="${expat_min_major}.${expat_min_minor}.${expat_min_micro}"
98 AC_MSG_CHECKING([for expat library version >= ${expat_min_version}])
99 AC_COMPILE_IFELSE(
100         AC_LANG_PROGRAM(
101             [#define MIN_MAJOR ${expat_min_major}
102             #define MIN_MINOR ${expat_min_minor}
103             #define MIN_MICRO ${expat_min_micro}
104             #include <expat.h>],
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"
110 #endif]]),
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.
127 AC_TYPE_SIZE_T
128 #AC_TYPE_SSIZE_T
129 AC_TYPE_UINT8_T
131 # Checks for library functions.
132 AC_FUNC_MALLOC
133 AC_FUNC_MKTIME
134 AC_FUNC_MMAP
135 AC_CHECK_FUNCS([localtime_r memset munmap setlocale strdup strerror])
137 # Default CFLAGS
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])
144 AC_OUTPUT