Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rhel/centos support #150

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ AC_ARG_ENABLE([examples],
[build_examples="no"])
AM_CONDITIONAL([BUILD_EXAMPLES], [test x"$build_examples" != xno])

AC_LANG([C])

# Checks for libraries.
AC_ARG_WITH([utempter],
[AS_HELP_STRING([--with-utempter], [write utmp entries using libutempter @<:@check@:>@])],
Expand All @@ -82,7 +84,11 @@ AS_IF([test x"$with_utempter" != xno],

AC_SEARCH_LIBS([compress], [z], , [AC_MSG_ERROR([Unable to find zlib.])])

AX_BOOST_BASE(, , [AC_MSG_ERROR([Unable to find boost libraries.])])
AX_BOOST_BASE(1.34, , [AC_MSG_ERROR([Unable to find boost libraries.])])
# AC_LANG_PUSH([C++])
# AC_CHECK_HEADER([boost/typeof/typeof.hpp], ,
# [AC_MSG_ERROR([boost-1.34 for BOOST_AUTO required])])
# AC_LANG_POP([C++])

AC_ARG_WITH([skalibs],
[AS_HELP_STRING([--with-skalibs[=DIR]],
Expand Down Expand Up @@ -160,9 +166,13 @@ AC_CHECK_DECL([mach_absolute_time],

AC_CHECK_DECL([pipe2],
[AC_DEFINE([HAVE_PIPE2], [1],
[Define if pipe2 is available.])],
[Define if pipe2 and O_CLOEXEC is available.])],
, [[#define _GNU_SOURCE
#include <unistd.h>]])
#include <unistd.h>
#include <fcntl.h>
#ifndef O_CLOEXEC
#error O_CLOEXEC undeclared
#endif]])

AC_CHECK_DECL([signalfd],
[AC_DEFINE([HAVE_SIGNALFD], [1],
Expand All @@ -180,7 +190,11 @@ AC_CHECK_DECL([htobe64],
[AC_CHECK_DECL([OSSwapHostToBigInt64],
[AC_DEFINE([HAVE_OSX_SWAP], [1],
[Define if OSSwapHostToBigInt64 and friends exist.])],
[AC_MSG_ERROR([Unable to find byte swapping functions])],
[AC_CHECK_DECL([bswap_64],
[AC_DEFINE([HAVE_BSWAP_64], [1],
[Define if bswap_64 exist.])],
[AC_MSG_ERROR([Unable to find byte swapping functions])],
[[#include <byteswap.h>]])],
[[#include <libkern/OSByteOrder.h>]])],
[[#if defined(HAVE_ENDIAN_H)
#include <endian.h>
Expand Down
29 changes: 29 additions & 0 deletions src/crypto/byteorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,35 @@
# define be64toh OSSwapBigToHostInt64
# define htobe16 OSSwapHostToBigInt16
# define be16toh OSSwapBigToHostInt16
#elif HAVE_BSWAP_64
# include <byteswap.h>
# if __BYTE_ORDER == __LITTLE_ENDIAN
# ifndef htobe16
# define htobe16(x) bswap_16 (x)
# endif
# ifndef be16toh
# define be16toh(x) bswap_16 (x)
# endif
# ifndef htobe64
# define htobe64(x) bswap_64 (x)
# endif
# ifndef be64toh
# define be64toh(x) bswap_64 (x)
# endif
# else
# ifndef htobe16
# define htobe16(x) (x)
# endif
# ifndef be16toh
# define be16toh(x) (x)
# endif
# ifndef htobe64
# define htobe64(x) (x)
# endif
# ifndef be64toh
# define be64toh(x) (x)
# endif
# endif
#endif

#endif