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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/common/paths_sml.in
ViewVC logotype

Diff of /branches/vis12/src/compiler/common/paths_sml.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2429, Wed Sep 18 20:05:57 2013 UTC revision 2430, Thu Sep 19 21:41:27 2013 UTC
# Line 19  Line 19 
19      val diderotSrc = "@DIDEROT_ROOT@" // "src"      val diderotSrc = "@DIDEROT_ROOT@" // "src"
20      val diderotInclude = diderotSrc // "include"      val diderotInclude = diderotSrc // "include"
21    
22      (* look for an executable using the user's PATH prepended with a list of
23       * additional search directories.
24       *)
25        fun findExe (searchDirs, name) = let
26              val dirs = searchDirs @ String.fields
27                    (fn #":" => true | _ => false)
28                      (case (OS.Process.getEnv "PATH") of (SOME p) => p | _ => "")
29              in
30                case PathUtil.findExe dirs name
31                 of SOME p => p
32                  | NONE => raise Fail(concat[
33                        "unable to find ", name, " executable in \"",
34                        String.concatWith ":" dirs, "\""
35                      ])
36              end (* getPath *)
37    
38    (* directories for Teem stuff *)    (* directories for Teem stuff *)
39      val teemBin = "@TEEM_DIR@" // "bin"      local
40      val teemInclude = "@TEEM_DIR@" // "include"        val teemDir : string option ref = ref NONE
41      val teemLib = "@TEEM_DIR@" // "lib"      (* return the path to the teem stuff *)
42      val teemLinkFlags = if @LD_NEEDS_RPATH@        fun resolveTeemDir subDir = (case !teemDir
43            then ["-Wl,-rpath=" ^ teemLib, "-L" ^ teemLib, "-lteem"]               of SOME dir => dir // subDir
44            else ["-L" ^ teemLib, "-lteem"]                | NONE => let
45                      val unuPath = findExe (["@TEEM_DIR@" // "bin"], "unu")
46                      val dir = OS.Path.getParent(#dir(OS.Path.splitDirFile unuPath))
47                      in
48                        teemDir := SOME dir;
49                        dir // subDir
50                      end
51                (* end case *))
52        in
53        fun teemBin () = resolveTeemDir "bin"
54        fun teemInclude () = resolveTeemDir "include"
55        fun teemLib () = resolveTeemDir "lib"
56        fun teemLinkFlags () = if @LD_NEEDS_RPATH@
57              then ["-Wl,-rpath=" ^ teemLib(), "-L" ^ teemLib(), "-lteem"]
58              else ["-L" ^ teemLib(), "-lteem"]
59        end (* local *)
60    
61    (* installation directories for Diderot stuff *)    (* installation directories for Diderot stuff *)
62      val installBin = "@prefix@" // "bin"      val installBin = "@prefix@" // "bin"
# Line 33  Line 64 
64      val installLib = "@prefix@" // "lib"      val installLib = "@prefix@" // "lib"
65    
66    (* paths to some useful tools *)    (* 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: won't need the isAbsolute check in 110.75 *)  
       fun findExe (paths, name) = if OS.Path.isAbsolute name  
             then name  
             else (case PathUtil.findExe paths name  
                of SOME p => p  
                 | NONE => raise Fail(concat["unable to find ", name, " executable"])  
               (* end case *))  
     in  
     val dnorm = findExe ([diderotBin, installBin, diderotSrc // "dnorm"], "dnorm")  
67      val cc = let      val cc = let
68            val (cmd::args) = String.tokens Char.isSpace "@CC@"            val (cmd::args) = String.tokens Char.isSpace "@CC@"
69            val cmd = findExe (PATH, cmd)            val cmd = findExe ([], cmd)
70            val args = if ("@CFLAG_MXX@" <> "") then "@CFLAG_MXX@" :: args else args            val args = if ("@CFLAG_MXX@" <> "") then "@CFLAG_MXX@" :: args else args
71            in            in
72              String.concatWith " " (cmd::args)              String.concatWith " " (cmd::args)
# Line 68  Line 81 
81            }            }
82      val ld = let      val ld = let
83            val (cmd::args) = String.tokens Char.isSpace "@LD@"            val (cmd::args) = String.tokens Char.isSpace "@LD@"
84            val cmd = findExe (PATH, cmd)            val cmd = findExe ([], cmd)
85            in            in
86              String.concatWith " " (cmd :: args)              String.concatWith " " (cmd :: args)
87            end            end
# Line 77  Line 90 
90              pthread = "@PTHREAD_LIBS@",              pthread = "@PTHREAD_LIBS@",
91              cl = "@CL_LIBS@"              cl = "@CL_LIBS@"
92            }            }
     end (* local *)  
93    
94    (* other configuration options *)    (* other configuration options *)
95      val clEnabled = @CL_ENABLED@      val clEnabled = @CL_ENABLED@

Legend:
Removed from v.2429  
changed lines
  Added in v.2430

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