]> git.ipfire.org Git - thirdparty/squid.git/blob - src/auth/ntlm/helpers.m4
0e5868b956889bf9a4f6f87489d9b73133c12012
[thirdparty/squid.git] / src / auth / ntlm / helpers.m4
1 ## Copyright (C) 1996-2017 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 auto_auth_ntlm_modules=no
23 if test "x$enable_auth_ntlm" = "xyes" ; then
24 SQUID_LOOK_FOR_MODULES([$srcdir/src/auth/ntlm],[enable_auth_ntlm])
25 auto_auth_ntlm_modules=yes
26 fi
27 #handle the "none" special case
28 if test "x$enable_auth_ntlm" = "xnone" ; then
29 enable_auth_ntlm=""
30 fi
31
32 NTLM_AUTH_HELPERS=""
33 #enable_auth_ntlm contains either "no" or the list of modules to be built
34 enable_auth_ntlm="`echo $enable_auth_ntlm| sed -e 's/,/ /g;s/ */ /g'`"
35 if test "x$enable_auth_ntlm" != "xno" ; then
36 AUTH_MODULES="$AUTH_MODULES ntlm"
37 AC_DEFINE([HAVE_AUTH_MODULE_NTLM],1,[NTLM auth module is built])
38 for helper in $enable_auth_ntlm; do
39 dir="$srcdir/src/auth/ntlm/$helper"
40
41 # modules converted to autoconf macros already
42 # NP: we only need this list because m4_include() does not accept variables
43 if test "x$helper" = "xfake" ; then
44 m4_include([src/auth/ntlm/fake/required.m4])
45
46 elif test "x$helper" = "xSMB_LM" ; then
47 m4_include([src/auth/ntlm/SMB_LM/required.m4])
48
49 elif test "x$helper" = "xSSPI" ; then
50 m4_include([src/auth/ntlm/SSPI/required.m4])
51
52 # modules not yet converted to autoconf macros (or third party drop-in's)
53 elif test -f "$dir/config.test" && sh "$dir/config.test" "$squid_host_os"; then
54 BUILD_HELPER="$helper"
55 fi
56
57 if test -d "$srcdir/src/auth/ntlm/$helper"; then
58 if test "$BUILD_HELPER" != "$helper"; then
59 if test "x$auto_auth_ntlm_modules" = "xyes"; then
60 AC_MSG_NOTICE([NTLM auth helper $helper ... found but cannot be built])
61 else
62 AC_MSG_ERROR([NTLM auth helper $helper ... found but cannot be built])
63 fi
64 else
65 NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $BUILD_HELPER"
66 fi
67 else
68 AC_MSG_ERROR([NTLM auth helper $helper ... not found])
69 fi
70 done
71 fi
72 AC_MSG_NOTICE([NTLM auth helpers to be built: $NTLM_AUTH_HELPERS])
73 AM_CONDITIONAL(ENABLE_AUTH_NTLM, test "x$enable_auth_ntlm" != "xno")
74 AC_SUBST(NTLM_AUTH_HELPERS)
75
76 ## NTLM requires some special Little-Endian conversion hacks
77 if test "x$enable_auth_ntlm" != "xno"; then
78 AC_CHECK_HEADERS(machine/byte_swap.h sys/bswap.h endian.h sys/endian.h)
79 AC_CHECK_FUNCS(
80 bswap_16 bswap16 \
81 bswap_32 bswap32 \
82 htole16 __htole16 \
83 htole32 __htole32 \
84 le16toh __le16toh \
85 le32toh __le32toh \
86 )
87 fi