Add.
[shishi.git] / configure.ac
blob88e1fbb27b6682eb978dd086a50f82a46852ab51
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.0, 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=0
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 programs.
38 AM_GNU_GETTEXT(use-libtool, need-ngettext)
39 AM_GNU_GETTEXT_VERSION(0.11.5)
40 AC_PROG_LIBTOOL
41 AC_PROG_CC
42 AM_MISSING_PROG(PERL, perl, $missing_dir)
43 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
44 AM_MISSING_PROG(TEXI2PDF, texi2pdf, $missing_dir)
45 AM_MISSING_PROG(DOCBOOK2TXT, docbook2txt, $missing_dir)
46 AM_MISSING_PROG(DOCBOOK2HTML, docbook2html, $missing_dir)
47 AM_MISSING_PROG(DOCBOOK2PS, docbook2ps, $missing_dir)
48 AM_MISSING_PROG(DOCBOOK2PDF, docbook2pdf, $missing_dir)
49 AM_WITH_DMALLOC
51 # Checks for header files.
52 AC_HEADER_STDC
53 AC_CHECK_HEADERS([stdlib.h memory.h string.h strings.h sys/socket.h unistd.h])
54 AC_CHECK_HEADERS(getopt.h unistd.h strings.h netdb.h time.h sys/poll.h \
55         sys/time.h sys/types.h sys/select.h sys/socket.h sys/stat.h stdint.h \
56         termios.h signal.h pwd.h errno.h syslog.h)
57 AC_CHECK_HEADERS(netinet/in.h netinet/in6.h arpa/inet.h)
59 # Checks for typedefs, structures, and compiler characteristics.
60 AC_C_CONST
61 AC_TYPE_SIZE_T
62 AC_TYPE_UID_T
63 AC_TYPE_SIGNAL
64 AC_HEADER_TIME
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 # Check for PAM
80 AC_ARG_ENABLE(pam,
81   AC_HELP_STRING([--disable-pam], [Don't use PAM even if available]))
82 if test "$enable_pam" != "no"; then
83         AC_CHECK_HEADERS(security/pam_appl.h)
84         AC_CHECK_HEADERS(security/pam_modules.h, [], [],
85         [
86 #if HAVE_SECURITY_PAM_APPL_H
87 #include <security/pam_appl.h>
88 #endif
90   AC_CHECK_HEADERS(security/_pam_macros.h)
91   enable_pam=$ac_cv_header_security_pam_modules_h
93 if test "$enable_pam" != "no"; then
94         PAM_SHISHI=pam_shishi
95 else
96         AC_MSG_WARN([[The Shishi PAM module will not be built.]])
98 AC_SUBST(PAM_SHISHI)
99 AC_MSG_CHECKING([if PAM should be used])
100 AC_MSG_RESULT($enable_pam)
102 # Check for IPv6
103 AC_ARG_ENABLE(ipv6,
104   AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
105 if test "$enable_ipv6" != "no"; then
106   enable_ipv6=yes
107   AC_CHECK_DECLS([AF_INET6, IN6ADDR_ANY_INIT],,enable_ipv6=no,[
108   #ifdef HAVE_SYS_TYPES_H
109   #include <sys/types.h>
110   #endif
111   #ifdef HAVE_SYS_SOCKET_H
112   #include <sys/socket.h>
113   #endif
114   #ifdef HAVE_NETINET_IN_H
115   #include <netinet/in.h>
116   #endif
117   #ifdef HAVE_NETINET_IN6_H
118   #include <netinet/in6.h>
119   #endif
120   ])
121   AC_CHECK_TYPE(struct sockaddr_in6,,enable_ipv6=no,[
122   #ifdef HAVE_SYS_TYPES_H
123   #include <sys/types.h>
124   #endif
125   #ifdef HAVE_SYS_SOCKET_H
126   #include <sys/socket.h>
127   #endif
128   #ifdef HAVE_NETINET_IN_H
129   #include <netinet/in.h>
130   #endif
131   #ifdef HAVE_NETINET_IN6_H
132   #include <netinet/in6.h>
133   #endif
134   ])
136 if test "$enable_ipv6" != "no"; then
137   AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
138 else
139   AC_MSG_WARN([[IPv6 support is disabled.]])
141 AC_MSG_CHECKING([if IPv6 should be used])
142 AC_MSG_RESULT($enable_ipv6)
144 # Test if the libc includes a good enough argp.
145 AC_ARG_WITH(system-argp,
146   AC_HELP_STRING([--without-system-argp], [Don't use the system's argp]))
147 if test "$with_system_argp" != "no" ; then
148   AC_LIB_ARGP(,with_system_argp=no)
150 if test "$with_system_argp" = "no" ; then
151   ARGP_LIBS="\$(top_builddir)/argp/libargp.a"
152   ARGP_CFLAGS="-I\$(top_srcdir)/argp"
153   ARGP=argp
155 AC_SUBST(ARGP)
156 AC_SUBST(ARGP_LIBS)
157 AC_SUBST(ARGP_CFLAGS)
158 AC_CONFIG_SUBDIRS(argp)
160 # Check gdbm
161 #AC_ARG_WITH(system-gdbm,
162 #  AC_HELP_STRING([--without-system-gdbm], [Don't use the system's gdbm]))
163 #if test "$with_system_gdbm" != "no" ; then
164 #  AC_CHECK_LIB(gdbm, gdbm_open,,with_system_gdbm=no)
166 #LIBGDBM=""
167 #if test "$with_system_gdbm" = "no" ; then
168 #  LIBGDBM="\$(top_builddir)/gdbm/libgdbm.a"
169 #  CFLAGS="$CFLAGS -I\$(top_srcdir)/gdbm"
170 #  GDBM=gdbm
171 #  AC_SUBST(GDBM)
173 #AC_SUBST(LIBGDBM)
175 # Check for idn
176 AC_ARG_WITH(system-idn,
177   AC_HELP_STRING([--without-system-idn],
178                 [don't use the system's libidn]))
179 if test "$with_system_idn" != "no" ; then
180         PKG_CHECK_MODULES(LIBIDN, libidn >= 0.1.0,
181                 with_system_idn=yes,
182                 with_system_idn=no)
184 if test "$with_system_idn" = "no"; then
185         AC_MSG_WARN([[
187 The system's libidn 0.1.0 or later not used.  Using copy distributed
188 with Shishi instead.  See <http://www.gnu.org/software/libidn/>.
191         LIBIDN_CFLAGS="-I\$(top_srcdir)/libstringprep"
192         LIBIDN_LIBS="\$(top_builddir)/libstringprep/libidn.la"
193         LIBIDN=libstringprep
195 AC_SUBST(LIBIDN_CFLAGS)
196 AC_SUBST(LIBIDN_LIBS)
197 AC_SUBST(LIBIDN)
198 AC_MSG_CHECKING([if system's libidn should be used])
199 AC_MSG_RESULT($with_system_idn)
200 AC_CONFIG_SUBDIRS(libstringprep)
202 # Check for libtasn1
203 AC_ARG_WITH(system-libtasn1,
204   AC_HELP_STRING([--without-system-libtasn1],
205                 [don't use the system's libtasn1]))
206 if test "$with_system_libtasn1" != "no" ; then
207         AC_CHECK_LIB(tasn1, asn1_read_tag, [
208                 LIBTASN1_LIBS="-ltasn1"
209                 LIBTASN1_CFLAGS=""
210                 with_system_libtasn1=yes
211         ], [
212                 with_system_libtasn1=no
213         ])
215 if test "$with_system_libtasn1" = "no"; then
216         AC_MSG_WARN([[
218 The system's libtasn1 0.2.0 or later not used.  Using copy distributed
219 with Shishi instead.  See <http://www.gnu.org/software/gnutls/>.
222         LIBTASN1_CFLAGS="-I\$(top_srcdir)/asn1/lib"
223         LIBTASN1_LIBS="\$(top_builddir)/asn1/lib/libtasn1.la"
224         ASN1=asn1
226 AC_SUBST(LIBTASN1_CFLAGS)
227 AC_SUBST(LIBTASN1_LIBS)
228 AC_SUBST(ASN1)
229 AC_MSG_CHECKING([if system's libtasn1 should be used])
230 AC_MSG_RESULT($with_system_libtasn1)
231 AC_CONFIG_SUBDIRS(asn1)
233 # Check for libgcrypt
234 AC_ARG_WITH(system-libgcrypt,
235   AC_HELP_STRING([--without-system-libgcrypt],
236                 [don't use the system's libgcrypt]))
237 if test "$with_system_libgcrypt" != "no" ; then
238         AM_PATH_LIBGCRYPT(1.1.13, [
239                 with_system_libgcrypt=yes
240         ], [
241                 with_system_libgcrypt=no
242         ])
244 if test "$with_system_libgcrypt" = "no"; then
245         AC_MSG_WARN([[
247 The system's libgcrypt 1.1.13 or later not used.  Using copy distributed
248 with shishi instead. See <ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/>.
251         LIBGCRYPT_CFLAGS="-I\$(top_srcdir)/crypto/src"
252         LIBGCRYPT_LIBS="\$(top_builddir)/crypto/src/libgcrypt.la"
253         CRYPTO=crypto
255 AC_SUBST(LIBGCRYPT_CFLAGS)
256 AC_SUBST(LIBGCRYPT_LIBS)
257 AC_SUBST(CRYPTO)
258 AC_MSG_CHECKING([if system's libgcrypt should be used])
259 AC_MSG_RESULT($with_system_libgcrypt)
260 AC_CONFIG_SUBDIRS(crypto)
262 # Checks for library functions.
263 AC_FUNC_STRFTIME
264 AC_CHECK_FUNCS(signal select ngettext gethostbyname)
265 AC_REPLACE_FUNCS(setenv unsetenv strdup memmove memset strcasecmp \
266                 strerror gethostname)
268 # Configure extra tools
269 enable_ftpd=no; export enable_ftpd 
270 enable_inetd=no; export enable_inetd 
271 enable_rexecd=no; export enable_rexecd 
272 enable_rlogind=no; export enable_rlogind 
273 enable_rshd=no; export enable_rshd 
274 enable_syslogd=no; export enable_syslogd 
275 enable_talkd=no; export enable_talkd 
276 enable_telnetd=yes; export enable_telnetd 
277 enable_tftpd=no; export enable_tftpd 
278 enable_uucpd=no; export enable_uucpd 
279 enable_ftp=no; export enable_ftp 
280 enable_ping=no; export enable_ping 
281 enable_rcp=no; export enable_rcp 
282 enable_rlogin=no; export enable_rlogin 
283 enable_rsh=yes; export enable_rsh 
284 enable_logger=no; export enable_logger 
285 enable_talk=no; export enable_talk 
286 enable_telnet=yes; export enable_telnet 
287 enable_tftp=no; export enable_tftp 
288 enable_whois=no; export enable_whois 
289 enable_ifconfig=no; export enable_ifconfig 
290 enable_authentication=yes; export enable_authentication
291 enable_encryption=yes; export enable_encryption
292 with_shishi=yes; export with_shishi
293 AC_CONFIG_SUBDIRS(extra/inetutils)
295 # Check for gtk-doc.
296 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
297 if test "x$with_html_dir" = "x" ; then
298   HTML_DIR='${datadir}/gtk-doc/html'
299 else
300   HTML_DIR=$with_html_dir
302 AC_SUBST(HTML_DIR)
303 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
304 gtk_doc_min_version=0.6
305 if $GTKDOC ; then 
306     gtk_doc_version=`gtkdoc-mkdb --version`
307     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
308     if perl <<EOF ; then
309       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
310             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
312       AC_MSG_RESULT(yes)
313    else
314       AC_MSG_RESULT(no)
315       GTKDOC=false
316    fi
319 # Let people disable the gtk-doc stuff.
320 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
321 if test x$enable_gtk_doc = xauto ; then
322   if test x$GTKDOC = xtrue ; then
323     enable_gtk_doc=yes
324   else
325     enable_gtk_doc=no 
326   fi
328 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
330 AC_CONFIG_FILES(Makefile intl/Makefile po/Makefile.in m4/Makefile \
331         lib/Makefile lib/shishi.h src/Makefile tests/Makefile doc/Makefile \
332         doc/reference/Makefile extra/Makefile extra/pam_shishi/Makefile \
333         shishi.pc shishi.conf shishi.skel)
335 # We are done
336 AC_OUTPUT