Skip to content

Commit

Permalink
Update configure to find proper openssl
Browse files Browse the repository at this point in the history
  • Loading branch information
weetmuts committed Aug 24, 2023
1 parent 4896b7a commit 6964dd7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
23 changes: 19 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,7 @@ else
if test "${host_vendor}" = "apple"; then
CONF_MNEMONIC="osx64"
MNEMONIC="OSX64"
CXXFLAGS_EXTRAS=-D_DARWIN_FEATURE_64_BIT_INODE
CXXFLAGS_EXTRAS=-D_DARWIN_FEATURE_64_BIT_INODE $(brew --prefix)/include
fi
if test "${host_vendor}" = "pc"; then
CONF_MNEMONIC="linux64"
Expand Down Expand Up @@ -4572,10 +4572,25 @@ fi
#x86_64-w64-mingw32-g++ -I../openssl-1.0.2l/include/ test.cc ../openssl-1.0.2l/libcrypto.a

if test "x${with_openssl}" = "x"; then
OPENSSL_CFLAGS="$($PKG_CONFIG openssl --cflags) -DOPENSSL_API_COMPAT=0x10100000L"
OPENSSL_LIBS="$($PKG_CONFIG openssl --libs)"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5
if $PKG_CONFIG openssl --cflags > /dev/null 2>&1
then
OPENSSL_CFLAGS="$($PKG_CONFIG openssl --cflags) -DOPENSSL_API_COMPAT=0x10100000L"
OPENSSL_LIBS="$($PKG_CONFIG openssl --libs)"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5
printf "%s\n" "found" >&6; }
else
if test "$(uname -s)" = "Darwin"
then
OPENSSL_CFLAGS="-I$(brew --prefix)/opt/openssl@3/include -DOPENSSL_API_COMPAT=0x10100000L"
OPENSSL_LIBS="-L$(brew --prefix)/opt/openssl@3/lib -lcrypto"
if ! test -r $(brew --prefix)/opt/openssl@3/include/openssl/sha.h
then
as_fn_error $? "Expected openssl/sha.h to be found in brew install!" "$LINENO" 5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5
printf "%s\n" "found" >&6; }
fi
fi
else
with_openssl=$(realpath ${with_openssl})
OPENSSL_CFLAGS="-I${with_openssl}/include -DOPENSSL_API_COMPAT=0x10100000L"
Expand Down
22 changes: 18 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ else
if test "${host_vendor}" = "apple"; then
CONF_MNEMONIC="osx64"
MNEMONIC="OSX64"
CXXFLAGS_EXTRAS=-D_DARWIN_FEATURE_64_BIT_INODE
CXXFLAGS_EXTRAS=-D_DARWIN_FEATURE_64_BIT_INODE $(brew --prefix)/include
fi
if test "${host_vendor}" = "pc"; then
CONF_MNEMONIC="linux64"
Expand Down Expand Up @@ -171,9 +171,23 @@ AC_ARG_WITH(openssl, [AS_HELP_STRING([--with-openssl],
#x86_64-w64-mingw32-g++ -I../openssl-1.0.2l/include/ test.cc ../openssl-1.0.2l/libcrypto.a

if test "x${with_openssl}" = "x"; then
OPENSSL_CFLAGS="$($PKG_CONFIG openssl --cflags) -DOPENSSL_API_COMPAT=0x10100000L"
OPENSSL_LIBS="$($PKG_CONFIG openssl --libs)"
AC_MSG_RESULT([found])
if $PKG_CONFIG openssl --cflags > /dev/null 2>&1
then
OPENSSL_CFLAGS="$($PKG_CONFIG openssl --cflags) -DOPENSSL_API_COMPAT=0x10100000L"
OPENSSL_LIBS="$($PKG_CONFIG openssl --libs)"
AC_MSG_RESULT([found])
else
if test "$(uname -s)" = "Darwin"
then
OPENSSL_CFLAGS="-I$(brew --prefix)/opt/openssl@3/include -DOPENSSL_API_COMPAT=0x10100000L"
OPENSSL_LIBS="-L$(brew --prefix)/opt/openssl@3/lib -lcrypto"
if ! test -r $(brew --prefix)/opt/openssl@3/include/openssl/sha.h
then
AC_MSG_ERROR([Expected openssl/sha.h to be found in brew install!])
fi
AC_MSG_RESULT([found])
fi
fi
else
with_openssl=$(realpath ${with_openssl})
OPENSSL_CFLAGS="-I${with_openssl}/include -DOPENSSL_API_COMPAT=0x10100000L"
Expand Down

0 comments on commit 6964dd7

Please sign in to comment.