forked from MDSplus/mdsplus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·303 lines (272 loc) · 9.3 KB
/
configure
File metadata and controls
executable file
·303 lines (272 loc) · 9.3 KB
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
#!/bin/bash
echo "###"
echo "### This script is provided for convenience, we highly recommend you move to calling cmake directly."
echo "###"
echo ""
help() {
cat <<EOF
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Configuration:
-h, --help display this help and exit
Installation directories:
--prefix=PREFIX install files in PREFIX [/usr/local/mdsplus]
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [PREFIX/bin]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--libdir=DIR object code libraries [PREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
Optional Features:
--enable-debug=[yes/info/profile/no]
compile with debugging
--disable-largefile omit support for large files
--disable-shared Prevent building shared libraries
--enable-perf enable MDSplus I/O statistics
--disable-java Do not build java libraries and applications
--enable-d3d build d3d ptdata access library
--enable-valgrind Whether to enable Valgrind on the unit tests
--enable-sanitize=flavor
Enable compile sanitizer with flavor in
(memory | address | thread | undefined)
--disable-doxygen-doc don't generate any doxygen documentation
--enable-doxygen-dot generate graphics for doxygen documentation
--enable-doxygen-man generate doxygen manual pages
--enable-doxygen-rtf generate doxygen RTF documentation
--enable-doxygen-xml generate doxygen XML documentation
--enable-doxygen-chm generate doxygen compressed HTML help documentation
--enable-doxygen-chi generate doxygen seperate compressed HTML help index
file
--disable-doxygen-html don't generate doxygen plain HTML documentation
--enable-doxygen-ps generate doxygen PostScript documentation
--disable-doxygen-pdf don't generate doxygen PDF documentation
--enable-werror Treat all warnings as errors
Optional Packages:
--with-jdk=JDKDIR specify location of java jdk
--with-java_target=version
specify version of compiled mdsobjects classes (i.e.
6)
--with-java_bootclasspath=bootclasspath
specify the bootclasspath option for use with
--with-java_target (i.e.
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/rt.jar)
--with-gsi=globus-location:flavor
Use globus gsi for mdsip communications
--with-srb=srb-install-dir
Enable srb capabilities
--with-labview=labview-top-dir
specify location of labview such as
/usr/local/natinst/Labview
--with-idl[=idl-top-dir]
specify location of idl such as /usr/local/itt/idl,
or set IDL_DIR
--with-readline=READLINE_DIR
look for the readline library in READLINE_DIR
--with-xml-prefix=PFX Prefix where libxml is installed (optional)
Some influential environment variables:
CXX C++ compiler command
CXXFLAGS C++ compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CC C compiler command
CFLAGS C compiler flags
FC Fortran compiler command
FCFLAGS Fortran compiler flags
CPP C preprocessor
PYTHON the Python interpreter
Use these variables to override the choices made by 'configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <mdsplus@lists.psfc.mit.edu>.
EOF
}
ENVIRONMENT=
CMAKE_OPTIONS=
for i in "$@"; do
on_off=
if [[ "$i" == *"enable"* ]]; then
on_off=ON
elif [[ "$i" == *"disable"* ]]; then
on_off=OFF
fi
case $1 in
-h|--help)
help
exit 0
;;
--*-shared)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DBUILD_SHARED_LIBS=$on_off"
;;
--disable-debug)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Release -DENABLE_GPROF=OFF"
;;
--enable-debug)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug -DENABLE_GPROF=OFF"
;;
--enable-debug=*)
value="${i#*=}"
case $value in
no)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Release -DENABLE_GPROF=OFF"
;;
yes)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=Debug -DENABLE_GPROF=OFF"
;;
info)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_GPROF=OFF"
;;
profile)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_GPROF=ON"
;;
esac
;;
--prefix=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_INSTALL_PREFIX=$value"
;;
--exec-prefix=*)
echo "--exec-prefix is no longer supported"
;;
--*-largefile)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DENABLE_LARGEFILE=$on_off"
;;
--*-perf)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DENABLE_TREE_PERF=$on_off"
;;
--*-java)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DENABLE_JAVA=$on_off"
;;
--*-d3d)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DENABLE_D3D=$on_off"
;;
--*-valgrind)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DENABLE_VALGRIND=$on_off"
;;
--*-doxygen)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DENABLE_DOXYGEN=$on_off"
;;
--*-werror)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DENABLE_WERROR=$on_off"
;;
--*-wreturns)
echo "$i is no longer supported"
;;
--*-wconversion)
echo "$i is no longer supported"
;;
--disable-sanitize)
CMAKE_OPTIONS="$CMAKE_OPTIONS -DSANITIZE=OFF"
;;
--enable-sanitize=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DSANITIZE=$value"
;;
--*-silent-rules)
echo "$i is no longer supported"
;;
--jars)
# TODO
;;
--with-jdk=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DJDK_DIR=$value"
;;
--with-gsi=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DGSI=$value"
;;
--with-srb=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DSRB_DIR=$value"
;;
--with-labview=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DLABVIEW_DIR=$value"
;;
--with-idl=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DIDL_DIR=$value"
;;
--with-readline=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DREADLINE_DIR=$value"
;;
--with-xml-prefix=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DLIBXML2_DIR=$value"
;;
--with-xml-exec-prefix=*)
echo "--with-xml-exec-prefix is no longer supported"
;;
--program-prefix=*)
echo "--program-prefix is no longer supported"
;;
--program-suffix=*)
echo "--program-suffix is no longer supported"
;;
--program-transform-name=*)
echo "--program-transform-name is no longer supported"
;;
--bindir=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_INSTALL_BINDIR=$value"
;;
--libdir=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_INSTALL_LIBDIR=$value"
;;
--sysconfdir=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_INSTALL_SYSCONFDIR=$value"
;;
--includedir=*)
value="${i#*=}"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_INSTALL_INCLUDEDIR=$value"
;;
--*)
echo "Ignoring option $i"
;;
*=*)
ENVIRONMENT="$ENVIRONMENT $i"
;;
*)
;;
esac
shift
done
echo ""
echo "###"
echo "### These are the commands to use in place of this script, with the equivalent options set."
echo "###"
echo ""
WORKING_DIRECTORY="$(readlink -f "$(pwd)")"
SOURCE_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"
BINARY_DIR="${WORKING_DIRECTORY}"
# in-source builds are no longer supported
if [[ "$SOURCE_DIR" == "$WORKING_DIRECTORY" ]]; then
echo "# Builds within the source directory are no longer supported"
echo "mkdir build && cd build"
mkdir -p build
cd build || exit
SOURCE_DIR=".."
BINARY_DIR="build"
fi
CMAKE_OPTIONS="${CMAKE_OPTIONS} ${SOURCE_DIR}"
# Trim leading and trailing whitespace
ENVIRONMENT=$(echo "${ENVIRONMENT}" | xargs)
CMAKE_OPTIONS=$(echo "${CMAKE_OPTIONS}" | xargs)
echo "${ENVIRONMENT}cmake -G\"Unix Makefiles\" ${CMAKE_OPTIONS}"
echo ""
# Force reconfigure
rm -f CMakeCache.txt
env ${ENVIRONMENT} cmake -G"Unix Makefiles" "${CMAKE_OPTIONS}"
echo ""
echo "###"
echo "### Now run the following to build."
echo "###"
echo ""
if [[ "$BINARY_DIR" != "$WORKING_DIRECTORY" ]]; then
echo "cd ${BINARY_DIR}"
fi
echo "make -j"