Browse Source

Getting platform detection working

It now automatically detects whether it should build use
GSK SSL or OpenSSL for building the backend.
master
David Lanzendörfer 10 months ago
parent
commit
7de87d3332
2 changed files with 29 additions and 14 deletions
  1. +14
    -12
      ax_check_gskssl.m4
  2. +15
    -2
      configure.ac

+ 14
- 12
ax_check_gskssl.m4 View File

@ -3,7 +3,7 @@ AC_DEFUN([AX_CHECK_GSKSSL], [
found=false
AC_ARG_WITH(gskssl,
AS_HELP_STRING([--with-gskssl=DIR],
[root of the OpenSSL directory]),
[root of the GSK SSL directory]),
[
case "$withval" in
"" | y | ye | yes | n | no)
@ -27,25 +27,27 @@ AC_DEFUN([AX_CHECK_GSKSSL], [
# no such luck; use some default ssldirs
if ! $found; then
ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
ssldirs="/usr/lpp/gskssl /usr"
fi
]
)
# note that we #include <gskssl/foo.h>, so the OpenSSL headers have to be in
# note that we #include <gskssl/foo.h>, so the GSK SSL headers have to be in
# an 'gskssl' subdirectory
if ! $found; then
GSKSSL_INCLUDES=
for ssldir in $ssldirs; do
AC_MSG_CHECKING([for gskssl/ssl.h in $ssldir])
if test -f "$ssldir/include/gskssl/ssl.h"; then
GSKSSL_INCLUDES="-I$ssldir/include"
GSKSSL_LDFLAGS="-L$ssldir/lib"
GSKSSL_LIBS="-lssl -lcrypto"
found=true
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for include/gskssl.h in $ssldir])
if test -f "$ssldir/include/gskssl.h"; then
if test -f "$ssldir/lib/GSKSSL.x"; then
GSKSSL_INCLUDES="-I$ssldir/include"
GSKSSL_LDFLAGS="-L$ssldir/lib"
GSKSSL_LIBS="$ssldir/lib/GSKSSL.x"
found=true
AC_MSG_RESULT([yes])
fi
break
else
AC_MSG_RESULT([no])
@ -59,7 +61,7 @@ AC_DEFUN([AX_CHECK_GSKSSL], [
# try the preprocessor and linker with our new flags,
# being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
AC_MSG_CHECKING([whether compiling and linking against GSK SSL works])
echo "Trying link with GSKSSL_LDFLAGS=$GSKSSL_LDFLAGS;" \
"GSKSSL_LIBS=$GSKSSL_LIBS; GSKSSL_INCLUDES=$GSKSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
@ -70,7 +72,7 @@ AC_DEFUN([AX_CHECK_GSKSSL], [
LIBS="$GSKSSL_LIBS $LIBS"
CPPFLAGS="$GSKSSL_INCLUDES $CPPFLAGS"
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include <gskssl/ssl.h>], [SSL_new(NULL)]),
AC_LANG_PROGRAM([#include <gskssl.h>], [gsk_handle env_handle;]),
[
AC_MSG_RESULT([yes])
$1


+ 15
- 2
configure.ac View File

@ -77,11 +77,17 @@ AC_TYPE_UINT8_T
m4_include([ax_check_openssl.m4])
m4_include([ax_check_gskssl.m4])
AX_CHECK_OPENSSL([LIBS="$LIBS $OPENSSL_LDFLAGS $OPENSSL_LIBS" INCLUDES="$INCLUDES $OPENSSL_INCLUDES"])
AX_CHECK_GSKSSL([LIBS="$LIBS $OPENSSL_LDFLAGS $OPENSSL_LIBS" INCLUDES="$INCLUDES $OPENSSL_INCLUDES"])
AX_CHECK_OPENSSL([LIBS="$LIBS $OPENSSL_LDFLAGS $OPENSSL_LIBS" INCLUDES="$INCLUDES $OPENSSL_INCLUDES" found_openssl="yes"],[found_openssl="no"])
AX_CHECK_GSKSSL([LIBS="$LIBS $GSKSSL_LDFLAGS $GSKSSL_LIBS" INCLUDES="$INCLUDES $GSKSSL_INCLUDES" found_gskssl="yes"],[found_gskssl="no"])
AS_IF([test "$found_openssl" == "no"],[AS_IF([test "$found_gskssl" == "no"],[AC_MSG_FAILURE([No suitable SSL library found])])])
CPPFLAGS="$CPPFLAGS $INCLUDES"
AS_IF([test "$found_openssl" == "yes" ],[
echo "OpenSSL found"
AC_DEFINE([HAVE_OPENSSL], [1], [Use OpenSSL])
AC_CHECK_HEADERS([openssl/aes.h openssl/bn.h openssl/camellia.h openssl/cast.h \
openssl/des.h openssl/dsa.h openssl/err.h openssl/idea.h \
openssl/md5.h openssl/rand.h openssl/rsa.h openssl/sha.h \
@ -103,6 +109,13 @@ AC_CHECK_TYPES([SHA256_CTX],
#endif
]])
])
AS_IF([test "$found_gskssl" == "yes" ],[
echo "GSK SSL found"
AC_DEFINE([HAVE_GSKSSL], [1], [Use the SSL implementation from IBM])
])
# Checks for library functions.
#
AC_SEARCH_LIBS([gzopen], [z])


Loading…
Cancel
Save