]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - configure.ac
Update libsspwin32 (#1348)
[thirdparty/squid.git] / configure.ac
index db986911aa1511a0dc9863812cbc070a3d38e020..df97988bab06f433221f2e5715a3347b76c5c86c 100644 (file)
@@ -1,11 +1,11 @@
-## Copyright (C) 1996-2022 The Squid Software Foundation and contributors
+## Copyright (C) 1996-2023 The Squid Software Foundation and contributors
 ##
 ## Squid software is distributed under GPLv2+ license and includes
 ## contributions from numerous individuals and organizations.
 ## Please see the COPYING and CONTRIBUTORS files for details.
 ##
 
-AC_INIT([Squid Web Proxy],[6.0.0-VCS],[http://bugs.squid-cache.org/],[squid])
+AC_INIT([Squid Web Proxy],[7.0.0-VCS],[http://bugs.squid-cache.org/],[squid])
 AC_PREREQ(2.61)
 AC_CONFIG_HEADERS([include/autoconf.h])
 AC_CONFIG_AUX_DIR(cfgaux)
@@ -28,6 +28,7 @@ m4_include([acinclude/pkg.m4])
 m4_include([acinclude/tdb.m4])
 m4_include([acinclude/lib-checks.m4])
 m4_include([acinclude/ax_cxx_compile_stdcxx.m4])
+m4_include([acinclude/win32-sspi.m4])
 
 PRESET_CFLAGS="$CFLAGS"
 PRESET_CXXFLAGS="$CXXFLAGS"
@@ -132,6 +133,9 @@ AC_SUBST(AR_R)
 AC_PATH_PROG(LINUXDOC, linuxdoc, $FALSE)
 AM_CONDITIONAL(ENABLE_RELEASE_DOCS, test "x${ac_cv_path_LINUXDOC}" != "x$FALSE")
 
+SQUID_RELEASE=`echo $VERSION | cut -d. -f1`
+AC_SUBST(SQUID_RELEASE)
+
 # pre-define DEFAULT_PREFIX, some modules need it.
 AS_IF([test "${prefix}" = "NONE"],[squid_prefix=$ac_default_prefix],[squid_prefix=$prefix])
 AC_DEFINE_UNQUOTED(DEFAULT_PREFIX,[$squid_prefix],[The install prefix])
@@ -183,16 +187,8 @@ AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
 
 AS_CASE(["$squid_host_os"],
   [mingw],[
-    AC_PATH_PROG(WIN32_PSAPI, psapi.dll, none)
     CFLAGS="$CFLAGS -mthreads"
     CXXFLAGS="$CXXFLAGS -mthreads -static-libgcc -static-libstdc++"
-    AS_IF([test "x$ac_cv_path_WIN32_PSAPI" = "xnone"],[
-      AC_MSG_NOTICE([PSAPI.DLL is recommended to run Squid on Windows NT Platform])
-      AC_MSG_NOTICE([Please see PSAPI.DLL section on doc/win32-relnotes.html.])
-    ],[
-      AC_DEFINE(HAVE_WIN32_PSAPI,1,[Define if you have PSAPI.DLL on Windows systems])
-      LIBS="$LIBS -lpsapi"
-    ])
     MINGW_LIBS="-lmingwex"
     AC_SUBST(MINGW_LIBS)
   ],
@@ -421,6 +417,30 @@ AS_IF([test "x$libatomic_checker_result" = "xno"],[
 SQUID_STATE_ROLLBACK(LIBATOMIC)
 AC_SUBST(ATOMICLIB)
 
+SQUID_AUTO_LIB(psapi,[Windows PSAPI.dll],[LIBPSAPI])
+AS_IF([test "x$with_psapi" != "xno"],[
+  SQUID_STATE_SAVE(squid_psapi_state)
+  CPPFLAGS="$LIBPSAPI_CFLAGS $CPPFLAGS"
+  LIBS="$LIBPSAPI_PATH $LIBS"
+  AC_CHECK_LIB([psapi],[K32GetProcessMemoryInfo],[LIBPSAPI_LIBS="-lpsapi"])
+  AC_CHECK_HEADER([psapi.h],,,[
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+  ])
+  SQUID_STATE_ROLLBACK(squid_psapi_state)
+  AS_IF([test "x$LIBPSAPI_LIBS" != "x"],[
+    CXXFLAGS="$LIBPSAPI_CFLAGS $CXXFLAGS"
+    LIBPSAPI_LIBS="$LIBPSAPI_PATH $LIBPSAPI_LIBS"
+  ],[test "x$with_psapi" = "xyes"],[
+    AC_MSG_ERROR([Required library PSAPI.dll not found])
+  ],[
+    AC_MSG_NOTICE([Library PSAPI.dll not found.])
+  ])
+])
+AC_MSG_NOTICE([Using Windows PSAPI.dll library: ${with_psapi:=auto}])
+AC_SUBST(LIBPSAPI_LIBS)
+
 AC_SEARCH_LIBS([shm_open], [rt])
 AS_IF([test "x$ac_cv_search_shm_open" != "xno"],[
   AC_DEFINE(HAVE_SHM,1,[Support shared memory features])
@@ -1090,7 +1110,8 @@ AS_IF([test "x$with_gnutls" != "xno"],[
     ## by testing for a 3.4.0+ function which we use
     AC_CHECK_LIB(gnutls,gnutls_pcert_export_x509,[LIBGNUTLS_LIBS="-lgnutls"])
   ])
-  AC_CHECK_HEADERS(gnutls/gnutls.h gnutls/x509.h gnutls/abstract.h)
+  # if any of the required headers is not found, signal we can't support gnutls
+  AC_CHECK_HEADERS([gnutls/gnutls.h gnutls/x509.h gnutls/abstract.h], [], [LIBGNUTLS_LIBS=""])
 
   SQUID_STATE_ROLLBACK(squid_gnutls_state) #de-pollute LIBS
 
@@ -2012,6 +2033,7 @@ SQUID_DEFINE_BOOL(USE_AUTH,$enable_auth,[Enable support for authentication])
 AM_CONDITIONAL(ENABLE_AUTH, test "x$enable_auth" != "xno")
 AUTH_MODULES=""
 require_smblib="no"
+require_sspi="no"
 
 AC_ARG_ENABLE(auth-basic,
   AS_HELP_STRING([--enable-auth-basic="list of helpers"],
@@ -2072,6 +2094,7 @@ done
 AC_SUBST(AUTH_MODULES)
 AC_SUBST(AUTH_LIBS_TO_BUILD)
 AM_CONDITIONAL(ENABLE_SMBLIB, test "x$require_smblib" = "xyes")
+AM_CONDITIONAL(ENABLE_SSPI, test "x$require_sspi" = "xyes")
 
 dnl Select logging daemon helpers to build
 AC_ARG_ENABLE(log-daemon-helpers,
@@ -2343,20 +2366,13 @@ AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
 #endif
 ])
 
-dnl Override rusage() detect on MinGW because is emulated in source code
-AS_IF([test "$squid_host_os" = "mingw"],[
-  AC_DEFINE(HAVE_STRUCT_RUSAGE)
-  ac_cv_func_getrusage="yes"
-  AC_MSG_NOTICE([Using own rusage on Windows.])
-],[
-  AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
+AC_CHECK_TYPE(struct rusage,AC_DEFINE(HAVE_STRUCT_RUSAGE,1,[The system provides struct rusage]),,[
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
 #if HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
-  ])
 ])
 
 AC_CHECK_MEMBERS([struct iphdr.ip_hl],,,[
@@ -2396,8 +2412,6 @@ AC_CHECK_TYPE([bool])
 #need the defines for PRId64
 AC_CHECK_SIZEOF(int64_t)
 AC_CHECK_SIZEOF(long)
-#need the defines for PRIuSIZE
-AC_CHECK_SIZEOF(size_t)
 #need the define for overflow checks
 AC_CHECK_SIZEOF(off_t)
 AC_CHECK_SIZEOF(size_t)
@@ -2435,17 +2449,6 @@ AC_CHECK_TYPE(cpu_set_t,
 #endif
 ])
 
-# check for compiler support of %zu printf macro
-AH_TEMPLATE(PRIuSIZE,[Compiler supports %zu printf macro])
-AC_MSG_CHECKING([for compiler %zu support])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-  ]],[[size_t n=1;printf("%zu",n);]])],[
-    AC_DEFINE(PRIuSIZE,"zu")
-    AC_MSG_RESULT(yes)
-  ],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
-
-
 dnl Check for special functions
 AC_FUNC_ALLOCA
 
@@ -3080,6 +3083,7 @@ AC_CONFIG_FILES([
        lib/rfcnb/Makefile
        lib/smblib/Makefile
        lib/snmplib/Makefile
+       lib/sspi/Makefile
        scripts/Makefile
        src/Makefile
        src/acl/Makefile