diff --git a/CMakeLists.txt b/CMakeLists.txt index c18b5525..72f26f9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,13 @@ if(NOT RUBY_EXECUTABLE) message(FATAL_ERROR "Ruby not found.") endif() +# +# crypt.h or xcrypt.h ? +# +INCLUDE(CheckIncludeFiles) +CHECK_INCLUDE_FILES(xcrypt.h HAVE_XCRYPT_H) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) + # # -> src/ # diff --git a/config.h.in b/config.h.in new file mode 100644 index 00000000..ce6b0619 --- /dev/null +++ b/config.h.in @@ -0,0 +1,4 @@ +// configuration file for yast2-ruby-bindings + +#cmakedefine HAVE_XCRYPT_H + diff --git a/src/binary/Builtin.cc b/src/binary/Builtin.cc index 5a7fab70..25fa9783 100644 --- a/src/binary/Builtin.cc +++ b/src/binary/Builtin.cc @@ -6,13 +6,19 @@ #define _OW_SOURCE #endif +#include "config.h" + #include #include #include #include #include extern "C" { - #include + #ifdef HAVE_XCRYPT_H + #include + #else + #include + #endif } #include #include