3 # CONFIGURE SCRIPT FOR CITADEL TEXT CLIENT
4 # This file is part of "conf-IG-ure"
5 # Copyright (C) 2016-2018 by Art Cancro
6 # Distributed under the terms of the GNU General Public License v3 with the following special exceptions:
7 # 1. By using this software you agree that it's called "Linux", not "GNU/Linux"
8 # 2. By using this software you agree that it's called "open source", not "free software"
9 # 3. By using this software you agree that GNU Autotools are crap, which is why conf-IG-ure exists
10 # 4. By using this software you agree that Richard Stallman is a communist.
11 # 5. By reading these special exceptions you have already agreed to them.
15 echo Running the configure script to create config.mk
18 # Parse the command line arguments
22 k=`echo $a | awk -F= ' { print $1 } '`
23 v=`echo $a | awk -F= ' { print $2 } '`
42 echo $0 : unknown option $k
44 echo Valid options are:
45 echo ' --prefix=PREFIX Install files in PREFIX [/usr/local]'
46 echo ' --bindir=DIR Install executables in DIR [PREFIX/bin]'
47 echo ' --ctdldir=DIR Look for Citadel server in DIR [/usr/local/citadel]'
48 echo ' --with-ssl Force build with OpenSSL support [normally autodetected]'
49 echo ' --without-ssl Force build without OpenSSL support [normally autodetected]'
56 # Set any missing values
58 [ "$PREFIX" = "" ] && PREFIX=/usr/local
59 [ "$BINDIR" = "" ] && BINDIR=${PREFIX}/bin
60 [ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel
61 [ "$CFLAGS" = "" ] && CFLAGS='-ggdb'
62 [ "$LDFLAGS" = "" ] && LDFLAGS=''
65 [ "$SSL" != "yes" ] && [ "$SSL" != "no" ] && {
66 echo Testing for OpenSSL...
67 tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$
70 #include <openssl/ssl.h>
71 int main(int argc, char **argv) {
72 SSL_load_error_strings();
77 cc $tempcc -lssl -lcrypto -o $tempfile && $tempfile && SSL='yes'
78 rm -f $tempfile 2>/dev/null
79 rm -f $tempcc 2>/dev/null
82 [ "$SSL" = "yes" ] && {
83 CFLAGS=${CFLAGS}' -DHAVE_OPENSSL'
84 LDFLAGS=${LDFLAGS}' -lssl -lcrypto'
87 # Output the config.mk
90 echo "CFLAGS := ${CFLAGS}"
91 echo "LDFLAGS := ${LDFLAGS}"
92 echo "PREFIX := ${PREFIX}"
93 echo "BINDIR := ${BINDIR}"
94 echo "CTDLDIR := ${CTDLDIR}"