kamm@663: project.name = ldc lindquist@1: lindquist@268: -- options lindquist@295: lindquist@295: -- we always make vtables opaque, it simply kills performance... lindquist@268: OPAQUE_VTBLS = 1 lindquist@295: lindquist@295: -- use of boehm gc kamm@544: USE_BOEHM_GC = 0 kamm@544: if OS ~= "windows" then kamm@544: addoption("enable-boehm-gc", "Enable use of the Boehm GC (broken!)") lindquist@295: kamm@544: if options["enable-boehm-gc"] then lindquist@295: USE_BOEHM_GC = 1 lindquist@295: end lindquist@285: end lindquist@268: tomas@571: -- are we on a Posix system? tomas@571: POSIX = 1 tomas@571: if OS == "windows" then tomas@571: POSIX = 0 tomas@571: end tomas@571: tomas@699: tomas@699: -- guess the host machine description tomas@699: -- also allow overriding it tomas@699: tomas@699: addoption("target-override", "Override the default target machine"); tomas@699: tomas@699: TRIPLE = ""; tomas@699: if options["target-override"] then tomas@699: TRIPLE = options["target-override"] tomas@699: else tomas@699: local p = io.popen("./config.guess") tomas@699: TRIPLE = p:read() tomas@699: end tomas@699: lindquist@336: -- D version - don't change these !!! lindquist@336: DMDV1 = "1" lindquist@336: lindquist@268: -- idgen lindquist@1: package = newpackage() lindquist@1: package.name = "idgen" lindquist@1: package.kind = "exe" lindquist@1: package.language = "c++" lindquist@1: package.files = { "dmd/idgen.c" } lindquist@1: package.buildoptions = { "-x c++" } lindquist@35: package.postbuildcommands = { "./idgen", "mv -f id.c id.h dmd" } lindquist@336: package.defines = { "DMDV1="..DMDV1 } lindquist@1: lindquist@268: -- impcnvgen lindquist@1: package = newpackage() lindquist@1: package.name = "impcnvgen" lindquist@1: package.kind = "exe" lindquist@1: package.language = "c++" lindquist@1: package.files = { "dmd/impcnvgen.c" } lindquist@1: package.buildoptions = { "-x c++" } lindquist@35: package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c dmd" } lindquist@336: package.defines = { "DMDV1="..DMDV1 } lindquist@336: kamm@663: -- ldc lindquist@1: package = newpackage() lindquist@35: package.bindir = "bin" kamm@663: package.name = "ldc" lindquist@1: package.kind = "exe" lindquist@1: package.language = "c++" lindquist@136: package.files = { matchfiles("dmd/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") } lindquist@366: package.excludes = { "dmd/idgen.c", "dmd/impcnvgen.c" } lindquist@1: package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" } lindquist@131: package.linkoptions = { lindquist@131: -- long but it's faster than just 'all' kamm@673: "`llvm-config --libs bitwriter linker ipo instrumentation backend`", lindquist@193: "`llvm-config --ldflags`", lindquist@131: } lindquist@193: package.defines = { lindquist@193: "IN_LLVM", lindquist@193: "_DH", lindquist@268: "OPAQUE_VTBLS="..OPAQUE_VTBLS, lindquist@268: "USE_BOEHM_GC="..USE_BOEHM_GC, lindquist@336: "DMDV1="..DMDV1, tomas@571: "POSIX="..POSIX, tomas@699: "DEFAULT_TARGET_TRIPLE=\\\""..TRIPLE.."\\\"", lindquist@193: } lindquist@1: package.config.Release.defines = { "LLVMD_NO_LOGGER" } lindquist@86: package.config.Debug.buildoptions = { "-g -O0" } lindquist@1: --package.targetprefix = "llvm" lindquist@4: package.includepaths = { ".", "dmd" } lindquist@1: --package.postbuildcommands = { "cd runtime; ./build.sh; cd .." } lindquist@268: if USE_BOEHM_GC == 1 then lindquist@268: package.links = { "gc" } lindquist@268: end