chiark / gitweb /
Change James's email address
[sympathy.git] / libsympathy-config.src
1 #!/bin/sh
2 #
3 # libsympathy-config.src.in:
4 #
5 # Copyright (c) 2008 James McKenzie <sympathy@madingley.org>,
6 # All rights reserved.
7 #
8 # $Id: libsympathy-config.src.in,v 1.1 2008/02/03 16:20:23 james Exp $
9 #
10 # $Log: libsympathy-config.src.in,v $
11 # Revision 1.1  2008/02/03 16:20:23  james
12 # *** empty log message ***
13 #
14 #
15 #
16 #
17
18 prefix=/usr/local
19 exec_prefix=${prefix}
20 exec_prefix_set=no
21
22 usage()
23 {
24         cat <<EOF
25 Usage: libsympathy-config [OPTIONS] [LIBRARIES]
26 Options:
27         [--prefix[=DIR]]
28         [--exec-prefix[=DIR]]
29         [--version]
30         [--libs]
31         [--cflags]
32 EOF
33         exit $1
34 }
35
36 if test $# -eq 0; then
37         usage 1 1>&2
38 fi
39
40 while test $# -gt 0; do
41   case "$1" in
42   -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
43   *) optarg= ;;
44   esac
45
46   case $1 in
47     --prefix=*)
48       prefix=$optarg
49       if test $exec_prefix_set = no ; then
50         exec_prefix=$optarg
51       fi
52       ;;
53     --prefix)
54       echo_prefix=yes
55       ;;
56     --exec-prefix=*)
57       exec_prefix=$optarg
58       exec_prefix_set=yes
59       ;;
60     --exec-prefix)
61       echo_exec_prefix=yes
62       ;;
63     --version)
64       echo %VERSION%
65       exit 0
66       ;;
67     --cflags)
68       if test "${prefix}/include" != /usr/include ; then
69         includes="-I${prefix}/include"
70       fi
71       echo_cflags=yes
72       ;;
73     --libs)
74       echo_libs=yes
75       ;;
76     *)
77       usage 1 1>&2
78       ;;
79   esac
80   shift
81 done
82
83 if test "$echo_prefix" = "yes"; then
84         echo $prefix
85 fi
86 if test "$echo_exec_prefix" = "yes"; then
87         echo $exec_prefix
88 fi
89 if test "$echo_cflags" = "yes"; then
90         echo $includes
91 fi
92 if test "$echo_libs" = "yes"; then
93         echo -L${exec_prefix}/lib -lsympathy 
94 fi