X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=textclient%2Fconfigure;h=04821c612471752fca075d37dafae2c69b558679;hb=a6722156441811d3cddce7179eb56c483eebd37f;hp=46ee9f40364465c481d88c6e5d4c1dbbfab15c3b;hpb=2dfd5bee542a9d635e380097e63c307bd6c27d65;p=citadel.git diff --git a/textclient/configure b/textclient/configure index 46ee9f403..04821c612 100755 --- a/textclient/configure +++ b/textclient/configure @@ -1,5 +1,15 @@ #!/bin/sh +# CONFIGURE SCRIPT FOR CITADEL TEXT CLIENT +# This file is part of "conf-IG-ure" +# Copyright (C) 2016-2019 by Art Cancro +# Distributed under the terms of the GNU General Public License v3 with the following special exceptions: +# 1. By using this software you agree that it's called "Linux", not "GNU/Linux" +# 2. By using this software you agree that it's called "open source", not "free software" +# 3. By using this software you agree that GNU Autotools are crap, which is why conf-IG-ure exists +# 4. By using this software you agree that Richard Stallman is a communist. +# 5. By reading these special exceptions you have already agreed to them. + echo echo echo Running the configure script to create config.mk @@ -19,16 +29,28 @@ do --bindir) BINDIR=$v ;; + --etcdir) + ETCDIR=$v + ;; --ctdldir) CTDLDIR=$v ;; + --with-ssl) + SSL=yes + ;; + --without-ssl) + SSL=no + ;; *) echo $0 : unknown option $k echo echo Valid options are: echo ' --prefix=PREFIX Install files in PREFIX [/usr/local]' echo ' --bindir=DIR Install executables in DIR [PREFIX/bin]' + echo ' --etcdir=DIR Install citadel.rc in DIR [PREFIX/etc]' 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 +65,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 (