]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Refactored LogDaemon helpers selection code.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 28 Dec 2009 21:40:31 +0000 (22:40 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 28 Dec 2009 21:40:31 +0000 (22:40 +0100)
1  2 
configure.in

diff --cc configure.in
index 1066efe4c21fc4cd8c035a2069a85dbf6c127ffc,83034d68b895f38ac2727701a8e36c6632f570a9..8bc39569ea56b3df86743aa5a9777dab9cf8c256
  AC_MSG_NOTICE([Basic auth helpers built: $BASIC_AUTH_HELPERS])
  AC_SUBST(BASIC_AUTH_HELPERS)
  
--dnl ************** KK HERE *************
- dnl Select ntlm auth helpers to build
- if test -n "$AUTH_MODULES_ntlm"; then
-       NTLM_AUTH_HELPERS="all"
+ # Select ntlm auth helpers to build
+ if test "$AUTH_MODULES_ntlm" = "yes" ; then
+   squid_opt_ntlm_auth_helpers="auto"
+ else
+   squid_opt_ntlm_auth_helpers=""
  fi
  AC_ARG_ENABLE(ntlm-auth-helpers,
-   AS_HELP_STRING([--enable-ntlm-auth-helpers="list of helpers"],[This option selects which proxy_auth ntlm helpers
+   AS_HELP_STRING([--enable-ntlm-auth-helpers="list of helpers"],
+                  [This option selects which proxy_auth ntlm helpers
                   to build and install as part of the normal build 
                   process. For a list of available helpers see
-                  the helpers/ntlm_auth directory.]),
- [ case "$enableval" in
-   yes) 
-       NTLM_AUTH_HELPERS="all"
-       ;;
-   no)
-       NTLM_AUTH_HELPERS=""
-       ;;
-   *)
-       NTLM_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/  */ /g'`"
-       ;;
+                  the helpers/ntlm_auth directory.]), [
+ case "$enableval" in
+   yes) squid_opt_ntlm_auth_helpers="auto" ;;
+   no)  squid_opt_ntlm_auth_helpers="" ;;
+   *) squid_opt_ntlm_auth_helpers="`echo $enableval| sed -e 's/,/ /g;s/  */ /g'`" ;;
    esac
  ])
- if test "$NTLM_AUTH_HELPERS" = "all" ; then
-       NTLM_AUTH_HELPERS=""
-       for dir in $srcdir/helpers/ntlm_auth/*; do
-           helper="`basename $dir`"
-           if test -f $dir/config.test && sh $dir/config.test "$@"; then
-               NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
-             elif test -d $srcdir/helpers/ntlm_auth/$helper ; then
-                 AC_MSG_NOTICE([NTLM auth helper $helper ... found but cannot be built])
-           fi
-       done
+ if test "$squid_opt_ntlm_auth_helpers" = "auto" ; then
+   squid_opt_ntlm_auth_helpers=""
+   SQUID_LOOK_FOR_MODULES([$srcdir/helpers/ntlm_auth],[squid_opt_ntlm_auth_helpers])
  fi
- if test -n "$NTLM_AUTH_HELPERS"; then
-     for helper in $NTLM_AUTH_HELPERS; do
-       if test -d $srcdir/helpers/ntlm_auth/$helper; then
-           :
-       else
-           AC_MSG_ERROR(NTLM Auth helper $helper does not exist)
-       fi
-     done
-     AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS])
+ if test -n "$squid_opt_ntlm_auth_helpers" -a -z "$AUTH_MODULES_ntlm" ; then
+   AC_MSG_WARN([NTLM auth helpers selected without the NTLM scheme enabled])
  fi
+ for helper in $squid_opt_ntlm_auth_helpers ; do
+   dir="$srcdir/helpers/ntlm_auth/$helper"
+   if test -f $dir/config.test && sh $dir/config.test "$@"; then
+     NTLM_AUTH_HELPERS="$NTLM_AUTH_HELPERS $helper"
+   elif test -d $srcdir/helpers/ntlm_auth/$helper ; then
+     AC_MSG_NOTICE([NTLM auth helper $helper ... found but cannot be built])
+   fi
+ done
+ AC_MSG_NOTICE([NTLM auth helpers built: $NTLM_AUTH_HELPERS])
  AC_SUBST(NTLM_AUTH_HELPERS)
  
- dnl Select negotiate auth helpers to build
- if test -n "$AUTH_MODULES_negotiate"; then
-       NEGOTIATE_AUTH_HELPERS="all"
+ # Select negotiate auth helpers to build
+ if test "$AUTH_MODULES_negotiate" = "yes" ; then
+   squid_opt_negotiate_auth_helpers="auto"
+ else
+   squid_opt_negotiate_auth_helpers=""
  fi
  AC_ARG_ENABLE(negotiate-auth-helpers,
-   AS_HELP_STRING([--enable-negotiate-auth-helpers="list of helpers"],[This option selects which proxy_auth negotiate helpers
+   AS_HELP_STRING([--enable-negotiate-auth-helpers="list of helpers"],
+                  [This option selects which proxy_auth negotiate helpers
                    to build and install as part of the normal build 
                    process. For a list of available helpers see
-                   the helpers/negotiate_auth directory.]),
- [ case "$enableval" in
-   yes) 
-       NEGOTIATE_AUTH_HELPERS="all"
-       ;;
-   no)
-       NEGOTIATE_AUTH_HELPERS=""
-       ;;
-   *)
-       NEGOTIATE_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/  */ /g'`"
-       ;;
+                   the helpers/negotiate_auth directory.]), [
+   case "$enableval" in
+   yes) squid_opt_negotiate_auth_helpers="all" ;;
+   no)  squid_opt_negotiate_auth_helpers="" ;;
+   *)   squid_opt_negotiate_auth_helpers="`echo $enableval| sed -e 's/,/ /g;s/  */ /g'`" ;;
    esac
  ])
- if test "$NEGOTIATE_AUTH_HELPERS" = "all" ; then
-       NEGOTIATE_AUTH_HELPERS=""
-       for dir in $srcdir/helpers/negotiate_auth/*; do
-           helper="`basename $dir`"
-           if test -f $dir/config.test && sh $dir/config.test "$@";  then
-               NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
-             elif test -d $srcdir/helpers/negotiate_auth/$helper ; then
-                 AC_MSG_NOTICE([Negotiate auth helper $helper ... found but cannot be built])
-           fi
-       done
+ if test "$squid_opt_negotiate_auth_helpers" = "auto" ; then
+   squid_opt_negotiate_auth_helpers=""
+   SQUID_LOOK_FOR_MODULES([$srcdir/helpers/negotiate_auth],[squid_opt_negotiate_auth_helpers])
  fi
- if test -n "$NEGOTIATE_AUTH_HELPERS"; then
-     for helper in $NEGOTIATE_AUTH_HELPERS; do
-       if test -d $srcdir/helpers/negotiate_auth/$helper; then
-           :
-       else
-           AC_MSG_ERROR(Negotiate Auth helper $helper does not exist)
-       fi
-     done
-     AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS])
+ if test -n "$squid_opt_negotiate_auth_helpers" -a -z "$AUTH_MODULES_negotiate" ; then
+   AC_MSG_WARN([Negotiate auth helpers selected without the Negotiate scheme enabled])
  fi
+ for helper in $squid_opt_negotiate_auth_helpers ; do
+   dir="$srcdir/helpers/negotiate_auth/$helper"
+   if test -f $dir/config.test && sh $dir/config.test "$@"; then
+     NEGOTIATE_AUTH_HELPERS="$NEGOTIATE_AUTH_HELPERS $helper"
+   elif test -d $srcdir/helpers/negotiate_auth/$helper ; then
+     AC_MSG_NOTICE([Negotiate auth helper $helper ... found but cannot be built])
+   fi
+ done
+ AC_MSG_NOTICE([Negotiate auth helpers built: $NEGOTIATE_AUTH_HELPERS])
  AC_SUBST(NEGOTIATE_AUTH_HELPERS)
  
  dnl Select digest auth scheme helpers to build
- if test -n "$AUTH_MODULES_digest"; then
-       DIGEST_AUTH_HELPERS=all
+ if test "$AUTH_MODULES_digest" = "yes" ; then
+   squid_opt_digest_auth_helpers="auto"
+ else
+   squid_opt_digest_auth_helpers=""
  fi
  AC_ARG_ENABLE(digest-auth-helpers,
-   AS_HELP_STRING([--enable-digest-auth-helpers="list of helpers"],[This option selects which digest scheme authentication
+   AS_HELP_STRING([--enable-digest-auth-helpers="list of helpers"],
+                  [This option selects which digest scheme authentication
                    helpers to build and install as part of the normal build
                    process. For a list of available helpers see the
-                   helpers/digest_auth directory.]),
- [ case "$enableval" in
-   yes)
-       DIGEST_AUTH_HELPERS="all"
-       ;;
-   no)
-       DIGEST_AUTH_HELPERS=""
-       ;;
-   *)
-       DIGEST_AUTH_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/  */ /g'`"
-       ;;
+                   helpers/digest_auth directory.]), [
+ case "$enableval" in
+   yes) squid_opt_digest_auth_helpers="all" ;;
+   no)  squid_opt_digest_auth_helpers="" ;;
+   *)   squid_opt_digest_auth_helpers="`echo $enableval| sed -e 's/,/ /g;s/  */ /g'`" ;;
    esac
  ])
- if test "$DIGEST_AUTH_HELPERS" = "all" ; then
-       DIGEST_AUTH_HELPERS=""
-       for dir in $srcdir/helpers/digest_auth/*; do
-           helper="`basename $dir`"
-           if test -f $dir/config.test && sh $dir/config.test "$@"; then
-               DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
-             elif test -d $srcdir/helpers/digest_auth/$helper ; then
-                 AC_MSG_NOTICE([Digest auth helper $helper ... found but cannot be built])
-           fi
-       done
+ if test "$squid_opt_digest_auth_helpers" = "auto" ; then
+   squid_opt_digest_auth_helpers=""
+   SQUID_LOOK_FOR_MODULES([$srcdir/helpers/digest_auth],[squid_opt_digest_auth_helpers])
  fi
- if test -n "$DIGEST_AUTH_HELPERS"; then
-     for helper in $DIGEST_AUTH_HELPERS; do
-       if test -f $srcdir/helpers/digest_auth/$helper/Makefile.in; then
-               :
-       else
-               AC_MSG_ERROR(digest auth helper $helper does not exist)
-       fi
-     done
-     AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
+ if test -n "$squid_opt_digest_auth_helpers" -a -z "$AUTH_MODULES_digest" ; then
+   AC_MSG_WARN([Digest auth helpers selected without the Digest scheme enabled])
  fi
+ for helper in $squid_opt_digest_auth_helpers ; do
+   dir="$srcdir/helpers/digest_auth/$helper"
+   if test -f $dir/config.test && sh $dir/config.test "$@"; then
+     DIGEST_AUTH_HELPERS="$DIGEST_AUTH_HELPERS $helper"
+   elif test -d $srcdir/helpers/digest_auth/$helper ; then
+     AC_MSG_NOTICE([Digest auth helper $helper ... found but cannot be built])
+   fi
+ done
+ AC_MSG_NOTICE([Digest auth helpers built: $DIGEST_AUTH_HELPERS])
  AC_SUBST(DIGEST_AUTH_HELPERS)
  
  dnl Select logging daemon helpers to build
--LOG_DAEMON_HELPERS="all"
++squid_opt_logdaemon_helpers="auto"
  AC_ARG_ENABLE(log-daemon-helpers,
--  AS_HELP_STRING([--enable-log-daemon-auth-helpers="list of helpers"],[This option selects which logging daemon
--                  helpers to build and install as part of the normal build process. For a list of available
--                  helpers see the helpers/log_daemon directory.]),
--[ case "$enableval" in
--  yes)
--      LOG_DAEMON_HELPERS="all"
--      ;;
--  no)
--      LOG_DAEMON_HELPERS=""
--      ;;
--  *)
--      LOG_DAEMON_HELPERS="`echo $enableval| sed -e 's/,/ /g;s/  */ /g'`"
--      ;;
++  AS_HELP_STRING([--enable-log-daemon-auth-helpers="list of helpers"],
++                 [This option selects which logging daemon helpers to 
++                  build and install as part of the normal build process
++                  For a list of available helpers see the helpers/log_daemon
++                  directory.]),[
++case "$enableval" in
++  yes) : ;;
++  no)  squid_opt_logdaemon_helpers="" ;;
++  *)   squid_opt_logdaemon_helpers="`echo $enableval| sed -e 's/,/ /g;s/  */ /g'`" ;;
    esac
  ])
--if test "$LOG_DAEMON_HELPERS" = "all" ; then
--      LOG_DAEMON_HELPERS=""
--      for dir in $srcdir/helpers/log_daemon/*; do
--          helper="`basename $dir`"
--          if test -f $dir/config.test && sh $dir/config.test "$@"; then
--              LOG_DAEMON_HELPERS="$LOG_DAEMON_HELPERS $helper"
--            elif test -d $srcdir/helpers/log_daemon/$helper ; then
--                AC_MSG_NOTICE([Log daemon auth helper $helper ... found but cannot be built])
--          fi
--      done
--fi
--if test -n "$LOG_DAEMON_HELPERS"; then
--    for helper in $LOG_DAEMON_HELPERS; do
--      if test -d $srcdir/helpers/log_daemon/$helper; then
--              :
--      else
--          AC_MSG_ERROR(Log daemon helper $helper does not exist)
--      fi
--    done
--    AC_MSG_NOTICE([Log daemon helpers built: $LOG_DAEMON_HELPERS])
++if test "$squid_opt_logdaemon_helpers" = "auto" ; then
++  squid_opt_logdaemon_helpers=""
++  SQUID_LOOK_FOR_MODULES([$srcdir/helpers/log_daemon],[squid_opt_logdaemon_helpers])
  fi
++for helper in $squid_opt_logdaemon_helpers ; do
++  dir="$srcdir/helpers/log_daemon/$helper"
++  if test -f $dir/config.test && sh $dir/config.test "$@"; then
++    LOG_DAEMON_HELPERS="$LOG_DAEMON_HELPERS $helper"
++  elif test -d $srcdir/helpers/log_daemon/$helper ; then
++    AC_MSG_NOTICE([Log daemon auth helper $helper ... found but cannot be built])
++  fi
++done
++AC_MSG_NOTICE([Log daemon helpers built: $LOG_DAEMON_HELPERS])
  AC_SUBST(LOG_DAEMON_HELPERS)
  
++dnl ######## KK HERE ###########
  dnl
  dnl Check Kerberos/GSSAPI/SPNEGO
  dnl