From 4320036bfa1898292b8083c27141f1964fd63ba8 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Fri, 25 Oct 2019 18:25:06 -0600 Subject: [PATCH] Add fake OSMAJORVERSION/OSMINORVERSION CPP flags These really need to go away and are primarily used by older unsupported platforms. Here we fake these for Linux (4.15), freebsd (10.0), openbsd (6.2), netbsd (8.0), and solaris (5.10). I'm not sure about the Solaris one as I don't have any of them. Basically, anything after Solaris 5.10, which is pretty ancient. These should be considered temporary - all uses of these macros in the code should be removed in favor of functionality-specific checks in configure. --- cde/configure.ac | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cde/configure.ac b/cde/configure.ac index 9f5f25bd..3d2fe479 100644 --- a/cde/configure.ac +++ b/cde/configure.ac @@ -32,24 +32,43 @@ build_solaris=no build_hpux=no build_aix=no +dnl For now, we need to fake the OSMAJORVERSION, OSMINORVERSION. In Linux +dnl this never mattered anyway as it was always the kernel version. We will +dnl choose defaults here. These need to be removed in the code in favor +dnl of actual checks for functionality. So this should be considered +dnl temporary. + +osmajorversion=4 +osminorversion=15 + case "${host_os}" in linux*) build_linux=yes + osmajorversion=4 + osminorversion=15 ;; freebsd*) build_freebsd=yes bsd=yes + osmajorversion=10 + osminorversion=0 ;; openbsd*) build_openbsd=yes bsd=yes + osmajorversion=6 + osminorversion=2 ;; netbsd*) build_netbsd=yes bsd=yes + osmajorversion=8 + osminorversion=0 ;; solaris*|sun*) build_solaris=yes + osmajorversion=5 + osminorversion=10 ;; aix*) build_aix=yes @@ -68,6 +87,12 @@ AM_CONDITIONAL([SOLARIS], [test "$build_solaris" = "yes"]) AM_CONDITIONAL([AIX], [test "$build_aix" = "yes"]) AM_CONDITIONAL([HPUX], [test "$build_hpux" = "yes"]) +dnl Add osmajor/minor version to cppflags. +oflags="$CPPFLAGS" +CPPFLAGS="$oflags -DOSMAJORVERSION=$osmajorversion \ + -DOSMINORVERSION=$osminorversion" + + dnl set CSRG_BASED define for the BSD's if test "$build_bsd" = "yes" then -- 2.25.1