1 # Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002, 2003, 2004, 2005, 2006 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 the Free
18 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 AC_INIT([shishi], [0.0.31], [bug-shishi@josefsson.org])
23 # Library code modified: REVISION++
24 # Interfaces changed/added/removed: CURRENT++ REVISION=0
25 # Interfaces added: AGE++
26 # Interfaces removed: AGE=0
27 AC_SUBST(LT_CURRENT, 0)
28 AC_SUBST(LT_REVISION, 31)
32 AM_INIT_AUTOMAKE([1.9 gnits])
33 AC_CONFIG_HEADERS(config.h)
36 # Checks for header files.
40 AC_CHECK_HEADERS(sys/poll.h sys/time.h \
41 netdb.h time.h termios.h signal.h pwd.h errno.h syslog.h \
42 locale.h resolv.h fcntl.h \
43 arpa/nameser.h arpa/inet.h netinet/in.h netinet/in6.h)
45 # Checks for programs.
48 AM_GNU_GETTEXT(external, need-ngettext)
49 AM_GNU_GETTEXT_VERSION(0.14.1)
50 AM_MISSING_PROG(PERL, perl, $missing_dir)
51 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
52 AM_MISSING_PROG(ASN1PARSER, asn1Parser, $missing_dir)
53 AM_MISSING_PROG(GENGETOPT, gengetopt, $missing_dir)
54 AM_MISSING_PROG(DIA, dia, $missing_dir)
56 # Checks for typedefs, structures, and compiler characteristics.
60 AC_CHECK_DECLS(h_errno)
63 AC_CHECK_SIZEOF(unsigned long int, 4)
64 AC_CHECK_SIZEOF(unsigned int, 4)
66 # For gnulib stuff in gl/.
68 AC_DEFINE(OK_TO_USE_1S_CLOCK, 1, [Define to 1 to make gettime work.])
71 # Checks for library functions.
72 AC_CHECK_FUNCS(signal select ngettext gethostbyname)
73 AC_CHECK_LIB(resolv, res_query,, AC_MSG_WARN([[no libresolv, SRV RRs not used]]))
74 AC_SEARCH_LIBS(socket, socket)
75 AC_SEARCH_LIBS(gethostbyname, nsl)
76 AC_SEARCH_LIBS(syslog, syslog)
80 AC_HELP_STRING([--disable-pam], [Don't use PAM even if available]))
81 if test "$enable_pam" != "no"; then
82 AC_CHECK_HEADERS(security/pam_appl.h)
83 AC_CHECK_HEADERS(security/pam_modules.h, [], [],
85 #if HAVE_SECURITY_PAM_APPL_H
86 #include <security/pam_appl.h>
89 AC_CHECK_HEADERS(security/_pam_macros.h)
90 enable_pam=$ac_cv_header_security_pam_modules_h
92 if test "$enable_pam" != "no"; then
95 AC_MSG_WARN([[The Shishi PAM module will not be built.]])
98 AC_MSG_CHECKING([if PAM should be used])
99 AC_MSG_RESULT($enable_pam)
101 AC_SUBST(PAMDIR, "\$(exec_prefix)/lib/security")
103 AC_HELP_STRING([--with-pam-dir=DIR],
104 [Where to install PAM module [[PREFIX/lib/security]]]),
105 [case "${withval}" in
106 /*) PAMDIR="${withval}";;
107 ./*|../*) AC_MSG_ERROR(Bad value for --with-pam-dir);;
108 *) PAMDIR="\$(exec_prefix)/lib/${withval}";;
110 AC_MSG_NOTICE([PAM installation path $PAMDIR])
114 AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
115 if test "$enable_ipv6" != "no"; then
117 enable_ipv6=$gl_cv_socket_ipv6
119 if test "$enable_ipv6" != "no"; then
120 AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
122 AC_MSG_WARN([[IPv6 support is disabled.]])
124 AC_MSG_CHECKING([if IPv6 should be used])
125 AC_MSG_RESULT($enable_ipv6)
128 AC_ARG_WITH(stringprep,
129 AC_HELP_STRING([--without-stringprep],
130 [don't use libidn for string processing even if available]),
131 stringprep=$withval, stringprep=yes)
132 if test "$stringprep" != "no"; then
133 AC_LIB_HAVE_LINKFLAGS(idn,, [#include <stringprep.h>],
134 [stringprep_check_version (0);])
136 if test "$ac_cv_libidn" != yes; then
138 AC_MSG_WARN([Libidn not found. String process disabled.])
140 AC_MSG_CHECKING([if String processing support via Libidn should be built])
141 AC_MSG_RESULT($stringprep)
144 AC_ARG_WITH(system-asn1,
145 AC_HELP_STRING([--with-system-asn1], [Use the system's libtasn1]),
146 system_asn1=$withval, system_asn1=yes)
147 if test "$system_asn1" != "no"; then
148 AC_LIB_HAVE_LINKFLAGS(tasn1,, [#include <libtasn1.h>],
149 [asn1_find_node (0, 0);])
151 if test "$ac_cv_libtasn1" = "yes"; then
155 LTLIBTASN1="\$(top_builddir)/asn1/libminitasn1.la"
156 LIBTASN1_CFLAGS="-I\$(top_srcdir)/asn1"
157 AC_SUBST(LIBTASN1_CFLAGS)
158 AC_MSG_WARN([Libtasn1 >= 0.3.1 not found. Using included one.])
160 AC_MSG_CHECKING([whether to use the system's libtasn1])
161 AC_MSG_RESULT($system_asn1)
162 AM_CONDITIONAL(ASN1, test "$system_asn1" = "no")
165 AC_ARG_ENABLE(starttls,
166 AC_HELP_STRING([--disable-starttls], [disable non-standard STARTTLS]),
167 starttls=$enableval, starttls=yes)
168 if test "$starttls" != "no"; then
169 AC_LIB_HAVE_LINKFLAGS(gnutls,, [#include <gnutls/gnutls.h>],
170 [gnutls_check_version (0);])
171 if test "$ac_cv_libgnutls" != yes; then
173 AC_MSG_WARN([GnuTLS not found. STARTTLS disabled.])
178 AC_MSG_CHECKING([if non-standard STARTTLS support should be enabled])
179 AC_MSG_RESULT($starttls)
180 if test "$starttls" != "no"; then
181 AC_DEFINE(USE_STARTTLS, 1, [Define to 1 if you want STARTTLS.])
183 AM_CONDITIONAL(STARTTLS, test "$starttls" != "no")
188 # For some systems we know that we have ld_version scripts.
189 # Use it then as default.
190 have_ld_version_script=no
193 have_ld_version_script=yes
196 have_ld_version_script=yes
199 AC_ARG_ENABLE([ld-version-script],
200 AC_HELP_STRING([--enable-ld-version-script],
201 [enable/disable use of linker version script.
202 (default is system dependent)]),
203 [have_ld_version_script=$enableval],
205 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
207 # Let people enable/disable various encryption/checksum types.
208 AC_ARG_ENABLE(des, AC_HELP_STRING([--disable-des],
209 [disable DES related encryption/checksum types]),
210 enable_des=$enableval, enable_des=yes)
211 AM_CONDITIONAL(DES, test "$enable_des" != "no")
212 if test "$enable_des" != "no"; then
213 AC_DEFINE(WITH_DES, 1, [Define to 1 if you want DES {e,cksum}types.])
215 AC_MSG_CHECKING([if DES related encryption/checksum types should be used])
216 AC_MSG_RESULT($enable_des)
218 AC_ARG_ENABLE(3des, AC_HELP_STRING([--disable-3des],
219 [disable 3DES encryption/checksum type]),
220 enable_3des=$enableval, enable_3des=yes)
221 AM_CONDITIONAL(DES3, test "$enable_3des" != "no")
222 if test "$enable_3des" != "no"; then
223 AC_DEFINE(WITH_3DES, 1, [Define to 1 if you want 3DES {e,cksum}type.])
225 AC_MSG_CHECKING([if 3DES encryption/checksum type should be used])
226 AC_MSG_RESULT($enable_3des)
228 AC_ARG_ENABLE(aes, AC_HELP_STRING([--disable-aes],
229 [disable AES encryption/checksum types]),
230 enable_aes=$enableval, enable_aes=yes)
231 AM_CONDITIONAL(AES, test "$enable_aes" != "no")
232 if test "$enable_aes" != "no"; then
233 AC_DEFINE(WITH_AES, 1, [Define to 1 if you want AES {e,cksum}types.])
235 AC_MSG_CHECKING([if AES encryption/checksum types should be used])
236 AC_MSG_RESULT($enable_aes)
238 AC_ARG_ENABLE(md, AC_HELP_STRING([--disable-md],
239 [disable unkeyed MD4/MD5 checksum types]),
240 enable_md=$enableval, enable_md=yes)
241 AM_CONDITIONAL(MD, test "$enable_md" != "no")
242 if test "$enable_md" != "no"; then
243 AC_DEFINE(WITH_MD, 1, [Define to 1 if you want MD cksumtypes.])
245 AC_MSG_CHECKING([if unkeyed MD checksum types should be used])
246 AC_MSG_RESULT($enable_md)
248 AC_ARG_ENABLE(null, AC_HELP_STRING([--disable-null],
249 [disable dummy NULL encryption/checksum type]),
250 enable_null=$enableval, enable_null=yes)
251 AM_CONDITIONAL(NULL, test "$enable_null" != "no")
252 if test "$enable_null" != "no"; then
253 AC_DEFINE(WITH_NULL, 1, [Define to 1 if you want NULL {e,cksum}type.])
255 AC_MSG_CHECKING([if dummy NULL encryption/checksum type should be used])
256 AC_MSG_RESULT($enable_null)
258 AC_ARG_ENABLE(arcfour, AC_HELP_STRING([--disable-arcfour],
259 [disable ARCFOUR encryption/checksum type]),
260 enable_arcfour=$enableval, enable_arcfour=yes)
261 AM_CONDITIONAL(ARCFOUR, test "$enable_arcfour" != "no")
262 if test "$enable_arcfour" != "no"; then
263 AC_DEFINE(WITH_ARCFOUR, 1,
264 [Define to 1 if you want ARCFOUR {e,cksum}type.])
266 AC_MSG_CHECKING([if ARCFOUR encryption/checksum type should be used])
267 AC_MSG_RESULT($enable_arcfour)
269 AC_SUBST(CONFDIR, "\$(sysconfdir)/\$(PACKAGE)")
270 AC_ARG_WITH(conf-dir,
271 AC_HELP_STRING([--with-conf-dir=DIR],
272 [store configuration in DIR [[PREFIX/etc/shishi]]]),
273 [case "${withval}" in
274 /*) CONFDIR="${withval}";;
275 ./*|../*) AC_MSG_ERROR(Bad value for --with-conf-dir);;
276 *) CONFDIR="\$(sysconfdir)/${withval}";;
278 AC_MSG_NOTICE([configuration files will be stored in $CONFDIR])
280 AC_SUBST(SKELDIR, "\$(sysconfdir)/\$(PACKAGE)")
281 AC_ARG_WITH(skel-dir,
282 AC_HELP_STRING([--with-skel-dir=DIR],
283 [store template cfg in DIR [[PREFIX/etc/shishi]]]),
284 [case "${withval}" in
285 /*) SKELDIR="${withval}";;
286 ./*|../*) AC_MSG_ERROR(Bad value for --with-skel-dir);;
287 *) SKELDIR="\$(sysconfdir)/${withval}";;
289 AC_MSG_NOTICE([user template configuration file in $SKELDIR])
291 AC_SUBST(KEYDIR, "\$(sysconfdir)/\$(PACKAGE)")
293 AC_HELP_STRING([--with-key-dir=DIR],
294 [store host keys in DIR [[PREFIX/etc/shishi]]]),
295 [case "${withval}" in
296 /*) KEYDIR="${withval}";;
297 ./*|../*) AC_MSG_ERROR(Bad value for --with-key-dir);;
298 *) KEYDIR="\$(sysconfdir)/${withval}";;
300 AC_MSG_NOTICE([host keys will be stored in $KEYDIR])
302 AC_SUBST(DBDIR, "\$(localstatedir)/\$(PACKAGE)")
304 AC_HELP_STRING([--with-db-dir=DIR],
305 [Shisa database in DIR [[PREFIX/var/shishi]])]),
306 [case "${withval}" in
307 /*) DBDIR="${withval}";;
308 ./*|../*) AC_MSG_ERROR(Bad value for --with-db-dir);;
309 *) DBDIR="\$(localstatedir)/${withval}";;
311 AC_MSG_NOTICE([user database root path $DBDIR])
313 AC_DEFINE([xalloc_die], [shishi_xalloc_die], [Fix namespace of xalloc_die.])
315 # Run self-tests under valgrind?
316 if test "$cross_compiling" = no; then
317 AC_CHECK_PROGS(VALGRIND, valgrind)
319 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
320 opt_valgrind_tests=yes
322 opt_valgrind_tests=no
325 AC_MSG_CHECKING([whether self tests are run under valgrind])
326 AC_ARG_ENABLE(valgrind-tests,
327 AS_HELP_STRING([--enable-valgrind-tests],
328 [run self tests under valgrind]),
329 opt_valgrind_tests=$enableval)
330 AC_MSG_RESULT($opt_valgrind_tests)
332 AC_CONFIG_FILES(Makefile po/Makefile.in \
333 asn1/Makefile examples/Makefile \
334 lib/Makefile lib/shishi.h db/Makefile src/Makefile tests/Makefile \
335 doc/Makefile doc/reference/Makefile \
336 extra/Makefile extra/pam_shishi/Makefile extra/rsh-redone/Makefile \
337 gl/Makefile shishi.pc shishi.conf shishi.skel shisa.conf)