Mercurial > projects > ldc
annotate premake.lua @ 1083:c1e9f612e2e2
Fix for dual operand form of fistp, also make reg ST(0) explicit and fix lindquists
previous code that allowed dual operand form of fstp but dissallowed the single
operand form accidently
author | Kelly Wilson <wilsonk cpsc.ucalgary.ca> |
---|---|
date | Tue, 10 Mar 2009 06:23:26 -0600 |
parents | f04dde6e882c |
children |
rev | line source |
---|---|
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
582
diff
changeset
|
1 project.name = ldc |
1 | 2 |
268
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
3 -- options |
295
895e1b50cf2a
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
lindquist
parents:
285
diff
changeset
|
4 |
895e1b50cf2a
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
lindquist
parents:
285
diff
changeset
|
5 -- we always make vtables opaque, it simply kills performance... |
268
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
6 OPAQUE_VTBLS = 1 |
295
895e1b50cf2a
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
lindquist
parents:
285
diff
changeset
|
7 |
895e1b50cf2a
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
lindquist
parents:
285
diff
changeset
|
8 -- use of boehm gc |
544
1c7220171d41
Disable boehm gc by default. Use --enable-boehm-gc on premake to enable.
Christian Kamm <kamm incasoftware de>
parents:
366
diff
changeset
|
9 USE_BOEHM_GC = 0 |
1c7220171d41
Disable boehm gc by default. Use --enable-boehm-gc on premake to enable.
Christian Kamm <kamm incasoftware de>
parents:
366
diff
changeset
|
10 if OS ~= "windows" then |
1c7220171d41
Disable boehm gc by default. Use --enable-boehm-gc on premake to enable.
Christian Kamm <kamm incasoftware de>
parents:
366
diff
changeset
|
11 addoption("enable-boehm-gc", "Enable use of the Boehm GC (broken!)") |
295
895e1b50cf2a
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
lindquist
parents:
285
diff
changeset
|
12 |
544
1c7220171d41
Disable boehm gc by default. Use --enable-boehm-gc on premake to enable.
Christian Kamm <kamm incasoftware de>
parents:
366
diff
changeset
|
13 if options["enable-boehm-gc"] then |
295
895e1b50cf2a
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
lindquist
parents:
285
diff
changeset
|
14 USE_BOEHM_GC = 1 |
895e1b50cf2a
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
lindquist
parents:
285
diff
changeset
|
15 end |
285
297690b5d4a5
[svn r306] Fixed: it's now possible to compile and link llvmdc with MinGW32 and msys on Win32 :D I tried it myself ;) Building the runtime still needs some work, but it's a step in the right direction.
lindquist
parents:
268
diff
changeset
|
16 end |
268
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
17 |
571
cbd6c8073a32
Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
544
diff
changeset
|
18 -- are we on a Posix system? |
cbd6c8073a32
Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
544
diff
changeset
|
19 POSIX = 1 |
cbd6c8073a32
Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
544
diff
changeset
|
20 if OS == "windows" then |
cbd6c8073a32
Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
544
diff
changeset
|
21 POSIX = 0 |
cbd6c8073a32
Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
544
diff
changeset
|
22 end |
cbd6c8073a32
Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
544
diff
changeset
|
23 |
699
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
24 |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
25 -- guess the host machine description |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
26 -- also allow overriding it |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
27 |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
28 addoption("target-override", "Override the default target machine"); |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
29 |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
30 TRIPLE = ""; |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
31 if options["target-override"] then |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
32 TRIPLE = options["target-override"] |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
33 else |
711
eed2de0c67a0
Changed premake script to write target triple to a file, then read that, instead of using popen
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
703
diff
changeset
|
34 os.execute("sh config.guess > default-target-triple.tmp") |
eed2de0c67a0
Changed premake script to write target triple to a file, then read that, instead of using popen
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
703
diff
changeset
|
35 TRIPLE = io.open("default-target-triple.tmp"):read() |
699
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
36 end |
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
37 |
711
eed2de0c67a0
Changed premake script to write target triple to a file, then read that, instead of using popen
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
703
diff
changeset
|
38 io.write("Default target: '"..TRIPLE.."'\n"); |
eed2de0c67a0
Changed premake script to write target triple to a file, then read that, instead of using popen
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
703
diff
changeset
|
39 |
724
6de2ed4f0abe
Disabled parameter reversing by default, it broke mini/typeinfo10.d
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
711
diff
changeset
|
40 -- x86 ABI support |
730
09b88beffd2d
Enable arg reversal on x86 by default. Make change to TypeInfo_Struct.compare to accomodate for it.
Christian Kamm <kamm incasoftware de>
parents:
727
diff
changeset
|
41 X86_REVERSE_PARAMS = 1 |
739
1ae94fb1dbbd
Fix accidental double-inreg caused by shared TupleType. Enabled inreg by default.
Christian Kamm <kamm incasoftware de>
parents:
730
diff
changeset
|
42 X86_PASS_IN_EAX = 1 |
724
6de2ed4f0abe
Disabled parameter reversing by default, it broke mini/typeinfo10.d
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
711
diff
changeset
|
43 |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
44 -- D version |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
45 DMDV2 = true |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
46 |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
47 if DMDV2 then |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
48 DMD_V_DEF = "DMDV2=1" |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
49 DMD_DIR = "dmd2" |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
50 else |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
51 DMD_V_DEF = "DMDV1=1" |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
52 DMD_DIR = "dmd" |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
53 end |
336 | 54 |
268
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
55 -- idgen |
1 | 56 package = newpackage() |
57 package.name = "idgen" | |
58 package.kind = "exe" | |
59 package.language = "c++" | |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
60 package.files = { DMD_DIR.."/idgen.c" } |
1 | 61 package.buildoptions = { "-x c++" } |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
62 package.postbuildcommands = { "./idgen", "mv -f id.c id.h "..DMD_DIR } |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
63 package.defines = { DMD_V_DEF } |
1 | 64 |
268
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
65 -- impcnvgen |
1 | 66 package = newpackage() |
67 package.name = "impcnvgen" | |
68 package.kind = "exe" | |
69 package.language = "c++" | |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
70 package.files = { DMD_DIR.."/impcnvgen.c" } |
1 | 71 package.buildoptions = { "-x c++" } |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
72 package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c "..DMD_DIR } |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
73 package.defines = { DMD_V_DEF } |
336 | 74 |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
582
diff
changeset
|
75 -- ldc |
1 | 76 package = newpackage() |
35
3cfcb944304e
[svn r39] * Updated to DMD 1.022 with the exception of:
lindquist
parents:
4
diff
changeset
|
77 package.bindir = "bin" |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
78 package.name = DMDV2 and "ldc2" or "ldc" |
1 | 79 package.kind = "exe" |
80 package.language = "c++" | |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
81 package.files = { matchfiles(DMD_DIR.."/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") } |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
82 package.excludes = { DMD_DIR.."/idgen.c", DMD_DIR.."/impcnvgen.c" } |
1 | 83 package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" } |
131 | 84 package.linkoptions = { |
85 -- long but it's faster than just 'all' | |
673
37a7688a7494
Add basics for direct assembly output.
Christian Kamm <kamm incasoftware de>
parents:
663
diff
changeset
|
86 "`llvm-config --libs bitwriter linker ipo instrumentation backend`", |
193
aca17e55b7a5
[svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents:
136
diff
changeset
|
87 "`llvm-config --ldflags`", |
131 | 88 } |
193
aca17e55b7a5
[svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents:
136
diff
changeset
|
89 package.defines = { |
aca17e55b7a5
[svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents:
136
diff
changeset
|
90 "IN_LLVM", |
aca17e55b7a5
[svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents:
136
diff
changeset
|
91 "_DH", |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
92 DMD_V_DEF, |
268
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
93 "OPAQUE_VTBLS="..OPAQUE_VTBLS, |
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
94 "USE_BOEHM_GC="..USE_BOEHM_GC, |
571
cbd6c8073a32
Changed all '#if linux || __APPLE__' to '#if POSIX' so we can support other platforms too, thanx for the suggestion anders.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
544
diff
changeset
|
95 "POSIX="..POSIX, |
699
ed9a9e6dd1cc
Started changing target triple stuff, part of fixing #97
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
673
diff
changeset
|
96 "DEFAULT_TARGET_TRIPLE=\\\""..TRIPLE.."\\\"", |
724
6de2ed4f0abe
Disabled parameter reversing by default, it broke mini/typeinfo10.d
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
711
diff
changeset
|
97 "X86_REVERSE_PARAMS="..X86_REVERSE_PARAMS, |
6de2ed4f0abe
Disabled parameter reversing by default, it broke mini/typeinfo10.d
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
711
diff
changeset
|
98 "X86_PASS_IN_EAX="..X86_PASS_IN_EAX, |
193
aca17e55b7a5
[svn r209] Fixed: exotic array to pointer casts were broken.
lindquist
parents:
136
diff
changeset
|
99 } |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
100 |
1 | 101 package.config.Release.defines = { "LLVMD_NO_LOGGER" } |
86
fd32135dca3e
[svn r90] Major updates to the gen directory. Redesigned the 'elem' struct. Much more... !!!
lindquist
parents:
35
diff
changeset
|
102 package.config.Debug.buildoptions = { "-g -O0" } |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
103 |
1 | 104 --package.targetprefix = "llvm" |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
105 package.includepaths = { ".", DMD_DIR } |
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
106 |
1 | 107 --package.postbuildcommands = { "cd runtime; ./build.sh; cd .." } |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
739
diff
changeset
|
108 |
268
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
109 if USE_BOEHM_GC == 1 then |
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
110 package.links = { "gc" } |
23d0d9855cad
[svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents:
237
diff
changeset
|
111 end |