3 # CONFIGURE SCRIPT FOR CITADEL TEXT CLIENT
4 # This file is part of "conf-IG-ure"
5 # Copyright (C) 2016-2019 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 } '`
45 echo $0 : unknown option $k
47 echo Valid options are:
48 echo ' --prefix=PREFIX Install files in PREFIX [/usr/local]'
49 echo ' --bindir=DIR Install executables in DIR [PREFIX/bin]'
50 echo ' --etcdir=DIR Install citadel.rc in DIR [PREFIX/etc]'
51 echo ' --ctdldir=DIR Look for Citadel server in DIR [/usr/local/citadel]'
52 echo ' --with-ssl Force build with OpenSSL support [normally autodetected]'
53 echo ' --without-ssl Force build without OpenSSL support [normally autodetected]'
60 # Set any missing values
62 [ "$PREFIX" = "" ] && PREFIX=/usr/local
63 [ "$BINDIR" = "" ] && BINDIR=${PREFIX}/bin
64 [ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel
65 [ "$CFLAGS" = "" ] && CFLAGS='-ggdb'
66 [ "$LDFLAGS" = "" ] && LDFLAGS=''
69 [ "$SSL" != "yes" ] && [ "$SSL" != "no" ] && {
70 echo Testing for OpenSSL...
71 tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$
74 #include <openssl/ssl.h>
75 int main(int argc, char **argv) {
76 SSL_load_error_strings();
81 cc $tempcc -lssl -lcrypto -o $tempfile && $tempfile && SSL='yes'
82 rm -f $tempfile 2>/dev/null
83 rm -f $tempcc 2>/dev/null
86 [ "$SSL" = "yes" ] && {
87 CFLAGS=${CFLAGS}' -DHAVE_OPENSSL'
88 LDFLAGS=${LDFLAGS}' -lssl -lcrypto'
91 # Output the config.mk
94 echo "CFLAGS := ${CFLAGS}"
95 echo "LDFLAGS := ${LDFLAGS}"
96 echo "PREFIX := ${PREFIX}"
97 echo "BINDIR := ${BINDIR}"
98 echo "CTDLDIR := ${CTDLDIR}"