libsolv/libsolv-rubyinclude.patch

31 lines
1.2 KiB
Diff
Raw Normal View History

2012-02-07 19:23:40 +00:00
diff -up libsolv/bindings/ruby/CMakeLists.txt.rubyinclude libsolv/bindings/ruby/CMakeLists.txt
--- libsolv/bindings/ruby/CMakeLists.txt.rubyinclude 2012-02-07 18:49:31.075581334 +0100
+++ libsolv/bindings/ruby/CMakeLists.txt 2012-02-07 19:55:59.627717571 +0100
@@ -6,8 +6,17 @@ ELSE (USE_VENDORDIRS)
SET (RUBY_INSTALL_DIR ${RUBY_SITEARCH_DIR})
ENDIF (USE_VENDORDIRS)
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['arch']"
+ OUTPUT_VARIABLE RUBY_ARCH)
+
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubyhdrdir']"
+ OUTPUT_VARIABLE RUBY_HDR_DIR)
+
+SET(RUBY_INCLUDE_DIRS ${RUBY_HDR_DIR} ${RUBY_HDR_DIR}/${RUBY_ARCH})
+
MESSAGE (STATUS "Ruby executable: ${RUBY_EXECUTABLE}")
MESSAGE (STATUS "Ruby installation dir: ${RUBY_INSTALL_DIR}")
+MESSAGE (STATUS "Ruby include dir: ${RUBY_INCLUDE_DIRS}")
ADD_CUSTOM_COMMAND (
OUTPUT solv_ruby.c
@@ -17,7 +26,7 @@ ADD_CUSTOM_COMMAND (
)
ADD_DEFINITIONS(-Wno-unused)
-INCLUDE_DIRECTORIES (${RUBY_INCLUDE_PATH})
+INCLUDE_DIRECTORIES (${RUBY_INCLUDE_DIRS})
ADD_LIBRARY (bindings_ruby SHARED solv_ruby.c)
SET_TARGET_PROPERTIES (bindings_ruby PROPERTIES PREFIX "" OUTPUT_NAME "solv")