From 805c27ce671937ff9506130e4b026c64ee76fc5e Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Mon, 5 Nov 2018 23:24:15 +0100 Subject: [PATCH] configure: Do not use pkg-config to find OpenSSL This allows working with both OpenSSL and LibreSSL. --- .gitignore | 1 + autogen.sh | 2 +- configure.ac | 14 ++++---------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index b1db827..37de9d6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.framework *.o *.so +*.so.* *~ .deps aclocal.m4 diff --git a/autogen.sh b/autogen.sh index 1db3b32..218fb7c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,7 +3,7 @@ set -e # Set a version for OpenBSD : ${AUTOCONF_VERSION:=2.69} -: ${AUTOMAKE_VERSION:=1.15} +: ${AUTOMAKE_VERSION:=1.16} export AUTOCONF_VERSION AUTOMAKE_VERSION aclocal -I build-aux/m4 diff --git a/configure.ac b/configure.ac index 2a27959..2e4127a 100644 --- a/configure.ac +++ b/configure.ac @@ -44,17 +44,11 @@ AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [ AC_SUBST(OBJOPENSSL_STATIC_LIB, "libobjopenssl.a") ]) -PKG_CHECK_MODULES(openssl, [openssl >= 1.0.2], [ - CPPFLAGS="$CPPFLAGS $openssl_CFLAGS" - LIBS="$LIBS $openssl_LIBS" +AC_CHECK_LIB(ssl, main, [ + LIBS="$LIBS -lssl -lcrypto" ], [ - PKG_CHECK_MODULES(eopenssl, [eopenssl >= 1.0.2], [ - CPPFLAGS="$CPPFLAGS $eopenssl_CFLAGS" - LIBS="$LIBS $eopenssl_LIBS" - ], [ - AC_MSG_ERROR(You need openssl >= 1.0.2 installed!) - ]) -]) + AC_MSG_ERROR(You need openssl >= 1.0.2 installed!) +], [-lcrypto]) AS_IF([test x"$GOBJC" = x"yes"], [ OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith -Werror"