Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/pure-cfg/src/compiler/common/paths_sml.in
ViewVC logotype

View of /branches/pure-cfg/src/compiler/common/paths_sml.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 632 - (download) (annotate)
Thu Mar 17 00:32:17 2011 UTC (9 years, 10 months ago) by jhr
File size: 1522 byte(s)
  Preparing to support the rest of the build process in the compiler
(* paths.sml
 *
 * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * @configure_input@
 *)

structure Paths =
  struct

  (* directories for Diderot stuff *)
    val diderotBin = "@DIDEROT_ROOT@/bin"
    val diderotInclude = "@DIDEROT_ROOT@/src/include"
    val diderotLib = "@DIDEROT_ROOT@/src/lib"

  (* directories for Teem stuff *)
    val teemBin = "@TEEM_DIR@/bin"
    val teemInclude = "@TEEM_DIR@/include"
    val teemLib = "@TEEM_DIR@/lib"

  (* installation directories for Diderot stuff *)
    val installBin = "@prefix@/bin"
    val installInclude = "@prefix@/include"
    val installLib = "@prefix@/lib"

  (* paths to some useful tools *)
    local
    (* get the user's PATH environment variable as a list of paths.  Note that this is
     * executed at build time.
     *)
      val PATH = let
	    val path = (case (OS.Process.getEnv "PATH") of (SOME p) => p | _ => "")
	    in
	       String.fields (fn #":" => true | _ => false) path
	    end (* getPath *)
(* FIXME: with SML/NJ 110.73, we'll be able to use PathUtil.findExe *)
      fun findExe (paths, name) = let
	    fun isExe p = OS.FileSys.access(p, [OS.FileSys.A_EXEC])
	    in
	      case PathUtil.existsFile isExe paths name
	       of SOME cmd => cmd
		| NONE => raise Fail(concat["unable to find ", name " executable"])
	      (* end case *)
	    end
    in
    val dnorm = findExe ([diderotBin, installBin], "dnorm")
    val cc = findExe (PATH, "@CC@")
    end (* local *)

  end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0