author | haftmann |
Mon, 16 Jun 2025 15:25:38 +0200 | |
changeset 82730 | 3b98b1b57435 |
parent 82720 | 956ecf2c07a0 |
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. |
|
78772 | 5 |
|
6 |
Note: macOS 14 Sonoma requires "LDFLAGS=... -ld64". |
|
64483 | 7 |
*/ |
8 |
||
9 |
package isabelle |
|
10 |
||
11 |
||
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
12 |
object Component_PolyML { |
82471 | 13 |
/** platform information **/ |
64496 | 14 |
|
82612 | 15 |
object Platform_Info { |
16 |
def apply(platform: Isabelle_Platform): Platform_Info = |
|
82495 | 17 |
if (platform.is_linux) { |
18 |
Platform_Info( |
|
82612 | 19 |
platform = platform, |
82495 | 20 |
options = List("LDFLAGS=-Wl,-rpath,_DUMMY_"), |
21 |
libs = Set("libgmp")) |
|
22 |
} |
|
23 |
else if (platform.is_macos) { |
|
24 |
Platform_Info( |
|
82612 | 25 |
platform = platform, |
82495 | 26 |
options = List("CFLAGS=-O3", "CXXFLAGS=-O3", "LDFLAGS=-segprot POLY rwx rwx"), |
27 |
setup = "PATH=/usr/bin:/bin:/usr/sbin:/sbin", |
|
28 |
libs = Set("libpolyml", "libgmp")) |
|
29 |
} |
|
30 |
else if (platform.is_windows) { |
|
31 |
Platform_Info( |
|
82612 | 32 |
platform = platform, |
82495 | 33 |
options = |
34 |
List("--host=x86_64-w64-mingw32", "CPPFLAGS=-I/mingw64/include", "--disable-windows-gui"), |
|
35 |
setup = MinGW.env_prefix, |
|
36 |
libs = Set("libgcc_s_seh", "libgmp", "libstdc++", "libwinpthread")) |
|
37 |
} |
|
38 |
else error("Bad platform: " + quote(platform.toString)) |
|
82612 | 39 |
} |
82495 | 40 |
|
82612 | 41 |
sealed case class Platform_Info( |
42 |
platform: Isabelle_Platform = Isabelle_Platform.local, |
|
43 |
options: List[String] = Nil, |
|
44 |
setup: String = "", |
|
45 |
libs: Set[String] = Set.empty |
|
46 |
) { |
|
82464
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
47 |
def polyml(arch_64: Boolean): String = |
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
48 |
(if (arch_64) platform.arch_64 else platform.arch_64_32) + "-" + platform.os_name |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
49 |
} |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
50 |
|
82471 | 51 |
|
52 |
/** build stages **/ |
|
53 |
||
82475 | 54 |
def make_polyml_gmp( |
82612 | 55 |
platform_context: Isabelle_Platform.Context, |
82482 | 56 |
dir: Path, |
82475 | 57 |
options: List[String] = Nil |
58 |
): Path = { |
|
59 |
val progress = platform_context.progress |
|
82612 | 60 |
val platform = platform_context.isabelle_platform |
82475 | 61 |
|
62 |
val platform_arch = if (platform.is_arm) "aarch64" else "x86_64" |
|
63 |
val platform_os = |
|
64 |
if (platform.is_linux) "unknown-linux-gnu" |
|
65 |
else if (platform.is_windows) "w64-mingw32" |
|
66 |
else if (platform.is_macos) """apple-darwin"$(uname -r)"""" |
|
67 |
else error("Bad platform " + platform) |
|
68 |
||
82482 | 69 |
val root = dir.absolute |
82475 | 70 |
val target_dir = root + Path.explode("target") |
71 |
||
72 |
progress.echo("Building GMP library ...") |
|
73 |
platform_context.execute(root, |
|
74 |
"[ -f Makefile ] && make distclean", |
|
82481
041d65893a85
clarified GMP build options, notably for Windows;
wenzelm
parents:
82480
diff
changeset
|
75 |
"./configure --disable-static --enable-shared --enable-cxx" + |
041d65893a85
clarified GMP build options, notably for Windows;
wenzelm
parents:
82480
diff
changeset
|
76 |
" --build=" + platform_arch + "-" + platform_os + |
82492 | 77 |
""" --prefix="$PWD/target" """ + Bash.strings(options), |
78 |
"rm -rf target", |
|
82475 | 79 |
"make", |
80 |
"make check", |
|
81 |
"make install") |
|
82 |
||
82494
1ef574aa854a
more uniform directory structure: Windows DLLs are treated like binaries;
wenzelm
parents:
82493
diff
changeset
|
83 |
if (platform.is_windows) { |
1ef574aa854a
more uniform directory structure: Windows DLLs are treated like binaries;
wenzelm
parents:
82493
diff
changeset
|
84 |
val bin_dir = target_dir + Path.explode("bin") |
1ef574aa854a
more uniform directory structure: Windows DLLs are treated like binaries;
wenzelm
parents:
82493
diff
changeset
|
85 |
val lib_dir = target_dir + Path.explode("lib") |
1ef574aa854a
more uniform directory structure: Windows DLLs are treated like binaries;
wenzelm
parents:
82493
diff
changeset
|
86 |
Isabelle_System.copy_dir(bin_dir, lib_dir, direct = true) |
1ef574aa854a
more uniform directory structure: Windows DLLs are treated like binaries;
wenzelm
parents:
82493
diff
changeset
|
87 |
} |
1ef574aa854a
more uniform directory structure: Windows DLLs are treated like binaries;
wenzelm
parents:
82493
diff
changeset
|
88 |
|
82475 | 89 |
target_dir |
90 |
} |
|
91 |
||
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
92 |
def make_polyml( |
82612 | 93 |
platform_context: Isabelle_Platform.Context, |
64489 | 94 |
root: Path, |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
95 |
gmp_root: Option[Path] = None, |
64495 | 96 |
sha1_root: Option[Path] = None, |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
97 |
target_dir: Path = Path.current, |
64493 | 98 |
arch_64: Boolean = false, |
82464
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
99 |
options: List[String] = Nil |
75393 | 100 |
): Unit = { |
64489 | 101 |
if (!((root + Path.explode("configure")).is_file && (root + Path.explode("PolyML")).is_dir)) |
102 |
error("Bad Poly/ML root directory: " + root) |
|
64483 | 103 |
|
82612 | 104 |
val platform = platform_context.isabelle_platform |
105 |
val platform_info = Platform_Info(platform) |
|
70977 | 106 |
|
64491 | 107 |
|
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
108 |
/* configure and make */ |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
109 |
|
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
110 |
val configure_options = { |
82468
40a609d67b33
clarified Windows: always use MinGW version (it is unclear how to build libgmp-10.dll);
wenzelm
parents:
82465
diff
changeset
|
111 |
val options1 = |
82497
b7554954d697
more accurate MinGW path conversion: support locations outside of mingw.root;
wenzelm
parents:
82496
diff
changeset
|
112 |
if (gmp_root.nonEmpty) List("--with-gmp") else List("--without-gmp") |
64495 | 113 |
|
82480
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
114 |
def detect_CFLAGS(s: String): Boolean = s.startsWith("CFLAGS=") |
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
115 |
|
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
116 |
val info_options = |
82612 | 117 |
if (platform_info.options.exists(detect_CFLAGS)) platform_info.options |
118 |
else "CFLAGS=" :: platform_info.options |
|
82480
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
119 |
|
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
120 |
val options2 = |
82480
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
121 |
for (opt <- info_options) yield { |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
122 |
if (opt.startsWith("CFLAGS=") && gmp_root.nonEmpty) { |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
123 |
val root0 = gmp_root.get.absolute |
82464
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
124 |
val root1 = platform_context.standard_path(root0) |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
125 |
require(root0.implode == File.bash_path(root0), "Bad directory name " + root0) |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
126 |
opt + " " + "-I" + root1 + "/include -L" + root1 + "/lib" |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
127 |
} |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
128 |
else opt |
73672
70d3c7009a65
proper support for macOS/Rosetta: let "uname -m" report arm64 instead of x86_64;
wenzelm
parents:
73667
diff
changeset
|
129 |
} |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
130 |
|
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
131 |
val options3 = if (arch_64) Nil else List("--enable-compact32bit") |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
132 |
|
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
133 |
List("--disable-shared", "--enable-intinf-as-int") ::: |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
134 |
options1 ::: options2 ::: options ::: options3 |
64504 | 135 |
} |
64495 | 136 |
|
82480
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
137 |
val gmp_setup = |
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
138 |
gmp_root match { |
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
139 |
case Some(dir) => |
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
140 |
val v = Executable.library_path_variable(platform) |
82482 | 141 |
val s = platform_context.standard_path(dir.absolute) + "/lib" |
82483 | 142 |
"export " + v + "=" + quote(s + ":" + "$" + v) |
82480
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
143 |
case None => "" |
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
144 |
} |
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
145 |
|
82473 | 146 |
platform_context.execute(root, |
82612 | 147 |
platform_info.setup, |
82482 | 148 |
gmp_setup, |
82473 | 149 |
"[ -f Makefile ] && make distclean", |
150 |
"""./configure --prefix="$PWD/target" """ + Bash.strings(configure_options), |
|
151 |
"rm -rf target", |
|
152 |
"make", |
|
153 |
"make install") |
|
64485
e996c0a5eca9
support other bash executable (notably for msys on Windows);
wenzelm
parents:
64484
diff
changeset
|
154 |
|
64491 | 155 |
|
64495 | 156 |
/* sha1 library */ |
157 |
||
158 |
val sha1_files = |
|
82474 | 159 |
sha1_root match { |
160 |
case Some(dir) => |
|
82613 | 161 |
val platform_path = Path.explode(platform.ISABELLE_PLATFORM(windows = true, apple = true)) |
82474 | 162 |
val platform_dir = dir + platform_path |
163 |
platform_context.execute(dir, "./build " + File.bash_path(platform_path)) |
|
164 |
File.read_dir(platform_dir).map(entry => platform_dir + Path.basic(entry)) |
|
165 |
case None => Nil |
|
64495 | 166 |
} |
167 |
||
168 |
||
72462
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
169 |
/* install */ |
64484 | 170 |
|
82612 | 171 |
val platform_path = Path.explode(platform_info.polyml(arch_64)) |
82478 | 172 |
val platform_dir = target_dir + platform_path |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
173 |
|
72462
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
174 |
Isabelle_System.rm_tree(platform_dir) |
7c552a256ca5
misc tuning and clarification: prefer Executable.libraries_closure;
wenzelm
parents:
72455
diff
changeset
|
175 |
Isabelle_System.make_directory(platform_dir) |
64483 | 176 |
|
82478 | 177 |
for (d <- List("target/bin", "target/lib")) { |
178 |
Isabelle_System.copy_dir(root + Path.explode(d), platform_dir, direct = true) |
|
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 |
for (file <- sha1_files) Isabelle_System.copy_file(file, platform_dir) |
67584 | 182 |
|
82499 | 183 |
Executable.library_closure( |
82480
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
184 |
platform_dir + Path.basic("poly").platform_exe, |
82483 | 185 |
env_prefix = gmp_setup + "\n", |
82480
489f4a79d215
more robust access to GMP library that is provided here;
wenzelm
parents:
82479
diff
changeset
|
186 |
mingw = platform_context.mingw, |
82612 | 187 |
filter = platform_info.libs) |
72469 | 188 |
|
67584 | 189 |
|
190 |
/* polyc: directory prefix */ |
|
191 |
||
72378 | 192 |
val Header = "#! */bin/sh".r |
75205 | 193 |
File.change_lines(platform_dir + Path.explode("polyc")) { |
194 |
case Header() :: lines => |
|
195 |
val lines1 = |
|
196 |
lines.map(line => |
|
197 |
if (line.startsWith("prefix=")) "prefix=\"$(cd \"$(dirname \"$0\")\"; pwd)\"" |
|
198 |
else if (line.startsWith("BINDIR=")) "BINDIR=\"$prefix\"" |
|
199 |
else if (line.startsWith("LIBDIR=")) "LIBDIR=\"$prefix\"" |
|
200 |
else line) |
|
201 |
"#!/usr/bin/env bash" :: lines1 |
|
202 |
case lines => |
|
203 |
error(cat_lines("Cannot patch polyc -- undetected header:" :: lines.take(3))) |
|
75202 | 204 |
} |
64483 | 205 |
} |
206 |
||
207 |
||
64496 | 208 |
|
65880 | 209 |
/** skeleton for component **/ |
210 |
||
82497
b7554954d697
more accurate MinGW path conversion: support locations outside of mingw.root;
wenzelm
parents:
82496
diff
changeset
|
211 |
val default_gmp_url = "https://gmplib.org/download/gmp/gmp-6.3.0.tar.bz2" |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
212 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
213 |
val default_polyml_url = "https://github.com/polyml/polyml/archive" |
78774 | 214 |
val default_polyml_version = "90c0dbb2514e" |
215 |
val default_polyml_name = "polyml-5.9.1" |
|
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
216 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
217 |
val default_sha1_url = "https://isabelle.sketis.net/repos/sha1/archive" |
78775 | 218 |
val default_sha1_version = "0ce12663fe76" |
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
219 |
|
77191 | 220 |
private def init_src_root(src_dir: Path, input: String, output: String): Unit = { |
221 |
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
|
222 |
val ml_files = |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
223 |
for { |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
224 |
line <- lines |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
225 |
rest <- Library.try_unprefix("use", line) |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
226 |
} yield "ML_file" + rest |
65880 | 227 |
|
77191 | 228 |
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
|
229 |
"""(* Poly/ML Compiler root file. |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
230 |
|
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
231 |
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
|
232 |
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
|
233 |
not affect the running ML session. *) |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
234 |
""" + ml_files.mkString("\n", "\n", "\n")) |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
235 |
} |
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
236 |
|
77190
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 |
def build_polyml( |
82612 | 239 |
platform_context: Isabelle_Platform.Context, |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
240 |
options: List[String] = Nil, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
241 |
component_name: String = "", |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
242 |
gmp_url: String = "", |
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
243 |
gmp_root: Option[Path] = None, |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
244 |
polyml_url: String = default_polyml_url, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
245 |
polyml_version: String = default_polyml_version, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
246 |
polyml_name: String = default_polyml_name, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
247 |
sha1_url: String = default_sha1_url, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
248 |
sha1_version: String = default_sha1_version, |
82464
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
249 |
target_dir: Path = Path.current |
75393 | 250 |
): Unit = { |
82612 | 251 |
val platform = platform_context.isabelle_platform |
252 |
val platform_info = Platform_Info(platform) |
|
253 |
||
82464
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
254 |
val progress = platform_context.progress |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
255 |
|
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
256 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
257 |
/* component */ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
258 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
259 |
val component_name1 = if (component_name.isEmpty) "polyml-" + polyml_version else component_name |
81927 | 260 |
val component_dir = |
261 |
Components.Directory(target_dir + Path.basic(component_name1)).create(progress = progress) |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
262 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
263 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
264 |
/* download and build */ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
265 |
|
82477 | 266 |
Isabelle_System.with_tmp_dir("build") { build_dir => |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
267 |
/* GMP library */ |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
268 |
|
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
269 |
val gmp_root1: Option[Path] = |
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
270 |
if (gmp_url.isEmpty) gmp_root |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
271 |
else { |
82477 | 272 |
val gmp_dir = Isabelle_System.make_directory(build_dir + Path.basic("gmp")) |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
273 |
|
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
274 |
val archive_name = |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
275 |
Url.get_base_name(gmp_url).getOrElse(error("No base name in " + quote(gmp_url))) |
82477 | 276 |
val archive = build_dir + Path.basic(archive_name) |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
277 |
Isabelle_System.download_file(gmp_url, archive, progress = progress) |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
278 |
Isabelle_System.extract(archive, gmp_dir, strip = true) |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
279 |
|
82475 | 280 |
Some(make_polyml_gmp(platform_context, gmp_dir)) |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
281 |
} |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
282 |
|
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
283 |
|
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
284 |
/* Poly/ML */ |
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
285 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
286 |
val List(polyml_download, sha1_download) = |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
287 |
for { |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
288 |
(url, version, target) <- |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
289 |
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
|
290 |
} yield { |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
291 |
val remote = Url.append_path(url, version + ".tar.gz") |
82477 | 292 |
val download = build_dir + Path.basic(version) |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
293 |
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
|
294 |
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
|
295 |
Isabelle_System.extract( |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
296 |
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
|
297 |
download |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
298 |
} |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
299 |
|
77191 | 300 |
init_src_root(component_dir.src, "RootArm64.ML", "ROOT0.ML") |
301 |
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
|
302 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
303 |
for (arch_64 <- List(false, true)) { |
82612 | 304 |
progress.echo("Building Poly/ML " + platform_info.polyml(arch_64)) |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
305 |
make_polyml( |
82464
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
306 |
platform_context, |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
307 |
root = polyml_download, |
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
308 |
gmp_root = gmp_root1, |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
309 |
sha1_root = Some(sha1_download), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
310 |
target_dir = component_dir.path, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
311 |
arch_64 = arch_64, |
82464
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
312 |
options = options) |
77190
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 |
} |
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 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
317 |
/* settings */ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
318 |
|
82720
956ecf2c07a0
more flexible ML_Settings in Isabelle/Scala, depending on system options and some default settings;
wenzelm
parents:
82613
diff
changeset
|
319 |
component_dir.write_settings(""" |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
320 |
POLYML_HOME="$COMPONENT" |
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
321 |
|
82720
956ecf2c07a0
more flexible ML_Settings in Isabelle/Scala, depending on system options and some default settings;
wenzelm
parents:
82613
diff
changeset
|
322 |
ML_SYSTEM=""" + Bash.string(polyml_name) + """ |
956ecf2c07a0
more flexible ML_Settings in Isabelle/Scala, depending on system options and some default settings;
wenzelm
parents:
82613
diff
changeset
|
323 |
ML_OPTIONS32="--minheap 500" |
956ecf2c07a0
more flexible ML_Settings in Isabelle/Scala, depending on system options and some default settings;
wenzelm
parents:
82613
diff
changeset
|
324 |
ML_OPTIONS64="--minheap 1000" |
956ecf2c07a0
more flexible ML_Settings in Isabelle/Scala, depending on system options and some default settings;
wenzelm
parents:
82613
diff
changeset
|
325 |
ML_OPTIONS="" |
956ecf2c07a0
more flexible ML_Settings in Isabelle/Scala, depending on system options and some default settings;
wenzelm
parents:
82613
diff
changeset
|
326 |
ML_PLATFORM="" |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
327 |
|
82720
956ecf2c07a0
more flexible ML_Settings in Isabelle/Scala, depending on system options and some default settings;
wenzelm
parents:
82613
diff
changeset
|
328 |
ISABELLE_DOCS_EXAMPLES="$ISABELLE_DOCS_EXAMPLES:\$POLYML_HOME/\$ML_SOURCES_ROOT" |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
329 |
""") |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
330 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
331 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
332 |
/* README */ |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
333 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
334 |
File.write(component_dir.README, |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
335 |
"""Poly/ML for Isabelle |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
336 |
==================== |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
337 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
338 |
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
|
339 |
source distribution from |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
340 |
https://github.com/polyml/polyml/commit/""" + polyml_version + """ |
64483 | 341 |
|
78774 | 342 |
This coincides with the official release of Poly/ML 5.9.1, see also |
343 |
https://github.com/polyml/polyml/releases/tag/v5.9.1 |
|
344 |
||
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
345 |
The Isabelle repository provides an administrative tool "isabelle |
78482 | 346 |
component_polyml", which can be used in the polyml component directory as |
347 |
follows: |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
348 |
|
78482 | 349 |
* Linux and macOS |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
350 |
|
82490
5df2050f1c31
clarified default options: prefer GMP from source;
wenzelm
parents:
82483
diff
changeset
|
351 |
$ isabelle component_polyml |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
352 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
353 |
* Windows (Cygwin shell) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
354 |
|
82490
5df2050f1c31
clarified default options: prefer GMP from source;
wenzelm
parents:
82483
diff
changeset
|
355 |
$ 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
|
356 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
357 |
|
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
358 |
Makarius |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
359 |
""" + Date.Format.date(Date.now()) + "\n") |
65880 | 360 |
} |
361 |
||
362 |
||
363 |
||
364 |
/** Isabelle tool wrappers **/ |
|
365 |
||
366 |
val isabelle_tool1 = |
|
82475 | 367 |
Isabelle_Tool("make_polyml_gmp", "make GMP library from existing sources", Scala_Project.here, |
368 |
{ args => |
|
369 |
var mingw = MinGW.none |
|
82476 | 370 |
var verbose = false |
82475 | 371 |
|
372 |
val getopts = Getopts(""" |
|
373 |
Usage: isabelle make_polyml_gmp [OPTIONS] ROOT [CONFIGURE_OPTIONS] |
|
374 |
||
375 |
Options are: |
|
376 |
-M DIR msys/mingw root specification for Windows |
|
377 |
||
378 |
Make GMP library in the ROOT directory of its sources, with additional |
|
379 |
CONFIGURE_OPTIONS. |
|
380 |
""", |
|
82476 | 381 |
"M:" -> (arg => mingw = MinGW(Path.explode(arg))), |
382 |
"v" -> (_ => verbose = true)) |
|
82475 | 383 |
|
384 |
val more_args = getopts(args) |
|
385 |
val (root, options) = |
|
386 |
more_args match { |
|
387 |
case root :: options => (Path.explode(root), options) |
|
388 |
case Nil => getopts.usage() |
|
389 |
} |
|
82476 | 390 |
|
391 |
val progress = new Console_Progress(verbose = verbose) |
|
82496 | 392 |
|
82612 | 393 |
val platform_context = Isabelle_Platform.Context(mingw = mingw, progress = progress) |
394 |
val target_dir = make_polyml_gmp(platform_context, root, options = options) |
|
82496 | 395 |
|
396 |
progress.echo("GMP installation directory: " + target_dir) |
|
82475 | 397 |
}) |
398 |
||
399 |
val isabelle_tool2 = |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
400 |
Isabelle_Tool("make_polyml", "make Poly/ML from existing sources", Scala_Project.here, |
75394 | 401 |
{ args => |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
402 |
var gmp_root: Option[Path] = None |
75394 | 403 |
var mingw = MinGW.none |
404 |
var arch_64 = false |
|
405 |
var sha1_root: Option[Path] = None |
|
82476 | 406 |
var verbose = false |
64483 | 407 |
|
75394 | 408 |
val getopts = Getopts(""" |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
409 |
Usage: isabelle make_polyml [OPTIONS] ROOT [CONFIGURE_OPTIONS] |
64483 | 410 |
|
411 |
Options are: |
|
72429 | 412 |
-M DIR msys/mingw root specification for Windows |
82479 | 413 |
-g DIR GMP library root |
72352
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
414 |
-m ARCH processor architecture (32 or 64, default: """ + |
f4bd6f123fdf
more systematic platform support, including arm64-linux;
wenzelm
parents:
72351
diff
changeset
|
415 |
(if (arch_64) "64" else "32") + """) |
69691 | 416 |
-s DIR sha1 sources, see https://isabelle.sketis.net/repos/sha1 |
64483 | 417 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
418 |
Make Poly/ML in the ROOT directory of its sources, with additional |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
419 |
CONFIGURE_OPTIONS. |
64483 | 420 |
""", |
75394 | 421 |
"M:" -> (arg => mingw = MinGW(Path.explode(arg))), |
82479 | 422 |
"g:" -> (arg => gmp_root = Some(Path.explode(arg))), |
75394 | 423 |
"m:" -> |
424 |
{ |
|
425 |
case "32" => arch_64 = false |
|
426 |
case "64" => arch_64 = true |
|
427 |
case bad => error("Bad processor architecture: " + quote(bad)) |
|
428 |
}, |
|
82476 | 429 |
"s:" -> (arg => sha1_root = Some(Path.explode(arg))), |
430 |
"v" -> (_ => verbose = true)) |
|
64483 | 431 |
|
75394 | 432 |
val more_args = getopts(args) |
433 |
val (root, options) = |
|
434 |
more_args match { |
|
435 |
case root :: options => (Path.explode(root), options) |
|
436 |
case Nil => getopts.usage() |
|
437 |
} |
|
82476 | 438 |
|
439 |
val progress = new Console_Progress(verbose = verbose) |
|
82612 | 440 |
val platform_context = Isabelle_Platform.Context(mingw = mingw, progress = progress) |
441 |
make_polyml(platform_context, root, |
|
442 |
gmp_root = gmp_root, sha1_root = sha1_root, arch_64 = arch_64, options = options) |
|
75394 | 443 |
}) |
65880 | 444 |
|
82475 | 445 |
val isabelle_tool3 = |
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
446 |
Isabelle_Tool("component_polyml", "build Poly/ML component from official repository", |
75394 | 447 |
Scala_Project.here, |
448 |
{ args => |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
449 |
var target_dir = Path.current |
82490
5df2050f1c31
clarified default options: prefer GMP from source;
wenzelm
parents:
82483
diff
changeset
|
450 |
var gmp_url = default_gmp_url |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
451 |
var mingw = MinGW.none |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
452 |
var component_name = "" |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
453 |
var sha1_url = default_sha1_url |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
454 |
var sha1_version = default_sha1_version |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
455 |
var polyml_url = default_polyml_url |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
456 |
var polyml_version = default_polyml_version |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
457 |
var polyml_name = default_polyml_name |
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
458 |
var gmp_root: Option[Path] = None |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
459 |
var verbose = false |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
460 |
|
75394 | 461 |
val getopts = Getopts(""" |
77566
2a99fcb283ee
renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents:
77510
diff
changeset
|
462 |
Usage: isabelle component_polyml [OPTIONS] [CONFIGURE_OPTIONS] |
65880 | 463 |
|
464 |
Options are: |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
465 |
-D DIR target directory (default ".") |
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
466 |
-G URL build GMP library from source (overrides option -g) |
82490
5df2050f1c31
clarified default options: prefer GMP from source;
wenzelm
parents:
82483
diff
changeset
|
467 |
(default """ + quote(default_gmp_url) + """) |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
468 |
-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
|
469 |
-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
|
470 |
-S URL SHA1 repository archive area |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
471 |
(default: """ + quote(default_sha1_url) + """) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
472 |
-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
|
473 |
-U URL Poly/ML repository archive area |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
474 |
(default: """ + quote(default_polyml_url) + """) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
475 |
-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
|
476 |
-W NAME Poly/ML name (default: """ + quote(default_polyml_name) + """) |
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
477 |
-g DIR use existing GMP library (overrides option -G) |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
478 |
-v verbose |
65880 | 479 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
480 |
Download and build Poly/ML component from source repositories, with additional |
82463
3125fd1ee69c
added option -G to build GMP library from sources;
wenzelm
parents:
82142
diff
changeset
|
481 |
CONFIGURE_OPTIONS. |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
482 |
""", |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
483 |
"D:" -> (arg => target_dir = Path.explode(arg)), |
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
484 |
"G:" -> (arg => { gmp_url = arg; gmp_root = None }), |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
485 |
"M:" -> (arg => mingw = MinGW(Path.explode(arg))), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
486 |
"N:" -> (arg => component_name = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
487 |
"S:" -> (arg => sha1_url = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
488 |
"T:" -> (arg => sha1_version = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
489 |
"U:" -> (arg => polyml_url = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
490 |
"V:" -> (arg => polyml_version = arg), |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
491 |
"W:" -> (arg => polyml_name = arg), |
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
492 |
"g:" -> (arg => { gmp_root = Some(Path.explode(arg)); gmp_url = "" }), |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
493 |
"v" -> (_ => verbose = true)) |
71396
c1c61d0d8e7c
clarified build_polyml_component: include IDE entry point for ML compiler;
wenzelm
parents:
71117
diff
changeset
|
494 |
|
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
495 |
val options = getopts(args) |
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
496 |
|
77510
f5d6cd98b16a
clarified signature: manage "verbose" flag via "progress";
wenzelm
parents:
77191
diff
changeset
|
497 |
val progress = new Console_Progress(verbose = verbose) |
82612 | 498 |
val platform_context = Isabelle_Platform.Context(mingw = mingw, progress = progress) |
77190
f6ba88f23135
clarified "isabelle build_polyml": download and build everything for current platform;
wenzelm
parents:
76547
diff
changeset
|
499 |
|
82464
7c9fcf2d6706
clarified signature: more explicit type Platform_Context;
wenzelm
parents:
82463
diff
changeset
|
500 |
build_polyml(platform_context, options = options, component_name = component_name, |
82491
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
501 |
gmp_url = gmp_url, gmp_root = gmp_root, polyml_url = polyml_url, |
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
502 |
polyml_version = polyml_version, polyml_name = polyml_name, sha1_url = sha1_url, |
537e81b82329
clarified options: explicit use of existing GMP library;
wenzelm
parents:
82490
diff
changeset
|
503 |
sha1_version = sha1_version, target_dir = target_dir) |
75394 | 504 |
}) |
64483 | 505 |
} |