]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Display Linux variant at ./configure time (#1928)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Fri, 1 Nov 2024 14:11:41 +0000 (14:11 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 1 Nov 2024 22:23:12 +0000 (22:23 +0000)
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

index 58481fed7fbd57dad837832572687cd9df880546..2cbd317cf05e5d6e7a8145b096ac17061a751e73 100644 (file)
@@ -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