Check-in [3defed1bc3]
Overview
Comment:Updated to support building our own libSSL (LibreSSL) if none is available or if requested (KC_TLS_BUILDSSL)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3defed1bc38425d084fad6c98a49238a265eb5b6
User & Date: rkeene on 2016-07-08 19:41:13
Other Links: manifest | tags
Context
2016-07-08
21:36
Disable SSLv3 from our TclTLS builds -- newer versions of LibSSL no longer support it check-in: cac6170c7a user: rkeene tags: trunk
19:41
Updated to support building our own libSSL (LibreSSL) if none is available or if requested (KC_TLS_BUILDSSL) check-in: 3defed1bc3 user: rkeene tags: trunk
2016-05-13
02:00
Fix to build of TCL_UTF_MAX check-in: 71bd41f921 user: rkeene tags: trunk
Changes

Modified tls/build.sh from [caf2415988] to [1b0c40489d].

    41     41   	mkdir 'src' >/dev/null 2>/dev/null
    42     42   
    43     43   	if [ ! -d 'buildsrc' ]; then
    44     44   		download "${SRCURL}" "${SRC}" "${SRCHASH}" || exit 1
    45     45   	fi
    46     46   fi
    47     47   
           48  +function buildSSLLibrary() {
           49  +	local version url hash
           50  +	local archive
           51  +
           52  +	version='2.4.1'
           53  +	url="http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${version}.tar.gz"
           54  +	hash='121922b13169cd47a85e3e77f0bc129f8d04247193b42491cb1fab9074e80477'
           55  +
           56  +	archive="src/libressl-${version}.tar.gz"
           57  +
           58  +	echo " *** Building LibreSSL v${version}" >&2
           59  +
           60  +	if [ ! -e "../${archive}" ]; then
           61  +		download "${url}" "../${archive}" "${hash}" || return 1
           62  +	fi
           63  +
           64  +	(
           65  +		rm -rf libressl-*
           66  +
           67  +		gzip -dc "../${archive}" | tar -xf - || exit 1
           68  +
           69  +		cd "libressl-${version}" || exit 1
           70  +
           71  +		echo "Running: ./configure ${CONFIGUREEXTRA} --disable-shared --enable-static --prefix=\"$(pwd)/INST\""
           72  +		./configure ${CONFIGUREEXTRA} --disable-shared --enable-static --prefix="$(pwd)/INST" || exit 1
           73  +
           74  +		echo "Running: ${MAKE:-make} V=1"
           75  +		${MAKE:-make} V=1 || exit 1
           76  +
           77  +		echo "Running: ${MAKE:-make} V=1 install" 
           78  +		${MAKE:-make} V=1 install || exit 1
           79  +	) || return 1
           80  +
           81  +	SSLDIR="$(pwd)/libressl-${version}/INST"
           82  +}
           83  +
    48     84   (
    49     85   	cd 'build' || exit 1
    50     86   
    51     87   	if [ ! -d '../buildsrc' ]; then
    52     88   		gzip -dc "../${SRC}" | tar -xf -
    53     89   	else    
    54     90   		cp -rp ../buildsrc/* './'
................................................................................
    58     94   	if [ -z "${CPP}" ]; then
    59     95   		CPP="${CC:-cc} -E"
    60     96   	fi
    61     97   
    62     98   	if [ -n "${KC_TLS_SSLDIR}" ]; then
    63     99   		SSLDIR="${KC_TLS_SSLDIR}"
    64    100   	else
    65         -		SSLDIR="$(echo '#include <openssl/ssl.h>' 2>/dev/null | ${CPP} - | awk '/# 1 "\/.*\/ssl\.h/{ print $3; exit }' | sed 's@^"@@;s@"$@@;s@/include/openssl/ssl\.h$@@')"
          101  +		SSLDIR=''
          102  +
          103  +		if [ -z "${KC_TLS_BUILDSSL}" ]; then
          104  +			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$@@')"
          105  +		fi
          106  +
          107  +		if [ -z "${SSLDIR}" ]; then
          108  +			buildSSLLibrary || SSLDIR=''
          109  +		fi
          110  +
    66    111   		if [ -z "${SSLDIR}" ]; then
    67    112   			echo "Unable to find OpenSSL, aborting." >&2
    68    113   
    69    114   			exit 1
    70    115   		fi
    71    116   	fi
    72    117