From 242167171054e373d4bda14166d557ef5c4e4b3d Mon Sep 17 00:00:00 2001 From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:11:41 +0000 Subject: [PATCH] Display Linux variant at ./configure time (#1928) Linux standards offer an /etc/os-release file containing information about the operating system. Parse that file and print an identifier of the Linux version at configure time. --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 58481fed7f..2cbd317cf0 100644 --- a/configure.ac +++ b/configure.ac @@ -49,6 +49,16 @@ AS_IF([test -n "$squid_host_os_version"],[ AC_MSG_RESULT($squid_host_os (version $squid_host_os_version)) # on windows squid_host_os is either mingw or cygwin, version is 32 +AS_IF([test -e /etc/os-release],[ + squid_build_os_release_name=`grep '^PRETTY_NAME=' /etc/os-release | sed 's/^[[^"]]*"//;s/".*$//'` + AS_IF([test "x$squid_build_os_release_name" = "x"],[ + squid_build_os_release_name=`grep '^NAME=' /etc/os-release | sed 's/^[[^"]]*"//;s/".*$//'` + ]) + AS_IF([test "x$squid_build_os_release_name" != "x"],[ + AC_MSG_NOTICE([Building on $squid_build_os_release_name]) + ]) +]) + AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX -- 2.47.2