]> git.ipfire.org Git - thirdparty/squid.git/blob - helpers/ntlm_auth/modules.m4
SourceFormat Enforcement
[thirdparty/squid.git] / helpers / ntlm_auth / modules.m4
1 ## Copyright (C) 1996-2015 The Squid Software Foundation and contributors
2 ##
3 ## Squid software is distributed under GPLv2+ license and includes
4 ## contributions from numerous individuals and organizations.
5 ## Please see the COPYING and CONTRIBUTORS files for details.
6 ##
7
8 # This file is supposed to run all the tests required to identify which
9 # configured modules are able to be built in this environment
10
11 # FIXME: de-duplicate $enable_auth_ntlm list containing double entries.
12
13 #not specified. Inherit global
14 if test "x$enable_auth_ntlm" = "x"; then
15 enable_auth_ntlm=$enable_auth
16 fi
17 #conflicts with global
18 if test "x$enable_auth_ntlm" != "xno" -a "x$enable_auth" = "xno" ; then
19 AC_MSG_ERROR([NTLM auth requested but auth disabled])
20 fi
21 #define list of modules to build
22 if test "x$enable_auth_ntlm" = "xyes" ; then
23 SQUID_LOOK_FOR_MODULES([$srcdir/helpers/ntlm_auth],[enable_auth_ntlm])
24 fi
25 #handle the "none" special case
26 if test "x$enable_auth_ntlm" = "xnone" ; then
27 enable_auth_ntlm=""
28 fi
29
30 NTLM_AUTH_HELPERS=""
31 #enable_auth_ntlm contains either "no" or the list of modules to be built
32 enable_auth_ntlm="`echo $enable_auth_ntlm| sed -e 's/,/ /g;s/ */ /g'`"
33 if test "x$enable_auth_ntlm" != "xno" ; then
34 AUTH_MODULES="$AUTH_MODULES ntlm"
35 AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
36 for helper in $enable_auth_ntlm; do
37 dir="$srcdir/helpers/ntlm_auth/$helper"
38
39 # modules converted to autoconf macros already
40 # NP: we only need this list because m4_include() does not accept variables
41 if test "x$helper" = "xfake" ; then
42 m4_include([helpers/ntlm_auth/fake/required.m4])
43
44 elif test "x$helper" = "xSSPI" ; then
45 m4_include([helpers/ntlm_auth/SSPI/required.m4])
46
47 elif test "x$helper" = "xsmb_lm" ; then
48 m4_include([helpers/ntlm_auth/smb_lm/required.m4])
49
50 # modules not yet converted to autoconf macros (or third party drop-in's)
51 elif test -f "$dir/config.test" && sh "$dir/config.test" "$squid_host_os"; then
52 BUILD_HELPER="$helper"
53 fi
54
55 if test -d "$srcdir/helpers/ntlm_auth/$helper"; then
56 if test "$BUILD_HELPER" != "$helper"; then
57 AC_MSG_NOTICE([NTLM auth helper $helper ... found but cannot be built])
58 else
59 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $BUILD_HELPER"
60 fi
61 else
62 AC_MSG_ERROR([NTLM auth helper $helper ... not found])
63 fi
64 done
65 fi
66 AC_MSG_NOTICE([NTLM auth helpers to be built: $NTLM_AUTH_HELPERS])
67 AM_CONDITIONAL(ENABLE_AUTH_NTLM, test "x$enable_auth_ntlm" != "xno")
68 AC_SUBST(NTLM_AUTH_HELPERS)
69
70 ## NTLM requires some special Little-Endian conversion hacks
71 if test "x$enable_auth_ntlm" != "xno"; then
72 AC_CHECK_HEADERS(machine/byte_swap.h sys/bswap.h endian.h sys/endian.h)
73 AC_CHECK_FUNCS(
74 bswap_16 bswap16 \
75 bswap_32 bswap32 \
76 htole16 __htole16 \
77 htole32 __htole32 \
78 le16toh __le16toh \
79 le32toh __le32toh \
80 )
81 fi