Skip to content

Commit 23b1053

Browse files
amosr-msftgebner
authored andcommitted
get_fstar_z3: add command-line options to specify arch and kernel
For cross-compiling or packaging, it would be useful if the script to get Z3 could get specific architectures. This PR adds --kernel and --arch options to get_fstar_z3.sh.
1 parent 67e65e8 commit 23b1053

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

.scripts/get_fstar_z3.sh

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,54 @@ full_install_z3() {
9696
}
9797

9898
usage() {
99-
echo "Usage: get_fstar_z3.sh destination/directory/bin"
99+
echo "Usage: get_fstar_z3.sh destination/directory/bin [--full] [--arch <x86_64|aarch64>] [--kernel <Linux|Darwin|Windows>]"
100100
exit 1
101101
}
102102

103-
if [ $# -ge 1 ] && [ "$1" == "--full" ]; then
104-
# Passing --full xyz/ will create a tree like
105-
# xyz/z3-4.8.5/bin/z3
106-
# xyz/z3-4.13.3/bin/z3
107-
# (plus all other files in each package). This is used
108-
# for our binary packages which include Z3.
109-
full_install=true;
110-
shift;
111-
fi
103+
dest_dir_set=false
104+
while [ $# -ge 1 ]; do
105+
case "$1" in
106+
--arch)
107+
shift
108+
if [ $# -lt 1 ]; then usage; fi
109+
arch="$1"
110+
;;
111+
--kernel)
112+
shift
113+
if [ $# -lt 1 ]; then usage; fi
114+
kernel="$1"
115+
;;
116+
--full)
117+
# Passing --full xyz/ will create a tree like
118+
# xyz/z3-4.8.5/bin/z3
119+
# xyz/z3-4.13.3/bin/z3
120+
# (plus all other files in each package). This is used
121+
# for our binary packages which include Z3.
122+
full_install=true;
123+
;;
124+
--*)
125+
usage
126+
;;
127+
--)
128+
if $dest_dir_set; then usage; fi
129+
shift
130+
if [ $# -lt 1 ]; then usage; fi
131+
dest_dir="$1"
132+
dest_dir_set=true
133+
;;
134+
*)
135+
if $dest_dir_set; then usage; fi
136+
dest_dir="$1"
137+
dest_dir_set=true
138+
;;
139+
esac
140+
shift
141+
done
112142

113-
if [ $# -ne 1 ]; then
143+
if [ "$dest_dir_set" == "false" ]; then
114144
usage
115145
fi
116146

117-
dest_dir="$1"
118-
119147
mkdir -p "$dest_dir"
120148

121149
for z3_ver in 4.8.5 4.13.3 4.15.3; do

0 commit comments

Comments
 (0)