1#! /bin/sh
2# retawq/tool/tlsmode - calculate TLS/SSL mode information
3# This file is part of retawq (<http://retawq.sourceforge.net/>), a network
4# client created by Arne Thomassen; retawq is basically released under certain
5# versions of the GNU General Public License and WITHOUT ANY WARRANTY.
6# Read the file COPYING for license details, README for program information.
7# Copyright (C) 2004-2005 Arne Thomassen <arne@arne-thomassen.de>
8
9# This shell script is automatically executed during configuration of the
10# program, to prepare compilation. Don't start it manually.
11
12# step 1: prepare
13
14#me=`echo "$0" | sed 's,.*[/],,'`
15me="$0"
16
17case "x$0" in
18  xtool/tlsmode) ;;
19  *) echo "$me: must be executed as 'tool/tlsmode'" >&2; (exit 1); exit 1 ;;
20esac
21
22case "x$#" in
23  x2) ;;
24  *) echo "$me: usage: $me <task> <OPTION_TLS>" >&2; (exit 1); exit 1 ;;
25esac
26
27task="$1"
28option_tls="$2"
29
30# step 2: calculate information
31
32cflags=
33liblink=
34
35case "x$option_tls" in
36  x0) ;; # xnone) ;;
37  x1) # xgnutls | xGnuTLS)
38    cflags=`libgnutls-config --cflags`;
39    liblink=`libgnutls-config --libs` ;;
40  x2) # xopenssl | xOpenSSL)
41    cflags=`pkg-config --cflags openssl`;
42    liblink=`pkg-config --libs openssl` ;;
43  x3) # xmatrixssl | xMatrixSSL)
44    liblink='-lmatrixssl' ;;
45  *) echo "$me: bad OPTION_TLS parameter" >&2; (exit 1); exit 1 ;;
46esac
47
48# step 3: look what to do with the calculated information
49
50case "x$task" in
51  x--cflags) echo "$cflags" ;;
52  x--libs) echo "$liblink" ;;
53  *) echo "$me: bad task parameter" >&2; (exit 1); exit 1 ;;
54esac
55
56:; exit 0
57