annotate premake.lua @ 1060:599e3d6d0dbd

Remove a dead variable from ldmd. (It used to be used to pass an extra -help to ldc when no files were specified, but we handle that in ldc itself now)
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 08 Mar 2009 09:57:20 +0100
parents f04dde6e882c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
aaade6ded589 [svn r357] Merged DMD 1.033
lindquist
parents: 295
diff changeset
54
268
23d0d9855cad [svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents: 237
diff changeset
55 -- idgen
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
56 package = newpackage()
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
57 package.name = "idgen"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
58 package.kind = "exe"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
64
268
23d0d9855cad [svn r289] Fixed: right shift >> was broken for unsigned types.
lindquist
parents: 237
diff changeset
65 -- impcnvgen
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
66 package = newpackage()
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
67 package.name = "impcnvgen"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
68 package.kind = "exe"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
aaade6ded589 [svn r357] Merged DMD 1.033
lindquist
parents: 295
diff changeset
74
663
6aaa3d3c1183 First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents: 582
diff changeset
75 -- ldc
1
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
79 package.kind = "exe"
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
83 package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" }
131
5825d48b27d1 [svn r135] * Merged DMD 1.025 *
lindquist
parents: 125
diff changeset
84 package.linkoptions = {
5825d48b27d1 [svn r135] * Merged DMD 1.025 *
lindquist
parents: 125
diff changeset
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
5825d48b27d1 [svn r135] * Merged DMD 1.025 *
lindquist
parents: 125
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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
c53b6e3fe49a [svn r5] Initial commit. Most things are very rough.
lindquist
parents:
diff changeset
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