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=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,,
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
238 LIBTASN1_LIBS="\$(top_builddir)/asn1/libminitasn1.la"
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, :, [
250 AC_MSG_WARN([Libgcrypt >= 1.1.44 not found.])
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.])
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")
265 AC_SUBST(CRYPTO_CFLAGS)
266 AC_SUBST(CRYPTO_LIBS)
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])
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'
286 HTML_DIR=$with_html_dir
289 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
290 gtk_doc_min_version=0.6
292 gtk_doc_version=`gtkdoc-mkdb --version`
293 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
295 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
296 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
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
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)