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