Generated.
[shishi.git] / configure.ac
blob88d2a6ec8cd1eb2df1234b9b9a0215d7c1e9e7a6
1 # Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002, 2003 Simon Josefsson.
4 # This file is part of Shishi.
6 # Shishi is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
11 # Shishi is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Shishi; see the file COPYING.  If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 AC_PREREQ(2.50)
22 AC_INIT(shishi, 0.0.2, bug-shishi@josefsson.org)
24 # Interfaces removed:    CURRENT++, AGE=0, REVISION=0
25 # Interfaces added:      CURRENT++, AGE++, REVISION=0
26 # No interfaces changed:                   REVISION++
27 LT_CURRENT=0
28 LT_AGE=0
29 LT_REVISION=2
30 AC_SUBST(LT_CURRENT)
31 AC_SUBST(LT_AGE)
32 AC_SUBST(LT_REVISION)
34 AM_INIT_AUTOMAKE(gnits)
35 AM_CONFIG_HEADER(config.h)
37 # Checks for header files.
38 AC_PROG_CC
39 AC_GNU_SOURCE
40 AC_HEADER_STDC
41 AC_CHECK_HEADERS([sys/types.h])
42 AC_CHECK_HEADERS([stdlib.h memory.h string.h strings.h sys/socket.h unistd.h])
43 AC_CHECK_HEADERS(getopt.h unistd.h strings.h netdb.h time.h sys/poll.h \
44         sys/time.h sys/select.h sys/socket.h sys/stat.h stdint.h termios.h \
45         signal.h pwd.h errno.h syslog.h locale.h arpa/nameser.h \
46         netinet/in.h netinet/in6.h arpa/inet.h inttypes.h resolv.h fcntl.h)
48 # Checks for programs.
49 AC_PROG_LIBTOOL
50 AM_GNU_GETTEXT(external)
51 AM_GNU_GETTEXT_VERSION(0.12.1)
52 AM_MISSING_PROG(PERL, perl, $missing_dir)
53 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
54 AM_MISSING_PROG(ASN1PARSER, asn1Parser, $missing_dir)
55 AM_WITH_DMALLOC
57 # Checks for typedefs, structures, and compiler characteristics.
58 AC_C_CONST
59 AC_TYPE_SIZE_T
60 AC_TYPE_UID_T
61 AC_TYPE_SIGNAL
62 AC_HEADER_TIME
63 AX_CREATE_STDINT_H(lib/shishi-int.h)
64 AC_CHECK_DECLS(h_errno)
65 AC_CHECK_TYPE([socklen_t],, [AC_DEFINE([socklen_t], [size_t],
66               [Define to `size_t' if `socklen_t' is missing.])], [
67 #ifdef HAVE_SYS_TYPES_H
68 #include <sys/types.h>
69 #endif
70 #ifdef HAVE_SYS_SOCKET_H
71 #include <sys/socket.h>
72 #endif
73 #ifdef HAVE_NETDB_H
74 #include <netdb.h>
75 #endif
77 # For libtasn1
78 AC_CHECK_SIZEOF(unsigned long long, 8)
79 AC_CHECK_SIZEOF(unsigned long int, 4)
80 AC_CHECK_SIZEOF(unsigned int, 4)
81 AC_CHECK_SIZEOF(unsigned short int, 2)
82 AC_CHECK_SIZEOF(unsigned char, 1)
84 # Check for PAM
85 AC_ARG_ENABLE(pam,
86   AC_HELP_STRING([--disable-pam], [Don't use PAM even if available]))
87 if test "$enable_pam" != "no"; then
88         AC_CHECK_HEADERS(security/pam_appl.h)
89         AC_CHECK_HEADERS(security/pam_modules.h, [], [],
90         [
91 #if HAVE_SECURITY_PAM_APPL_H
92 #include <security/pam_appl.h>
93 #endif
95   AC_CHECK_HEADERS(security/_pam_macros.h)
96   enable_pam=$ac_cv_header_security_pam_modules_h
98 if test "$enable_pam" != "no"; then
99         PAM_SHISHI=pam_shishi
100 else
101         AC_MSG_WARN([[The Shishi PAM module will not be built.]])
103 AC_SUBST(PAM_SHISHI)
104 AC_MSG_CHECKING([if PAM should be used])
105 AC_MSG_RESULT($enable_pam)
107 # Check for IPv6
108 AC_ARG_ENABLE(ipv6,
109   AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
110 if test "$enable_ipv6" != "no"; then
111   enable_ipv6=yes
112   AC_CHECK_DECLS([AF_INET6, IN6ADDR_ANY_INIT],,enable_ipv6=no,[
113   #ifdef HAVE_SYS_TYPES_H
114   #include <sys/types.h>
115   #endif
116   #ifdef HAVE_SYS_SOCKET_H
117   #include <sys/socket.h>
118   #endif
119   #ifdef HAVE_NETINET_IN_H
120   #include <netinet/in.h>
121   #endif
122   #ifdef HAVE_NETINET_IN6_H
123   #include <netinet/in6.h>
124   #endif
125   ])
126   AC_CHECK_TYPE(struct sockaddr_in6,,enable_ipv6=no,[
127   #ifdef HAVE_SYS_TYPES_H
128   #include <sys/types.h>
129   #endif
130   #ifdef HAVE_SYS_SOCKET_H
131   #include <sys/socket.h>
132   #endif
133   #ifdef HAVE_NETINET_IN_H
134   #include <netinet/in.h>
135   #endif
136   #ifdef HAVE_NETINET_IN6_H
137   #include <netinet/in6.h>
138   #endif
139   ])
141 if test "$enable_ipv6" != "no"; then
142   AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
143 else
144   AC_MSG_WARN([[IPv6 support is disabled.]])
146 AC_MSG_CHECKING([if IPv6 should be used])
147 AC_MSG_RESULT($enable_ipv6)
149 # Check gdbm
150 #AC_ARG_WITH(system-gdbm,
151 #  AC_HELP_STRING([--without-system-gdbm], [Don't use the system's gdbm]))
152 #if test "$with_system_gdbm" != "no" ; then
153 #  AC_CHECK_LIB(gdbm, gdbm_open,,with_system_gdbm=no)
155 #LIBGDBM=""
156 #if test "$with_system_gdbm" = "no" ; then
157 #  LIBGDBM="\$(top_builddir)/gdbm/libgdbm.a"
158 #  CFLAGS="$CFLAGS -I\$(top_srcdir)/gdbm"
159 #  GDBM=gdbm
160 #  AC_SUBST(GDBM)
162 #AC_SUBST(LIBGDBM)
164 # Check for idn
165 AC_ARG_WITH(stringprep,
166   AC_HELP_STRING([--without-stringprep],
167                 [don't use libidn even if available]))
168 if test "$with_stringprep" != "no" ; then
169         PKG_CHECK_MODULES(LIBIDN, libidn >= 0.1.0,, with_stringprep=no)
171 if test "$with_stringprep" != "no"; then
172         AC_DEFINE(WITH_STRINGPREP, 1, [Define to 1 if you want to use libidn.])
173 else
174         AC_MSG_WARN([[String processing disabled due to no libidn.]])
177 # Check for libtasn1
178 AC_ARG_WITH(system-asn1,
179         AC_HELP_STRING([--with-system-asn1], [Use the system's libtasn1]),
180         system_asn1=$withval, system_asn1=no)
181 if test "$system_asn1" = "yes"; then
182         AC_CHECK_LIB(tasn1, asn1_read_tag, :,
183                 system_asn1=no
184                 AC_MSG_WARN([Libtasn1 0.2.x not found. Using included one.]))
186 AC_MSG_CHECKING([whether to use the system's libtasn1])
187 AC_MSG_RESULT($system_asn1)
188 if test "$system_asn1" = "yes"; then
189  LIBTASN1_LIBS=-ltasn1
190 else
191  ASN1=asn1
192  LIBTASN1_LIBS="-L../asn1 -lminitasn1"
194 AC_SUBST(ASN1)
195 AC_SUBST(LIBTASN1_LIBS)
197 # Check for libgcrypt
198 AC_ARG_WITH(libgcrypt,
199   AC_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
200   libgcrypt=$withval, libgcrypt=no)
201 if test "$libgcrypt" != "no" ; then
202         AM_PATH_LIBGCRYPT(1.1.42, :, [
203                 libgcrypt=no
204                 AC_MSG_WARN([Libgcrypt >= 1.1.42 not found.])
205         ])
207 AC_MSG_CHECKING([whether to use libgcrypt])
208 AC_MSG_RESULT($libgcrypt)
209 if test "$libgcrypt" != "no" ; then
210         AC_DEFINE(USE_GCRYPT, 1, [Define to 1 if you want to use libgcrypt.])
211 else
212         CRYPTO=crypto
213         CRYPTO_CFLAGS="-I\$(top_srcdir)/crypto"
214         CRYPTO_LIBS="-L../crypto -lnettle"
216 AC_SUBST(CRYPTO)
217 AC_SUBST(CRYPTO_CFLAGS)
218 AC_SUBST(CRYPTO_LIBS)
220 # Check for resolver.
221 AC_CHECK_LIB(resolv, res_query,, AC_MSG_WARN([[no libresolv, SRV RRs not used]]))
223 # For gnulib stuff in gl/.
224 gl_FUNC_STRNLEN
225 gl_FUNC_STRNDUP
226 gl_FUNC_MEMPCPY
227 gl_FUNC_ALLOCA
228 gl_ARGP
229 gl_ERROR
230 gl_FUNC_GETHOSTNAME
231 gl_GETOPT
232 jm_FUNC_MALLOC
233 gl_FUNC_MEMMOVE
234 gl_FUNC_MEMSET
235 jm_FUNC_REALLOC
236 gt_FUNC_SETENV
237 gl_STRCASE
238 gl_FUNC_STRCHRNUL
239 gl_FUNC_STRDUP
240 gl_FUNC_STRERROR
241 gl_SYSEXITS
242 jm_FUNC_GLIBC_UNLOCKED_IO
243 gl_FUNC_VASNPRINTF
244 gl_FUNC_VASPRINTF
245 gl_XALLOC
246 gl_GETDATE
247 gl_FUNC_MKTIME
249 # Checks for library functions.
250 AC_FUNC_STRFTIME
251 AC_CHECK_FUNCS(signal select ngettext gethostbyname)
253 # Check for gtk-doc.
254 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
255 if test "x$with_html_dir" = "x" ; then
256   HTML_DIR='${datadir}/gtk-doc/html'
257 else
258   HTML_DIR=$with_html_dir
260 AC_SUBST(HTML_DIR)
261 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
262 gtk_doc_min_version=0.6
263 if $GTKDOC ; then 
264     gtk_doc_version=`gtkdoc-mkdb --version`
265     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
266     if perl <<EOF ; then
267       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
268             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
270       AC_MSG_RESULT(yes)
271    else
272       AC_MSG_RESULT(no)
273       GTKDOC=false
274    fi
277 # Let people disable the gtk-doc stuff.
278 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
279 if test x$enable_gtk_doc = xauto ; then
280   if test x$GTKDOC = xtrue ; then
281     enable_gtk_doc=yes
282   else
283     enable_gtk_doc=no 
284   fi
286 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
288 AC_CONFIG_FILES(Makefile po/Makefile.in m4/Makefile \
289         asn1/Makefile crypto/Makefile \
290         lib/Makefile lib/shishi.h src/Makefile tests/Makefile doc/Makefile \
291         doc/reference/Makefile extra/Makefile extra/pam_shishi/Makefile \
292         gl/Makefile gl/m4/Makefile shishi.pc shishi.conf shishi.skel)
294 # We are done
295 AC_OUTPUT