Skip to content

Commit

Permalink
ose: Fix support for crypto
Browse files Browse the repository at this point in the history
To enable it you have to modify the OSESSL variable in the
ose xcomp file.
  • Loading branch information
garazdawi committed Feb 24, 2014
1 parent d58602a commit 6c4ee83
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 29 deletions.
29 changes: 25 additions & 4 deletions erts/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -3940,7 +3940,7 @@ AC_SUBST(STATIC_KERBEROS_LIBS)
AC_SUBST(SSL_LINK_WITH_ZLIB)
AC_SUBST(STATIC_ZLIB_LIBS)

std_ssl_locations="/usr/local /usr/sfw /usr /opt/local /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl"
std_ssl_locations="/usr/local /usr/sfw /usr /opt/local /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl /"

AC_ARG_WITH(ssl-zlib,
AS_HELP_STRING([--with-ssl-zlib=PATH],
Expand Down Expand Up @@ -4047,6 +4047,7 @@ for a in ssl crypto ssh; do
done

SSL_DYNAMIC_ONLY=$enable_dynamic_ssl
SSL_STATIC_ONLY=no

case "$erl_xcomp_without_sysroot-$with_ssl" in
yes-* | no-no)
Expand Down Expand Up @@ -4166,6 +4167,10 @@ case "$erl_xcomp_without_sysroot-$with_ssl" in
else
is_real_ssl=no
fi
elif test -f "$dir/lib/powerpc/libsslcrypto.a"; then
SSL_CRYPTO_LIBNAME=sslcrypto
SSL_LIBDIR="$dir/lib/powerpc/"
SSL_RUNTIME_LIBDIR="$rdir/lib/powerpc/"
else
if test "x$ac_cv_sizeof_void_p" = "x8"; then
if test -f "$dir/lib64/libcrypto.a"; then
Expand All @@ -4189,9 +4194,12 @@ case "$erl_xcomp_without_sysroot-$with_ssl" in
SSL_LIBDIR="$dir/lib"
fi
fi
if test '!' -f $SSL_LIBDIR/libcrypto.a; then
if test '!' -f "$SSL_LIBDIR/lib${SSL_CRYPTO_LIBNAME}.a"; then
SSL_DYNAMIC_ONLY=yes
fi
if test '!' -f "$SSL_LIBDIR/lib${SSL_CRYPTO_LIBNAME}.so"; then
SSL_STATIC_ONLY=yes
fi
SSL_BINDIR="$rdir/bin"
if test "x$is_real_ssl" = "xyes" ; then
SSL_INCLUDE="-I$dir/include"
Expand All @@ -4212,13 +4220,20 @@ case "$erl_xcomp_without_sysroot-$with_ssl" in
if test "x$ssl_found" = "xyes"; then
if test "x$MIXED_CYGWIN" = "xyes" -o "x$MIXED_MSYS" = "xyes"; then
ssl_linkable=yes
elif test "x${SSL_CRYPTO_LIBNAME}" = "xsslcrypto"; then
# This should only be triggered seen OSE
ssl_linkable=yes
else
saveCFLAGS="$CFLAGS"
saveLDFLAGS="$LDFLAGS"
saveLIBS="$LIBS"
CFLAGS="$CFLAGS $SSL_INCLUDE"
LDFLAGS="$LDFLAGS -L$SSL_LIBDIR"
LIBS="-lcrypto"
if test "x$SSL_STATIC_ONLY" = "xyes"; then
LIBS="${SSL_LIBDIR}/lib${SSL_CRYPTO_LIBNAME}.a"
else
LDFLAGS="$LDFLAGS -L$SSL_LIBDIR"
LIBS="$LIBS -l${SSL_CRYPTO_LIBNAME}"
fi
AC_TRY_LINK([
#include <stdio.h>
#include <openssl/hmac.h>],
Expand Down Expand Up @@ -4346,6 +4361,9 @@ dnl so it is - be adoptable
# This probably wont work, but that's what the user said, so...
SSL_LIBDIR="$with_ssl/lib"
fi
elif test -f "$dir/lib/powerpc/libsslcrypto.a"; then
SSL_CRYPTO_LIBNAME=sslcrypto
SSL_LIBDIR="$with_ssl/lib/powerpc/"
elif test "x$ac_cv_sizeof_void_p" = "x8"; then
if test -f "$with_ssl/lib64/libcrypto.a"; then
SSL_LIBDIR="$with_ssl/lib64"
Expand All @@ -4364,6 +4382,9 @@ dnl so it is - be adoptable
if test '!' -f $SSL_LIBDIR/libcrypto.a; then
SSL_DYNAMIC_ONLY=yes
fi
if test '!' -f $SSL_LIBDIR/libcrypto.so; then
SSL_STATIC_ONLY=yes
fi
SSL_INCLUDE="-I$with_ssl/include"
SSL_APP=ssl
CRYPTO_APP=crypto
Expand Down
4 changes: 4 additions & 0 deletions lib/crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
# Macros
#

ifneq ($(findstring ose,$(TARGET)),ose)
SUB_DIRECTORIES = src c_src doc/src
else
SUB_DIRECTORIES = src doc/src
endif
static_lib: SUB_DIRECTORIES = c_src

include vsn.mk
Expand Down
Loading

0 comments on commit 6c4ee83

Please sign in to comment.