File: link_atomic.diff

package info (click to toggle)
luametatex 2.11.07%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,348 kB
  • sloc: ansic: 237,080; makefile: 364; sh: 98
file content (35 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (2)
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
Description: Link with libatomic on some arches.
Author: Hilmar Preusse <hille42@web.de>
Last-Update: 2024-02-21
Forwarded: not needed.

--- luametatex.orig/cmake/luametatex.cmake
+++ luametatex/cmake/luametatex.cmake
@@ -1,3 +1,13 @@
+# Debian: determine host arch.
+execute_process(COMMAND
+  dpkg-architecture
+    -qDEB_HOST_ARCH
+  OUTPUT_VARIABLE
+    CMAKE_DEB_HOST_ARCH
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+
 add_compile_options(-DLUA_CORE)
 
 set(luametatex_sources
@@ -69,6 +79,13 @@
 )
 endif()
 
+# Debian: link with atomic on specific arches.
+if(${CMAKE_DEB_HOST_ARCH} MATCHES "m68k" OR ${CMAKE_DEB_HOST_ARCH} MATCHES "powerpc" OR ${CMAKE_DEB_HOST_ARCH} MATCHES "sh4" OR ${CMAKE_DEB_HOST_ARCH} MATCHES "armel")
+    target_link_libraries(luametatex
+        atomic
+)
+endif()
+
 if (${CMAKE_HOST_SOLARIS})
     target_link_libraries(luametatex
         rt