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.1, 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 no-dependencies])
35 AM_CONFIG_HEADER(config.h)
37 # Checks for header files.
41 AC_CHECK_HEADERS([sys/types.h])
42 AC_CHECK_HEADERS([stdlib.h memory.h string.h strings.h sys/socket.h unistd.h])
43 AC_CHECK_HEADERS(getopt.h unistd.h strings.h netdb.h time.h sys/poll.h \
44 sys/time.h sys/select.h sys/socket.h sys/stat.h stdint.h termios.h \
45 signal.h pwd.h errno.h syslog.h locale.h arpa/nameser.h)
46 AC_CHECK_HEADERS(netinet/in.h netinet/in6.h arpa/inet.h inttypes.h resolv.h)
48 # Checks for programs.
50 AM_GNU_GETTEXT(external)
51 AM_GNU_GETTEXT_VERSION(0.12.1)
52 AM_MISSING_PROG(PERL, perl, $missing_dir)
53 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
54 AM_MISSING_PROG(TEXI2PDF, texi2pdf, $missing_dir)
55 AM_MISSING_PROG(DOCBOOK2TXT, docbook2txt, $missing_dir)
56 AM_MISSING_PROG(DOCBOOK2HTML, docbook2html, $missing_dir)
57 AM_MISSING_PROG(DOCBOOK2PS, docbook2ps, $missing_dir)
58 AM_MISSING_PROG(DOCBOOK2PDF, docbook2pdf, $missing_dir)
59 AM_MISSING_PROG(ASN1PARSER, asn1Parser, $missing_dir)
62 # Checks for typedefs, structures, and compiler characteristics.
68 AX_CREATE_STDINT_H(lib/shishi-int.h)
69 AC_CHECK_DECLS(h_errno)
70 AC_CHECK_TYPE([socklen_t],, [AC_DEFINE([socklen_t], [size_t],
71 [Define to `size_t' if `socklen_t' is missing.])], [
72 #ifdef HAVE_SYS_TYPES_H
73 #include <sys/types.h>
75 #ifdef HAVE_SYS_SOCKET_H
76 #include <sys/socket.h>
85 AC_HELP_STRING([--disable-pam], [Don't use PAM even if available]))
86 if test "$enable_pam" != "no"; then
87 AC_CHECK_HEADERS(security/pam_appl.h)
88 AC_CHECK_HEADERS(security/pam_modules.h, [], [],
90 #if HAVE_SECURITY_PAM_APPL_H
91 #include <security/pam_appl.h>
94 AC_CHECK_HEADERS(security/_pam_macros.h)
95 enable_pam=$ac_cv_header_security_pam_modules_h
97 if test "$enable_pam" != "no"; then
100 AC_MSG_WARN([[The Shishi PAM module will not be built.]])
103 AC_MSG_CHECKING([if PAM should be used])
104 AC_MSG_RESULT($enable_pam)
108 AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
109 if test "$enable_ipv6" != "no"; then
111 AC_CHECK_DECLS([AF_INET6, IN6ADDR_ANY_INIT],,enable_ipv6=no,[
112 #ifdef HAVE_SYS_TYPES_H
113 #include <sys/types.h>
115 #ifdef HAVE_SYS_SOCKET_H
116 #include <sys/socket.h>
118 #ifdef HAVE_NETINET_IN_H
119 #include <netinet/in.h>
121 #ifdef HAVE_NETINET_IN6_H
122 #include <netinet/in6.h>
125 AC_CHECK_TYPE(struct sockaddr_in6,,enable_ipv6=no,[
126 #ifdef HAVE_SYS_TYPES_H
127 #include <sys/types.h>
129 #ifdef HAVE_SYS_SOCKET_H
130 #include <sys/socket.h>
132 #ifdef HAVE_NETINET_IN_H
133 #include <netinet/in.h>
135 #ifdef HAVE_NETINET_IN6_H
136 #include <netinet/in6.h>
140 if test "$enable_ipv6" != "no"; then
141 AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
143 AC_MSG_WARN([[IPv6 support is disabled.]])
145 AC_MSG_CHECKING([if IPv6 should be used])
146 AC_MSG_RESULT($enable_ipv6)
149 #AC_ARG_WITH(system-gdbm,
150 # AC_HELP_STRING([--without-system-gdbm], [Don't use the system's gdbm]))
151 #if test "$with_system_gdbm" != "no" ; then
152 # AC_CHECK_LIB(gdbm, gdbm_open,,with_system_gdbm=no)
155 #if test "$with_system_gdbm" = "no" ; then
156 # LIBGDBM="\$(top_builddir)/gdbm/libgdbm.a"
157 # CFLAGS="$CFLAGS -I\$(top_srcdir)/gdbm"
164 AC_ARG_WITH(stringprep,
165 AC_HELP_STRING([--without-stringprep],
166 [don't use libidn even if available]))
167 if test "$with_stringprep" != "no" ; then
168 PKG_CHECK_MODULES(LIBIDN, libidn >= 0.1.0,, with_stringprep=no)
170 if test "$with_stringprep" != "no"; then
171 AC_DEFINE(WITH_STRINGPREP, 1, [Define to 1 if you want to use libidn.])
173 AC_MSG_WARN([[String processing disabled due to no libidn.]])
177 AC_ARG_WITH(included-libtasn1,
178 AC_HELP_STRING([--with-included-libtasn1], [Use the included libtasn1]),
179 minitasn1_enabled=$withval,
181 AC_CHECK_LIB(tasn1, asn1_read_tag, :,
182 minitasn1_enabled=yes
183 AC_MSG_WARN([Libtasn1 0.2.x not found. Using included one.])))
184 AC_MSG_CHECKING([whether to use the included tasn1])
185 AC_MSG_RESULT($minitasn1_enabled)
186 if test x"$minitasn1_enabled" = xyes; then
188 LIBTASN1_LIBS="-L../asn1 -lminitasn1"
190 LIBTASN1_LIBS=-ltasn1
193 AC_SUBST(LIBTASN1_LIBS)
196 AC_CHECK_SIZEOF(unsigned long long, 8)
197 AC_CHECK_SIZEOF(unsigned long int, 4)
198 AC_CHECK_SIZEOF(unsigned int, 4)
199 AC_CHECK_SIZEOF(unsigned short int, 2)
200 AC_CHECK_SIZEOF(unsigned char, 1)
202 # Check for libgcrypt
203 AC_ARG_WITH(system-libgcrypt,
204 AC_HELP_STRING([--without-system-libgcrypt],
205 [don't use the system's libgcrypt]))
206 if test "$with_system_libgcrypt" != "no" ; then
207 AM_PATH_LIBGCRYPT(1.1.42, [
208 with_system_libgcrypt=yes
210 with_system_libgcrypt=no
213 if test "$with_system_libgcrypt" = "no"; then
216 The system's libgcrypt 1.1.42 or later not used. Using copy distributed
217 with shishi instead. See <ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/>.
219 LIBGCRYPT_CFLAGS="-I\$(top_srcdir)/crypto/src -I\$(top_srcdir)/errcrypto/src"
220 LIBGCRYPT_LIBS="\$(top_builddir)/crypto/src/libgcrypt.la"
221 CRYPTO="errcrypto crypto"
223 AC_SUBST(LIBGCRYPT_CFLAGS)
224 AC_SUBST(LIBGCRYPT_LIBS)
226 AC_MSG_CHECKING([if system's libgcrypt should be used])
227 AC_MSG_RESULT($with_system_libgcrypt)
228 GPG_ERROR_CONFIG=`pwd`/errcrypto/src/gpg-error-config; export GPG_ERROR_CONFIG
229 enable_ld_version_script=no; export enable_ld_version_script
230 AC_CONFIG_SUBDIRS(errcrypto crypto)
232 # Check for resolver.
233 AC_CHECK_LIB(resolv, res_query,, AC_MSG_WARN([[no libresolv, SRV RRs not used]]))
235 # For gnulib stuff in gl/.
254 jm_FUNC_GLIBC_UNLOCKED_IO
259 # Checks for library functions.
261 AC_CHECK_FUNCS(signal select ngettext gethostbyname)
264 AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
265 if test "x$with_html_dir" = "x" ; then
266 HTML_DIR='${datadir}/gtk-doc/html'
268 HTML_DIR=$with_html_dir
271 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
272 gtk_doc_min_version=0.6
274 gtk_doc_version=`gtkdoc-mkdb --version`
275 AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
277 exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
278 ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
287 # Let people disable the gtk-doc stuff.
288 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
289 if test x$enable_gtk_doc = xauto ; then
290 if test x$GTKDOC = xtrue ; then
296 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
298 AC_CONFIG_FILES(Makefile po/Makefile.in m4/Makefile asn1/Makefile \
299 lib/Makefile lib/shishi.h src/Makefile tests/Makefile doc/Makefile \
300 doc/reference/Makefile extra/Makefile extra/pam_shishi/Makefile \
301 gl/Makefile gl/m4/Makefile shishi.pc shishi.conf shishi.skel)