Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -99,11 +99,11 @@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CCLD = @CCLD@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ -CFLAGS_WARNING = @CFLAGS_WARNING@ -Wno-deprecated-declarations +CFLAGS_WARNING = @CFLAGS_WARNING@ EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ 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 @@ -97,49 +97,52 @@ openssldir="$withval" ], [ openssldir='' ] ) + AC_MSG_CHECKING([for OpenSSL directory]) + AC_MSG_RESULT($openssldir) dnl Set SSL include files path AC_ARG_WITH([openssl-includedir], AS_HELP_STRING([--with-openssl-includedir=], [path to include directory of OpenSSL or LibreSSL installation] ), [ opensslincludedir="$withval" ], [ - if test -n "$openssldir"; then - opensslincludedir="$openssldir/include/openssl" + if test ! -z "$openssldir"; then + opensslincludedir="${openssldir}/include" else opensslincludedir='' fi ] ) AC_MSG_CHECKING([for OpenSSL include directory]) AC_MSG_RESULT($opensslincludedir) dnl Set SSL include vars - if test -n "$opensslincludedir"; then - if test -f "$opensslincludedir/ssl.h"; then + if test ! -z "$opensslincludedir"; then + if test -f "$opensslincludedir/openssl/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=], [path to lib directory of OpenSSL or LibreSSL installation] ), [ openssllibdir="$withval" ], [ - if test -n "$openssldir"; then + if test ! -z "$openssldir"; then if test "$do64bit" == 'yes'; then openssllibdir="$openssldir/lib64" else openssllibdir="$openssldir/lib" fi @@ -150,42 +153,37 @@ ) AC_MSG_CHECKING([for OpenSSL lib directory]) AC_MSG_RESULT($openssllibdir) dnl Set SSL lib vars - if test -n "$openssllibdir"; then + 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) @@ -203,11 +201,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 @@ -217,6 +215,25 @@ 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 -f /usr/include/openssl/ssl.h; then + 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 @@ -1442,12 +1442,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 @@ -9287,12 +9287,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 @@ -9304,12 +9304,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 @@ -9321,12 +9321,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 @@ -9338,12 +9338,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 @@ -9438,10 +9438,14 @@ ;; esac fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL directory" >&5 +printf %s "checking for OpenSSL directory... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $openssldir" >&5 +printf "%s\n" "$openssldir" >&6; } # Check whether --with-openssl-includedir was given. if test ${with_openssl_includedir+y} then : @@ -9448,12 +9452,12 @@ withval=$with_openssl_includedir; opensslincludedir="$withval" else case e in #( e) - if test -n "$openssldir"; then - opensslincludedir="$openssldir/include/openssl" + if test ! -z "$openssldir"; then + opensslincludedir="${openssldir}/include" else opensslincludedir='' fi ;; @@ -9463,20 +9467,25 @@ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL include directory" >&5 printf %s "checking for OpenSSL include directory... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $opensslincludedir" >&5 printf "%s\n" "$opensslincludedir" >&6; } - if test -n "$opensslincludedir"; then - if test -f "$opensslincludedir/ssl.h"; then + if test ! -z "$opensslincludedir"; then + if test -f "$opensslincludedir/openssl/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} @@ -9484,11 +9493,11 @@ withval=$with_openssl_libdir; openssllibdir="$withval" else case e in #( e) - if test -n "$openssldir"; then + if test ! -z "$openssldir"; then if test "$do64bit" == 'yes'; then openssllibdir="$openssldir/lib64" else openssllibdir="$openssldir/lib" fi @@ -9503,32 +9512,24 @@ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenSSL lib directory" >&5 printf %s "checking for OpenSSL lib directory... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $openssllibdir" >&5 printf "%s\n" "$openssllibdir" >&6; } - if test -n "$openssllibdir"; then + 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 : @@ -9535,11 +9536,15 @@ withval=$with_openssl_pkgconfig; opensslpkgconfigdir="$withval" else case e in #( e) - opensslpkgconfigdir='' + if test -d ${libdir}/../pkgconfig; then + opensslpkgconfigdir="$libdir/../pkgconfig" + else + opensslpkgconfigdir='' + fi ;; esac fi @@ -9560,11 +9565,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 @@ -9575,10 +9580,27 @@ 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 -f /usr/include/openssl/ssl.h; then + 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. # For the OpenSSL version, I chose to use the same library names that @@ -9586,11 +9608,11 @@ #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "$GCC" = "yes"; then - PKG_CFLAGS="$PKG_CFLAGS ${TCLTLS_SSL_CFLAGS}" + PKG_CFLAGS="$PKG_CFLAGS ${TCLTLS_SSL_CFLAGS} -Wno-deprecated-declarations" vars="${TCLTLS_SSL_INCLUDES}" for i in $vars; do @@ -9610,11 +9632,11 @@ fi else - PKG_CFLAGS="$PKG_CFLAGS ${TCLTLS_SSL_CFLAGS}" + PKG_CFLAGS="$PKG_CFLAGS ${TCLTLS_SSL_CFLAGS} -Wno-deprecated-declarations" vars="${TCLTLS_SSL_INCLUDES}" for i in $vars; do Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -175,16 +175,16 @@ # OpenSSL uses as its default names. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "$GCC" = "yes"; then - TEA_ADD_CFLAGS([${TCLTLS_SSL_CFLAGS}]) + TEA_ADD_CFLAGS([${TCLTLS_SSL_CFLAGS} -Wno-deprecated-declarations]) TEA_ADD_INCLUDES([${TCLTLS_SSL_INCLUDES}]) TEA_ADD_LIBS([${TCLTLS_SSL_LIBS}]) fi else - TEA_ADD_CFLAGS([${TCLTLS_SSL_CFLAGS}]) + TEA_ADD_CFLAGS([${TCLTLS_SSL_CFLAGS} -Wno-deprecated-declarations]) TEA_ADD_INCLUDES([${TCLTLS_SSL_INCLUDES}]) TEA_ADD_LIBS([${TCLTLS_SSL_LIBS}]) fi #-------------------------------------------------------------------- Index: pkgIndex.tcl.in ================================================================== --- pkgIndex.tcl.in +++ pkgIndex.tcl.in @@ -10,12 +10,14 @@ } } else { if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ [list apply {{dir} { if {[string tolower [file extension @PKG_LIB_FILE8@]] in [list .dll .dylib .so]} { + # Load dynamic library load [file join $dir @PKG_LIB_FILE8@] [string totitle @PACKAGE_NAME@] } else { + # Static library load {} [string totitle @PACKAGE_NAME@] } set initScript [file join $dir @PACKAGE_NAME@.tcl] if {[file exists $initScript]} { source -encoding utf-8 $initScript