blob: 50a939715ced77a09cd94245251863bdb85cec61 [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: ucommon-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 --clink print c model linking information
28 --cflags print pre-processor and compiler flags
29 --minimal print minimal linking information
30 --includes print framework include directory
31 --plugins print framework plugin directory
32 --model print the linking model used
33 --help display this help and exit
34 --version output version information
35EOF
36
37 exit $1
38}
39
40if test $# -eq 0; then
41 usage 1
42fi
43
44cflags=false
45libs=false
46
47while test $# -gt 0; do
48 case "$1" in
49 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
50 *) optarg= ;;
51 esac
52
53 case "$1" in
54 --prefix=*)
55 prefix=$optarg
56 includedir=$prefix/include
57 libdir=$prefix/lib
58 ;;
59
60 --prefix)
61 echo $prefix
62 ;;
63
64 --exec-prefix=*)
65 exec_prefix=$optarg
66 libdir=$exec_prefix/lib
67 ;;
68
69 --exec-prefix)
70 echo $exec_prefix
71 ;;
72
73 --version)
74 echo ${PACKAGE_FILE_VERSION}
75 exit 0
76 ;;
77
78 --help)
79 usage 0
80 ;;
81
82 --cflags)
83 echo ${PACKAGE_FLAGS}
84 ;;
85
86 --libtool-libs)
87 if [ -r ${libdir}/libucommon.la ]
88 then
89 echo ${libdir}/libucommon.la
90 fi
91 ;;
92
93 --model)
94 echo CXX
95 ;;
96
97 --clink)
98 echo -lc
99 ;;
100
101 --minimal)
102 echo -lucommon ${PACKAGE_LIBS}
103 ;;
104
105
106 --libs)
107 echo -lusecure -lucommon ${ADDITIONAL_LIBS} ${PACKAGE_LIBS}
108 ;;
109
110 --includes)
111 echo ${CMAKE_INSTALL_PREFIX}/include
112 ;;
113
114 *)
115 usage
116 exit 1
117 ;;
118
119 esac
120 shift
121done
122
123exit 0