diff options
author | Patrick Welche <prlw1@cam.ac.uk> | 2016-07-28 16:26:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-02 14:04:31 (GMT) |
commit | 16a3a73508e8109e453e35288c37fe545a8ab59e (patch) | |
tree | eb5bf5efbdcbd5e81006827a3d8165f0927b64e1 /Source/cmELF.cxx | |
parent | fd59f9ad519c1c311c54569133797d9061e90558 (diff) | |
download | CMake-16a3a73508e8109e453e35288c37fe545a8ab59e.zip CMake-16a3a73508e8109e453e35288c37fe545a8ab59e.tar.gz CMake-16a3a73508e8109e453e35288c37fe545a8ab59e.tar.bz2 |
cmELF: Port to SCO OpenServer 5.0.7/3.2
Take changes used by pkgsrc [1]:
* SCO OpenServer 5.0.7/3.2 does not support 64-bit ELF.
[1] http://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/cmake/patches/
Diffstat (limited to 'Source/cmELF.cxx')
-rw-r--r-- | Source/cmELF.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index 15755cb..266b786 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,7 @@ struct cmELFTypes32 }; // Configure the implementation template for 64-bit ELF files. +#ifndef _SCO_DS struct cmELFTypes64 { typedef Elf64_Ehdr ELF_Ehdr; @@ -223,6 +227,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 +805,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; } |