Remove.
[shishi.git] / configure.ac
blob39c0cd88d275d35873c6383682a594e76984cdcf
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.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++
27 LT_CURRENT=0
28 LT_AGE=0
29 LT_REVISION=1
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 AC_HEADER_STDC
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 \
45         termios.h signal.h pwd.h errno.h syslog.h)
46 AC_CHECK_HEADERS(netinet/in.h netinet/in6.h arpa/inet.h)
48 # Checks for programs.
49 AC_PROG_LIBTOOL
50 AM_GNU_GETTEXT(use-libtool, need-ngettext)
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)
60 AM_WITH_DMALLOC
62 # Checks for typedefs, structures, and compiler characteristics.
63 AC_C_CONST
64 AC_TYPE_SIZE_T
65 AC_TYPE_UID_T
66 AC_TYPE_SIGNAL
67 AC_HEADER_TIME
68 AC_CHECK_DECLS(h_errno)
69 AC_CHECK_TYPE([socklen_t],, [AC_DEFINE([socklen_t], [size_t],
70               [Define to `size_t' if `socklen_t' is missing.])], [
71 #ifdef HAVE_SYS_TYPES_H
72 #include <sys/types.h>
73 #endif
74 #ifdef HAVE_SYS_SOCKET_H
75 #include <sys/socket.h>
76 #endif
77 #ifdef HAVE_NETDB_H
78 #include <netdb.h>
79 #endif
82 # Check for PAM
83 AC_ARG_ENABLE(pam,
84   AC_HELP_STRING([--disable-pam], [Don't use PAM even if available]))
85 if test "$enable_pam" != "no"; then
86         AC_CHECK_HEADERS(security/pam_appl.h)
87         AC_CHECK_HEADERS(security/pam_modules.h, [], [],
88         [
89 #if HAVE_SECURITY_PAM_APPL_H
90 #include <security/pam_appl.h>
91 #endif
93   AC_CHECK_HEADERS(security/_pam_macros.h)
94   enable_pam=$ac_cv_header_security_pam_modules_h
96 if test "$enable_pam" != "no"; then
97         PAM_SHISHI=pam_shishi
98 else
99         AC_MSG_WARN([[The Shishi PAM module will not be built.]])
101 AC_SUBST(PAM_SHISHI)
102 AC_MSG_CHECKING([if PAM should be used])
103 AC_MSG_RESULT($enable_pam)
105 # Check for IPv6
106 AC_ARG_ENABLE(ipv6,
107   AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
108 if test "$enable_ipv6" != "no"; then
109   enable_ipv6=yes
110   AC_CHECK_DECLS([AF_INET6, IN6ADDR_ANY_INIT],,enable_ipv6=no,[
111   #ifdef HAVE_SYS_TYPES_H
112   #include <sys/types.h>
113   #endif
114   #ifdef HAVE_SYS_SOCKET_H
115   #include <sys/socket.h>
116   #endif
117   #ifdef HAVE_NETINET_IN_H
118   #include <netinet/in.h>
119   #endif
120   #ifdef HAVE_NETINET_IN6_H
121   #include <netinet/in6.h>
122   #endif
123   ])
124   AC_CHECK_TYPE(struct sockaddr_in6,,enable_ipv6=no,[
125   #ifdef HAVE_SYS_TYPES_H
126   #include <sys/types.h>
127   #endif
128   #ifdef HAVE_SYS_SOCKET_H
129   #include <sys/socket.h>
130   #endif
131   #ifdef HAVE_NETINET_IN_H
132   #include <netinet/in.h>
133   #endif
134   #ifdef HAVE_NETINET_IN6_H
135   #include <netinet/in6.h>
136   #endif
137   ])
139 if test "$enable_ipv6" != "no"; then
140   AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
141 else
142   AC_MSG_WARN([[IPv6 support is disabled.]])
144 AC_MSG_CHECKING([if IPv6 should be used])
145 AC_MSG_RESULT($enable_ipv6)
147 # Check gdbm
148 #AC_ARG_WITH(system-gdbm,
149 #  AC_HELP_STRING([--without-system-gdbm], [Don't use the system's gdbm]))
150 #if test "$with_system_gdbm" != "no" ; then
151 #  AC_CHECK_LIB(gdbm, gdbm_open,,with_system_gdbm=no)
153 #LIBGDBM=""
154 #if test "$with_system_gdbm" = "no" ; then
155 #  LIBGDBM="\$(top_builddir)/gdbm/libgdbm.a"
156 #  CFLAGS="$CFLAGS -I\$(top_srcdir)/gdbm"
157 #  GDBM=gdbm
158 #  AC_SUBST(GDBM)
160 #AC_SUBST(LIBGDBM)
162 # Check for idn
163 AC_ARG_WITH(stringprep,
164   AC_HELP_STRING([--without-stringprep],
165                 [don't use libidn even if available]))
166 if test "$with_stringprep" != "no" ; then
167         PKG_CHECK_MODULES(LIBIDN, libidn >= 0.1.0,, with_stringprep=no)
169 if test "$with_stringprep" != "no"; then
170         AC_DEFINE(WITH_STRINGPREP, 1, [Define to 1 if you want to use libidn.])
171 else
172         AC_MSG_WARN([[String processing disabled due to no libidn.]])
175 # Check for libtasn1
176 AC_ARG_WITH(system-libtasn1,
177   AC_HELP_STRING([--without-system-libtasn1],
178                 [don't use the system's libtasn1]))
179 if test "$with_system_libtasn1" != "no" ; then
180         AC_CHECK_LIB(tasn1, asn1_read_tag, [
181                 LIBTASN1_LIBS="-ltasn1"
182                 LIBTASN1_CFLAGS=""
183                 with_system_libtasn1=yes
184         ], [
185                 with_system_libtasn1=no
186         ])
188 if test "$with_system_libtasn1" = "no"; then
189         AC_MSG_WARN([[
191 The system's libtasn1 0.2.0 or later not used.  Using copy distributed
192 with Shishi instead.  See <http://www.gnu.org/software/gnutls/>.
194         LIBTASN1_CFLAGS="-I\$(top_srcdir)/asn1/lib"
195         LIBTASN1_LIBS="\$(top_builddir)/asn1/lib/libtasn1.la"
196         ASN1=asn1
198 AC_SUBST(LIBTASN1_CFLAGS)
199 AC_SUBST(LIBTASN1_LIBS)
200 AC_SUBST(ASN1)
201 AC_MSG_CHECKING([if system's libtasn1 should be used])
202 AC_MSG_RESULT($with_system_libtasn1)
203 AC_CONFIG_SUBDIRS(asn1)
205 # Check for libgcrypt
206 AC_ARG_WITH(system-libgcrypt,
207   AC_HELP_STRING([--without-system-libgcrypt],
208                 [don't use the system's libgcrypt]))
209 if test "$with_system_libgcrypt" != "no" ; then
210         AM_PATH_LIBGCRYPT(1.1.13, [
211                 with_system_libgcrypt=yes
212         ], [
213                 with_system_libgcrypt=no
214         ])
216 if test "$with_system_libgcrypt" = "no"; then
217   AC_MSG_WARN([[
219 The system's libgcrypt 1.1.13 or later not used.  Using copy distributed
220 with shishi instead. See <ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/>.
222   LIBGCRYPT_CFLAGS="-I\$(top_srcdir)/crypto/src -I\$(top_srcdir)/errcrypto/src"
223   LIBGCRYPT_LIBS="\$(top_builddir)/crypto/src/libgcrypt.la"
224   CRYPTO="errcrypto crypto"
226 AC_SUBST(LIBGCRYPT_CFLAGS)
227 AC_SUBST(LIBGCRYPT_LIBS)
228 AC_SUBST(CRYPTO)
229 AC_MSG_CHECKING([if system's libgcrypt should be used])
230 AC_MSG_RESULT($with_system_libgcrypt)
231 GPG_ERROR_CONFIG=`pwd`/errcrypto/src/gpg-error-config; export GPG_ERROR_CONFIG
232 enable_ld_version_script=no; export enable_ld_version_script
233 AC_CONFIG_SUBDIRS(errcrypto crypto)
235 # For gnulib stuff in gl/.
236 gl_FUNC_STRNLEN
237 gl_FUNC_STRNDUP
238 gl_FUNC_MEMPCPY
239 gl_FUNC_ALLOCA
240 gl_ARGP
241 gl_ERROR
242 gl_FUNC_GETHOSTNAME
243 gl_GETOPT
244 jm_FUNC_MALLOC
245 gl_FUNC_MEMMOVE
246 gl_FUNC_MEMSET
247 jm_FUNC_REALLOC
248 gt_FUNC_SETENV
249 gl_STRCASE
250 gl_FUNC_STRCHRNUL
251 gl_FUNC_STRDUP
252 gl_FUNC_STRERROR
253 gl_SYSEXITS
254 jm_FUNC_GLIBC_UNLOCKED_IO
255 gl_FUNC_VASNPRINTF
256 gl_FUNC_VASPRINTF
257 gl_XALLOC
259 # Checks for library functions.
260 AC_FUNC_STRFTIME
261 AC_CHECK_FUNCS(signal select ngettext gethostbyname)
263 # Check for gtk-doc.
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'
267 else
268   HTML_DIR=$with_html_dir
270 AC_SUBST(HTML_DIR)
271 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
272 gtk_doc_min_version=0.6
273 if $GTKDOC ; then 
274     gtk_doc_version=`gtkdoc-mkdb --version`
275     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
276     if perl <<EOF ; then
277       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
278             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
280       AC_MSG_RESULT(yes)
281    else
282       AC_MSG_RESULT(no)
283       GTKDOC=false
284    fi
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
291     enable_gtk_doc=yes
292   else
293     enable_gtk_doc=no 
294   fi
296 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
298 AC_CONFIG_FILES(Makefile intl/Makefile po/Makefile.in m4/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)
303 # We are done
304 AC_OUTPUT