Skip to content

Instantly share code, notes, and snippets.

@stintel
Created March 15, 2022 12:18
Show Gist options
  • Save stintel/f403cab509d5301ce5dc4bae72d94e61 to your computer and use it in GitHub Desktop.
Save stintel/f403cab509d5301ce5dc4bae72d94e61 to your computer and use it in GitHub Desktop.
sys-apps/ubus/files/ubus-lib64.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a65ccbb..f2b9012 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,16 @@ ENDIF(BUILD_STATIC)
FIND_PATH(ubox_include_dir libubox/usock.h)
INCLUDE_DIRECTORIES(${ubox_include_dir})
+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")
+
SET(LIB_SOURCES libubus.c libubus-io.c libubus-obj.c libubus-sub.c libubus-req.c libubus-acl.c)
IF(BUILD_STATIC)
@@ -73,8 +83,8 @@ IF(ABIVERSION)
ENDIF()
INSTALL(TARGETS ubus cli
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION "${LIB_DIR}"
+ LIBRARY DESTINATION "${LIB_DIR}"
RUNTIME DESTINATION bin
)
INSTALL(TARGETS ubusd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment