src/Pure/Admin/component_polyml.scala
changeset 82497 b7554954d697
parent 82496 0366d0139f15
child 82499 d46bc8a03141
equal deleted inserted replaced
82496:0366d0139f15 82497:b7554954d697
    41           setup = MinGW.env_prefix,
    41           setup = MinGW.env_prefix,
    42           libs = Set("libgcc_s_seh", "libgmp", "libstdc++", "libwinpthread"))
    42           libs = Set("libgcc_s_seh", "libgmp", "libstdc++", "libwinpthread"))
    43       }
    43       }
    44       else error("Bad platform: " + quote(platform.toString))
    44       else error("Bad platform: " + quote(platform.toString))
    45 
    45 
    46     def standard_path(path: Path): String = mingw.standard_path(path)
    46     def standard_path(path: Path): String =
       
    47       mingw.standard_path(File.standard_path(path))
    47 
    48 
    48     def polyml(arch_64: Boolean): String =
    49     def polyml(arch_64: Boolean): String =
    49       (if (arch_64) platform.arch_64 else platform.arch_64_32) + "-" + platform.os_name
    50       (if (arch_64) platform.arch_64 else platform.arch_64_32) + "-" + platform.os_name
    50 
    51 
    51     def sha1: String = platform.arch_64 + "-" + platform.os_name
    52     def sha1: String = platform.arch_64 + "-" + platform.os_name
   122 
   123 
   123     /* configure and make */
   124     /* configure and make */
   124 
   125 
   125     val configure_options = {
   126     val configure_options = {
   126       val options1 =
   127       val options1 =
   127         if (gmp_root.nonEmpty || platform.is_windows) List("--with-gmp")
   128         if (gmp_root.nonEmpty) List("--with-gmp") else List("--without-gmp")
   128         else List("--without-gmp")
       
   129 
   129 
   130       def detect_CFLAGS(s: String): Boolean = s.startsWith("CFLAGS=")
   130       def detect_CFLAGS(s: String): Boolean = s.startsWith("CFLAGS=")
   131 
   131 
   132       val info_options =
   132       val info_options =
   133         if (info.options.exists(detect_CFLAGS)) info.options
   133         if (info.options.exists(detect_CFLAGS)) info.options
   222 
   222 
   223 
   223 
   224 
   224 
   225   /** skeleton for component **/
   225   /** skeleton for component **/
   226 
   226 
   227   def default_gmp_url: String =
   227   val default_gmp_url = "https://gmplib.org/download/gmp/gmp-6.3.0.tar.bz2"
   228     if (Platform.is_windows) ""
       
   229     else "https://gmplib.org/download/gmp/gmp-6.3.0.tar.bz2"
       
   230 
   228 
   231   val default_polyml_url = "https://github.com/polyml/polyml/archive"
   229   val default_polyml_url = "https://github.com/polyml/polyml/archive"
   232   val default_polyml_version = "90c0dbb2514e"
   230   val default_polyml_version = "90c0dbb2514e"
   233   val default_polyml_name = "polyml-5.9.1"
   231   val default_polyml_name = "polyml-5.9.1"
   234 
   232 
   282     Isabelle_System.with_tmp_dir("build") { build_dir =>
   280     Isabelle_System.with_tmp_dir("build") { build_dir =>
   283       /* GMP library */
   281       /* GMP library */
   284 
   282 
   285       val gmp_root1: Option[Path] =
   283       val gmp_root1: Option[Path] =
   286         if (gmp_url.isEmpty) gmp_root
   284         if (gmp_url.isEmpty) gmp_root
   287         else if (platform.is_windows) error("Bad GMP source for Windows: use MinGW version instead")
       
   288         else {
   285         else {
   289           val gmp_dir = Isabelle_System.make_directory(build_dir + Path.basic("gmp"))
   286           val gmp_dir = Isabelle_System.make_directory(build_dir + Path.basic("gmp"))
   290 
   287 
   291           val archive_name =
   288           val archive_name =
   292             Url.get_base_name(gmp_url).getOrElse(error("No base name in " + quote(gmp_url)))
   289             Url.get_base_name(gmp_url).getOrElse(error("No base name in " + quote(gmp_url)))