Skip to content

Commit 03f562c

Browse files
Elly Jonesbrson
authored andcommitted
---
yaml --- r: 6126 b: refs/heads/master c: a26554d h: refs/heads/master v: v3
1 parent 700d07f commit 03f562c

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 5970e9c117ebf0b3056536553dee046fa05b6c9d
2+
refs/heads/master: a26554d97bcba62f221d5dc4112f34f86b5b60e3

trunk/configure

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,32 @@ probe_need() {
7777
fi
7878
}
7979

80+
valopt() {
81+
local OP=$1
82+
local DEFAULT=$2
83+
shift
84+
shift
85+
local DOC="$*"
86+
if [ $HELP -eq 0 ]
87+
then
88+
local UOP=$(echo $OP | tr 'a-z-' 'A-Z_')
89+
local V="CFG_${UOP}"
90+
eval $V="$DEFAULT"
91+
for arg in $CFG_CONFIGURE_ARGS
92+
do
93+
if echo "$arg" | grep -q -- "--$OP="
94+
then
95+
val=$(echo "$arg" | cut -f2 -d=)
96+
eval $V=$val
97+
fi
98+
done
99+
putvar $V
100+
else
101+
local OPDEF="${OP}=[${DEFAULT}]"
102+
printf " --%-30s %s\n" "$OPDEF" "$DOC"
103+
fi
104+
}
105+
80106
opt() {
81107
local OP=$1
82108
local DEFAULT=$2
@@ -219,7 +245,7 @@ opt valgrind 1 "run tests with valgrind"
219245
opt docs 1 "build documentation"
220246
opt optimize 1 "build optimized rust code"
221247
opt mingw-cross 0 "cross-compile for win32 using mingw"
222-
248+
valopt prefix "/usr/local" "set installation prefix"
223249

224250
if [ $HELP -eq 1 ]
225251
then

0 commit comments

Comments
 (0)