chiark / gitweb /
Add some more vectors, and a whinge about how Skipjack test vectors are.
[catacomb] / catacomb-config.in
1 #! /bin/sh
2 #
3 # $Id: catacomb-config.in,v 1.1 1999/11/11 17:38:31 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 #----- Revision history -----------------------------------------------------
30 #
31 # $Log: catacomb-config.in,v $
32 # Revision 1.1  1999/11/11 17:38:31  mdw
33 # New library configuration system.
34 #
35
36 #----- Configuration --------------------------------------------------------
37
38 prefix=@prefix@
39 exec_prefix=@exec_prefix@
40 libdir=@libdir@
41 includedir=@includedir@
42 archincludedir=${libdir}/catacomb/include
43
44 VERSION=@VERSION@
45
46 #----- Command-line parsing and output --------------------------------------
47
48 ego=`echo "$0" | sed 's:.*/::'`
49
50 if [ -z "${1+x}" ]; then
51   echo >&2 "Usage: $ego OPTION"
52   echo >&2 "Run \`$ego --help' for more information."
53   exit 1
54 fi
55
56 case "$1" in
57   --help)
58     cat <<EOF
59 Catacomb, version $VERSION
60
61 Usage: $ego OPTION
62
63 Provides configuration parameters for Catacomb client programs.  Options
64 are:
65
66 --help          Display this help text.
67 --version       Display Catacomb version number.
68 --check VERSION Verifies that the given version number is supported.
69 --cflags        Display appropriate compiler flags.
70 --libs          Display appropriate linker flags and library names.
71 EOF
72   ;;
73   --version)
74     echo $VERSION
75     ;;
76   --check)
77     version=${2-1.0.0pre0}
78     set `echo $VERSION | sed 's/[^0-9][^0-9]*/ /g'`
79     MAJOR=${1-1} MINOR=${2-0} PATCH=${3-0} PRE=$4
80     set `echo $version | sed 's/[^0-9][^0-9]*/ /g'`
81     major=${1-1} minor=${2-0} patch=${3-0} pre=$4
82     [ $major -gt $MAJOR ] && exit 1
83     [ $major -lt $MAJOR ] && exit 0
84     [ $minor -gt $MINOR ] && exit 1
85     [ $minor -lt $MINOR ] && exit 0
86     [ $patch -gt $PATCH ] && exit 1
87     [ $patch -lt $PATCH ] && exit 0
88     if [ "$PRE" ]; then
89       [ -z "$pre" ] && exit 1
90       [ $pre -gt $PRE ] && exit 1
91       [ $pre -lt $PRE ] && exit 0
92     fi
93     exit 0
94     ;;
95   --cflags)
96     echo "-I${includedir} -I${archincludedir}"
97     ;;
98   --libs)
99     echo "-L${libdir} -lcatacomb"
100     ;;
101   *)
102     echo >&2 "$ego: unrecognized option \`$1'"
103     exit 1
104 esac
105
106 #----- That's all, folks ----------------------------------------------------