blob: 18aea99a27aaa4356d3339eeed166a0935c1654e [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=${CMAKE_INSTALL_PREFIX}
13exec_prefix=${CMAKE_INSTALL_PREFIX}/bin
14includedir=${CMAKE_INSTALL_PREFIX}/include
15libdir=${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
16
17usage()
18{
19 cat <<EOF
20Usage: commoncpp-config [OPTION]
21
22Known values for OPTION are:
23
24 --prefix=DIR change ucommon prefix [default $prefix]
25 --exec-prefix=DIR change ucommon exec prefix [default $exec_prefix]
26 --libs print library linking information
27 --cflags print pre-processor and compiler flags
28 --includes print framework include directory
29 --plugins print framework plugin directory
30 --help display this help and exit
31 --version output version information
32EOF
33
34 exit $1
35}
36
37if test $# -eq 0; then
38 usage 1
39fi
40
41cflags=false
42libs=false
43
44while test $# -gt 0; do
45 case "$1" in
46 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
47 *) optarg= ;;
48 esac
49
50 case "$1" in
51 --prefix=*)
52 prefix=$optarg
53 includedir=$prefix/include
54 libdir=$prefix/lib
55 ;;
56
57 --prefix)
58 echo $prefix
59 ;;
60
61 --exec-prefix=*)
62 exec_prefix=$optarg
63 libdir=$exec_prefix/lib
64 ;;
65
66 --exec-prefix)
67 echo $exec_prefix
68 ;;
69
70 --version)
71 echo ${PACKAGE_FILE_VERSION}
72 exit 0
73 ;;
74
75 --help)
76 usage 0
77 ;;
78
79 --cflags)
80 echo ${PACKAGE_FLAGS}
81 ;;
82
83 --libtool-libs)
84 if [ -r ${libdir}/libcommoncpp.la ]
85 then
86 echo ${libdir}/libcommoncpp.la
87 fi
88 ;;
89
90 --libs)
91 echo -lcommoncpp -lucommon ${PACKAGE_LIBS}
92 ;;
93
94 --includes)
95 echo ${CMAKE_INSTALL_PREFIX}/include
96 ;;
97
98 *)
99 usage
100 exit 1
101 ;;
102
103 esac
104 shift
105done
106
107exit 0