History

Revert "Create ordered module list without grep and an external file"

This reverts commit 8087d283c08033c61112cf7ce847433f92da5220. Bash that comes with macOS does not support associative arrays.

malc committed 5 years ago

Commit 37efe281 parent 8087d281 file · +6 −8Browse files

Unified · Split

build.bash+6−8
@@ -40,6 +40,7 @@ muinc="-I $mudir/include -I $mudir/thirdparty/freetype/include" · 39 unmodified lines
40test -d "$mudir" || die muPDF not found, consult $(dirname $0)/BUILDING40test -d "$mudir" || die muPDF not found, consult $(dirname $0)/BUILDING
41 41
42mkdir -p $outd/{$wsid,lablGL}42mkdir -p $outd/{$wsid,lablGL}
43:>$outd/ordered
43 44
44isfresh() { test -r $1.past && test "$(<$1.past)" = "$2"; }45isfresh() { test -r $1.past && test "$(<$1.past)" = "$2"; }
45 46
@@ -137,14 +138,10 @@ done < <(ocamlc -config) · 91 unmodified lines
137 138
138read cvers < <($ccomp --version)139read cvers < <($ccomp --version)
139 140
140declare -A modset
141modord=
142
143bocaml1() {141bocaml1() {
144 if test -z "${modset[$3]-}"; then142 if ! grep -q "$3" $outd/ordered; then
145 bocaml2 "$@"143 bocaml2 "$@"
146 modset[$3]=+144 echo "$3" >>"$outd/ordered"
147 test "${3%%.cmi}" != "$3" || modord="$modord $3"
148 fi145 fi
149}146}
150 147
@@ -287,8 +284,9 @@ else · 136 unmodified lines
287 bocamlc wsi/x11/xlib.o284 bocamlc wsi/x11/xlib.o
288fi285fi
289 286
290cmd="ocamlc -custom $libs -o $outd/llpp $cobjs $modord -cclib \"$clibs\""287ord=$(grep -v \.cmi $outd/ordered)
291keycmd="digest $outd/llpp $cobjs $modord $mulibs"288cmd="ocamlc -custom $libs -o $outd/llpp $cobjs $(echo $ord) -cclib \"$clibs\""
289keycmd="digest $outd/llpp $cobjs $ord $mulibs"
292isfresh "$outd/llpp" "$cmd$(eval $keycmd)" || {290isfresh "$outd/llpp" "$cmd$(eval $keycmd)" || {
293 echo linking $outd/llpp291 echo linking $outd/llpp
294 eval "$cmd" || die "$cmd failed"292 eval "$cmd" || die "$cmd failed"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t