author | wenzelm |
Tue, 29 Aug 2023 12:53:28 +0200 | |
changeset 78592 | fdfe9b91d96e |
parent 78483 | 5683e49f7884 |
child 78770 | 8a7c0f8fc9d2 |
permissions | -rw-r--r-- |
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
1 |
/* Title: Pure/Admin/component_polyml.scala |
64483 | 2 |
Author: Makarius |
3 |
||
4 |
Build Poly/ML from sources. |
|
5 |
*/ |
|
6 |
||
7 |
package isabelle |
|
8 |
||
9 |
||
69704 | 10 |
import scala.util.matching.Regex |
11 |
||
12 |
||
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
13 |
object Component_PolyML { |
65880 | 14 |
/** platform-specific build **/ |
64496 | 15 |
|
64483 | 16 |
sealed case class Platform_Info( |
17 |
options: List[String] = Nil, |
|
64487 | 18 |
setup: String = "", |
72462
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
19 |
libs: Set[String] = Set.empty) |
64483 | 20 |
|
21 |
private val platform_info = Map( |
|
69704 | 22 |
"linux" -> |
67580
eb64467e8bcf
more robust access to shared libraries for poly executable: avoid global change of LD_LIBRARY_PATH (e.g. relevant for subprocesses);
wenzelm
parents:
66998
diff
changeset
|
23 |
Platform_Info( |
69704 | 24 |
options = List("LDFLAGS=-Wl,-rpath,_DUMMY_"), |
72462
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
25 |
libs = Set("libgmp")), |
69704 | 26 |
"darwin" -> |
64483 | 27 |
Platform_Info( |
73666
4d0df84a5b88
clarified options: implicitly support both x86_64 and arm64;
wenzelm
parents:
73340
diff
changeset
|
28 |
options = List("CFLAGS=-O3", "CXXFLAGS=-O3", "LDFLAGS=-segprot POLY rwx rwx"), |
69704 | 29 |
setup = "PATH=/usr/bin:/bin:/usr/sbin:/sbin", |
72462
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
30 |
libs = Set("libpolyml", "libgmp")), |
69704 | 31 |
"windows" -> |
64483 | 32 |
Platform_Info( |
33 |
options = |
|
67597 | 34 |
List("--host=x86_64-w64-mingw32", "CPPFLAGS=-I/mingw64/include", "--disable-windows-gui"), |
72427 | 35 |
setup = MinGW.environment_export, |
72468 | 36 |
libs = Set("libgcc_s_seh", "libgmp", "libstdc++", "libwinpthread"))) |
64483 | 37 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
38 |
def polyml_platform(arch_64: Boolean): String = { |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
39 |
val platform = Isabelle_Platform.self |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
40 |
(if (arch_64) platform.arch_64 else platform.arch_64_32) + "-" + platform.os_name |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
41 |
} |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
42 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
43 |
def make_polyml( |
64489 | 44 |
root: Path, |
64495 | 45 |
sha1_root: Option[Path] = None, |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
46 |
target_dir: Path = Path.current, |
64493 | 47 |
arch_64: Boolean = false, |
64485
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
48 |
options: List[String] = Nil, |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
49 |
mingw: MinGW = MinGW.none, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
50 |
progress: Progress = new Progress, |
75393 | 51 |
): Unit = { |
64489 | 52 |
if (!((root + Path.explode("configure")).is_file && (root + Path.explode("PolyML")).is_dir)) |
53 |
error("Bad Poly/ML root directory: " + root) |
|
64483 | 54 |
|
72352
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
55 |
val platform = Isabelle_Platform.self |
69704 | 56 |
|
72352
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
57 |
val sha1_platform = platform.arch_64 + "-" + platform.os_name |
64493 | 58 |
|
64483 | 59 |
val info = |
72352
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
60 |
platform_info.getOrElse(platform.os_name, |
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
61 |
error("Bad OS platform: " + quote(platform.os_name))) |
64483 | 62 |
|
72455 | 63 |
if (platform.is_linux) Isabelle_System.require_command("chrpath") |
70977 | 64 |
|
64491 | 65 |
|
64495 | 66 |
/* bash */ |
67 |
||
64504 | 68 |
def bash( |
73672
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
69 |
cwd: Path, script: String, |
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
70 |
redirect: Boolean = false, |
75393 | 71 |
echo: Boolean = false |
72 |
): Process_Result = { |
|
73672
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
73 |
val script1 = |
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
74 |
if (platform.is_arm && platform.is_macos) { |
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
75 |
"arch -arch arm64 bash -c " + Bash.string(script) |
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
76 |
} |
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
77 |
else mingw.bash_script(script) |
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
78 |
progress.bash(script1, cwd = cwd.file, redirect = redirect, echo = echo) |
64504 | 79 |
} |
64495 | 80 |
|
81 |
||
64491 | 82 |
/* configure and make */ |
83 |
||
64483 | 84 |
val configure_options = |
67783
839de121665c
more robust build: prevent problems seen with Poly/ML eb94e2820013 on Mac OS X;
wenzelm
parents:
67609
diff
changeset
|
85 |
List("--disable-shared", "--enable-intinf-as-int", "--with-gmp") ::: |
69704 | 86 |
info.options ::: options ::: (if (arch_64) Nil else List("--enable-compact32bit")) |
64483 | 87 |
|
64495 | 88 |
bash(root, |
64487 | 89 |
info.setup + "\n" + |
64485
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
90 |
""" |
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
91 |
[ -f Makefile ] && make distclean |
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
92 |
{ |
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
93 |
./configure --prefix="$PWD/target" """ + Bash.strings(configure_options) + """ |
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
94 |
rm -rf target |
74635 | 95 |
make && make install |
64485
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
96 |
} || { echo "Build failed" >&2; exit 2; } |
64501 | 97 |
""", redirect = true, echo = true).check |
64485
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
98 |
|
64491 | 99 |
|
64495 | 100 |
/* sha1 library */ |
101 |
||
102 |
val sha1_files = |
|
103 |
if (sha1_root.isDefined) { |
|
104 |
val dir1 = sha1_root.get |
|
72352
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
105 |
bash(dir1, "./build " + sha1_platform, redirect = true, echo = true).check |
64505 | 106 |
|
72352
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
107 |
val dir2 = dir1 + Path.explode(sha1_platform) |
72462
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
108 |
File.read_dir(dir2).map(entry => dir2 + Path.basic(entry)) |
64495 | 109 |
} |
110 |
else Nil |
|
111 |
||
112 |
||
72462
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
113 |
/* install */ |
64484 | 114 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
115 |
val platform_path = Path.explode(polyml_platform(arch_64)) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
116 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
117 |
val platform_dir = target_dir + platform_path |
72462
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
118 |
Isabelle_System.rm_tree(platform_dir) |
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
119 |
Isabelle_System.make_directory(platform_dir) |
64483 | 120 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
121 |
val root_platform_dir = Isabelle_System.make_directory(root + platform_path) |
64483 | 122 |
for { |
64484 | 123 |
d <- List("target/bin", "target/lib") |
64489 | 124 |
dir = root + Path.explode(d) |
64483 | 125 |
entry <- File.read_dir(dir) |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
126 |
} Isabelle_System.move_file(dir + Path.explode(entry), root_platform_dir) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
127 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
128 |
Isabelle_System.copy_dir(root_platform_dir, platform_dir, direct = true) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
129 |
for (file <- sha1_files) Isabelle_System.copy_file(file, platform_dir) |
67584 | 130 |
|
72469 | 131 |
Executable.libraries_closure( |
132 |
platform_dir + Path.basic("poly").platform_exe, mingw = mingw, filter = info.libs) |
|
133 |
||
67584 | 134 |
|
135 |
/* polyc: directory prefix */ |
|
136 |
||
72378 | 137 |
val Header = "#! */bin/sh".r |
75205 | 138 |
File.change_lines(platform_dir + Path.explode("polyc")) { |
139 |
case Header() :: lines => |
|
140 |
val lines1 = |
|
141 |
lines.map(line => |
|
142 |
if (line.startsWith("prefix=")) "prefix=\"$(cd \"$(dirname \"$0\")\"; pwd)\"" |
|
143 |
else if (line.startsWith("BINDIR=")) "BINDIR=\"$prefix\"" |
|
144 |
else if (line.startsWith("LIBDIR=")) "LIBDIR=\"$prefix\"" |
|
145 |
else line) |
|
146 |
"#!/usr/bin/env bash" :: lines1 |
|
147 |
case lines => |
|
148 |
error(cat_lines("Cannot patch polyc -- undetected header:" :: lines.take(3))) |
|
75202 | 149 |
} |
64483 | 150 |
} |
151 |
||
152 |
||
64496 | 153 |
|
65880 | 154 |
/** skeleton for component **/ |
155 |
||
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
156 |
val default_polyml_url = "https://github.com/polyml/polyml/archive" |
78483
5683e49f7884
update to polyml-219e0a248f70, with more robust support for ARM64;
wenzelm
parents:
78482
diff
changeset
|
157 |
val default_polyml_version = "219e0a248f70" |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
158 |
val default_polyml_name = "polyml-5.9" |
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
159 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
160 |
val default_sha1_url = "https://isabelle.sketis.net/repos/sha1/archive" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
161 |
val default_sha1_version = "e0239faa6f42" |
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
162 |
|
77191 | 163 |
private def init_src_root(src_dir: Path, input: String, output: String): Unit = { |
164 |
val lines = split_lines(File.read(src_dir + Path.explode(input))) |
|
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
165 |
val ml_files = |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
166 |
for { |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
167 |
line <- lines |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
168 |
rest <- Library.try_unprefix("use", line) |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
169 |
} yield "ML_file" + rest |
65880 | 170 |
|
77191 | 171 |
File.write(src_dir + Path.explode(output), |
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
172 |
"""(* Poly/ML Compiler root file. |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
173 |
|
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
174 |
When this file is open in the Prover IDE, the ML files of the Poly/ML |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
175 |
compiler can be explored interactively. This is a separate copy: it does |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
176 |
not affect the running ML session. *) |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
177 |
""" + ml_files.mkString("\n", "\n", "\n")) |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
178 |
} |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
179 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
180 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
181 |
def build_polyml( |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
182 |
options: List[String] = Nil, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
183 |
mingw: MinGW = MinGW.none, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
184 |
component_name: String = "", |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
185 |
polyml_url: String = default_polyml_url, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
186 |
polyml_version: String = default_polyml_version, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
187 |
polyml_name: String = default_polyml_name, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
188 |
sha1_url: String = default_sha1_url, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
189 |
sha1_version: String = default_sha1_version, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
190 |
target_dir: Path = Path.current, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
191 |
progress: Progress = new Progress |
75393 | 192 |
): Unit = { |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
193 |
/* component */ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
194 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
195 |
val component_name1 = if (component_name.isEmpty) "polyml-" + polyml_version else component_name |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
196 |
val component_dir = Components.Directory(target_dir + Path.basic(component_name1)).create() |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
197 |
progress.echo("Component " + component_dir) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
198 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
199 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
200 |
/* download and build */ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
201 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
202 |
Isabelle_System.with_tmp_dir("download") { download_dir => |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
203 |
val List(polyml_download, sha1_download) = |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
204 |
for { |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
205 |
(url, version, target) <- |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
206 |
List((polyml_url, polyml_version, "src"), (sha1_url, sha1_version, "sha1")) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
207 |
} yield { |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
208 |
val remote = Url.append_path(url, version + ".tar.gz") |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
209 |
val download = download_dir + Path.basic(version) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
210 |
Isabelle_System.download_file(remote, download.tar.gz, progress = progress) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
211 |
Isabelle_System.extract(download.tar.gz, download, strip = true) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
212 |
Isabelle_System.extract( |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
213 |
download.tar.gz, component_dir.path + Path.basic(target), strip = true) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
214 |
download |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
215 |
} |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
216 |
|
77191 | 217 |
init_src_root(component_dir.src, "RootArm64.ML", "ROOT0.ML") |
218 |
init_src_root(component_dir.src, "RootX86.ML", "ROOT.ML") |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
219 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
220 |
for (arch_64 <- List(false, true)) { |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
221 |
progress.echo("Building " + polyml_platform(arch_64)) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
222 |
make_polyml( |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
223 |
root = polyml_download, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
224 |
sha1_root = Some(sha1_download), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
225 |
target_dir = component_dir.path, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
226 |
arch_64 = arch_64, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
227 |
options = options, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
228 |
mingw = mingw, |
77510
f5d6cd98b16a
clarified signature: manage "verbose" flag via "progress";
wenzelm
parents:
77191
diff
changeset
|
229 |
progress = if (progress.verbose) progress else new Progress) |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
230 |
} |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
231 |
} |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
232 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
233 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
234 |
/* settings */ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
235 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
236 |
component_dir.write_settings("""# -*- shell-script -*- :mode=shellscript: |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
237 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
238 |
POLYML_HOME="$COMPONENT" |
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
239 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
240 |
if [ -n "$ISABELLE_APPLE_PLATFORM64" ] |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
241 |
then |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
242 |
if grep "ML_system_apple.*=.*false" "$ISABELLE_HOME_USER/etc/preferences" >/dev/null 2>/dev/null |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
243 |
then |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
244 |
ML_PLATFORM="$ISABELLE_PLATFORM64" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
245 |
else |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
246 |
ML_PLATFORM="$ISABELLE_APPLE_PLATFORM64" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
247 |
fi |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
248 |
else |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
249 |
ML_PLATFORM="${ISABELLE_WINDOWS_PLATFORM64:-$ISABELLE_PLATFORM64}" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
250 |
fi |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
251 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
252 |
if grep "ML_system_64.*=.*true" "$ISABELLE_HOME_USER/etc/preferences" >/dev/null 2>/dev/null |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
253 |
then |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
254 |
ML_OPTIONS="--minheap 1000" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
255 |
else |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
256 |
ML_PLATFORM="${ML_PLATFORM/64/64_32}" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
257 |
ML_OPTIONS="--minheap 500" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
258 |
fi |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
259 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
260 |
ML_SYSTEM=""" + Bash.string(polyml_name) + """ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
261 |
ML_HOME="$POLYML_HOME/$ML_PLATFORM" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
262 |
ML_SOURCES="$POLYML_HOME/src" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
263 |
|
77191 | 264 |
case "$ML_PLATFORM" in |
265 |
*arm64*) |
|
266 |
ISABELLE_DOCS_EXAMPLES="$ISABELLE_DOCS_EXAMPLES:\$ML_SOURCES/ROOT0.ML" |
|
267 |
;; |
|
268 |
*) |
|
269 |
ISABELLE_DOCS_EXAMPLES="$ISABELLE_DOCS_EXAMPLES:\$ML_SOURCES/ROOT.ML" |
|
270 |
;; |
|
271 |
esac |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
272 |
""") |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
273 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
274 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
275 |
/* README */ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
276 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
277 |
File.write(component_dir.README, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
278 |
"""Poly/ML for Isabelle |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
279 |
==================== |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
280 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
281 |
This compilation of Poly/ML (https://www.polyml.org) is based on the |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
282 |
source distribution from |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
283 |
https://github.com/polyml/polyml/commit/""" + polyml_version + """ |
64483 | 284 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
285 |
The Isabelle repository provides an administrative tool "isabelle |
78482 | 286 |
component_polyml", which can be used in the polyml component directory as |
287 |
follows: |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
288 |
|
78482 | 289 |
* Linux and macOS |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
290 |
|
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
291 |
$ isabelle component_polyml |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
292 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
293 |
* Windows (Cygwin shell) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
294 |
|
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
295 |
$ isabelle component_polyml -M /cygdrive/c/msys64 |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
296 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
297 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
298 |
Building libgmp on macOS |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
299 |
======================== |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
300 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
301 |
The build_polyml invocations above implicitly use the GNU Multiple Precision |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
302 |
Arithmetic Library (libgmp), but that is not available on macOS by default. |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
303 |
Appending "--without-gmp" to the command-line omits this library. Building |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
304 |
libgmp properly from sources works as follows (library headers and binaries |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
305 |
will be placed in /usr/local). |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
306 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
307 |
* Download: |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
308 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
309 |
$ curl https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2 | tar xjf - |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
310 |
$ cd gmp-6.2.1 |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
311 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
312 |
* build: |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
313 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
314 |
$ make distclean |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
315 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
316 |
#Intel |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
317 |
$ ./configure --enable-cxx --build=core2-apple-darwin"$(uname -r)" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
318 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
319 |
#ARM |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
320 |
$ ./configure --enable-cxx --build=aarch64-apple-darwin"$(uname -r)" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
321 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
322 |
$ make && make check |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
323 |
$ sudo make install |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
324 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
325 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
326 |
Makarius |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
327 |
""" + Date.Format.date(Date.now()) + "\n") |
65880 | 328 |
} |
329 |
||
330 |
||
331 |
||
332 |
/** Isabelle tool wrappers **/ |
|
333 |
||
334 |
val isabelle_tool1 = |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
335 |
Isabelle_Tool("make_polyml", "make Poly/ML from existing sources", Scala_Project.here, |
75394 | 336 |
{ args => |
337 |
var mingw = MinGW.none |
|
338 |
var arch_64 = false |
|
339 |
var sha1_root: Option[Path] = None |
|
64483 | 340 |
|
75394 | 341 |
val getopts = Getopts(""" |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
342 |
Usage: isabelle make_polyml [OPTIONS] ROOT [CONFIGURE_OPTIONS] |
64483 | 343 |
|
344 |
Options are: |
|
72429 | 345 |
-M DIR msys/mingw root specification for Windows |
72352
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
346 |
-m ARCH processor architecture (32 or 64, default: """ + |
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
347 |
(if (arch_64) "64" else "32") + """) |
69691 | 348 |
-s DIR sha1 sources, see https://isabelle.sketis.net/repos/sha1 |
64483 | 349 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
350 |
Make Poly/ML in the ROOT directory of its sources, with additional |
67593 | 351 |
CONFIGURE_OPTIONS (e.g. --without-gmp). |
64483 | 352 |
""", |
75394 | 353 |
"M:" -> (arg => mingw = MinGW(Path.explode(arg))), |
354 |
"m:" -> |
|
355 |
{ |
|
356 |
case "32" => arch_64 = false |
|
357 |
case "64" => arch_64 = true |
|
358 |
case bad => error("Bad processor architecture: " + quote(bad)) |
|
359 |
}, |
|
360 |
"s:" -> (arg => sha1_root = Some(Path.explode(arg)))) |
|
64483 | 361 |
|
75394 | 362 |
val more_args = getopts(args) |
363 |
val (root, options) = |
|
364 |
more_args match { |
|
365 |
case root :: options => (Path.explode(root), options) |
|
366 |
case Nil => getopts.usage() |
|
367 |
} |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
368 |
make_polyml(root, sha1_root = sha1_root, progress = new Console_Progress, |
75394 | 369 |
arch_64 = arch_64, options = options, mingw = mingw) |
370 |
}) |
|
65880 | 371 |
|
372 |
val isabelle_tool2 = |
|
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
373 |
Isabelle_Tool("component_polyml", "build Poly/ML component from official repository", |
75394 | 374 |
Scala_Project.here, |
375 |
{ args => |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
376 |
var target_dir = Path.current |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
377 |
var mingw = MinGW.none |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
378 |
var component_name = "" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
379 |
var sha1_url = default_sha1_url |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
380 |
var sha1_version = default_sha1_version |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
381 |
var polyml_url = default_polyml_url |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
382 |
var polyml_version = default_polyml_version |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
383 |
var polyml_name = default_polyml_name |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
384 |
var verbose = false |
75394 | 385 |
|
386 |
val getopts = Getopts(""" |
|
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
387 |
Usage: isabelle component_polyml [OPTIONS] [CONFIGURE_OPTIONS] |
65880 | 388 |
|
389 |
Options are: |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
390 |
-D DIR target directory (default ".") |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
391 |
-M DIR msys/mingw root specification for Windows |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
392 |
-N NAME component name (default: derived from Poly/ML version) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
393 |
-S URL SHA1 repository archive area |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
394 |
(default: """ + quote(default_sha1_url) + """) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
395 |
-T VERSION SHA1 version (default: """ + quote(default_sha1_version) + """) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
396 |
-U URL Poly/ML repository archive area |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
397 |
(default: """ + quote(default_polyml_url) + """) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
398 |
-V VERSION Poly/ML version (default: """ + quote(default_polyml_version) + """) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
399 |
-W NAME Poly/ML name (default: """ + quote(default_polyml_name) + """) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
400 |
-v verbose |
65880 | 401 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
402 |
Download and build Poly/ML component from source repositories, with additional |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
403 |
CONFIGURE_OPTIONS (e.g. --without-gmp). |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
404 |
""", |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
405 |
"D:" -> (arg => target_dir = Path.explode(arg)), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
406 |
"M:" -> (arg => mingw = MinGW(Path.explode(arg))), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
407 |
"N:" -> (arg => component_name = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
408 |
"S:" -> (arg => sha1_url = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
409 |
"T:" -> (arg => sha1_version = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
410 |
"U:" -> (arg => polyml_url = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
411 |
"V:" -> (arg => polyml_version = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
412 |
"W:" -> (arg => polyml_name = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
413 |
"v" -> (_ => verbose = true)) |
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
414 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
415 |
val options = getopts(args) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
416 |
|
77510
f5d6cd98b16a
clarified signature: manage "verbose" flag via "progress";
wenzelm
parents:
77191
diff
changeset
|
417 |
val progress = new Console_Progress(verbose = verbose) |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
418 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
419 |
build_polyml(options = options, mingw = mingw, component_name = component_name, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
420 |
polyml_url = polyml_url, polyml_version = polyml_version, polyml_name = polyml_name, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
421 |
sha1_url = sha1_url, sha1_version = sha1_version, target_dir = target_dir, |
77510
f5d6cd98b16a
clarified signature: manage "verbose" flag via "progress";
wenzelm
parents:
77191
diff
changeset
|
422 |
progress = progress) |
75394 | 423 |
}) |
64483 | 424 |
} |