General utilities cleanup. Add signature support to catcrypt. Throw in
[u/mdw/catacomb] / catacomb-config.in
1 #! /bin/sh
2 #
3 # $Id: catacomb-config.in,v 1.2 2004/04/08 01:36:15 mdw Exp $
4 #
5 # Provide configuration information for Catacomb clients
6 #
7 # (c) 1999 Straylight/Edgeware
8 #
9
10 #----- Licensing notice -----------------------------------------------------
11 #
12 # This file is part of Catacomb.
13 #
14 # Catacomb is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU Library General Public License as
16 # published by the Free Software Foundation; either version 2 of the
17 # License, or (at your option) any later version.
18 #
19 # Catacomb is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Library General Public License for more details.
23 #
24 # You should have received a copy of the GNU Library General Public
25 # License along with Catacomb; if not, write to the Free
26 # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27 # MA 02111-1307, USA.
28
29 #----- Configuration --------------------------------------------------------
30
31 prefix=@prefix@
32 exec_prefix=@exec_prefix@
33 libdir=@libdir@
34 includedir=@includedir@
35 archincludedir=${libdir}/catacomb/include
36
37 VERSION=@VERSION@
38
39 #----- Command-line parsing and output --------------------------------------
40
41 ego=`echo "$0" | sed 's:.*/::'`
42
43 if [ -z "${1+x}" ]; then
44 echo >&2 "Usage: $ego OPTION"
45 echo >&2 "Run \`$ego --help' for more information."
46 exit 1
47 fi
48
49 case "$1" in
50 --help)
51 cat <<EOF
52 Catacomb, version $VERSION
53
54 Usage: $ego OPTION
55
56 Provides configuration parameters for Catacomb client programs. Options
57 are:
58
59 --help Display this help text.
60 --version Display Catacomb version number.
61 --check VERSION Verifies that the given version number is supported.
62 --cflags Display appropriate compiler flags.
63 --libs Display appropriate linker flags and library names.
64 EOF
65 ;;
66 --version)
67 echo $VERSION
68 ;;
69 --check)
70 version=${2-1.0.0pre0}
71 set `echo $VERSION | sed 's/[^0-9][^0-9]*/ /g'`
72 MAJOR=${1-1} MINOR=${2-0} PATCH=${3-0} PRE=$4
73 set `echo $version | sed 's/[^0-9][^0-9]*/ /g'`
74 major=${1-1} minor=${2-0} patch=${3-0} pre=$4
75 [ $major -gt $MAJOR ] && exit 1
76 [ $major -lt $MAJOR ] && exit 0
77 [ $minor -gt $MINOR ] && exit 1
78 [ $minor -lt $MINOR ] && exit 0
79 [ $patch -gt $PATCH ] && exit 1
80 [ $patch -lt $PATCH ] && exit 0
81 if [ "$PRE" ]; then
82 [ -z "$pre" ] && exit 1
83 [ $pre -gt $PRE ] && exit 1
84 [ $pre -lt $PRE ] && exit 0
85 fi
86 exit 0
87 ;;
88 --cflags)
89 echo "-I${includedir} -I${archincludedir}"
90 ;;
91 --libs)
92 echo "-L${libdir} -lcatacomb"
93 ;;
94 *)
95 echo >&2 "$ego: unrecognized option \`$1'"
96 exit 1
97 esac
98
99 #----- That's all, folks ----------------------------------------------------