Add LIBTASN1_CFLAGS.
[shishi.git] / configure.ac
blobe7237f419da6f9f48a22bb5a2c5145beca507544
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"
239  LIBTASN1_CFLAGS="-I\$(top_srcdir)/asn1"
241 AC_SUBST(ASN1)
242 AC_SUBST(LIBTASN1_LIBS)
243 AC_SUBST(LIBTASN1_CFLAGS)
245 # Check for libgcrypt
246 AC_ARG_WITH(libgcrypt,
247   AC_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
248   libgcrypt=$withval, libgcrypt=yes)
249 if test "$libgcrypt" != "no" ; then
250         AM_PATH_LIBGCRYPT(1.1.44, :, [
251                 libgcrypt=no
252                 AC_MSG_WARN([Libgcrypt >= 1.1.44 not found.])
253         ])
255 AC_MSG_CHECKING([whether to use libgcrypt])
256 AC_MSG_RESULT($libgcrypt)
257 if test "$libgcrypt" != "no" ; then
258         AC_DEFINE(USE_GCRYPT, 1, [Define to 1 if you want to use libgcrypt.])
259 else
260         CRYPTO=crypto
261         CRYPTO_CFLAGS="-I\$(top_srcdir)/crypto"
262         CRYPTO_LIBS="\$(top_builddir)/crypto/libnettle.la"
264 AM_CONDITIONAL(LIBGCRYPT, test "$libgcrypt" != "no")
265 AM_CONDITIONAL(NETTLE, test "$libgcrypt" = "no")
266 AC_SUBST(CRYPTO)
267 AC_SUBST(CRYPTO_CFLAGS)
268 AC_SUBST(CRYPTO_LIBS)
270 # Check for gnutls.
271 AC_ARG_ENABLE(tls,
272         AC_HELP_STRING([--enable-tls], [enable unfinished TLS support]),
273         tls=$enableval, tls=no)
274 if test "$tls" != "no"; then
275         AM_PATH_LIBGNUTLS(0.8.8, tls=yes, tls=no)
277 if test "$tls" != "no"; then
278         AC_DEFINE(USE_GNUTLS, 1, [Define to 1 if you want TLS.])
280 AC_MSG_CHECKING([if unfinished TLS support should be enabled])
281 AC_MSG_RESULT($tls)
283 # Check for gtk-doc.
284 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
285 if test "x$with_html_dir" = "x" ; then
286   HTML_DIR='${datadir}/gtk-doc/html'
287 else
288   HTML_DIR=$with_html_dir
290 AC_SUBST(HTML_DIR)
291 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
292 gtk_doc_min_version=0.6
293 if $GTKDOC ; then 
294     gtk_doc_version=`gtkdoc-mkdb --version`
295     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
296     if perl <<EOF ; then
297       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
298             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
300       AC_MSG_RESULT(yes)
301    else
302       AC_MSG_RESULT(no)
303       GTKDOC=false
304    fi
307 # Let people disable the gtk-doc stuff.
308 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
309 if test x$enable_gtk_doc = xauto ; then
310   if test x$GTKDOC = xtrue ; then
311     enable_gtk_doc=yes
312   else
313     enable_gtk_doc=no 
314   fi
316 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
318 # Let people enable/disable various encryption/checksum types.
319 AC_ARG_ENABLE(des, AC_HELP_STRING([--disable-des],
320                         [disable DES related encryption/checksum types]),
321                 enable_des=$enableval, enable_des=yes)
322 AM_CONDITIONAL(DES, test "$enable_des" != "no")
323 if test "$enable_des" != "no"; then
324         AC_DEFINE(WITH_DES, 1, [Define to 1 if you want DES {e,cksum}types.])
326 AC_MSG_CHECKING([if DES related encryption/checksum types should be used])
327 AC_MSG_RESULT($enable_des)
329 AC_ARG_ENABLE(3des, AC_HELP_STRING([--disable-3des],
330                         [disable 3DES encryption/checksum type]),
331                 enable_3des=$enableval, enable_3des=yes)
332 AM_CONDITIONAL(DES3, test "$enable_3des" != "no")
333 if test "$enable_3des" != "no"; then
334         AC_DEFINE(WITH_3DES, 1, [Define to 1 if you want 3DES {e,cksum}type.])
336 AC_MSG_CHECKING([if 3DES encryption/checksum type should be used])
337 AC_MSG_RESULT($enable_3des)
339 AC_ARG_ENABLE(aes, AC_HELP_STRING([--disable-aes],
340                         [disable AES encryption/checksum types]),
341                 enable_aes=$enableval, enable_aes=yes)
342 AM_CONDITIONAL(AES, test "$enable_aes" != "no")
343 if test "$enable_aes" != "no"; then
344         AC_DEFINE(WITH_AES, 1, [Define to 1 if you want AES {e,cksum}types.])
346 AC_MSG_CHECKING([if AES encryption/checksum types should be used])
347 AC_MSG_RESULT($enable_aes)
349 AC_ARG_ENABLE(md, AC_HELP_STRING([--disable-md],
350                         [disable unkeyed MD4/MD5 checksum types]),
351                 enable_md=$enableval, enable_md=yes)
352 AM_CONDITIONAL(MD, test "$enable_md" != "no")
353 if test "$enable_md" != "no"; then
354         AC_DEFINE(WITH_MD, 1, [Define to 1 if you want MD cksumtypes.])
356 AC_MSG_CHECKING([if unkeyed MD checksum types should be used])
357 AC_MSG_RESULT($enable_md)
359 AC_ARG_ENABLE(null, AC_HELP_STRING([--disable-null],
360                         [disable dummy NULL encryption/checksum type]),
361                 enable_null=$enableval, enable_null=yes)
362 AM_CONDITIONAL(NULL, test "$enable_null" != "no")
363 if test "$enable_null" != "no"; then
364         AC_DEFINE(WITH_NULL, 1, [Define to 1 if you want NULL {e,cksum}type.])
366 AC_MSG_CHECKING([if dummy NULL encryption/checksum type should be used])
367 AC_MSG_RESULT($enable_null)
369 AC_ARG_ENABLE(arcfour, AC_HELP_STRING([--disable-arcfour],
370                         [disable ARCFOUR encryption/checksum type]),
371                 enable_arcfour=$enableval, enable_arcfour=no)
372 AM_CONDITIONAL(ARCFOUR, test "$enable_arcfour" != "no")
373 if test "$enable_arcfour" != "no"; then
374         AC_DEFINE(WITH_ARCFOUR, 1,
375                         [Define to 1 if you want ARCFOUR {e,cksum}type.])
377 AC_MSG_CHECKING([if ARCFOUR encryption/checksum type should be used])
378 AC_MSG_RESULT($enable_arcfour)
380 AC_CONFIG_FILES(Makefile po/Makefile.in m4/Makefile \
381         asn1/Makefile crypto/Makefile examples/Makefile \
382         lib/Makefile lib/shishi.h src/Makefile tests/Makefile \
383         doc/Makefile doc/reference/Makefile doc/man/Makefile \
384         extra/Makefile extra/pam_shishi/Makefile extra/rsh-redone/Makefile \
385         gl/Makefile gl/m4/Makefile shishi.pc shishi.conf shishi.skel)
387 # We are done
388 AC_OUTPUT