Check-in [c3e5ea305b]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Updated to support a user specifying a pkgconfig path for OpenSSL
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c3e5ea305b27cf178fc5eb20701c868fbfdf7389
User & Date: rkeene 2017-08-31 18:57:54
Context
2017-09-01
00:16
Try harder to ensure the right SSL libraries are used check-in: 6704c33e48 user: rkeene tags: trunk
2017-08-31
18:57
Updated to support a user specifying a pkgconfig path for OpenSSL check-in: c3e5ea305b user: rkeene tags: trunk
2017-05-30
20:46
Updated to use the shell to to find the shell rather than relying on /usr/bin/env check-in: 1370fceb9d user: rkeene tags: trunk
Changes

Changes to aclocal/tcltls_openssl.m4.

    18     18   		AC_DEFINE($4, [1], [Define this to disable $3 in OpenSSL support])
    19     19   	fi
    20     20   
    21     21   ])
    22     22   
    23     23   AC_DEFUN([TCLTLS_SSL_OPENSSL], [
    24     24   	openssldir=''
           25  +	opensslpkgconfigdir=''
    25     26   	AC_ARG_WITH([ssl-dir],
    26     27   		AS_HELP_STRING(
    27     28   			[--with-ssl-dir=<dir>],
    28     29   			[deprecated, use --with-openssl-dir -- currently has the same meaning]
    29     30   		), [
    30     31   			openssldir="$withval"
    31     32   		]
................................................................................
    33     34   	AC_ARG_WITH([openssl-dir],
    34     35   		AS_HELP_STRING(
    35     36   			[--with-openssl-dir=<dir>],
    36     37   			[path to root directory of OpenSSL or LibreSSL installation]
    37     38   		), [
    38     39   			openssldir="$withval"
    39     40   		]
           41  +	)
           42  +	AC_ARG_WITH([openssl-pkgconfig],
           43  +		AS_HELP_STRING(
           44  +			[--with-openssl-pkgconfig=<dir>],
           45  +			[path to root directory of OpenSSL or LibreSSL pkgconfigdir]
           46  +		), [
           47  +			opensslpkgconfigdir="$withval"
           48  +		]
    40     49   	)
    41     50   
    42     51   	if test -n "$openssldir"; then
    43     52   		if test -e "$openssldir/libssl.$SHOBJEXT"; then
    44     53   			TCLTLS_SSL_LIBS="-L$openssldir -lssl -lcrypto"
    45     54   			openssldir="`AS_DIRNAME(["$openssldir"])`"
    46     55   		else
................................................................................
    52     61   
    53     62   	pkgConfigExtraArgs=''
    54     63   	if test "$TCLEXT_BUILD" = "static" -o "$TCLEXT_TLS_STATIC_SSL" = 'yes'; then
    55     64   		pkgConfigExtraArgs='--static'
    56     65   	fi
    57     66   
    58     67   	dnl Use pkg-config to find the libraries
           68  +	dnl Temporarily update PKG_CONFIG_PATH
           69  +	PKG_CONFIG_PATH_SAVE="${PKG_CONFIG_PATH}"
           70  +	if test -n "${opensslpkgconfigdir}"; then
           71  +		if ! test -f "${opensslpkgconfigdir}/openssl.pc"; then
           72  +			AC_MSG_ERROR([Unable to locate ${opensslpkgconfigdir}/openssl.pc])
           73  +		fi
           74  +
           75  +		PKG_CONFIG_PATH="${opensslpkgconfigdir}${PATH_SEPARATOR}${PKG_CONFIG_PATH}"
           76  +		export PKG_CONFIG_PATH
           77  +	fi
           78  +
    59     79   	AC_ARG_VAR([TCLTLS_SSL_LIBS], [libraries to pass to the linker for OpenSSL or LibreSSL])
    60     80   	AC_ARG_VAR([TCLTLS_SSL_CFLAGS], [C compiler flags for OpenSSL or LibreSSL])
    61     81   	AC_ARG_VAR([TCLTLS_SSL_CPPFLAGS], [C preprocessor flags for OpenSSL or LibreSSL])
    62     82   	if test -z "$TCLTLS_SSL_LIBS"; then
    63     83   		TCLTLS_SSL_LIBS="`"${PKGCONFIG}" openssl --libs $pkgConfigExtraArgs`" || AC_MSG_ERROR([Unable to get OpenSSL Configuration])
    64     84   	fi
    65     85   	if test -z "$TCLTLS_SSL_CFLAGS"; then
    66     86   		TCLTLS_SSL_CFLAGS="`"${PKGCONFIG}" openssl --cflags-only-other $pkgConfigExtraArgs`" || AC_MSG_ERROR([Unable to get OpenSSL Configuration])
    67     87   	fi
    68     88   	if test -z "$TCLTLS_SSL_CPPFLAGS"; then
    69     89   		TCLTLS_SSL_CPPFLAGS="`"${PKGCONFIG}" openssl --cflags-only-I $pkgConfigExtraArgs`" || AC_MSG_ERROR([Unable to get OpenSSL Configuration])
    70     90   	fi
           91  +	PKG_CONFIG_PATH="${PKG_CONFIG_PATH_SAVE}"
    71     92   
    72     93   	if test "$TCLEXT_BUILD" = "static"; then
    73     94   		dnl If we are doing a static build, save the linker flags for other programs to consume
    74     95   		rm -f tcltls.a.linkadd
    75     96   		AS_ECHO(["$TCLTLS_SSL_LIBS"]) > tcltls.a.linkadd
    76     97   	fi
    77     98