File tree 1 file changed +40
-0
lines changed
1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,38 @@ probe_need() {
114
114
fi
115
115
}
116
116
117
+ validate_opt () {
118
+ for arg in $CFG_CONFIGURE_ARGS
119
+ do
120
+ isArgValid=0
121
+ for option in $BOOL_OPTIONS
122
+ do
123
+ if test --disable-$option = $arg
124
+ then
125
+ isArgValid=1
126
+ fi
127
+ if test --enable-$option = $arg
128
+ then
129
+ isArgValid=1
130
+ fi
131
+ done
132
+ for option in $VAL_OPTIONS
133
+ do
134
+ if echo " $arg " | grep -q -- " --$option ="
135
+ then
136
+ isArgValid=1
137
+ fi
138
+ done
139
+ if test $isArgValid -eq 0
140
+ then
141
+ err " Option '$arg ' is not recognized"
142
+ fi
143
+ done
144
+ }
145
+
117
146
valopt () {
147
+ VAL_OPTIONS=" $VAL_OPTIONS $1 "
148
+
118
149
local OP=$1
119
150
local DEFAULT=$2
120
151
shift
@@ -145,6 +176,8 @@ valopt() {
145
176
}
146
177
147
178
opt () {
179
+ BOOL_OPTIONS=" $BOOL_OPTIONS $1 "
180
+
148
181
local OP=$1
149
182
local DEFAULT=$2
150
183
shift
293
326
step_msg " processing $CFG_SELF args"
294
327
fi
295
328
329
+ BOOL_OPTIONS=" "
330
+ VAL_OPTIONS=" "
331
+
296
332
opt sharedstd 1 " build libstd as a shared library"
297
333
opt valgrind 0 " run tests with valgrind (memcheck by default)"
298
334
opt helgrind 0 " run tests with helgrind instead of memcheck"
@@ -313,6 +349,10 @@ valopt llvm-root "" "set LLVM root"
313
349
valopt host-triple " ${DEFAULT_HOST_TRIPLE} " " LLVM host triple"
314
350
valopt target-triples " ${CFG_HOST_TRIPLE} " " LLVM target triples"
315
351
352
+ # Validate Options
353
+ step_msg " validating $CFG_SELF args"
354
+ validate_opt
355
+
316
356
if [ $HELP -eq 1 ]
317
357
then
318
358
echo " "
You can’t perform that action at this time.
0 commit comments