blob: 82337ec9078e43054dc70e558486c43110976422 [file] [log] [blame]
Alexandre Lisionddd731e2014-01-31 11:50:08 -05001#!/bin/sh
2# Copyright (C) 2006-2007 David Sugar, Tycho Softworks.
3#
4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without
6# modifications, as long as this notice is preserved.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12prefix=@prefix@
13exec_prefix=@exec_prefix@
14includedir=@includedir@
15
16if [ "`ldd /bin/sh | grep lib64`" = "" ]
17then
18 libdir=${exec_prefix}/lib
19else
20 libdir=${exec_prefix}/lib64
21fi
22
23usage()
24{
25 cat <<EOF
26Usage: commoncpp-config [OPTION]
27
28Known values for OPTION are:
29
30 --prefix=DIR change ucommon prefix [default $prefix]
31 --exec-prefix=DIR change ucommon exec prefix [default $exec_prefix]
32 --libs print library linking information
33 --cflags print pre-processor and compiler flags
34 --includes print framework include directory
35 --plugins print framework plugin directory
36 --help display this help and exit
37 --version output version information
38EOF
39
40 exit $1
41}
42
43if test $# -eq 0; then
44 usage 1
45fi
46
47cflags=false
48libs=false
49
50while test $# -gt 0; do
51 case "$1" in
52 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
53 *) optarg= ;;
54 esac
55
56 case "$1" in
57 --prefix=*)
58 prefix=$optarg
59 includedir=$prefix/include
60 libdir=$prefix/lib
61 ;;
62
63 --prefix)
64 echo $prefix
65 ;;
66
67 --exec-prefix=*)
68 exec_prefix=$optarg
69 libdir=$exec_prefix/lib
70 ;;
71
72 --exec-prefix)
73 echo $exec_prefix
74 ;;
75
76 --version)
77 echo @VERSION@
78 exit 0
79 ;;
80
81 --help)
82 usage 0
83 ;;
84
85 --cflags)
86 echo @UCOMMON_FLAGS@
87 ;;
88
89 --libtool-libs)
90 if [ -r ${libdir}/libcommoncpp.la ]
91 then
92 echo ${libdir}/libcommoncpp.la
93 fi
94 ;;
95
96 --libs)
97 echo -lcommoncpp -lucommon @UCOMMON_LIBS@
98 ;;
99
100 --includes)
101 echo @UCOMMON_INCLUDES@
102 ;;
103
104 *)
105 usage
106 exit 1
107 ;;
108
109 esac
110 shift
111done
112
113exit 0