3 # CONFIGURE SCRIPT FOR CITADEL TEXT CLIENT
4 # This file is part of "conf-IG-ure"
5 # Copyright (C) 2016-2019 by Art Cancro
7 # This program is open source software. Use, duplication, and/or
8 # disclosure are subject to the GNU General Purpose License version 3.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
17 echo Running the configure script to create config.mk
20 # Parse the command line arguments
24 k=`echo $a | awk -F= ' { print $1 } '`
25 v=`echo $a | awk -F= ' { print $2 } '`
47 echo $0 : unknown option $k
49 echo Valid options are:
50 echo ' --prefix=PREFIX Install files in PREFIX [/usr/local]'
51 echo ' --bindir=DIR Install executables in DIR [PREFIX/bin]'
52 echo ' --etcdir=DIR Install citadel.rc in DIR [PREFIX/etc]'
53 echo ' --ctdldir=DIR Look for Citadel server in DIR [/usr/local/citadel]'
54 echo ' --with-ssl Force build with OpenSSL support [normally autodetected]'
55 echo ' --without-ssl Force build without OpenSSL support [normally autodetected]'
62 # Set any missing values
64 [ "$PREFIX" = "" ] && PREFIX=/usr/local
65 [ "$BINDIR" = "" ] && BINDIR=${PREFIX}/bin
66 [ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel
67 [ "$CFLAGS" = "" ] && CFLAGS='-Wformat-truncation=0 -ggdb'
68 [ "$LDFLAGS" = "" ] && LDFLAGS=''
71 [ "$SSL" != "yes" ] && [ "$SSL" != "no" ] && {
72 echo Testing for OpenSSL...
73 tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$
76 #include <openssl/ssl.h>
77 int main(int argc, char **argv) {
78 SSL_load_error_strings();
83 cc $tempcc -lssl -lcrypto -o $tempfile && $tempfile && SSL='yes'
84 rm -f $tempfile 2>/dev/null
85 rm -f $tempcc 2>/dev/null
88 [ "$SSL" = "yes" ] && {
89 CFLAGS=${CFLAGS}' -DHAVE_OPENSSL'
90 LDFLAGS=${LDFLAGS}' -lssl -lcrypto'
93 # Output the config.mk
96 echo "CFLAGS := ${CFLAGS}"
97 echo "LDFLAGS := ${LDFLAGS}"
98 echo "PREFIX := ${PREFIX}"
99 echo "BINDIR := ${BINDIR}"
100 echo "CTDLDIR := ${CTDLDIR}"