comparison premake.lua @ 758:f04dde6e882c

Added initial D2 support, D2 frontend and changes to codegen to make things compile.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 11 Nov 2008 01:38:48 +0100
parents 1ae94fb1dbbd
children
comparison
equal deleted inserted replaced
757:2c730d530c98 758:f04dde6e882c
39 39
40 -- x86 ABI support 40 -- x86 ABI support
41 X86_REVERSE_PARAMS = 1 41 X86_REVERSE_PARAMS = 1
42 X86_PASS_IN_EAX = 1 42 X86_PASS_IN_EAX = 1
43 43
44 -- D version - don't change these !!! 44 -- D version
45 DMDV1 = "1" 45 DMDV2 = true
46
47 if DMDV2 then
48 DMD_V_DEF = "DMDV2=1"
49 DMD_DIR = "dmd2"
50 else
51 DMD_V_DEF = "DMDV1=1"
52 DMD_DIR = "dmd"
53 end
46 54
47 -- idgen 55 -- idgen
48 package = newpackage() 56 package = newpackage()
49 package.name = "idgen" 57 package.name = "idgen"
50 package.kind = "exe" 58 package.kind = "exe"
51 package.language = "c++" 59 package.language = "c++"
52 package.files = { "dmd/idgen.c" } 60 package.files = { DMD_DIR.."/idgen.c" }
53 package.buildoptions = { "-x c++" } 61 package.buildoptions = { "-x c++" }
54 package.postbuildcommands = { "./idgen", "mv -f id.c id.h dmd" } 62 package.postbuildcommands = { "./idgen", "mv -f id.c id.h "..DMD_DIR }
55 package.defines = { "DMDV1="..DMDV1 } 63 package.defines = { DMD_V_DEF }
56 64
57 -- impcnvgen 65 -- impcnvgen
58 package = newpackage() 66 package = newpackage()
59 package.name = "impcnvgen" 67 package.name = "impcnvgen"
60 package.kind = "exe" 68 package.kind = "exe"
61 package.language = "c++" 69 package.language = "c++"
62 package.files = { "dmd/impcnvgen.c" } 70 package.files = { DMD_DIR.."/impcnvgen.c" }
63 package.buildoptions = { "-x c++" } 71 package.buildoptions = { "-x c++" }
64 package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c dmd" } 72 package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c "..DMD_DIR }
65 package.defines = { "DMDV1="..DMDV1 } 73 package.defines = { DMD_V_DEF }
66 74
67 -- ldc 75 -- ldc
68 package = newpackage() 76 package = newpackage()
69 package.bindir = "bin" 77 package.bindir = "bin"
70 package.name = "ldc" 78 package.name = DMDV2 and "ldc2" or "ldc"
71 package.kind = "exe" 79 package.kind = "exe"
72 package.language = "c++" 80 package.language = "c++"
73 package.files = { matchfiles("dmd/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") } 81 package.files = { matchfiles(DMD_DIR.."/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") }
74 package.excludes = { "dmd/idgen.c", "dmd/impcnvgen.c" } 82 package.excludes = { DMD_DIR.."/idgen.c", DMD_DIR.."/impcnvgen.c" }
75 package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" } 83 package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" }
76 package.linkoptions = { 84 package.linkoptions = {
77 -- long but it's faster than just 'all' 85 -- long but it's faster than just 'all'
78 "`llvm-config --libs bitwriter linker ipo instrumentation backend`", 86 "`llvm-config --libs bitwriter linker ipo instrumentation backend`",
79 "`llvm-config --ldflags`", 87 "`llvm-config --ldflags`",
80 } 88 }
81 package.defines = { 89 package.defines = {
82 "IN_LLVM", 90 "IN_LLVM",
83 "_DH", 91 "_DH",
92 DMD_V_DEF,
84 "OPAQUE_VTBLS="..OPAQUE_VTBLS, 93 "OPAQUE_VTBLS="..OPAQUE_VTBLS,
85 "USE_BOEHM_GC="..USE_BOEHM_GC, 94 "USE_BOEHM_GC="..USE_BOEHM_GC,
86 "DMDV1="..DMDV1,
87 "POSIX="..POSIX, 95 "POSIX="..POSIX,
88 "DEFAULT_TARGET_TRIPLE=\\\""..TRIPLE.."\\\"", 96 "DEFAULT_TARGET_TRIPLE=\\\""..TRIPLE.."\\\"",
89 "X86_REVERSE_PARAMS="..X86_REVERSE_PARAMS, 97 "X86_REVERSE_PARAMS="..X86_REVERSE_PARAMS,
90 "X86_PASS_IN_EAX="..X86_PASS_IN_EAX, 98 "X86_PASS_IN_EAX="..X86_PASS_IN_EAX,
91 } 99 }
100
92 package.config.Release.defines = { "LLVMD_NO_LOGGER" } 101 package.config.Release.defines = { "LLVMD_NO_LOGGER" }
93 package.config.Debug.buildoptions = { "-g -O0" } 102 package.config.Debug.buildoptions = { "-g -O0" }
103
94 --package.targetprefix = "llvm" 104 --package.targetprefix = "llvm"
95 package.includepaths = { ".", "dmd" } 105 package.includepaths = { ".", DMD_DIR }
106
96 --package.postbuildcommands = { "cd runtime; ./build.sh; cd .." } 107 --package.postbuildcommands = { "cd runtime; ./build.sh; cd .." }
108
97 if USE_BOEHM_GC == 1 then 109 if USE_BOEHM_GC == 1 then
98 package.links = { "gc" } 110 package.links = { "gc" }
99 end 111 end