Skip to content

Instantly share code, notes, and snippets.

@stintel
Created March 15, 2022 12:18
Show Gist options
  • Save stintel/8ed2e5adf0a08ae824b4d2aa89c979a3 to your computer and use it in GitHub Desktop.
Save stintel/8ed2e5adf0a08ae824b4d2aa89c979a3 to your computer and use it in GitHub Desktop.
./sys-apps/ubox/files/ubox-lib64.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62de1d4..cf53b39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,16 @@ ELSE()
message( FATAL_ERROR "Kernel too old, missing SYS_getrandom system call")
ENDIF()
+GET_PROPERTY(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+
+IF(LIB64)
+ set(LIB_SUFFIX 64)
+ELSE()
+ set(LIB_SUFFIX "")
+ENDIF()
+
+SET(LIB_DIR "lib${LIB_SUFFIX}" CACHE PATH "Library installation directory")
+
ADD_EXECUTABLE(kmodloader kmodloader.c)
TARGET_LINK_LIBRARIES(kmodloader ubox)
@@ -44,7 +54,7 @@ INSTALL(TARGETS lsbloader
ADD_LIBRARY(validate SHARED validate/validate.c)
INSTALL(TARGETS validate
- LIBRARY DESTINATION lib
+ LIBRARY DESTINATION "${LIB_DIR}"
)
FIND_PATH(uci_include_dir uci.h)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment