Build gl/m4/Makefile.
[shishi.git] / configure.ac
blob1955483c983fb2d007738bce0197bdcad0d7e027
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([stdlib.h memory.h string.h strings.h sys/socket.h unistd.h])
42 AC_CHECK_HEADERS(getopt.h unistd.h strings.h netdb.h time.h sys/poll.h \
43         sys/time.h sys/types.h sys/select.h sys/socket.h sys/stat.h stdint.h \
44         termios.h signal.h pwd.h errno.h syslog.h)
45 AC_CHECK_HEADERS(netinet/in.h netinet/in6.h arpa/inet.h)
47 # Checks for programs.
48 AC_PROG_LIBTOOL
49 AM_GNU_GETTEXT(use-libtool, need-ngettext)
50 AM_GNU_GETTEXT_VERSION(0.12.1)
51 AM_MISSING_PROG(PERL, perl, $missing_dir)
52 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
53 AM_MISSING_PROG(TEXI2PDF, texi2pdf, $missing_dir)
54 AM_MISSING_PROG(DOCBOOK2TXT, docbook2txt, $missing_dir)
55 AM_MISSING_PROG(DOCBOOK2HTML, docbook2html, $missing_dir)
56 AM_MISSING_PROG(DOCBOOK2PS, docbook2ps, $missing_dir)
57 AM_MISSING_PROG(DOCBOOK2PDF, docbook2pdf, $missing_dir)
58 AM_MISSING_PROG(ASN1PARSER, asn1Parser, $missing_dir)
59 AM_WITH_DMALLOC
61 # Checks for typedefs, structures, and compiler characteristics.
62 AC_C_CONST
63 AC_TYPE_SIZE_T
64 AC_TYPE_UID_T
65 AC_TYPE_SIGNAL
66 AC_HEADER_TIME
67 AC_CHECK_DECLS(h_errno)
68 AC_CHECK_TYPE([socklen_t],, [AC_DEFINE([socklen_t], [size_t],
69               [Define to `size_t' if `socklen_t' is missing.])], [
70 #ifdef HAVE_SYS_TYPES_H
71 #include <sys/types.h>
72 #endif
73 #ifdef HAVE_SYS_SOCKET_H
74 #include <sys/socket.h>
75 #endif
76 #ifdef HAVE_NETDB_H
77 #include <netdb.h>
78 #endif
81 # Check for PAM
82 AC_ARG_ENABLE(pam,
83   AC_HELP_STRING([--disable-pam], [Don't use PAM even if available]))
84 if test "$enable_pam" != "no"; then
85         AC_CHECK_HEADERS(security/pam_appl.h)
86         AC_CHECK_HEADERS(security/pam_modules.h, [], [],
87         [
88 #if HAVE_SECURITY_PAM_APPL_H
89 #include <security/pam_appl.h>
90 #endif
92   AC_CHECK_HEADERS(security/_pam_macros.h)
93   enable_pam=$ac_cv_header_security_pam_modules_h
95 if test "$enable_pam" != "no"; then
96         PAM_SHISHI=pam_shishi
97 else
98         AC_MSG_WARN([[The Shishi PAM module will not be built.]])
100 AC_SUBST(PAM_SHISHI)
101 AC_MSG_CHECKING([if PAM should be used])
102 AC_MSG_RESULT($enable_pam)
104 # Check for IPv6
105 AC_ARG_ENABLE(ipv6,
106   AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
107 if test "$enable_ipv6" != "no"; then
108   enable_ipv6=yes
109   AC_CHECK_DECLS([AF_INET6, IN6ADDR_ANY_INIT],,enable_ipv6=no,[
110   #ifdef HAVE_SYS_TYPES_H
111   #include <sys/types.h>
112   #endif
113   #ifdef HAVE_SYS_SOCKET_H
114   #include <sys/socket.h>
115   #endif
116   #ifdef HAVE_NETINET_IN_H
117   #include <netinet/in.h>
118   #endif
119   #ifdef HAVE_NETINET_IN6_H
120   #include <netinet/in6.h>
121   #endif
122   ])
123   AC_CHECK_TYPE(struct sockaddr_in6,,enable_ipv6=no,[
124   #ifdef HAVE_SYS_TYPES_H
125   #include <sys/types.h>
126   #endif
127   #ifdef HAVE_SYS_SOCKET_H
128   #include <sys/socket.h>
129   #endif
130   #ifdef HAVE_NETINET_IN_H
131   #include <netinet/in.h>
132   #endif
133   #ifdef HAVE_NETINET_IN6_H
134   #include <netinet/in6.h>
135   #endif
136   ])
138 if test "$enable_ipv6" != "no"; then
139   AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
140 else
141   AC_MSG_WARN([[IPv6 support is disabled.]])
143 AC_MSG_CHECKING([if IPv6 should be used])
144 AC_MSG_RESULT($enable_ipv6)
146 # Check gdbm
147 #AC_ARG_WITH(system-gdbm,
148 #  AC_HELP_STRING([--without-system-gdbm], [Don't use the system's gdbm]))
149 #if test "$with_system_gdbm" != "no" ; then
150 #  AC_CHECK_LIB(gdbm, gdbm_open,,with_system_gdbm=no)
152 #LIBGDBM=""
153 #if test "$with_system_gdbm" = "no" ; then
154 #  LIBGDBM="\$(top_builddir)/gdbm/libgdbm.a"
155 #  CFLAGS="$CFLAGS -I\$(top_srcdir)/gdbm"
156 #  GDBM=gdbm
157 #  AC_SUBST(GDBM)
159 #AC_SUBST(LIBGDBM)
161 # Check for idn
162 AC_ARG_WITH(system-idn,
163   AC_HELP_STRING([--without-system-idn],
164                 [don't use the system's libidn]))
165 if test "$with_system_idn" != "no" ; then
166         PKG_CHECK_MODULES(LIBIDN, libidn >= 0.1.0,
167                 with_system_idn=yes,
168                 with_system_idn=no)
170 if test "$with_system_idn" = "no"; then
171         AC_MSG_WARN([[
173 The system's libidn 0.1.0 or later not used.  Using copy distributed
174 with Shishi instead.  See <http://www.gnu.org/software/libidn/>.
176         LIBIDN_CFLAGS="-I\$(top_srcdir)/libstringprep"
177         LIBIDN_LIBS="\$(top_builddir)/libstringprep/libidn.la"
178         LIBIDN=libstringprep
180 AC_SUBST(LIBIDN_CFLAGS)
181 AC_SUBST(LIBIDN_LIBS)
182 AC_SUBST(LIBIDN)
183 AC_MSG_CHECKING([if system's libidn should be used])
184 AC_MSG_RESULT($with_system_idn)
185 AC_CONFIG_SUBDIRS(libstringprep)
187 # Check for libtasn1
188 AC_ARG_WITH(system-libtasn1,
189   AC_HELP_STRING([--without-system-libtasn1],
190                 [don't use the system's libtasn1]))
191 if test "$with_system_libtasn1" != "no" ; then
192         AC_CHECK_LIB(tasn1, asn1_read_tag, [
193                 LIBTASN1_LIBS="-ltasn1"
194                 LIBTASN1_CFLAGS=""
195                 with_system_libtasn1=yes
196         ], [
197                 with_system_libtasn1=no
198         ])
200 if test "$with_system_libtasn1" = "no"; then
201         AC_MSG_WARN([[
203 The system's libtasn1 0.2.0 or later not used.  Using copy distributed
204 with Shishi instead.  See <http://www.gnu.org/software/gnutls/>.
206         LIBTASN1_CFLAGS="-I\$(top_srcdir)/asn1/lib"
207         LIBTASN1_LIBS="\$(top_builddir)/asn1/lib/libtasn1.la"
208         ASN1=asn1
210 AC_SUBST(LIBTASN1_CFLAGS)
211 AC_SUBST(LIBTASN1_LIBS)
212 AC_SUBST(ASN1)
213 AC_MSG_CHECKING([if system's libtasn1 should be used])
214 AC_MSG_RESULT($with_system_libtasn1)
215 AC_CONFIG_SUBDIRS(asn1)
217 # Check for libgcrypt
218 AC_ARG_WITH(system-libgcrypt,
219   AC_HELP_STRING([--without-system-libgcrypt],
220                 [don't use the system's libgcrypt]))
221 if test "$with_system_libgcrypt" != "no" ; then
222         AM_PATH_LIBGCRYPT(1.1.13, [
223                 with_system_libgcrypt=yes
224         ], [
225                 with_system_libgcrypt=no
226         ])
228 if test "$with_system_libgcrypt" = "no"; then
229   AC_MSG_WARN([[
231 The system's libgcrypt 1.1.13 or later not used.  Using copy distributed
232 with shishi instead. See <ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/>.
234   LIBGCRYPT_CFLAGS="-I\$(top_srcdir)/crypto/src -I\$(top_srcdir)/errcrypto/src"
235   LIBGCRYPT_LIBS="\$(top_builddir)/crypto/src/libgcrypt.la"
236   CRYPTO="errcrypto crypto"
238 AC_SUBST(LIBGCRYPT_CFLAGS)
239 AC_SUBST(LIBGCRYPT_LIBS)
240 AC_SUBST(CRYPTO)
241 AC_MSG_CHECKING([if system's libgcrypt should be used])
242 AC_MSG_RESULT($with_system_libgcrypt)
243 GPG_ERROR_CONFIG=`pwd`/errcrypto/src/gpg-error-config; export GPG_ERROR_CONFIG
244 AC_CONFIG_SUBDIRS(errcrypto crypto)
246 # For gnulib stuff in gl/.
247 gl_FUNC_ALLOCA
248 gl_ARGP
249 gl_ERROR
250 gl_FUNC_GETHOSTNAME
251 gl_GETOPT
252 jm_FUNC_MALLOC
253 gl_FUNC_MEMMOVE
254 gl_FUNC_MEMSET
255 jm_FUNC_REALLOC
256 gt_FUNC_SETENV
257 gl_STRCASE
258 gl_FUNC_STRCHRNUL
259 gl_FUNC_STRDUP
260 gl_FUNC_STRERROR
261 gl_SYSEXITS
262 jm_FUNC_GLIBC_UNLOCKED_IO
263 gl_FUNC_VASNPRINTF
264 gl_FUNC_VASPRINTF
265 gl_XALLOC
267 # Checks for library functions.
268 AC_FUNC_STRFTIME
269 AC_CHECK_FUNCS(signal select ngettext gethostbyname)
271 # Configure extra tools
272 enable_ftpd=no; export enable_ftpd 
273 enable_inetd=no; export enable_inetd 
274 enable_rexecd=no; export enable_rexecd 
275 enable_rlogind=no; export enable_rlogind 
276 enable_rshd=no; export enable_rshd 
277 enable_syslogd=no; export enable_syslogd 
278 enable_talkd=no; export enable_talkd 
279 enable_telnetd=yes; export enable_telnetd 
280 enable_tftpd=no; export enable_tftpd 
281 enable_uucpd=no; export enable_uucpd 
282 enable_ftp=no; export enable_ftp 
283 enable_ping=no; export enable_ping 
284 enable_rcp=no; export enable_rcp 
285 enable_rlogin=no; export enable_rlogin 
286 enable_rsh=yes; export enable_rsh 
287 enable_logger=no; export enable_logger 
288 enable_talk=no; export enable_talk 
289 enable_telnet=yes; export enable_telnet 
290 enable_tftp=no; export enable_tftp 
291 enable_whois=no; export enable_whois 
292 enable_ifconfig=no; export enable_ifconfig 
293 enable_authentication=yes; export enable_authentication
294 enable_encryption=yes; export enable_encryption
295 with_shishi=yes; export with_shishi
296 AC_CONFIG_SUBDIRS(extra/inetutils)
298 # Check for gtk-doc.
299 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
300 if test "x$with_html_dir" = "x" ; then
301   HTML_DIR='${datadir}/gtk-doc/html'
302 else
303   HTML_DIR=$with_html_dir
305 AC_SUBST(HTML_DIR)
306 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
307 gtk_doc_min_version=0.6
308 if $GTKDOC ; then 
309     gtk_doc_version=`gtkdoc-mkdb --version`
310     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
311     if perl <<EOF ; then
312       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
313             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
315       AC_MSG_RESULT(yes)
316    else
317       AC_MSG_RESULT(no)
318       GTKDOC=false
319    fi
322 # Let people disable the gtk-doc stuff.
323 AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
324 if test x$enable_gtk_doc = xauto ; then
325   if test x$GTKDOC = xtrue ; then
326     enable_gtk_doc=yes
327   else
328     enable_gtk_doc=no 
329   fi
331 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
333 AC_CONFIG_FILES(Makefile intl/Makefile po/Makefile.in m4/Makefile \
334         lib/Makefile lib/shishi.h src/Makefile tests/Makefile doc/Makefile \
335         doc/reference/Makefile extra/Makefile extra/pam_shishi/Makefile \
336         gl/Makefile gl/m4/Makefile shishi.pc shishi.conf shishi.skel)
338 # We are done
339 AC_OUTPUT