Index: acinclude.m4
==================================================================
--- acinclude.m4
+++ acinclude.m4
@@ -14,38 +14,38 @@
dnl Disable support for TLS 1.0 protocol
AC_ARG_ENABLE([tls1], AS_HELP_STRING([--disable-tls1], [disable TLS1 protocol]), [
if test "${enableval}" = "no"; then
AC_DEFINE([NO_TLS1], [1], [Disable TLS1 protocol])
AC_MSG_CHECKING([for disable TLS1 protocol])
- AC_MSG_RESULT('yes')
+ AC_MSG_RESULT([yes])
fi
])
dnl Disable support for TLS 1.1 protocol
AC_ARG_ENABLE([tls1_1], AS_HELP_STRING([--disable-tls1_1], [disable TLS1.1 protocol]), [
if test "${enableval}" = "no"; then
AC_DEFINE([NO_TLS1_1], [1], [Disable TLS1.1 protocol])
AC_MSG_CHECKING([for disable TLS1.1 protocol])
- AC_MSG_RESULT('yes')
+ AC_MSG_RESULT([yes])
fi
])
dnl Disable support for TLS 1.2 protocol
AC_ARG_ENABLE([tls1_2], AS_HELP_STRING([--disable-tls1_2], [disable TLS1.2 protocol]), [
if test "${enableval}" = "no"; then
AC_DEFINE([NO_TLS1_2], [1], [Disable TLS1.2 protocol])
AC_MSG_CHECKING([for disable TLS1.2 protocol])
- AC_MSG_RESULT('yes')
+ AC_MSG_RESULT([yes])
fi
])
dnl Disable support for TLS 1.3 protocol
AC_ARG_ENABLE([tls1_3], AS_HELP_STRING([--disable-tls1_3], [disable TLS1.3 protocol]), [
if test "${enableval}" = "no"; then
AC_DEFINE([NO_TLS1_3], [1], [Disable TLS1.3 protocol])
AC_MSG_CHECKING([for disable TLS1.3 protocol])
- AC_MSG_RESULT('yes')
+ AC_MSG_RESULT([yes])
fi
])
dnl Determine if we have been asked to use a fast path if possible
@@ -108,11 +108,11 @@
[path to include directory of OpenSSL or LibreSSL installation]
), [
opensslincludedir="$withval"
], [
if test ! -z "$openssldir"; then
- if test -d "${openssldir}/include/openssl"; then
+ if test -f "${openssldir}/include/openssl/ssl.h"; then
opensslincludedir="${openssldir}/include/openssl"
else
opensslincludedir="${openssldir}/include"
fi
else
@@ -126,16 +126,17 @@
dnl Set SSL include vars
if test ! -z "$opensslincludedir"; then
if test -f "$opensslincludedir/ssl.h"; then
TCLTLS_SSL_CFLAGS="-I$opensslincludedir"
TCLTLS_SSL_INCLUDES="-I$opensslincludedir"
+ AC_MSG_CHECKING([for ssl.h])
+ AC_MSG_RESULT([yes])
else
+ AC_MSG_CHECKING([for ssl.h])
+ AC_MSG_RESULT([no])
AC_MSG_ERROR([Unable to locate ssl.h])
fi
- else
- TCLTLS_SSL_CFLAGS="-I${includedir}/openssl"
- TCLTLS_SSL_INCLUDES="-I${includedir}/openssl"
fi
dnl Set SSL lib files path
AC_ARG_WITH([openssl-libdir],
AS_HELP_STRING([--with-openssl-libdir=
],
@@ -160,38 +161,33 @@
dnl Set SSL lib vars
if test ! -z "$openssllibdir"; then
if test -f "$openssllibdir/libssl${SHLIB_SUFFIX}"; then
if test "${TCLEXT_TLS_STATIC_SSL}" == 'no'; then
TCLTLS_SSL_LIBS="-L$openssllibdir -lcrypto -lssl"
- else
+ #else
# Linux and Solaris
- TCLTLS_SSL_LIBS="-Wl,-Bstatic `$PKG_CONFIG --static --libs crypto ssl` -Wl,-Bdynamic"
+ #TCLTLS_SSL_LIBS="-Wl,-Bstatic `$PKG_CONFIG --static --libs crypto ssl` -Wl,-Bdynamic"
# HPUX
# -Wl,-a,archive ... -Wl,-a,shared_archive
fi
else
AC_MSG_ERROR([Unable to locate libssl${SHLIB_SUFFIX}])
fi
- else
- TCLTLS_SSL_LIBS="-lcrypto -lssl"
fi
-
-
- dnl Include config variables in --help list and make available to be substituted via AC_SUBST.
- AC_ARG_VAR([TCLTLS_SSL_CFLAGS], [C compiler flags for OpenSSL or LibreSSL])
- AC_ARG_VAR([TCLTLS_SSL_INCLUDES], [C compiler include paths for OpenSSL or LibreSSL])
- AC_ARG_VAR([TCLTLS_SSL_LIBS], [libraries to pass to the linker for OpenSSL or LibreSSL])
-
dnl Set location of pkgconfig files
AC_ARG_WITH([openssl-pkgconfig],
AS_HELP_STRING([--with-openssl-pkgconfig=],
- [path to root directory of OpenSSL or LibreSSL pkgconfigdir]
+ [path to pkgconfigdir directory for OpenSSL or LibreSSL]
), [
opensslpkgconfigdir="$withval"
], [
- opensslpkgconfigdir=''
+ if test -d ${libdir}/../pkgconfig; then
+ opensslpkgconfigdir="$libdir/../pkgconfig"
+ else
+ opensslpkgconfigdir=''
+ fi
]
)
AC_MSG_CHECKING([for OpenSSL pkgconfig])
AC_MSG_RESULT($opensslpkgconfigdir)
@@ -209,11 +205,11 @@
if test -n "${opensslpkgconfigdir}"; then
if ! test -f "${opensslpkgconfigdir}/openssl.pc"; then
AC_MSG_ERROR([Unable to locate ${opensslpkgconfigdir}/openssl.pc])
fi
- PKG_CONFIG_PATH="${opensslpkgconfigdir}${PATH_SEPARATOR}${PKG_CONFIG_PATH}"
+ PKG_CONFIG_PATH="${opensslpkgconfigdir}:${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
fi
if test -z "$TCLTLS_SSL_LIBS"; then
TCLTLS_SSL_LIBS="`"${PKG_CONFIG}" openssl --libs $pkgConfigExtraArgs`" || AC_MSG_ERROR([Unable to get OpenSSL Configuration])
fi
@@ -223,6 +219,27 @@
if test -z "$TCLTLS_SSL_INCLUDES"; then
TCLTLS_SSL_INCLUDES="`"${PKG_CONFIG}" openssl --cflags-only-I $pkgConfigExtraArgs`" || AC_MSG_ERROR([Unable to get OpenSSL Configuration])
fi
PKG_CONFIG_PATH="${PKG_CONFIG_PATH_SAVE}"
fi
+
+
+ dnl Fallback settings for OpenSSL includes and libs
+ if test -z "$TCLTLS_SSL_LIBS"; then
+ TCLTLS_SSL_LIBS="-lcrypto -lssl"
+ fi
+ if test -z "$TCLTLS_SSL_CFLAGS"; then
+ TCLTLS_SSL_CFLAGS=""
+ fi
+ if test -z "$TCLTLS_SSL_INCLUDES"; then
+ if test -d /usr/include/openssl; then
+ TCLTLS_SSL_INCLUDES="-I/usr/include/openssl"
+ else
+ TCLTLS_SSL_INCLUDES="-I/usr/include"
+ fi
+ fi
+
+ dnl Include config variables in --help list and make available to be substituted via AC_SUBST.
+ AC_ARG_VAR([TCLTLS_SSL_CFLAGS], [C compiler flags for OpenSSL or LibreSSL])
+ AC_ARG_VAR([TCLTLS_SSL_INCLUDES], [C compiler include paths for OpenSSL or LibreSSL])
+ AC_ARG_VAR([TCLTLS_SSL_LIBS], [libraries to pass to the linker for OpenSSL or LibreSSL])
])
Index: configure
==================================================================
--- configure
+++ configure
@@ -1451,12 +1451,12 @@
installation
--with-openssl-libdir=
path to lib directory of OpenSSL or LibreSSL
installation
--with-openssl-pkgconfig=
- path to root directory of OpenSSL or LibreSSL
- pkgconfigdir
+ path to pkgconfigdir directory for OpenSSL or
+ LibreSSL
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
@@ -9034,12 +9034,12 @@
printf "%s\n" "#define NO_TLS1 1" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for disable TLS1 protocol" >&5
printf %s "checking for disable TLS1 protocol... " >&6; }
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 'yes'" >&5
-printf "%s\n" "'yes'" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
fi
fi
@@ -9051,12 +9051,12 @@
printf "%s\n" "#define NO_TLS1_1 1" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for disable TLS1.1 protocol" >&5
printf %s "checking for disable TLS1.1 protocol... " >&6; }
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 'yes'" >&5
-printf "%s\n" "'yes'" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
fi
fi
@@ -9068,12 +9068,12 @@
printf "%s\n" "#define NO_TLS1_2 1" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for disable TLS1.2 protocol" >&5
printf %s "checking for disable TLS1.2 protocol... " >&6; }
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 'yes'" >&5
-printf "%s\n" "'yes'" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
fi
fi
@@ -9085,12 +9085,12 @@
printf "%s\n" "#define NO_TLS1_3 1" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for disable TLS1.3 protocol" >&5
printf %s "checking for disable TLS1.3 protocol... " >&6; }
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 'yes'" >&5
-printf "%s\n" "'yes'" >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
fi
fi
@@ -9196,11 +9196,11 @@
opensslincludedir="$withval"
else $as_nop
if test ! -z "$openssldir"; then
- if test -d "${openssldir}/include/openssl"; then
+ if test -f "${openssldir}/include/openssl/ssl.h"; then
opensslincludedir="${openssldir}/include/openssl"
else
opensslincludedir="${openssldir}/include"
fi
else
@@ -9217,16 +9217,21 @@
if test ! -z "$opensslincludedir"; then
if test -f "$opensslincludedir/ssl.h"; then
TCLTLS_SSL_CFLAGS="-I$opensslincludedir"
TCLTLS_SSL_INCLUDES="-I$opensslincludedir"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssl.h" >&5
+printf %s "checking for ssl.h... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssl.h" >&5
+printf %s "checking for ssl.h... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
as_fn_error $? "Unable to locate ssl.h" "$LINENO" 5
fi
- else
- TCLTLS_SSL_CFLAGS="-I${includedir}/openssl"
- TCLTLS_SSL_INCLUDES="-I${includedir}/openssl"
fi
# Check whether --with-openssl-libdir was given.
if test ${with_openssl_libdir+y}
@@ -9256,28 +9261,20 @@
if test ! -z "$openssllibdir"; then
if test -f "$openssllibdir/libssl${SHLIB_SUFFIX}"; then
if test "${TCLEXT_TLS_STATIC_SSL}" == 'no'; then
TCLTLS_SSL_LIBS="-L$openssllibdir -lcrypto -lssl"
- else
+ #else
# Linux and Solaris
- TCLTLS_SSL_LIBS="-Wl,-Bstatic `$PKG_CONFIG --static --libs crypto ssl` -Wl,-Bdynamic"
+ #TCLTLS_SSL_LIBS="-Wl,-Bstatic `$PKG_CONFIG --static --libs crypto ssl` -Wl,-Bdynamic"
# HPUX
# -Wl,-a,archive ... -Wl,-a,shared_archive
fi
else
as_fn_error $? "Unable to locate libssl${SHLIB_SUFFIX}" "$LINENO" 5
fi
- else
- TCLTLS_SSL_LIBS="-lcrypto -lssl"
fi
-
-
-
-
-
-
# Check whether --with-openssl-pkgconfig was given.
if test ${with_openssl_pkgconfig+y}
then :
@@ -9284,11 +9281,15 @@
withval=$with_openssl_pkgconfig;
opensslpkgconfigdir="$withval"
else $as_nop
- opensslpkgconfigdir=''
+ if test -d ${libdir}/../pkgconfig; then
+ opensslpkgconfigdir="$libdir/../pkgconfig"
+ else
+ opensslpkgconfigdir=''
+ fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL pkgconfig" >&5
@@ -9308,11 +9309,11 @@
if test -n "${opensslpkgconfigdir}"; then
if ! test -f "${opensslpkgconfigdir}/openssl.pc"; then
as_fn_error $? "Unable to locate ${opensslpkgconfigdir}/openssl.pc" "$LINENO" 5
fi
- PKG_CONFIG_PATH="${opensslpkgconfigdir}${PATH_SEPARATOR}${PKG_CONFIG_PATH}"
+ PKG_CONFIG_PATH="${opensslpkgconfigdir}:${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
fi
if test -z "$TCLTLS_SSL_LIBS"; then
TCLTLS_SSL_LIBS="`"${PKG_CONFIG}" openssl --libs $pkgConfigExtraArgs`" || as_fn_error $? "Unable to get OpenSSL Configuration" "$LINENO" 5
fi
@@ -9322,10 +9323,29 @@
if test -z "$TCLTLS_SSL_INCLUDES"; then
TCLTLS_SSL_INCLUDES="`"${PKG_CONFIG}" openssl --cflags-only-I $pkgConfigExtraArgs`" || as_fn_error $? "Unable to get OpenSSL Configuration" "$LINENO" 5
fi
PKG_CONFIG_PATH="${PKG_CONFIG_PATH_SAVE}"
fi
+
+
+ if test -z "$TCLTLS_SSL_LIBS"; then
+ TCLTLS_SSL_LIBS="-lcrypto -lssl"
+ fi
+ if test -z "$TCLTLS_SSL_CFLAGS"; then
+ TCLTLS_SSL_CFLAGS=""
+ fi
+ if test -z "$TCLTLS_SSL_INCLUDES"; then
+ if test -d /usr/include/openssl; then
+ TCLTLS_SSL_INCLUDES="-I/usr/include/openssl"
+ else
+ TCLTLS_SSL_INCLUDES="-I/usr/include"
+ fi
+ fi
+
+
+
+
#--------------------------------------------------------------------
# Shared libraries and static libraries have different names.
# Also, windows libraries and unix libraries have different names.