SCM Repository
Annotation of /branches/pure-cfg/src/compiler/common/paths_sml.in
Parent Directory
|
Revision Log
Revision 1096 - (view) (download)
1 : | jhr | 632 | (* paths.sml |
2 : | jhr | 627 | * |
3 : | * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu) | ||
4 : | * All rights reserved. | ||
5 : | jhr | 632 | * |
6 : | * @configure_input@ | ||
7 : | jhr | 627 | *) |
8 : | |||
9 : | structure Paths = | ||
10 : | struct | ||
11 : | |||
12 : | jhr | 731 | local |
13 : | val // = OS.Path.concat | ||
14 : | infixr 4 // | ||
15 : | in | ||
16 : | jhr | 627 | (* directories for Diderot stuff *) |
17 : | jhr | 731 | val diderotBin = "@DIDEROT_ROOT@" // "bin" |
18 : | val diderotInclude = "@DIDEROT_ROOT@" // "src/include" | ||
19 : | jhr | 1035 | val diderotSrc = "@DIDEROT_ROOT@" // "src" |
20 : | val diderotLib = diderotSrc // "lib" | ||
21 : | jhr | 627 | |
22 : | (* directories for Teem stuff *) | ||
23 : | jhr | 731 | val teemBin = "@TEEM_DIR@" // "bin" |
24 : | val teemInclude = "@TEEM_DIR@" // "include" | ||
25 : | val teemLib = "@TEEM_DIR@" // "lib" | ||
26 : | jhr | 989 | val teemLinkFlags = if @LD_NEEDS_RPATH@ |
27 : | then ["-Wl,-rpath=" ^ teemLib, "-L" ^ teemLib, "-lteem"] | ||
28 : | else ["-L" ^ teemLib, "-lteem"] | ||
29 : | jhr | 627 | |
30 : | (* installation directories for Diderot stuff *) | ||
31 : | jhr | 731 | val installBin = "@prefix@" // "bin" |
32 : | val installInclude = "@prefix@" // "include" | ||
33 : | val installLib = "@prefix@" // "lib" | ||
34 : | jhr | 627 | |
35 : | (* paths to some useful tools *) | ||
36 : | local | ||
37 : | (* get the user's PATH environment variable as a list of paths. Note that this is | ||
38 : | * executed at build time. | ||
39 : | *) | ||
40 : | val PATH = let | ||
41 : | val path = (case (OS.Process.getEnv "PATH") of (SOME p) => p | _ => "") | ||
42 : | in | ||
43 : | String.fields (fn #":" => true | _ => false) path | ||
44 : | end (* getPath *) | ||
45 : | (* FIXME: with SML/NJ 110.73, we'll be able to use PathUtil.findExe *) | ||
46 : | fun findExe (paths, name) = let | ||
47 : | fun isExe p = OS.FileSys.access(p, [OS.FileSys.A_EXEC]) | ||
48 : | in | ||
49 : | jhr | 731 | if OS.Path.isAbsolute name |
50 : | then if isExe name | ||
51 : | then name | ||
52 : | else raise Fail(name ^" is not executable") | ||
53 : | else (case PathUtil.existsFile isExe paths name | ||
54 : | of SOME cmd => cmd | ||
55 : | | NONE => raise Fail(concat["unable to find ", name, " executable"]) | ||
56 : | (* end case *)) | ||
57 : | jhr | 627 | end |
58 : | in | ||
59 : | jhr | 1035 | val dnorm = findExe ([diderotBin, installBin, diderotSrc // "dnorm"], "dnorm") |
60 : | jhr | 731 | val cc = let |
61 : | val (cmd::args) = String.tokens Char.isSpace "@CC@" | ||
62 : | val cmd = findExe (PATH, cmd) | ||
63 : | in | ||
64 : | String.concatWith " " (cmd::args) | ||
65 : | end | ||
66 : | jhr | 1096 | val cflags = "@CFLAGS@ @CFLAG_M64@ @PTHREAD_CFLAGS@" |
67 : | jhr | 997 | val extraLibs = "@PTHREAD_LIBS@ @LIBM@" |
68 : | jhr | 627 | end (* local *) |
69 : | jhr | 1035 | end (* local *) |
70 : | jhr | 627 | |
71 : | end |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |