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)
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.
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++
34 AM_INIT_AUTOMAKE(gnits)
35 AM_CONFIG_HEADER(config.h)
37 # Checks for header files.
40 gl_USE_SYSTEM_EXTENSIONS
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.
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)
58 # Checks for typedefs, structures, and compiler characteristics.
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>
71 #ifdef HAVE_SYS_SOCKET_H
72 #include <sys/socket.h>
79 # For gnulib stuff in gl/.
103 jm_FUNC_GLIBC_UNLOCKED_IO
110 # Checks for library functions.
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)
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, [], [],
125 #if HAVE_SECURITY_PAM_APPL_H
126 #include <security/pam_appl.h>
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
135 AC_MSG_WARN([[The Shishi PAM module will not be built.]])
138 AC_MSG_CHECKING([if PAM should be used])
139 AC_MSG_RESULT($enable_pam)
143 AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
144 if test "$enable_ipv6" != "no"; then
146 AC_CHECK_DECLS([AF_INET6, IN6ADDR_ANY_INIT],,enable_ipv6=no,[
147 #ifdef HAVE_SYS_TYPES_H
148 #include <sys/types.h>
150 #ifdef HAVE_SYS_SOCKET_H
151 #include <sys/socket.h>
153 #ifdef HAVE_NETINET_IN_H
154 #include <netinet/in.h>
156 #ifdef HAVE_NETINET_IN6_H
157 #include <netinet/in6.h>
160 AC_CHECK_TYPE(struct sockaddr_in6,,enable_ipv6=no,[
161 #ifdef HAVE_SYS_TYPES_H
162 #include <sys/types.h>
164 #ifdef HAVE_SYS_SOCKET_H
165 #include <sys/socket.h>
167 #ifdef HAVE_NETINET_IN_H
168 #include <netinet/in.h>
170 #ifdef HAVE_NETINET_IN6_H
171 #include <netinet/in6.h>
175 if test "$enable_ipv6" != "no"; then
176 AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
178 AC_MSG_WARN([[IPv6 support is disabled.]])
180 AC_MSG_CHECKING([if IPv6 should be used])
181 AC_MSG_RESULT($enable_ipv6)
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)
190 #if test "$with_system_gdbm" = "no" ; then
191 # LIBGDBM="\$(top_builddir)/gdbm/libgdbm.a"
192 # CFLAGS="$CFLAGS -I\$(top_srcdir)/gdbm"
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,,
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.])
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)
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
229 AC_CACHE_CHECK([for libtasn1 >= 0.2.5], ac_cv_libtasn1, [
231 #include <libtasn1.h>
234 return asn1_check_version ("0.2.5") == NULL;
242 if test "$ac_cv_libtasn1" = "yes"; then
244 LIBTASN1_LIBS="-ltasn1"
247 AC_MSG_WARN([Libtasn1 >= 0.2.5 not found. Using included one.])
250 AC_MSG_CHECKING([whether to use the system's libtasn1])
251 AC_MSG_RESULT($system_asn1)
252 if test "$system_asn1" = "no"; then
254 LIBTASN1_LIBS="\$(top_builddir)/asn1/libminitasn1.la"
255 LIBTASN1_CFLAGS="-I\$(top_srcdir)/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, :, [
268 AC_MSG_WARN([Libgcrypt >= 1.1.44 not found.])
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.])
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")
283 AC_SUBST(CRYPTO_CFLAGS)
284 AC_SUBST(CRYPTO_LIBS)
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])
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'
304 HTML_DIR=$with_html_dir
307 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
308 gtk_doc_min_version=0.6
310 gtk_doc_version=`gtkdoc-mkdb --version`
311 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
313 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
314 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
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
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)