Check-in [534f2d1839]
Overview
Comment:Updated to deal better with pkg-config OpenSSL and newer versions of TclTLS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:534f2d1839dacf600a2347da095829a1cb9226aa
User & Date: rkeene on 2017-09-06 02:08:51
Other Links: manifest | tags
Context
2017-10-13
01:52
Compile tcc4tcl with stubs enabled (should be optional?) check-in: 204d6385f0 user: rkeene tags: trunk
2017-09-06
02:08
Updated to deal better with pkg-config OpenSSL and newer versions of TclTLS check-in: 534f2d1839 user: rkeene tags: trunk
2017-09-01
00:31
Upgraded to latest TclTLS check-in: 742088eb80 user: rkeene tags: trunk
Changes

Modified tls/build.sh from [c263581111] to [ca779f9fb2].

    48     48   
    49     49   		${MAKE:-make} V=1 install || exit 1
    50     50   	) || return 1
    51     51   
    52     52   	# We always statically link
    53     53   	KC_TLS_LINKSSLSTATIC='1'
    54     54   
    55         -	SSLDIR="$(pwd)/libressl-${version}/INST"
    56         -
    57         -	PKG_CONFIG_PATH="${SSLDIR}/lib/pkgconfig:${PKG_CONFIG_PATH}"
    58         -	export PKG_CONFIG_PATH
           55  +	SSLPKGCONFIGDIR="$(pwd)/libressl-${version}/INST/lib/pkgconfig"
    59     56   
    60     57   	return 0
    61     58   }
    62     59   
    63     60   function preconfigure() {
    64     61   	# Determine SSL directory
    65     62   	if [ -z "${CPP}" ]; then
    66     63   		CPP="${CC:-cc} -E"
    67     64   	fi
           65  +
           66  +	SSLPKGCONFIGDIR=''
           67  +	SSLDIR=''
    68     68   
    69     69   	if [ -n "${KC_TLS_SSLDIR}" ]; then
    70         -		SSLDIR="${KC_TLS_SSLDIR}"
           70  +		case "${KC_TLS_SSLDIR}" in
           71  +			*/pkgconfig|*/pkgconfig/)
           72  +				SSLPKGCONFIGDIR="${KC_TLS_SSLDIR}"
           73  +				;;
           74  +			*)
           75  +				SSLDIR="${KC_TLS_SSLDIR}"
           76  +				;;
           77  +		esac
    71     78   	else
    72         -		SSLDIR=''
    73         -
           79  +		SSLGUESS='0'
    74     80   		if [ -z "${KC_TLS_BUILDSSL}" ]; then
    75         -			SSLDIR="$(echo '#include <openssl/ssl.h>' 2>/dev/null | ${CPP} - 2> /dev/null | awk '/# 1 "\/.*\/ssl\.h/{ print $3; exit }' | sed 's@^"@@;s@"$@@;s@/include/openssl/ssl\.h$@@')"
           81  +			if ! "${PKG_CONFIG:-pkg-config}" --exists openssl >/dev/null 2>/dev/null; then
           82  +				SSLDIR="$(echo '#include <openssl/ssl.h>' 2>/dev/null | ${CPP} - 2> /dev/null | awk '/# 1 "\/.*\/ssl\.h/{ print $3; exit }' | sed 's@^"@@;s@"$@@;s@/include/openssl/ssl\.h$@@')"
           83  +			else
           84  +				SSLGUESS='1'
           85  +			fi
           86  +		fi
           87  +
           88  +		if [ -z "${SSLDIR}" -a "${SSLGUESS}" = '0' ]; then
           89  +			buildSSLLibrary || SSLPKGCONFIGDIR=''
    76     90   		fi
    77     91   
    78         -		if [ -z "${SSLDIR}" ]; then
    79         -			buildSSLLibrary || SSLDIR=''
    80         -		fi
    81         -
    82         -		if [ -z "${SSLDIR}" ]; then
           92  +		if [ -z "${SSLPKGCONFIGDIR}" -a -z "${SSLDIR}" -a "${SSLGUESS}" = '0' ]; then
    83     93   			echo "Unable to find OpenSSL, aborting." >&2
    84     94   
    85     95   			return 1
    86     96   		fi
    87     97   	fi
    88     98   
    89     99   	# Add SSL library to configure options
    90         -	configure_extra=("${configure_extra[@]}" --with-openssl-dir="${SSLDIR}")
          100  +	if [ -n "${SSLPKGCONFIGDIR}" ]; then
          101  +		configure_extra=("${configure_extra[@]}" --with-openssl-pkgconfig="${SSLPKGCONFIGDIR}")
          102  +	elif [ -n "${SSLDIR}" ]; then
          103  +		configure_extra=("${configure_extra[@]}" --with-openssl-dir="${SSLDIR}")
          104  +	fi
    91    105   
    92    106   	# If we are statically linking to libssl, let tcltls know so it asks for the right
    93    107   	# packages
    94    108   	if [ "${KC_TLS_LINKSSLSTATIC}" = '1' ]; then
    95    109   		configure_extra=("${configure_extra[@]}" --enable-static-ssl)
    96    110   	fi
    97    111   }