Skip to content

Commit

Permalink
header detection, use xcrypt.h if present
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Sep 24, 2014
1 parent b49c95f commit 435daed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/
#
Expand Down
4 changes: 4 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// configuration file for yast2-ruby-bindings

#cmakedefine HAVE_XCRYPT_H

8 changes: 7 additions & 1 deletion src/binary/Builtin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
#define _OW_SOURCE
#endif

#include "config.h"

#include <string>
#include <sstream>
#include <stdexcept>
#include <iconv.h>
#include <errno.h>
extern "C" {
#include <crypt.h>
#ifdef HAVE_XCRYPT_H
#include <xcrypt.h>
#else
#include <crypt.h>
#endif
}
#include <stdio.h>
#include <unistd.h>
Expand Down

0 comments on commit 435daed

Please sign in to comment.