1 dnl Process this file with autoconf to produce a configure script.
3 # Copyright (C) 2002, 2003, 2004, 2005, 2006 Simon Josefsson.
5 # This file is part of GNU SASL Library.
7 # GNU SASL Library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public License
9 # as published by the Free Software Foundation; either version 2.1 of
10 # the License, or (at your option) any later version.
12 # GNU SASL Library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with GNU SASL Library; if not, write to the Free
19 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 AC_INIT([libgsasl], [0.3.0], [bug-gsasl@gnu.org])
24 # Library code modified: REVISION++
25 # Interfaces changed/added/removed: CURRENT++ REVISION=0
26 # Interfaces added: AGE++
27 # Interfaces removed: AGE=0
28 AC_SUBST(LT_CURRENT, 10)
29 AC_SUBST(LT_REVISION, 1)
33 AM_INIT_AUTOMAKE([1.9 gnits])
34 AC_CONFIG_HEADERS(config.h)
36 # Checks for programs.
37 AM_GNU_GETTEXT(external)
38 AM_GNU_GETTEXT_VERSION(0.14.1)
45 AC_ARG_ENABLE(anonymous,
46 AS_HELP_STRING([--disable-anonymous], [don't use the ANONYMOUS mechanism]),
48 if test "$anonymous" != "no" ; then
50 AC_DEFINE(USE_ANONYMOUS, 1, [Define to 1 if you want ANONYMOUS.])
52 AC_MSG_CHECKING([if ANONYMOUS should be used])
53 AC_MSG_RESULT($anonymous)
54 AM_CONDITIONAL(ANONYMOUS, test x$anonymous = xyes)
57 AC_ARG_ENABLE(external,
58 AS_HELP_STRING([--disable-external], [don't use the EXTERNAL mechanism]),
60 if test "$external" != "no" ; then
62 AC_DEFINE(USE_EXTERNAL, 1, [Define to 1 if you want EXTERNAL.])
64 AC_MSG_CHECKING([if EXTERNAL should be used])
65 AC_MSG_RESULT($external)
66 AM_CONDITIONAL(EXTERNAL, test x$external = xyes)
70 AS_HELP_STRING([--disable-plain], [don't use the PLAIN mechanism]),
72 if test "$plain" != "no" ; then
74 AC_DEFINE(USE_PLAIN, 1, [Define to 1 if you want PLAIN.])
76 AC_MSG_CHECKING([if PLAIN should be used])
78 AM_CONDITIONAL(PLAIN, test x$plain = xyes)
82 AS_HELP_STRING([--disable-login], [don't use the LOGIN mechanism]),
84 if test "$login" != "no" ; then
86 AC_DEFINE(USE_LOGIN, 1, [Define to 1 if you want LOGIN.])
88 AC_MSG_CHECKING([if LOGIN should be used])
90 AM_CONDITIONAL(LOGIN, test x$login = xyes)
93 AC_ARG_ENABLE(securid,
94 AS_HELP_STRING([--disable-securid], [don't use the SECURID mechanism]),
96 if test "$securid" != "no" ; then
98 AC_DEFINE(USE_SECURID, 1, [Define to 1 if you want SECURID.])
100 AC_MSG_CHECKING([if SECURID should be used])
101 AC_MSG_RESULT($securid)
102 AM_CONDITIONAL(SECURID, test x$securid = xyes)
106 AS_HELP_STRING([--disable-ntlm], [don't use the NTLM mechanism]),
108 if test "$ntlm" != "no"; then
109 AC_LIB_HAVE_LINKFLAGS(ntlm,, [#include <ntlm.h>],
110 [buildSmbNtlmAuthRequest_noatsplit (0, 0, 0);])
111 if test "$ac_cv_libntlm" != yes; then
113 AC_MSG_WARN([Libntlm >= 0.3.5 not found, disabling NTLM.])
116 AC_DEFINE(USE_NTLM, 1, [Define to 1 if you want NTLM.])
119 AC_MSG_CHECKING([if NTLM should be used])
121 AM_CONDITIONAL(NTLM, test x$ntlm = xyes)
124 AC_ARG_ENABLE(cram-md5,
125 AS_HELP_STRING([--disable-cram-md5], [don't use the CRAM-MD5 mechanism]),
127 if test "$cram_md5" != "no" ; then
129 AC_DEFINE(USE_CRAM_MD5, 1, [Define to 1 if you want CRAM-MD5.])
131 AC_MSG_CHECKING([if CRAM-MD5 should be used])
132 AC_MSG_RESULT($cram_md5)
133 AM_CONDITIONAL(CRAM_MD5, test x$cram_md5 = xyes)
136 AC_ARG_ENABLE(digest-md5,
137 AS_HELP_STRING([--disable-digest-md5], [don't use the DIGEST-MD5 mechanism]),
138 digest_md5=$enableval)
139 if test "$digest_md5" != "no" ; then
141 AC_DEFINE(USE_DIGEST_MD5, 1, [Define to 1 if you want DIGEST-MD5.])
143 AC_MSG_CHECKING([if DIGEST-MD5 should be used])
144 AC_MSG_RESULT($digest_md5)
145 AM_CONDITIONAL(DIGEST_MD5, test x$digest_md5 = xyes)
149 AS_HELP_STRING([--enable-gs2], [use the GS2 mechanism]),
150 gs2=$enableval, gs2=no)
151 if test "$gs2" != "no" ; then
156 AC_ARG_ENABLE(gssapi,
157 AS_HELP_STRING([--disable-gssapi], [don't use the GSSAPI mechanism]),
159 if test "$gssapi" != "no" ; then
164 AC_ARG_WITH(gssapi-impl,
165 AS_HELP_STRING([--with-gssapi-impl=gss/mit/heimdal/yes],
166 [select GSS-API implementation]),
167 gssapi_impl=$withval, gssapi_impl=yes)
168 AC_MSG_NOTICE([checking for GSS implementation ($gssapi_impl)])
169 if test "$gssapi_impl" = "gss"; then
170 AC_MSG_NOTICE([trying GSS])
171 AC_LIB_HAVE_LINKFLAGS(gss,, [#include <gss.h>], [gss_check_version (0);])
172 if test "$ac_cv_libgss" != yes; then
174 AC_MSG_WARN([GNU GSS not found, disabling GSSAPI.])
176 elif test "$gssapi_impl" = "mit"; then
177 AC_MSG_NOTICE([trying MIT])
178 AC_PATH_PROG(KRB5_CONFIG, krb5-config, no)
179 if test "$KRB5_CONFIG" != "no" ; then
180 CPPFLAGS="$CPPFLAGS `$KRB5_CONFIG --cflags`"
181 LIBS="$LIBS `$KRB5_CONFIG --libs gssapi`"
182 AC_CHECK_HEADERS(gssapi/gssapi.h gssapi/gssapi_generic.h)
183 AC_CHECK_DECL(GSS_C_NT_HOSTBASED_SERVICE,,
184 [AC_DEFINE(GSS_C_NT_HOSTBASED_SERVICE, gss_nt_service_name,
185 [Work around buggy MIT library])], [
186 #ifdef HAVE_GSSAPI_GSSAPI_H
187 # include <gssapi/gssapi.h>
189 #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
190 # include <gssapi/gssapi_generic.h>
194 AC_MSG_WARN([MIT Kerberos krb5-config not found, disabling GSSAPI])
197 elif test "$gssapi_impl" = "heimdal"; then
198 AC_MSG_NOTICE([trying Heimdal])
199 AC_PATH_PROG(KRB5_CONFIG, krb5-config, no)
200 if test "$KRB5_CONFIG" != "no" ; then
201 CPPFLAGS="$CPPFLAGS `$KRB5_CONFIG --cflags`"
202 LIBS="$LIBS `$KRB5_CONFIG --libs gssapi`"
203 AC_CHECK_HEADERS(gssapi.h)
205 AC_MSG_WARN([Heimdal krb5-config not found, disabling GSSAPI])
208 elif test "$gssapi_impl" != "no" ; then
209 AC_MSG_NOTICE([auto-detecing GSS/MIT/Heimdal])
210 AC_MSG_NOTICE([use --with-gssapi-impl=IMPL to override])
211 AC_MSG_NOTICE([where IMPL is `gss', `mit', or `heimdal'])
212 AC_LIB_HAVE_LINKFLAGS(gss,, [#include <gss.h>], [gss_check_version (0);])
213 if test "$ac_cv_libgss" = yes; then
215 AC_MSG_NOTICE([GNU GSS found])
216 elif test "$cross_compiling" != "no"; then
217 AC_MSG_WARN([Cross-compiling, won't rely on MIT/Heimdal krb5-config])
218 AC_MSG_NOTICE([Use --with-gssapi-impl=mit or --with-gssapi-impl=heimdal.])
221 AC_MSG_WARN([GNU GSS not found (see http://josefsson.org/gss/)...])
222 AC_PATH_PROG(KRB5_CONFIG, krb5-config, no)
223 if test "$KRB5_CONFIG" != "no" ; then
224 AC_MSG_NOTICE([MIT/Heimdal found])
225 CPPFLAGS="$CPPFLAGS `$KRB5_CONFIG --cflags`"
226 LIBS="$LIBS `$KRB5_CONFIG --libs gssapi`"
227 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h)
228 if test "$ac_cv_header_gssapi_h" = "yes" &&
229 test "$ac_cv_header_gssapi_gssapi_h" = "yes"; then
230 AC_MSG_WARN([Both Heimdal and MIT GSSAPI header files found. Will use Heimdal.])
231 AC_MSG_WARN([Use --with-gssapi-impl=mit to override.])
233 if test "$ac_cv_header_gssapi_h" != "no"; then
234 AC_MSG_NOTICE([Heimdal found])
237 AC_MSG_NOTICE([MIT found])
238 AC_CHECK_DECL(GSS_C_NT_HOSTBASED_SERVICE,,
239 [AC_DEFINE(GSS_C_NT_HOSTBASED_SERVICE, gss_nt_service_name,
240 [Work around buggy MIT library])], [
241 #ifdef HAVE_GSSAPI_GSSAPI_H
242 # include <gssapi/gssapi.h>
244 #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
245 # include <gssapi/gssapi_generic.h>
252 AC_MSG_WARN([krb5-config not found, disabling GSSAPI])
257 # Disable GSSAPI/GS2 if we can't find GSS-API implementation
258 if test "$gssapi_impl" = "no"; then
263 # GSSAPI, second part
264 if test "$gs2" != "no" ; then
265 AC_DEFINE(USE_GS2, 1, [Define to 1 if you want GS2.])
267 AC_MSG_CHECKING([if GS2 should be used])
269 AM_CONDITIONAL(GS2, test x$gs2 = xyes)
272 if test "$gssapi" != "no" ; then
273 AC_DEFINE(USE_GSSAPI, 1, [Define to 1 if you want GSSAPI.])
275 AC_MSG_CHECKING([if GSSAPI should be used])
276 AC_MSG_RESULT($gssapi)
277 AM_CONDITIONAL(GSSAPI, test x$gssapi = xyes)
280 AC_ARG_ENABLE(kerberos_v5,
281 AS_HELP_STRING([--enable-kerberos_v5],
282 [use the KERBEROS_V5 mechanism]),
283 kerberos_v5=$enableval, kerberos_v5=no)
284 if test "$kerberos_v5" != "no" ; then
285 AC_LIB_HAVE_LINKFLAGS(shishi,, [#include <shishi.h>], [shishi ();])
286 if test "$ac_cv_libshishi" != yes; then
288 AC_MSG_WARN([GNU Shishi not found, disabling KERBEROS_V5])
291 AC_DEFINE(USE_KERBEROS_V5, 1, [Define to 1 if you want KERBEROS_V5.])
294 AC_MSG_CHECKING([if KERBEROS_V5 should be used])
295 AC_MSG_RESULT($kerberos_v5)
296 AM_CONDITIONAL(KERBEROS_V5, test x$kerberos_v5 = xyes)
299 AC_ARG_WITH(stringprep,
300 AS_HELP_STRING([--without-stringprep], [disable non-ASCII support]),
301 stringprep=$withval, stringprep=yes)
302 if test "$stringprep" != "no"; then
303 AC_LIB_HAVE_LINKFLAGS(idn,, [#include <stringprep.h>],
304 [stringprep_check_version (0);])
305 if test "$ac_cv_libidn" != yes; then
307 AC_MSG_WARN([GNU Libidn not found. Stringprep disabled.])
312 AC_CHECK_FUNCS(pr29_8z)
313 AC_CHECK_HEADERS(pr29.h)
317 AC_MSG_CHECKING([if non-ASCII support via Libidn should be built])
318 AC_MSG_RESULT($stringprep)
320 # Allow disabling of client or server.
321 AC_ARG_ENABLE(client,
322 AS_HELP_STRING([--disable-client], [disable client code]),
324 AC_ARG_ENABLE(server,
325 AS_HELP_STRING([--disable-server], [disable server code]),
327 if test "$client" != "no"; then
328 AC_DEFINE(USE_CLIENT, 1, [Define to 1 if you want client code.])
331 if test "$server" != "no"; then
332 AC_DEFINE(USE_SERVER, 1, [Define to 1 if you want server code.])
335 if test "$server" = "no" && test "$client" = "no"; then
336 AC_MSG_ERROR([Disabling both client and server mode is meaningless])
338 AC_MSG_CHECKING([if client code should be built])
339 AC_MSG_RESULT($client)
340 AC_MSG_CHECKING([if server code should be built])
341 AC_MSG_RESULT($server)
342 AM_CONDITIONAL(CLIENT, test x$client = xyes)
343 AM_CONDITIONAL(SERVER, test x$server = xyes)
345 # Allow disabling of obsolete stuff.
346 AC_ARG_ENABLE(obsolete,
347 AS_HELP_STRING([--disable-obsolete], [disable backwards compatibility code]),
349 if test "$obsolete" = "no"; then
350 AC_DEFINE(GSASL_NO_OBSOLETE, 1,
351 [Define to 1 if you don't want backwards compatibility code.])
355 AC_MSG_CHECKING([if backwards compatibility code should be present])
356 AC_MSG_RESULT($obsolete)
357 AM_CONDITIONAL(OBSOLETE, test "$obsolete" = "yes")
359 # For gnulib stuff in gl/.
362 # Update version number in src/gsasl.h.
363 if ! sed 's/GSASL_VERSION ".*"/GSASL_VERSION "'$PACKAGE_VERSION'"/' \
364 $srcdir/src/gsasl.h > fixhdr.tmp; then
365 AC_MSG_ERROR([[*** Failed to update version number in src/gsasl.h...]])
367 if cmp -s $srcdir/src/gsasl.h fixhdr.tmp 2>/dev/null; then
369 elif ! mv fixhdr.tmp $srcdir/src/gsasl.h; then
370 AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to src/gsasl.h...]])
373 AC_CONFIG_FILES(Makefile libgsasl.pc po/Makefile.in \
374 gl/Makefile tests/Makefile src/Makefile \
375 anonymous/Makefile cram-md5/Makefile \
376 digest-md5/Makefile external/Makefile \
377 gssapi/Makefile gs2/Makefile kerberos_v5/Makefile \
378 login/Makefile ntlm/Makefile plain/Makefile \