Updated the boilerplate on each file
[citadel.git] / textclient / configure
index 46ee9f40364465c481d88c6e5d4c1dbbfab15c3b..f49e7527f21a726ba509bf56a7d1097264ab9ee0 100755 (executable)
@@ -1,5 +1,17 @@
 #!/bin/sh
 
+# CONFIGURE SCRIPT FOR CITADEL TEXT CLIENT
+# This file is part of "conf-IG-ure"
+# Copyright (C) 2016-2019 by Art Cancro
+#
+# This program is open source software.  Use, duplication, and/or
+# disclosure are subject to the GNU General Purpose License version 3.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
 echo 
 echo 
 echo Running the configure script to create config.mk
@@ -19,16 +31,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 +67,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 <<!
+#include <openssl/ssl.h>
+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
 
 (