Skip to content

Commit 395e15f

Browse files
committed
---
yaml --- r: 1921 b: refs/heads/master c: 94731fa h: refs/heads/master i: 1919: 9086a67 v: v3
1 parent ca1abcf commit 395e15f

File tree

3 files changed

+88
-15
lines changed

3 files changed

+88
-15
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: 301cfe135485e18666f1859ccf3e39ae4b91f564
2+
refs/heads/master: 94731fa458a7602d492fcd4cae97d9cfbef84a03

trunk/Makefile.in

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ else
162162
$(info cfg: have only ocaml bytecode compiler)
163163
endif
164164

165-
ifdef BOOT_PROFILE
166-
$(info cfg: forcing native bootstrap compiler (BOOT_PROFILE))
165+
ifdef CFG_BOOT_PROFILE
166+
$(info cfg: forcing native bootstrap compiler (CFG_BOOT_PROFILE))
167167
CFG_BOOT_NATIVE := 1
168168
CFG_OCAMLOPT_PROFILE_FLAGS := -p
169169
endif
170170

171-
ifdef BOOT_DEBUG
172-
$(info cfg: forcing bytecode bootstrap compiler (DEBUG))
171+
ifdef CFG_BOOT_DEBUG
172+
$(info cfg: forcing bytecode bootstrap compiler (CFG_BOOT_DEBUG))
173173
CFG_BOOT_NATIVE :=
174174
endif
175175

@@ -179,8 +179,8 @@ else
179179
$(info cfg: building bytecode bootstrap compiler)
180180
endif
181181

182-
ifdef NO_VALGRIND
183-
$(info cfg: disabling valgrind (NO_VALGRIND))
182+
ifdef CFG_DISABLE_VALGRIND
183+
$(info cfg: disabling valgrind (CFG_DISABLE_VALGRIND))
184184
CFG_VALGRIND :=
185185
endif
186186

@@ -201,6 +201,10 @@ else
201201
endif
202202
endif
203203

204+
ifdef CFG_DISABLE_DOCS
205+
$(info cfg: disabling doc build (CFG_DISABLE_DOCS))
206+
DOCS :=
207+
endif
204208

205209
######################################################################
206210
# Target-and-rule "utility variables"

trunk/configure

Lines changed: 77 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ msg() {
44
echo "configure: $1"
55
}
66

7+
step_msg() {
8+
msg
9+
msg "$1"
10+
msg
11+
}
12+
713
err() {
814
echo "configure: error: $1"
915
exit 1
@@ -67,6 +73,44 @@ probe_need() {
6773
fi
6874
}
6975

76+
opt() {
77+
local OP=$1
78+
local DEFAULT=$2
79+
shift
80+
shift
81+
local DOC="$*"
82+
local FLAG=""
83+
84+
if [ $DEFAULT -eq 0 ]
85+
then
86+
FLAG="enable"
87+
else
88+
FLAG="disable"
89+
DOC="don't $DOC"
90+
fi
91+
92+
if [ $HELP -eq 0 ]
93+
then
94+
for arg in $CFG_CONFIGURE_ARGS
95+
do
96+
if [ "$arg" = "--${FLAG}-${OP}" ]
97+
then
98+
OP=$(echo $OP | tr 'a-z' 'A-Z')
99+
FLAG=$(echo $FLAG | tr 'a-z' 'A-Z')
100+
local V="CFG_${FLAG}_${OP}"
101+
eval $V=1
102+
putvar $V
103+
fi
104+
done
105+
else
106+
if [ ! -z "$META" ]
107+
then
108+
OP="$OP=<$META>"
109+
fi
110+
printf " --%-30s %s\n" "$FLAG-$OP" "$DOC"
111+
fi
112+
}
113+
70114
msg "looking for configure programs"
71115
need_cmd mkdir
72116
need_cmd printf
@@ -84,16 +128,40 @@ msg "inspecting environment"
84128
CFG_OSTYPE=$(uname -s)
85129
CFG_CPUTYPE=$(uname -m)
86130

87-
CFG_SELF=$(echo $0 | tr '\' '/')
131+
CFG_SELF=$(echo $0 | tr '\\' '/')
88132
CFG_SRC_DIR=${CFG_SELF%${CFG_SELF##*/}}
89-
CFG_BUILD_DIR=$(echo $PWD | tr '\' '/')
133+
CFG_BUILD_DIR=$(echo $PWD | tr '\\' '/')
90134
CFG_CONFIGURE_ARGS="$@"
91135

136+
OPTIONS=""
137+
HELP=0
138+
if [ "$1" = "--help" ]
139+
then
140+
HELP=1
141+
shift
142+
echo ""
143+
echo "Usage: $CFG_SELF [options]"
144+
echo ""
145+
echo "Options:"
146+
echo ""
147+
else
148+
msg "recreating config.mk"
149+
echo '' >config.mk
150+
151+
step_msg "processing $CFG_SELF args"
152+
fi
92153

93-
msg "recreating config.mk"
94-
echo '' >config.mk
154+
opt valgrind 1 "run tests with valgrind"
155+
opt docs 1 "build documentation"
156+
157+
158+
if [ $HELP -eq 1 ]
159+
then
160+
echo ""
161+
exit 0
162+
fi
95163

96-
msg "making directories"
164+
step_msg "making directories"
97165
for i in \
98166
doc \
99167
boot/fe boot/me boot/be boot/driver boot/util \
@@ -106,13 +174,14 @@ do
106174
make_dir $i
107175
done
108176

177+
step_msg "writing out basic parameters"
109178
putvar CFG_SRC_DIR
110179
putvar CFG_BUILD_DIR
111180
putvar CFG_OSTYPE
112181
putvar CFG_CPUTYPE
113182
putvar CFG_CONFIGURE_ARGS
114183

115-
msg "looking for build programs"
184+
step_msg "looking for build programs"
116185
probe_need CFG_GCC gcc
117186
probe_need CFG_GIT git
118187
probe_need CFG_OCAMLC ocamlc
@@ -160,7 +229,7 @@ fi
160229

161230
case $CFG_LLVM_VERSION in
162231
(3.0svn | 3.0)
163-
msg "found ok version of LLVM: $CFG_LLVM_VERSION"
232+
step_msg "found ok version of LLVM: $CFG_LLVM_VERSION"
164233
;;
165234
(*)
166235
err "bad LLVM version: $CFG_LLVM_VERSION, need >=3.0svn"
@@ -181,4 +250,4 @@ rm -f config.mk.bak
181250

182251
copy ${CFG_SRC_DIR}Makefile.in ./Makefile
183252

184-
echo "configure: complete"
253+
step_msg "complete"

0 commit comments

Comments
 (0)