Add fake OSMAJORVERSION/OSMINORVERSION CPP flags
authorJon Trulson <jon@radscan.com>
Sat, 26 Oct 2019 00:25:06 +0000 (18:25 -0600)
committerJon Trulson <jon@radscan.com>
Sat, 26 Oct 2019 00:33:06 +0000 (18:33 -0600)
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

index 9f5f25bd3f41dc57af2e80bb8b87fa9b7bbafda6..3d2fe479d5e0dc702fa08d2dd7e6b004152df7d0 100644 (file)
@@ -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