(_shishi_crypto_init): Fix prototype, from Nicolas Pouvesle
[shishi.git] / configure.ac
blobd7ce8fe2650617ef506e67b88be4089206b6acb1
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.6, 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=6
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 gl_USE_SYSTEM_EXTENSIONS
41 AC_HEADER_STDC
42 AC_CHECK_HEADERS(stdlib.h string.h strings.h memory.h \
43         sys/types.h sys/socket.h sys/poll.h sys/time.h sys/select.h \
44         sys/socket.h sys/stat.h \
45         unistd.h netdb.h time.h termios.h signal.h pwd.h errno.h syslog.h \
46         locale.h resolv.h fcntl.h \
47         arpa/nameser.h arpa/inet.h netinet/in.h netinet/in6.h)
49 # Checks for programs.
50 AC_PROG_LIBTOOL
51 AM_GNU_GETTEXT(external)
52 AM_GNU_GETTEXT_VERSION(0.12.1)
53 AM_MISSING_PROG(PERL, perl, $missing_dir)
54 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
55 AM_MISSING_PROG(ASN1PARSER, asn1Parser, $missing_dir)
56 AM_WITH_DMALLOC
58 # Checks for typedefs, structures, and compiler characteristics.
59 AC_C_CONST
60 AC_TYPE_SIZE_T
61 AC_TYPE_UID_T
62 AC_TYPE_SIGNAL
63 AC_HEADER_TIME
64 AX_CREATE_STDINT_H(lib/shishi-int.h)
65 AC_CHECK_DECLS(h_errno)
66 AC_CHECK_TYPE([socklen_t],, [AC_DEFINE([socklen_t], [size_t],
67               [Define to `size_t' if `socklen_t' is missing.])], [
68 #ifdef HAVE_SYS_TYPES_H
69 #include <sys/types.h>
70 #endif
71 #ifdef HAVE_SYS_SOCKET_H
72 #include <sys/socket.h>
73 #endif
74 #ifdef HAVE_NETDB_H
75 #include <netdb.h>
76 #endif
79 # For gnulib stuff in gl/.
80 gl_C_RESTRICT
81 gl_FUNC_ALLOCA
82 gl_ARGP
83 gl_ERROR
84 gl_EXITFAIL
85 gl_GETDATE
86 gl_FUNC_GETHOSTNAME
87 gl_GETOPT
88 jm_FUNC_MALLOC
89 gl_FUNC_MEMMOVE
90 gl_FUNC_MEMPCPY
91 gl_FUNC_MEMSET
92 gl_FUNC_MKTIME
93 gl_FUNC_TIMEGM
94 jm_FUNC_REALLOC
95 gt_FUNC_SETENV
96 gl_STRCASE
97 gl_FUNC_STRCHRNUL
98 gl_FUNC_STRDUP
99 gl_FUNC_STRERROR
100 gl_FUNC_STRNDUP
101 gl_FUNC_STRNLEN
102 gl_SYSEXITS
103 jm_FUNC_GLIBC_UNLOCKED_IO
104 gl_FUNC_VASNPRINTF
105 gl_FUNC_VASPRINTF
106 gl_XALLOC
107 gl_XSTRNDUP
108 gl_TIME_R
110 # Checks for library functions.
111 AC_FUNC_STRFTIME
112 AC_CHECK_FUNCS(signal select ngettext gethostbyname)
113 AC_CHECK_LIB(resolv, res_query,, AC_MSG_WARN([[no libresolv, SRV RRs not used]]))
114 AC_SEARCH_LIBS(socket, socket)
115 AC_SEARCH_LIBS(gethostbyname, nsl)
116 AC_SEARCH_LIBS(syslog, syslog)
118 # Check for PAM
119 AC_ARG_ENABLE(pam,
120   AC_HELP_STRING([--disable-pam], [Don't use PAM even if available]))
121 if test "$enable_pam" != "no"; then
122         AC_CHECK_HEADERS(security/pam_appl.h)
123         AC_CHECK_HEADERS(security/pam_modules.h, [], [],
124         [
125 #if HAVE_SECURITY_PAM_APPL_H
126 #include <security/pam_appl.h>
127 #endif
129   AC_CHECK_HEADERS(security/_pam_macros.h)
130   enable_pam=$ac_cv_header_security_pam_modules_h
132 if test "$enable_pam" != "no"; then
133         PAM_SHISHI=pam_shishi
134 else
135         AC_MSG_WARN([[The Shishi PAM module will not be built.]])
137 AC_SUBST(PAM_SHISHI)
138 AC_MSG_CHECKING([if PAM should be used])
139 AC_MSG_RESULT($enable_pam)
141 # Check for IPv6
142 AC_ARG_ENABLE(ipv6,
143   AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
144 if test "$enable_ipv6" != "no"; then
145   enable_ipv6=yes
146   AC_CHECK_DECLS([AF_INET6, IN6ADDR_ANY_INIT],,enable_ipv6=no,[
147   #ifdef HAVE_SYS_TYPES_H
148   #include <sys/types.h>
149   #endif
150   #ifdef HAVE_SYS_SOCKET_H
151   #include <sys/socket.h>
152   #endif
153   #ifdef HAVE_NETINET_IN_H
154   #include <netinet/in.h>
155   #endif
156   #ifdef HAVE_NETINET_IN6_H
157   #include <netinet/in6.h>
158   #endif
159   ])
160   AC_CHECK_TYPE(struct sockaddr_in6,,enable_ipv6=no,[
161   #ifdef HAVE_SYS_TYPES_H
162   #include <sys/types.h>
163   #endif
164   #ifdef HAVE_SYS_SOCKET_H
165   #include <sys/socket.h>
166   #endif
167   #ifdef HAVE_NETINET_IN_H
168   #include <netinet/in.h>
169   #endif
170   #ifdef HAVE_NETINET_IN6_H
171   #include <netinet/in6.h>
172   #endif
173   ])
175 if test "$enable_ipv6" != "no"; then
176   AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
177 else
178   AC_MSG_WARN([[IPv6 support is disabled.]])
180 AC_MSG_CHECKING([if IPv6 should be used])
181 AC_MSG_RESULT($enable_ipv6)
183 # Check gdbm
184 #AC_ARG_WITH(system-gdbm,
185 #  AC_HELP_STRING([--without-system-gdbm], [Don't use the system's gdbm]))
186 #if test "$with_system_gdbm" != "no" ; then
187 #  AC_CHECK_LIB(gdbm, gdbm_open,,with_system_gdbm=no)
189 #LIBGDBM=""
190 #if test "$with_system_gdbm" = "no" ; then
191 #  LIBGDBM="\$(top_builddir)/gdbm/libgdbm.a"
192 #  CFLAGS="$CFLAGS -I\$(top_srcdir)/gdbm"
193 #  GDBM=gdbm
194 #  AC_SUBST(GDBM)
196 #AC_SUBST(LIBGDBM)
198 # Check for idn
199 AC_ARG_WITH(stringprep,
200   AC_HELP_STRING([--without-stringprep],
201                 [don't use libidn for string processing even if available]),
202         stringprep=$withval, stringprep=yes)
203 if test "$stringprep" != "no"; then
204         AC_CHECK_HEADER(stringprep.h,, stringprep=no)
206 if test "$stringprep" != "no"; then
207         AC_CHECK_LIB(idn, stringprep_check_version,,
208                 stringprep=no
209                 AC_MSG_WARN([Libidn not found.  String process disabled.]))
211 if test "$stringprep" != "no"; then
212         AC_DEFINE(WITH_STRINGPREP, 1, [Define to 1 if you want to use libidn.])
215 # For libtasn1
216 AC_CHECK_SIZEOF(unsigned long long, 8)
217 AC_CHECK_SIZEOF(unsigned long int, 4)
218 AC_CHECK_SIZEOF(unsigned int, 4)
219 AC_CHECK_SIZEOF(unsigned short int, 2)
220 AC_CHECK_SIZEOF(unsigned char, 1)
222 # Check for libtasn1
223 AC_ARG_WITH(system-asn1,
224         AC_HELP_STRING([--with-system-asn1], [Use the system's libtasn1]),
225         system_asn1=$withval, system_asn1=auto)
226 if test "$system_asn1" = "auto"; then
227         save_LIBS=$LIBS
228         LIBS="$LIBS -ltasn1"
229         AC_CACHE_CHECK([for libtasn1 >= 0.2.5], ac_cv_libtasn1, [
230                 AC_TRY_RUN([
231 #include <libtasn1.h>
232 int main ()
234   return asn1_check_version ("0.2.5") == NULL;
237                 ac_cv_libtasn1=yes,
238                 ac_cv_libtasn1=no,
239                 ac_cv_libtasn1=no)
240         ])
241         LIBS=$save_LIBS
242         if test "$ac_cv_libtasn1" = "yes"; then
243                 system_asn1=yes
244                 LIBTASN1_LIBS="-ltasn1"
245         else
246                 system_asn1=no
247                 AC_MSG_WARN([Libtasn1 >= 0.2.5 not found. Using included one.])
248         fi
250 AC_MSG_CHECKING([whether to use the system's libtasn1])
251 AC_MSG_RESULT($system_asn1)
252 if test "$system_asn1" = "no"; then
253         ASN1=asn1
254         LIBTASN1_LIBS="\$(top_builddir)/asn1/libminitasn1.la"
255         LIBTASN1_CFLAGS="-I\$(top_srcdir)/asn1"
257 AC_SUBST(ASN1)
258 AC_SUBST(LIBTASN1_LIBS)
259 AC_SUBST(LIBTASN1_CFLAGS)
261 # Check for libgcrypt
262 AC_ARG_WITH(libgcrypt,
263   AC_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
264   libgcrypt=$withval, libgcrypt=yes)
265 if test "$libgcrypt" != "no" ; then
266         AM_PATH_LIBGCRYPT(1.1.44, :, [
267                 libgcrypt=no
268                 AC_MSG_WARN([Libgcrypt >= 1.1.44 not found.])
269         ])
271 AC_MSG_CHECKING([whether to use libgcrypt])
272 AC_MSG_RESULT($libgcrypt)
273 if test "$libgcrypt" != "no" ; then
274         AC_DEFINE(USE_GCRYPT, 1, [Define to 1 if you want to use libgcrypt.])
275 else
276         CRYPTO=crypto
277         CRYPTO_CFLAGS="-I\$(top_srcdir)/crypto"
278         CRYPTO_LIBS="\$(top_builddir)/crypto/libnettle.la"
280 AM_CONDITIONAL(LIBGCRYPT, test "$libgcrypt" != "no")
281 AM_CONDITIONAL(NETTLE, test "$libgcrypt" = "no")
282 AC_SUBST(CRYPTO)
283 AC_SUBST(CRYPTO_CFLAGS)
284 AC_SUBST(CRYPTO_LIBS)
286 # Check for gnutls.
287 AC_ARG_ENABLE(tls,
288         AC_HELP_STRING([--enable-tls], [enable unfinished TLS support]),
289         tls=$enableval, tls=no)
290 if test "$tls" != "no"; then
291         AM_PATH_LIBGNUTLS(0.8.8, tls=yes, tls=no)
293 if test "$tls" != "no"; then
294         AC_DEFINE(USE_GNUTLS, 1, [Define to 1 if you want TLS.])
296 AC_MSG_CHECKING([if unfinished TLS support should be enabled])
297 AC_MSG_RESULT($tls)
299 # Check for gtk-doc.
300 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
301 if test "x$with_html_dir" = "x" ; then
302   HTML_DIR='${datadir}/gtk-doc/html'
303 else
304   HTML_DIR=$with_html_dir
306 AC_SUBST(HTML_DIR)
307 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
308 gtk_doc_min_version=0.6
309 if $GTKDOC ; then 
310     gtk_doc_version=`gtkdoc-mkdb --version`
311     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
312     if perl <<EOF ; then
313       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
314             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
316       AC_MSG_RESULT(yes)
317    else
318       AC_MSG_RESULT(no)
319       GTKDOC=false
320    fi
323 # Let people disable the gtk-doc stuff.
324 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
325 if test x$enable_gtk_doc = xauto ; then
326   if test x$GTKDOC = xtrue ; then
327     enable_gtk_doc=yes
328   else
329     enable_gtk_doc=no 
330   fi
332 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
334 # Let people enable/disable various encryption/checksum types.
335 AC_ARG_ENABLE(des, AC_HELP_STRING([--disable-des],
336                         [disable DES related encryption/checksum types]),
337                 enable_des=$enableval, enable_des=yes)
338 AM_CONDITIONAL(DES, test "$enable_des" != "no")
339 if test "$enable_des" != "no"; then
340         AC_DEFINE(WITH_DES, 1, [Define to 1 if you want DES {e,cksum}types.])
342 AC_MSG_CHECKING([if DES related encryption/checksum types should be used])
343 AC_MSG_RESULT($enable_des)
345 AC_ARG_ENABLE(3des, AC_HELP_STRING([--disable-3des],
346                         [disable 3DES encryption/checksum type]),
347                 enable_3des=$enableval, enable_3des=yes)
348 AM_CONDITIONAL(DES3, test "$enable_3des" != "no")
349 if test "$enable_3des" != "no"; then
350         AC_DEFINE(WITH_3DES, 1, [Define to 1 if you want 3DES {e,cksum}type.])
352 AC_MSG_CHECKING([if 3DES encryption/checksum type should be used])
353 AC_MSG_RESULT($enable_3des)
355 AC_ARG_ENABLE(aes, AC_HELP_STRING([--disable-aes],
356                         [disable AES encryption/checksum types]),
357                 enable_aes=$enableval, enable_aes=yes)
358 AM_CONDITIONAL(AES, test "$enable_aes" != "no")
359 if test "$enable_aes" != "no"; then
360         AC_DEFINE(WITH_AES, 1, [Define to 1 if you want AES {e,cksum}types.])
362 AC_MSG_CHECKING([if AES encryption/checksum types should be used])
363 AC_MSG_RESULT($enable_aes)
365 AC_ARG_ENABLE(md, AC_HELP_STRING([--disable-md],
366                         [disable unkeyed MD4/MD5 checksum types]),
367                 enable_md=$enableval, enable_md=yes)
368 AM_CONDITIONAL(MD, test "$enable_md" != "no")
369 if test "$enable_md" != "no"; then
370         AC_DEFINE(WITH_MD, 1, [Define to 1 if you want MD cksumtypes.])
372 AC_MSG_CHECKING([if unkeyed MD checksum types should be used])
373 AC_MSG_RESULT($enable_md)
375 AC_ARG_ENABLE(null, AC_HELP_STRING([--disable-null],
376                         [disable dummy NULL encryption/checksum type]),
377                 enable_null=$enableval, enable_null=yes)
378 AM_CONDITIONAL(NULL, test "$enable_null" != "no")
379 if test "$enable_null" != "no"; then
380         AC_DEFINE(WITH_NULL, 1, [Define to 1 if you want NULL {e,cksum}type.])
382 AC_MSG_CHECKING([if dummy NULL encryption/checksum type should be used])
383 AC_MSG_RESULT($enable_null)
385 AC_ARG_ENABLE(arcfour, AC_HELP_STRING([--disable-arcfour],
386                         [disable ARCFOUR encryption/checksum type]),
387                 enable_arcfour=$enableval, enable_arcfour=no)
388 AM_CONDITIONAL(ARCFOUR, test "$enable_arcfour" != "no")
389 if test "$enable_arcfour" != "no"; then
390         AC_DEFINE(WITH_ARCFOUR, 1,
391                         [Define to 1 if you want ARCFOUR {e,cksum}type.])
393 AC_MSG_CHECKING([if ARCFOUR encryption/checksum type should be used])
394 AC_MSG_RESULT($enable_arcfour)
396 AC_CONFIG_FILES(Makefile po/Makefile.in m4/Makefile \
397         asn1/Makefile crypto/Makefile examples/Makefile \
398         lib/Makefile lib/shishi.h src/Makefile tests/Makefile \
399         doc/Makefile doc/reference/Makefile doc/man/Makefile \
400         extra/Makefile extra/pam_shishi/Makefile extra/rsh-redone/Makefile \
401         gl/Makefile gl/m4/Makefile shishi.pc shishi.conf shishi.skel)
403 # We are done
404 AC_OUTPUT