summaryrefslogtreecommitdiffstats
path: root/patches/01_proteanos-port.patch
blob: dd3cbd25f729b071700b5a3ad6de6c3d187d1edc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Author: "P. J. McDermott" <pj@pehjota.net>
Subject: ProteanOS port

diff -Naur src.orig/Modules/CMakeFindPackageMode.cmake src/Modules/CMakeFindPackageMode.cmake
--- src.orig/Modules/CMakeFindPackageMode.cmake	2010-07-23 10:27:20.000000000 -0400
+++ src/Modules/CMakeFindPackageMode.cmake	2014-10-20 16:11:25.770252311 -0400
@@ -102,6 +102,16 @@
         endif()
       endforeach()
     endif()
+  elseif(EXISTS /etc/proteanos_arch)
+    if(NOT CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE )
+      file(GLOB filesInLib RELATIVE /lib /lib/*-linux-* )
+      foreach(file ${filesInLib})
+        if("${file}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
+          set(CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE ${file})
+          break()
+        endif()
+      endforeach()
+    endif()
   endif()
 
 endif()
diff -Naur src.orig/Modules/GNUInstallDirs.cmake src/Modules/GNUInstallDirs.cmake
--- src.orig/Modules/GNUInstallDirs.cmake	2014-09-11 09:24:00.000000000 -0400
+++ src/Modules/GNUInstallDirs.cmake	2014-10-20 16:09:56.263503487 -0400
@@ -132,7 +132,7 @@
   endif()
   if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
       AND NOT CMAKE_CROSSCOMPILING)
-    if (EXISTS "/etc/debian_version") # is this a debian system ?
+    if (EXISTS "/etc/debian_version" OR EXISTS "/etc/proteanos_arch") # is this a debian system ?
       if(CMAKE_LIBRARY_ARCHITECTURE)
         if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
           set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
diff -Naur src.orig/Modules/Platform/Linux.cmake src/Modules/Platform/Linux.cmake
--- src.orig/Modules/Platform/Linux.cmake	2014-09-11 09:24:00.000000000 -0400
+++ src/Modules/Platform/Linux.cmake	2014-10-20 16:07:12.962485916 -0400
@@ -39,6 +39,9 @@
   if(EXISTS "/etc/debian_version")
     set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
       "Install .so files without execute permission.")
+  elseif(EXISTS "/etc/proteanos_arch")
+    set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
+      "Install .so files without execute permission.")
   else()
     set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
       "Install .so files without execute permission.")
@@ -47,6 +50,9 @@
 
 # Match multiarch library directory names.
 set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
+if(EXISTS "/etc/proteanos_arch")
+  set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9]+-linux-[a-z0-9]+")
+endif()
 
 include(Platform/UnixPaths)
 
 # Debian has lib64 paths only for compatibility so they should not be
@@ -54,4 +60,6 @@
 # searched.
 if(EXISTS "/etc/debian_version")
   set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
+elseif(EXISTS "/etc/proteanos_arch")
+  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
 endif()