[cmake-developers] [PATCH 1/3] SCO OpenServer 5.0.7/3.2 support From ryoon at netbsd.org in pkgsrc.org since 2014, plus one sun fix.
Patrick Welche
prlw1 at cam.ac.uk
Thu Jul 28 12:26:10 EDT 2016
---
Modules/Platform/SCO_SV.cmake | 1 +
Source/cmELF.cxx | 14 ++++++++++++--
Source/kwsys/SystemInformation.cxx | 2 +-
Source/kwsys/SystemTools.cxx | 5 +++++
4 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/Modules/Platform/SCO_SV.cmake b/Modules/Platform/SCO_SV.cmake
index ddd9600..1cb4b38 100644
--- a/Modules/Platform/SCO_SV.cmake
+++ b/Modules/Platform/SCO_SV.cmake
@@ -1,2 +1,3 @@
set(CMAKE_DL_LIBS "")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-h,")
include(Platform/UnixPaths)
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 15755cb..ce3da30 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -46,6 +46,9 @@ typedef struct Elf32_Rela Elf32_Rela;
#if defined(__sun)
#include <sys/link.h> // For dynamic section information
#endif
+#ifdef _SCO_DS
+#include <link.h> // For DT_SONAME etc.
+#endif
// Low-level byte swapping implementation.
template <size_t s>
@@ -214,6 +217,8 @@ struct cmELFTypes32
};
// Configure the implementation template for 64-bit ELF files.
+#ifndef _SCO_DS
+// SCO OpenServer 5.0.7/3.2 does not support 64-bit ELF.
struct cmELFTypes64
{
typedef Elf64_Ehdr ELF_Ehdr;
@@ -223,6 +228,7 @@ struct cmELFTypes64
typedef KWIML_INT_uint64_t tagtype;
static const char* GetName() { return "64-bit"; }
};
+#endif
// Parser implementation template.
template <class Types>
@@ -800,10 +806,14 @@ cmELF::cmELF(const char* fname)
if (ident[EI_CLASS] == ELFCLASS32) {
// 32-bit ELF
this->Internal = new cmELFInternalImpl<cmELFTypes32>(this, fin, order);
- } else if (ident[EI_CLASS] == ELFCLASS64) {
+ }
+#ifndef _SCO_DS
+ else if (ident[EI_CLASS] == ELFCLASS64) {
// 64-bit ELF
this->Internal = new cmELFInternalImpl<cmELFTypes64>(this, fin, order);
- } else {
+ }
+#endif
+ else {
this->ErrorMessage = "ELF file class is not 32-bit or 64-bit.";
return;
}
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 81fb2f9..6c936e6 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -123,7 +123,7 @@ typedef int siginfo_t;
# endif
#endif
-#ifdef __linux
+#if defined(__linux) || defined (__sun) || defined(_SCO_DS)
# include <fenv.h>
# include <sys/socket.h>
# include <netdb.h>
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 0526372..c861d5a 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1316,8 +1316,13 @@ bool SystemTools::FileExists(const std::string& filename)
SystemTools::ConvertToWindowsExtendedPath(filename).c_str())
!= INVALID_FILE_ATTRIBUTES);
#else
+// SCO OpenServer 5.0.7/3.2's command has 711 permission.
+#if defined(_SCO_DS)
+ return access(filename.c_str(), F_OK) == 0;
+#else
return access(filename.c_str(), R_OK) == 0;
#endif
+#endif
}
//----------------------------------------------------------------------------
--
2.9.2
More information about the cmake-developers
mailing list