Sync with TP.
[shishi.git] / configure.ac
blobb64fb127fea6a3e57b5e2376724cab023c309af1
1 # Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Simon Josefsson.
4 # This file is part of Shishi.
6 # Shishi is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # Shishi is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Shishi; if not, see http://www.gnu.org/licenses or write
18 # to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
19 # Floor, Boston, MA 02110-1301, USA.
21 AC_PREREQ(2.61)
22 AC_INIT([shishi], [0.0.33], [bug-shishi@josefsson.org])
23 AC_CONFIG_AUX_DIR([build-aux])
25 # Library code modified:                              REVISION++
26 # Interfaces changed/added/removed:   CURRENT++       REVISION=0
27 # Interfaces added:                             AGE++
28 # Interfaces removed:                           AGE=0
29 AC_SUBST(LT_CURRENT, 0)
30 AC_SUBST(LT_REVISION, 33)
31 AC_SUBST(LT_AGE, 0)
33 AM_INIT_AUTOMAKE([1.10])
34 AC_CONFIG_HEADERS(config.h)
35 AB_INIT
37 # Checks for header files.
38 AC_PROG_CC
39 gl_EARLY
40 AC_HEADER_STDC
41 AC_CHECK_HEADERS(sys/poll.h sys/time.h \
42         netdb.h time.h termios.h signal.h pwd.h errno.h syslog.h \
43         locale.h resolv.h fcntl.h \
44         arpa/nameser.h arpa/inet.h netinet/in.h netinet/in6.h)
46 # Checks for programs.
47 AC_LIBTOOL_WIN32_DLL
48 AC_PROG_LIBTOOL
49 AM_GNU_GETTEXT(external, need-ngettext)
50 AM_GNU_GETTEXT_VERSION(0.16.1)
51 AM_MISSING_PROG(PERL, perl, $missing_dir)
52 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
53 AM_MISSING_PROG(ASN1PARSER, asn1Parser, $missing_dir)
54 AM_MISSING_PROG(GENGETOPT, gengetopt, $missing_dir)
55 AM_MISSING_PROG(DIA, dia, $missing_dir)
57 # Checks for typedefs, structures, and compiler characteristics.
58 AC_TYPE_UID_T
59 AC_TYPE_SIGNAL
60 AC_HEADER_TIME
61 AC_CHECK_DECLS(h_errno)
63 # For libtasn1
64 AC_CHECK_SIZEOF(unsigned long int, 4)
65 AC_CHECK_SIZEOF(unsigned int, 4)
67 # For gnulib stuff in gl/.
68 libgcrypt=yes
69 AC_DEFINE(OK_TO_USE_1S_CLOCK, 1, [Define to 1 to make gettime work.])
70 gl_INIT
72 # Checks for library functions.
73 AC_CHECK_FUNCS(signal select ngettext gethostbyname)
74 AC_CHECK_LIB(resolv, res_query,, AC_MSG_WARN([[no libresolv, SRV RRs not used]]))
75 AC_SEARCH_LIBS(socket, socket)
76 AC_SEARCH_LIBS(gethostbyname, nsl)
77 AC_SEARCH_LIBS(syslog, syslog)
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 AC_SUBST(PAMDIR, "\$(exec_prefix)/lib/security")
103 AC_ARG_WITH(pam-dir,
104   AC_HELP_STRING([--with-pam-dir=DIR],
105                  [Where to install PAM module [[PREFIX/lib/security]]]),
106             [case "${withval}" in
107             /*) PAMDIR="${withval}";;
108             ./*|../*) AC_MSG_ERROR(Bad value for --with-pam-dir);;
109             *)  PAMDIR="\$(exec_prefix)/lib/${withval}";;
110             esac])
111 AC_MSG_NOTICE([PAM installation path $PAMDIR])
113 # Check for IPv6
114 AC_ARG_ENABLE(ipv6,
115   AC_HELP_STRING([--disable-ipv6], [Don't use IPv6 even if available]))
116 if test "$enable_ipv6" != "no"; then
117   gl_SOCKET_FAMILIES
118   enable_ipv6=$gl_cv_socket_ipv6
120 if test "$enable_ipv6" != "no"; then
121   AC_DEFINE(WITH_IPV6, 1, [Define to 1 if you want IPv6.])
122 else
123   AC_MSG_WARN([[IPv6 support is disabled.]])
125 AC_MSG_CHECKING([if IPv6 should be used])
126 AC_MSG_RESULT($enable_ipv6)
128 # Check for idn
129 AC_ARG_WITH(stringprep,
130   AC_HELP_STRING([--without-stringprep],
131                 [don't use libidn for string processing even if available]),
132         stringprep=$withval, stringprep=yes)
133 if test "$stringprep" != "no"; then
134   AC_LIB_HAVE_LINKFLAGS(idn,, [#include <stringprep.h>],
135     [stringprep_check_version (0);])
137 if test "$ac_cv_libidn" != yes; then
138   stringprep=no
139   AC_MSG_WARN([Libidn not found.  String process disabled.])
141 AC_MSG_CHECKING([if String processing support via Libidn should be built])
142 AC_MSG_RESULT($stringprep)
144 # Check for libtasn1
145 AC_ARG_WITH(system-asn1,
146         AC_HELP_STRING([--with-system-asn1], [Use the system's libtasn1]),
147         system_asn1=$withval, system_asn1=yes)
148 if test "$system_asn1" != "no"; then
149   AC_LIB_HAVE_LINKFLAGS(tasn1,, [#include <libtasn1.h>],
150     [asn1_find_node (0, 0);])
152 if test "$ac_cv_libtasn1" = "yes"; then
153   system_asn1=yes
154 else
155   system_asn1=no
156   LTLIBTASN1="\$(top_builddir)/asn1/libminitasn1.la"
157   LIBTASN1_CFLAGS="-I\$(top_srcdir)/asn1"
158   AC_SUBST(LIBTASN1_CFLAGS)
159   AC_MSG_WARN([Libtasn1 >= 0.3.1 not found. Using included one.])
161 AC_MSG_CHECKING([whether to use the system's libtasn1])
162 AC_MSG_RESULT($system_asn1)
163 AM_CONDITIONAL(ASN1, test "$system_asn1" = "no")
165 # Check for gnutls.
166 AC_ARG_ENABLE(starttls,
167         AC_HELP_STRING([--disable-starttls], [disable non-standard STARTTLS]),
168         starttls=$enableval, starttls=yes)
169 if test "$starttls" != "no"; then
170   AC_LIB_HAVE_LINKFLAGS(gnutls,, [#include <gnutls/gnutls.h>],
171     [gnutls_check_version (0);])
172   if test "$ac_cv_libgnutls" != yes; then
173     starttls=no
174     AC_MSG_WARN([GnuTLS not found.  STARTTLS disabled.])
175   else
176     starttls=yes
177   fi
179 AC_MSG_CHECKING([if non-standard STARTTLS support should be enabled])
180 AC_MSG_RESULT($starttls)
181 if test "$starttls" != "no"; then
182         AC_DEFINE(USE_STARTTLS, 1, [Define to 1 if you want STARTTLS.])
184 AM_CONDITIONAL(STARTTLS, test "$starttls" != "no")
186 # Check for gtk-doc.
187 GTK_DOC_CHECK(1.1)
189 # For some systems we know that we have ld_version scripts.
190 # Use it then as default.
191 have_ld_version_script=no
192 case "${host}" in
193     *-*-linux*)
194         have_ld_version_script=yes
195         ;;
196     *-*-gnu*)
197         have_ld_version_script=yes
198         ;;
199 esac
200 AC_ARG_ENABLE([ld-version-script],
201               AC_HELP_STRING([--enable-ld-version-script],
202                              [enable/disable use of linker version script.
203                               (default is system dependent)]),
204               [have_ld_version_script=$enableval],
205               [ : ] )
206 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
208 # Let people enable/disable various encryption/checksum types.
209 AC_ARG_ENABLE(des, AC_HELP_STRING([--disable-des],
210                         [disable DES related encryption/checksum types]),
211                 enable_des=$enableval, enable_des=yes)
212 AM_CONDITIONAL(DES, test "$enable_des" != "no")
213 if test "$enable_des" != "no"; then
214         AC_DEFINE(WITH_DES, 1, [Define to 1 if you want DES {e,cksum}types.])
216 AC_MSG_CHECKING([if DES related encryption/checksum types should be used])
217 AC_MSG_RESULT($enable_des)
219 AC_ARG_ENABLE(3des, AC_HELP_STRING([--disable-3des],
220                         [disable 3DES encryption/checksum type]),
221                 enable_3des=$enableval, enable_3des=yes)
222 AM_CONDITIONAL(DES3, test "$enable_3des" != "no")
223 if test "$enable_3des" != "no"; then
224         AC_DEFINE(WITH_3DES, 1, [Define to 1 if you want 3DES {e,cksum}type.])
226 AC_MSG_CHECKING([if 3DES encryption/checksum type should be used])
227 AC_MSG_RESULT($enable_3des)
229 AC_ARG_ENABLE(aes, AC_HELP_STRING([--disable-aes],
230                         [disable AES encryption/checksum types]),
231                 enable_aes=$enableval, enable_aes=yes)
232 AM_CONDITIONAL(AES, test "$enable_aes" != "no")
233 if test "$enable_aes" != "no"; then
234         AC_DEFINE(WITH_AES, 1, [Define to 1 if you want AES {e,cksum}types.])
236 AC_MSG_CHECKING([if AES encryption/checksum types should be used])
237 AC_MSG_RESULT($enable_aes)
239 AC_ARG_ENABLE(md, AC_HELP_STRING([--disable-md],
240                         [disable unkeyed MD4/MD5 checksum types]),
241                 enable_md=$enableval, enable_md=yes)
242 AM_CONDITIONAL(MD, test "$enable_md" != "no")
243 if test "$enable_md" != "no"; then
244         AC_DEFINE(WITH_MD, 1, [Define to 1 if you want MD cksumtypes.])
246 AC_MSG_CHECKING([if unkeyed MD checksum types should be used])
247 AC_MSG_RESULT($enable_md)
249 AC_ARG_ENABLE(null, AC_HELP_STRING([--disable-null],
250                         [disable dummy NULL encryption/checksum type]),
251                 enable_null=$enableval, enable_null=yes)
252 AM_CONDITIONAL(NULL, test "$enable_null" != "no")
253 if test "$enable_null" != "no"; then
254         AC_DEFINE(WITH_NULL, 1, [Define to 1 if you want NULL {e,cksum}type.])
256 AC_MSG_CHECKING([if dummy NULL encryption/checksum type should be used])
257 AC_MSG_RESULT($enable_null)
259 AC_ARG_ENABLE(arcfour, AC_HELP_STRING([--disable-arcfour],
260                         [disable ARCFOUR encryption/checksum type]),
261                 enable_arcfour=$enableval, enable_arcfour=yes)
262 AM_CONDITIONAL(ARCFOUR, test "$enable_arcfour" != "no")
263 if test "$enable_arcfour" != "no"; then
264         AC_DEFINE(WITH_ARCFOUR, 1,
265                         [Define to 1 if you want ARCFOUR {e,cksum}type.])
267 AC_MSG_CHECKING([if ARCFOUR encryption/checksum type should be used])
268 AC_MSG_RESULT($enable_arcfour)
270 AC_SUBST(CONFDIR, "\$(sysconfdir)/\$(PACKAGE)")
271 AC_ARG_WITH(conf-dir,
272             AC_HELP_STRING([--with-conf-dir=DIR],
273                            [store configuration in DIR [[PREFIX/etc/shishi]]]),
274             [case "${withval}" in
275             /*) CONFDIR="${withval}";;
276             ./*|../*) AC_MSG_ERROR(Bad value for --with-conf-dir);;
277             *)  CONFDIR="\$(sysconfdir)/${withval}";;
278             esac])
279 AC_MSG_NOTICE([configuration files will be stored in $CONFDIR])
281 AC_SUBST(SKELDIR, "\$(sysconfdir)/\$(PACKAGE)")
282 AC_ARG_WITH(skel-dir,
283             AC_HELP_STRING([--with-skel-dir=DIR],
284                            [store template cfg in DIR [[PREFIX/etc/shishi]]]),
285             [case "${withval}" in
286             /*) SKELDIR="${withval}";;
287             ./*|../*) AC_MSG_ERROR(Bad value for --with-skel-dir);;
288             *)  SKELDIR="\$(sysconfdir)/${withval}";;
289             esac])
290 AC_MSG_NOTICE([user template configuration file in $SKELDIR])
292 AC_SUBST(KEYDIR, "\$(sysconfdir)/\$(PACKAGE)")
293 AC_ARG_WITH(key-dir,
294             AC_HELP_STRING([--with-key-dir=DIR],
295                            [store host keys in DIR [[PREFIX/etc/shishi]]]),
296             [case "${withval}" in
297             /*) KEYDIR="${withval}";;
298             ./*|../*) AC_MSG_ERROR(Bad value for --with-key-dir);;
299             *)  KEYDIR="\$(sysconfdir)/${withval}";;
300             esac])
301 AC_MSG_NOTICE([host keys will be stored in $KEYDIR])
303 AC_SUBST(DBDIR, "\$(localstatedir)/\$(PACKAGE)")
304 AC_ARG_WITH(db-dir,
305             AC_HELP_STRING([--with-db-dir=DIR],
306                            [Shisa database in DIR [[PREFIX/var/shishi]])]),
307             [case "${withval}" in
308             /*) DBDIR="${withval}";;
309             ./*|../*) AC_MSG_ERROR(Bad value for --with-db-dir);;
310             *)  DBDIR="\$(localstatedir)/${withval}";;
311             esac])
312 AC_MSG_NOTICE([user database root path $DBDIR])
314 AC_DEFINE([xalloc_die], [shishi_xalloc_die], [Fix namespace of xalloc_die.])
316 # Run self-tests under valgrind?
317 if test "$cross_compiling" = no; then
318   AC_CHECK_PROGS(VALGRIND, valgrind)
320 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
321   opt_valgrind_tests=yes
322 else
323   opt_valgrind_tests=no
324   VALGRIND=
325 fi 
326 AC_MSG_CHECKING([whether self tests are run under valgrind])
327 AC_ARG_ENABLE(valgrind-tests,
328         AS_HELP_STRING([--enable-valgrind-tests],
329                        [run self tests under valgrind]),
330   opt_valgrind_tests=$enableval)
331 AC_MSG_RESULT($opt_valgrind_tests)
333 AC_CONFIG_FILES(Makefile po/Makefile.in \
334         asn1/Makefile examples/Makefile \
335         lib/Makefile lib/shishi.h db/Makefile src/Makefile tests/Makefile \
336         doc/Makefile doc/reference/Makefile \
337         extra/Makefile extra/pam_shishi/Makefile extra/rsh-redone/Makefile \
338         gl/Makefile shishi.pc shishi.conf shishi.skel shisa.conf)
340 # We are done
341 AC_OUTPUT