~ubuntu-branches/ubuntu/trusty/osspsa/trusty

« back to all changes in this revision

Viewing changes to sa-1.2.2.orig/sa-config.in

  • Committer: Bazaar Package Importer
  • Author(s): Raphael Bossek
  • Date: 2004-11-29 10:55:45 UTC
  • Revision ID: james.westby@ubuntu.com-20041129105545-djyxcyrguk6dl3yb
Tags: 1.2.2-1
Initial Release (Closes: #285820).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
##
 
3
##  OSSP sa - Socket Abstraction
 
4
##  Copyright (c) 2001-2004 Ralf S. Engelschall <rse@engelschall.com>
 
5
##  Copyright (c) 2001-2004 The OSSP Project <http://www.ossp.org/>
 
6
##  Copyright (c) 2001-2004 Cable & Wireless <http://www.cw.com/>
 
7
##
 
8
##  This file is part of OSSP sa, a socket abstraction library which
 
9
##  can be found at http://www.ossp.org/pkg/lib/sa/.
 
10
##
 
11
##  Permission to use, copy, modify, and distribute this software for
 
12
##  any purpose with or without fee is hereby granted, provided that
 
13
##  the above copyright notice and this permission notice appear in all
 
14
##  copies.
 
15
##
 
16
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 
17
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 
18
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 
19
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
 
20
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
21
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
22
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 
23
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 
24
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
25
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 
26
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
27
##  SUCH DAMAGE.
 
28
##
 
29
##  sa-config.in: SA library build utility
 
30
##
 
31
 
 
32
DIFS=' 
 
33
'
 
34
 
 
35
prefix="@prefix@"
 
36
exec_prefix="@exec_prefix@"
 
37
 
 
38
sa_prefix="$prefix"
 
39
sa_exec_prefix="$exec_prefix"
 
40
sa_bindir="@bindir@"
 
41
sa_libdir="@libdir@"
 
42
sa_includedir="@includedir@"
 
43
sa_mandir="@mandir@"
 
44
sa_datadir="@datadir@"
 
45
sa_acdir="@datadir@/aclocal"
 
46
sa_cflags="@CFLAGS@"
 
47
sa_ldflags="@LDFLAGS@"
 
48
sa_libs="@LIBS@"
 
49
sa_version="@SA_VERSION_STR@"
 
50
 
 
51
help=no
 
52
version=no
 
53
 
 
54
usage="sa-config"
 
55
usage="$usage [--help] [--version] [--all]"
 
56
usage="$usage [--prefix] [--exec-prefix] [--bindir] [--libdir] [--includedir] [--mandir] [--datadir] [--acdir]"
 
57
usage="$usage [--cflags] [--ldflags] [--libs]"
 
58
if [ $# -eq 0 ]; then
 
59
    echo "sa-config:Error: Invalid option" 1>&2
 
60
    echo "sa-config:Usage: $usage" 1>&2
 
61
    exit 1
 
62
fi
 
63
output=''
 
64
output_extra=''
 
65
all=no
 
66
prev=''
 
67
OIFS="$IFS" IFS="$DIFS"
 
68
for option
 
69
do
 
70
    if [ ".$prev" != . ]; then
 
71
        eval "$prev=\$option"
 
72
        prev=''
 
73
        continue
 
74
    fi
 
75
    case "$option" in
 
76
        -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
 
77
           *) optarg='' ;;
 
78
    esac
 
79
    case "$option" in
 
80
        --help|-h)
 
81
            echo "Usage: $usage"
 
82
            exit 0
 
83
            ;;
 
84
        --version|-v)
 
85
            echo "OSSP sa $sa_version"
 
86
            exit 0
 
87
            ;;
 
88
        --all)
 
89
            all=yes
 
90
            ;;
 
91
        --prefix)
 
92
            output="$output $sa_prefix"
 
93
            ;;
 
94
        --exec-prefix)
 
95
            output="$output $sa_exec_prefix"
 
96
            ;;
 
97
        --bindir)
 
98
            output="$output $sa_bindir"
 
99
            ;;
 
100
        --libdir)
 
101
            output="$output $sa_libdir"
 
102
            ;;
 
103
        --includedir)
 
104
            output="$output $sa_includedir"
 
105
            ;;
 
106
        --mandir)
 
107
            output="$output $sa_mandir"
 
108
            ;;
 
109
        --datadir)
 
110
            output="$output $sa_datadir"
 
111
            ;;
 
112
        --acdir)
 
113
            output="$output $sa_acdir"
 
114
            ;;
 
115
        --cflags)
 
116
            output="$output -I$sa_includedir"
 
117
            output_extra="$output_extra $sa_cflags"
 
118
            ;;
 
119
        --ldflags)
 
120
            output="$output -L$sa_libdir"
 
121
            output_extra="$output_extra $sa_ldflags"
 
122
            ;;
 
123
        --libs)
 
124
            output="$output -lsa"
 
125
            output_extra="$output_extra $sa_libs"
 
126
            ;;
 
127
        * )
 
128
            echo "sa-config:Error: Invalid option" 1>&2
 
129
            echo "sa-config:Usage: $usage" 1>&2
 
130
            exit 1;
 
131
            ;;
 
132
    esac
 
133
done
 
134
IFS="$OIFS"
 
135
if [ ".$prev" != . ]; then
 
136
    echo "sa-config:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2
 
137
    exit 1
 
138
fi
 
139
if [ ".$output" != . ]; then
 
140
    if [ ".$all" = .yes ]; then
 
141
        output="$output $output_extra"
 
142
    fi
 
143
    echo $output
 
144
fi
 
145