Fix.
[shishi.git] / configure.ac
blob506bf607fbdfbca4b0c67884119e42027a74b096
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=yes)
226 if test "$system_asn1" != "no"; then
227         AC_CHECK_HEADER(libtasn1.h,, system_asn1=no)
229 if test "$system_asn1" != "no"; then
230         AC_CHECK_LIB(tasn1, asn1_check_version,,
231                 system_asn1=no
232                 AC_MSG_WARN([Libtasn1 >=0.2.2 not found. Using included one.]))
234 AC_MSG_CHECKING([whether to use the system's libtasn1])
235 AC_MSG_RESULT($system_asn1)
236 if test "$system_asn1" = "no"; then
237  ASN1=asn1
238  LIBTASN1_LIBS="\$(top_builddir)/asn1/libminitasn1.la"
240 AC_SUBST(ASN1)
241 AC_SUBST(LIBTASN1_LIBS)
243 # Check for libgcrypt
244 AC_ARG_WITH(libgcrypt,
245   AC_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
246   libgcrypt=$withval, libgcrypt=yes)
247 if test "$libgcrypt" != "no" ; then
248         AM_PATH_LIBGCRYPT(1.1.44, :, [
249                 libgcrypt=no
250                 AC_MSG_WARN([Libgcrypt >= 1.1.44 not found.])
251         ])
253 AC_MSG_CHECKING([whether to use libgcrypt])
254 AC_MSG_RESULT($libgcrypt)
255 if test "$libgcrypt" != "no" ; then
256         AC_DEFINE(USE_GCRYPT, 1, [Define to 1 if you want to use libgcrypt.])
257 else
258         CRYPTO=crypto
259         CRYPTO_CFLAGS="-I\$(top_srcdir)/crypto"
260         CRYPTO_LIBS="\$(top_builddir)/crypto/libnettle.la"
262 AM_CONDITIONAL(LIBGCRYPT, test "$libgcrypt" != "no")
263 AM_CONDITIONAL(NETTLE, test "$libgcrypt" = "no")
264 AC_SUBST(CRYPTO)
265 AC_SUBST(CRYPTO_CFLAGS)
266 AC_SUBST(CRYPTO_LIBS)
268 # Check for gnutls.
269 AC_ARG_ENABLE(tls,
270         AC_HELP_STRING([--enable-tls], [enable unfinished TLS support]),
271         tls=$enableval, tls=no)
272 if test "$tls" != "no"; then
273         AM_PATH_LIBGNUTLS(0.8.8, tls=yes, tls=no)
275 if test "$tls" != "no"; then
276         AC_DEFINE(USE_GNUTLS, 1, [Define to 1 if you want TLS.])
278 AC_MSG_CHECKING([if unfinished TLS support should be enabled])
279 AC_MSG_RESULT($tls)
281 # Check for gtk-doc.
282 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
283 if test "x$with_html_dir" = "x" ; then
284   HTML_DIR='${datadir}/gtk-doc/html'
285 else
286   HTML_DIR=$with_html_dir
288 AC_SUBST(HTML_DIR)
289 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
290 gtk_doc_min_version=0.6
291 if $GTKDOC ; then 
292     gtk_doc_version=`gtkdoc-mkdb --version`
293     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
294     if perl <<EOF ; then
295       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
296             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
298       AC_MSG_RESULT(yes)
299    else
300       AC_MSG_RESULT(no)
301       GTKDOC=false
302    fi
305 # Let people disable the gtk-doc stuff.
306 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
307 if test x$enable_gtk_doc = xauto ; then
308   if test x$GTKDOC = xtrue ; then
309     enable_gtk_doc=yes
310   else
311     enable_gtk_doc=no 
312   fi
314 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
316 # Let people enable/disable various encryption/checksum types.
317 AC_ARG_ENABLE(des, AC_HELP_STRING([--disable-des],
318                         [disable DES related encryption/checksum types]),
319                 enable_des=$enableval, enable_des=yes)
320 AM_CONDITIONAL(DES, test "$enable_des" != "no")
321 if test "$enable_des" != "no"; then
322         AC_DEFINE(WITH_DES, 1, [Define to 1 if you want DES {e,cksum}types.])
324 AC_MSG_CHECKING([if DES related encryption/checksum types should be used])
325 AC_MSG_RESULT($enable_des)
327 AC_ARG_ENABLE(3des, AC_HELP_STRING([--disable-3des],
328                         [disable 3DES encryption/checksum type]),
329                 enable_3des=$enableval, enable_3des=yes)
330 AM_CONDITIONAL(DES3, test "$enable_3des" != "no")
331 if test "$enable_3des" != "no"; then
332         AC_DEFINE(WITH_3DES, 1, [Define to 1 if you want 3DES {e,cksum}type.])
334 AC_MSG_CHECKING([if 3DES encryption/checksum type should be used])
335 AC_MSG_RESULT($enable_3des)
337 AC_ARG_ENABLE(aes, AC_HELP_STRING([--disable-aes],
338                         [disable AES encryption/checksum types]),
339                 enable_aes=$enableval, enable_aes=yes)
340 AM_CONDITIONAL(AES, test "$enable_aes" != "no")
341 if test "$enable_aes" != "no"; then
342         AC_DEFINE(WITH_AES, 1, [Define to 1 if you want AES {e,cksum}types.])
344 AC_MSG_CHECKING([if AES encryption/checksum types should be used])
345 AC_MSG_RESULT($enable_aes)
347 AC_ARG_ENABLE(md, AC_HELP_STRING([--disable-md],
348                         [disable unkeyed MD4/MD5 checksum types]),
349                 enable_md=$enableval, enable_md=yes)
350 AM_CONDITIONAL(MD, test "$enable_md" != "no")
351 if test "$enable_md" != "no"; then
352         AC_DEFINE(WITH_MD, 1, [Define to 1 if you want MD cksumtypes.])
354 AC_MSG_CHECKING([if unkeyed MD checksum types should be used])
355 AC_MSG_RESULT($enable_md)
357 AC_ARG_ENABLE(null, AC_HELP_STRING([--disable-null],
358                         [disable dummy NULL encryption/checksum type]),
359                 enable_null=$enableval, enable_null=yes)
360 AM_CONDITIONAL(NULL, test "$enable_null" != "no")
361 if test "$enable_null" != "no"; then
362         AC_DEFINE(WITH_NULL, 1, [Define to 1 if you want NULL {e,cksum}type.])
364 AC_MSG_CHECKING([if dummy NULL encryption/checksum type should be used])
365 AC_MSG_RESULT($enable_null)
367 AC_ARG_ENABLE(arcfour, AC_HELP_STRING([--disable-arcfour],
368                         [disable ARCFOUR encryption/checksum type]),
369                 enable_arcfour=$enableval, enable_arcfour=no)
370 AM_CONDITIONAL(ARCFOUR, test "$enable_arcfour" != "no")
371 if test "$enable_arcfour" != "no"; then
372         AC_DEFINE(WITH_ARCFOUR, 1,
373                         [Define to 1 if you want ARCFOUR {e,cksum}type.])
375 AC_MSG_CHECKING([if ARCFOUR encryption/checksum type should be used])
376 AC_MSG_RESULT($enable_arcfour)
378 AC_CONFIG_FILES(Makefile po/Makefile.in m4/Makefile \
379         asn1/Makefile crypto/Makefile examples/Makefile \
380         lib/Makefile lib/shishi.h src/Makefile tests/Makefile \
381         doc/Makefile doc/reference/Makefile doc/man/Makefile \
382         extra/Makefile extra/pam_shishi/Makefile extra/rsh-redone/Makefile \
383         gl/Makefile gl/m4/Makefile shishi.pc shishi.conf shishi.skel)
385 # We are done
386 AC_OUTPUT