From 20649f4f3cfe95b12a3a979860b92a9dda7451a4 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 19 Jun 2018 17:55:54 -0400 Subject: [PATCH] textclient: OpenSSL detection in conf-IG-ure --- textclient/configure | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/textclient/configure b/textclient/configure index 46ee9f403..c6f893664 100755 --- a/textclient/configure +++ b/textclient/configure @@ -22,6 +22,12 @@ do --ctdldir) CTDLDIR=$v ;; + --with-ssl) + SSL=yes + ;; + --without-ssl) + SSL=no + ;; *) echo $0 : unknown option $k echo @@ -29,6 +35,8 @@ do echo ' --prefix=PREFIX Install files in PREFIX [/usr/local]' echo ' --bindir=DIR Install executables in DIR [PREFIX/bin]' echo ' --ctdldir=DIR Look for Citadel server in DIR [/usr/local/citadel]' + echo ' --with-ssl Force build with OpenSSL support [normally autodetected' + echo ' --without-ssl Force build without OpenSSL support [normally autodetected' exit 1 ;; esac @@ -43,6 +51,29 @@ done [ "$CFLAGS" = "" ] && CFLAGS='-ggdb' [ "$LDFLAGS" = "" ] && LDFLAGS='' +# Test for OpenSSL +[ "$SSL" != "yes" ] && [ "$SSL" != "no" ] && { + echo Testing for OpenSSL... + tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$ + tempcc=${tempfile}.c + cat >$tempcc < +int main(int argc, char **argv) { + SSL_load_error_strings(); + exit(0); +} +! + SSL='no'; + cc $tempcc -lssl -lcrypto -o $tempfile && $tempfile && SSL='yes' + rm -f $tempfile 2>/dev/null + rm -f $tempcc 2>/dev/null +} +echo SSL: $SSL +[ "$SSL" = "yes" ] && { + CFLAGS=${CFLAGS}' -DHAVE_OPENSSL' + LDFLAGS=${LDFLAGS}' -lssl -lcrypto' +} + # Output the config.mk ( -- 2.30.2