forked from NationalAssociationOfRealtors/libRETS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
librets-config-inplace.in
132 lines (108 loc) · 2.38 KB
/
librets-config-inplace.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#! /bin/sh
#
# The idea to this kind of setup info script was stolen from numerous
# other packages, such as neon, libxml and gnome.
#
ARCH=@ARCH@
basedir=@abs_top_builddir@
builddir=@abs_top_builddir@/build${ARCH}
includedir=@abs_top_srcdir@/project/librets/include
librets_cflags="@LIBRETS_CFLAGS@"
librets_ldflags="@LIBRETS_LDFLAGS@"
sql="@USE_SQL_COMPILER@"
swig="@USE_SWIG_BINDINGS@"
usage()
{
cat <<EOF
Usage: librets-config [OPTION]
Available values for OPTION include:
--basedir project base directory
--cflags pre-processor and compiler flags
--help display this help and exit
--libs library linking information
--version output version information
--vernum output the version informatin as a number (hexadecimal)
--sql returns true if sql compiler included
--swig returns true if swig language bindings included
EOF
exit $1
}
output=""
output_separator=""
append_to_output()
{
output="${output}${output_separator}${1}"
output_separator=" "
}
if test $# -eq 0; then
usage 1
fi
while test $# -gt 0; do
case "$1" in
# this deals with options in the style
# --option=value and extracts the value part
# [not currently used]
-*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) value= ;;
esac
case "$1" in
--version)
echo @VERSION@
exit 0
;;
--vernum)
echo @HEX_VERSION@
exit 0
;;
--help)
usage 0
;;
--basedir)
show_basedir="yes"
;;
--cflags)
show_cflags="yes"
;;
--libs)
show_libs="yes"
;;
--sql)
show_sql="yes"
;;
--swig)
show_swig="yes"
;;
*)
echo "unknown option: $1"
usage 1
;;
esac
shift
done
if test "$show_basedir" = "yes"; then
append_to_output ${basedir}
fi
if test "$show_cflags" = "yes"; then
append_to_output -I${includedir}
append_to_output "$librets_cflags"
fi
if test "$show_libs" = "yes"; then
append_to_output ${builddir}/librets/lib/librets.a
append_to_output "$librets_ldflags"
fi
if test "$show_sql" = "yes"; then
if [ "$sql" = "1" ]; then
append_to_output "true"
else
append_to_output "false"
fi
fi
if test "$show_swig" = "yes"; then
if [ "$swig" = "1" ]; then
append_to_output "true"
else
append_to_output "false"
fi
fi
echo $output
exit 0