Index: acinclude.m4
==================================================================
--- acinclude.m4
+++ acinclude.m4
@@ -133,13 +133,10 @@
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=
],
@@ -164,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)
@@ -213,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
@@ -227,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.