SCM Repository
Annotation of /trunk/src/compiler/common/paths_sml.in
Parent Directory
|
Revision Log
Revision 1640 - (view) (download)
1 : | jhr | 1115 | (* paths.sml |
2 : | * | ||
3 : | * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu) | ||
4 : | * All rights reserved. | ||
5 : | * | ||
6 : | * @configure_input@ | ||
7 : | *) | ||
8 : | |||
9 : | structure Paths = | ||
10 : | struct | ||
11 : | |||
12 : | local | ||
13 : | val // = OS.Path.concat | ||
14 : | infixr 4 // | ||
15 : | in | ||
16 : | (* directories for Diderot stuff *) | ||
17 : | val diderotBin = "@DIDEROT_ROOT@" // "bin" | ||
18 : | jhr | 1232 | val diderotLib = "@DIDEROT_ROOT@" // "lib" |
19 : | jhr | 1115 | val diderotSrc = "@DIDEROT_ROOT@" // "src" |
20 : | jhr | 1232 | val diderotInclude = diderotSrc // "include" |
21 : | jhr | 1115 | |
22 : | (* directories for Teem stuff *) | ||
23 : | val teemBin = "@TEEM_DIR@" // "bin" | ||
24 : | val teemInclude = "@TEEM_DIR@" // "include" | ||
25 : | val teemLib = "@TEEM_DIR@" // "lib" | ||
26 : | val teemLinkFlags = if @LD_NEEDS_RPATH@ | ||
27 : | then ["-Wl,-rpath=" ^ teemLib, "-L" ^ teemLib, "-lteem"] | ||
28 : | else ["-L" ^ teemLib, "-lteem"] | ||
29 : | |||
30 : | (* installation directories for Diderot stuff *) | ||
31 : | val installBin = "@prefix@" // "bin" | ||
32 : | val installInclude = "@prefix@" // "include" | ||
33 : | val installLib = "@prefix@" // "lib" | ||
34 : | |||
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 : | jhr | 1640 | fun findExe (paths, name) = (case PathUtil.findExe paths name |
46 : | of SOME p => p | ||
47 : | | NONE => raise Fail(concat["unable to find ", name, " executable"]) | ||
48 : | (* end case *)) | ||
49 : | jhr | 1115 | in |
50 : | val dnorm = findExe ([diderotBin, installBin, diderotSrc // "dnorm"], "dnorm") | ||
51 : | val cc = let | ||
52 : | val (cmd::args) = String.tokens Char.isSpace "@CC@" | ||
53 : | val cmd = findExe (PATH, cmd) | ||
54 : | val args = if ("@CFLAG_M64@" <> "") then "@CFLAG_M64@" :: args else args | ||
55 : | in | ||
56 : | String.concatWith " " (cmd::args) | ||
57 : | end | ||
58 : | jhr | 1232 | val cflags = { |
59 : | base = "@CFLAGS_BASE@", | ||
60 : | pthread = "@PTHREAD_CFLAGS@", | ||
61 : | debug = "-g -O0", | ||
62 : | (* ndebug = "-march=native -O3 -DNDEBUG" *) (* gcc complains about -march=native, even though the man page says it is supported *) | ||
63 : | ndebug = "-O3 -DNDEBUG" | ||
64 : | } | ||
65 : | val extraLibs = { | ||
66 : | base = "@LIBM@", | ||
67 : | pthread = "@PTHREAD_LIBS@", | ||
68 : | cl = "@CL_LIBS@" | ||
69 : | } | ||
70 : | jhr | 1115 | end (* local *) |
71 : | jhr | 1232 | |
72 : | (* other configuration options *) | ||
73 : | val clEnabled = @CL_ENABLED@ | ||
74 : | val clVersion = if clEnabled | ||
75 : | then let | ||
76 : | val major = @CL_VERSION@ div 10000 | ||
77 : | val minor = (@CL_VERSION@ div 100) mod 100 | ||
78 : | val patch = @CL_VERSION@ mod 100 | ||
79 : | in | ||
80 : | if patch > 0 then [major, minor, patch] else [major, minor] | ||
81 : | end | ||
82 : | else [] | ||
83 : | val cudaEnabled = @CUDA_ENABLED@ | ||
84 : | jhr | 1115 | end (* local *) |
85 : | |||
86 : | end |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |