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
4040 test -d "$mudir" || die muPDF not found, consult $(dirname $0)/BUILDING
4141
4242 mkdir -p $outd/{$wsid,lablGL}
43+:>$outd/ordered
4344
4445 isfresh() { test -r $1.past && test "$(<$1.past)" = "$2"; }
4546
@@ -137,14 +138,10 @@ done < <(ocamlc -config) · 91 unmodified lines
137138
138139 read cvers < <($ccomp --version)
139140
140−declare -A modset
141−modord=
142−
143141 bocaml1() {
144− if test -z "${modset[$3]-}"; then
142+ if ! grep -q "$3" $outd/ordered; then
145143 bocaml2 "$@"
146− modset[$3]=+
147− test "${3%%.cmi}" != "$3" || modord="$modord $3"
144+ echo "$3" >>"$outd/ordered"
148145 fi
149146 }
150147
@@ -287,8 +284,9 @@ else · 136 unmodified lines
287284 bocamlc wsi/x11/xlib.o
288285 fi
289286
290−cmd="ocamlc -custom $libs -o $outd/llpp $cobjs $modord -cclib \"$clibs\""
291−keycmd="digest $outd/llpp $cobjs $modord $mulibs"
287+ord=$(grep -v \.cmi $outd/ordered)
288+cmd="ocamlc -custom $libs -o $outd/llpp $cobjs $(echo $ord) -cclib \"$clibs\""
289+keycmd="digest $outd/llpp $cobjs $ord $mulibs"
292290 isfresh "$outd/llpp" "$cmd$(eval $keycmd)" || {
293291 echo linking $outd/llpp
294292 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