forked from JeffersonLab/qdp-jit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qdp++-config.in
231 lines (197 loc) · 4.27 KB
/
qdp++-config.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#!/bin/sh
# qdp++-config
#
# George T. Fleming, 12 February 2003
#
# Tool for retrieving configuration information about the installed version
# of QMP.
#
# This script was inspired by many similar scripts available in RedHat Linux,
# including gnome-config, gtk-config and xmms-config.
#
# Be on the lookout for problems with undesirable CXXFLAGS and LDFLAGS
# propagating through this script. Send email to flemingg@jlab.org
# if you find such a problem.
prefix="@prefix@"
exec_prefix="@exec_prefix@"
exec_prefix_set=no
version="@VERSION@"
parallel_arch="@CONFIG_PARALLEL_ARCH@"
qmp_home="@QMP_HOME@"
qdp_cxx="@CXX@"
qdp_cxxflags="@CXXFLAGS@ -I@includedir@ @BAGEL_QDP_CXXFLAGS@ @HDF5_CXXFLAGS@ @LIBXML2_CXXFLAGS@ @QMP_CFLAGS@ @QMT_CXXFLAGS@ @LLVM_CXXFLAGS@ @CUDA_CXXFLAGS@"
qdp_ldflags="@LDFLAGS@ -L@libdir@ @BAGEL_QDP_LDFLAGS@ @HDF5_LDFLAGS@ @QMP_LDFLAGS@ @QMT_LDFLAGS@ @LLVM_LDFLAGS@"
qdp_libs="-lqdp -lXPathReader -lxmlWriter -lqio -llime @BAGEL_QDP_LIBS@ @HDF5_LIBS@ @LIBXML2_LIBS@ @QMP_LIBS@ @LIBS@ @QMT_LIBS@ @LLVM_LIBS@ @CUDA_LIBS@"
filedb_dir=@FILEDB_DIR@
case ${filedb_dir} in
filedb)
qdp_libs=${qdp_libs}" -lfiledb -lfilehash"
;;
*)
;;
esac
precision="@CONFIG_PRECISION@"
layout="@CONFIG_LAYOUT@"
qdp_ranlib="@RANLIB@"
qdp_ar="@AR@"
usage()
{
cat <<EOF
Usage: qdp++-config [OPTIONS]
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
[--version]
[--Nd]
[--Nc]
[--Ns]
[--parallel-arch]
[--qmp-home]
[--db-enabled]
[--precision]
[--layout]
[--cxx]
[--cxxflags]
[--ldflags]
[--libs]
{--ranlib]
[--ar]
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&2
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--version)
echo $version
;;
--Nd)
echo @CONFIG_ND@
;;
--Nc)
echo @CONFIG_NC@
;;
--Ns)
echo @CONFIG_NS@
;;
--parallel-arch)
echo $parallel_arch
;;
--qmp-home)
echo $qmp_home
;;
--cxx)
echo $qdp_cxx
;;
--cxxflags)
echo_cxxflags=yes
;;
--ldflags)
echo_ldflags=yes
;;
--libs)
echo_libs=yes
;;
--precision)
case "${precision}" in
32)
echo "single"
;;
64)
echo "double"
;;
*)
echo "Unknown Precision error"
;;
esac
;;
--layout)
echo ${layout}
;;
--ranlib)
echo ${qdp_ranlib}
;;
--ar)
echo ${qdp_ar}
;;
*)
usage 1 1>&2
;;
esac
shift
done
if test "X${echo_prefix}X" = "XyesX" ; then
echo $prefix
fi
if test "X${echo_exec_prefix}X" = "XyesX" ; then
echo $exec_prefix
fi
if test "X${echo_cxxflags}X" = "XyesX" ; then
output_cxxflags=
for i in $qdp_cxxflags ; do
case $i in
-I/usr/include) ;;
-g) ;;
# -O*) ;;
# -W*) ;;
*)
case " $output_cxxflags " in
*\ $i\ *) ;; # already there, skip it
*) output_cxxflags="$output_cxxflags $i" # add it to output
esac
esac
done
echo $output_cxxflags
fi
if test "X${echo_ldflags}X" = "XyesX" ; then
output_ldflags=
for i in $qdp_ldflags ; do
if test "X${i}X" != "X-I/usr/libX" ; then
case " $output_ldflags " in
*\ $i\ *) ;; # already there, skip it
*) output_ldflags="$output_ldflags $i" # add it to output
esac
fi
done
echo $output_ldflags
fi
# Straight out any possible duplicates, but be careful to
# get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz'
# Nonono! Don't do this. Sometimes you need things like
# -lpmpich -lmpich -lpmpich -lmpich when libraries depend on
# each other
if test "X${echo_libs}X" = "XyesX" ; then
rev_libs=
for i in $qdp_libs ; do
rev_libs="$i $rev_libs"
done
output_libs=
for i in $rev_libs ; do
case " $output_libs " in
*) output_libs="$i $output_libs" ;; # add it to output in reverse order
esac
done
echo $output_libs
fi