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@711: os.execute("sh config.guess > default-target-triple.tmp") tomas@711: TRIPLE = io.open("default-target-triple.tmp"):read() tomas@699: end tomas@699: tomas@711: io.write("Default target: '"..TRIPLE.."'\n"); tomas@711: tomas@724: -- x86 ABI support kamm@730: X86_REVERSE_PARAMS = 1 kamm@739: X86_PASS_IN_EAX = 1 tomas@724: tomas@758: -- D version tomas@758: DMDV2 = true tomas@758: tomas@758: if DMDV2 then tomas@758: DMD_V_DEF = "DMDV2=1" tomas@758: DMD_DIR = "dmd2" tomas@758: else tomas@758: DMD_V_DEF = "DMDV1=1" tomas@758: DMD_DIR = "dmd" tomas@758: end lindquist@336: lindquist@268: -- idgen lindquist@1: package = newpackage() lindquist@1: package.name = "idgen" lindquist@1: package.kind = "exe" lindquist@1: package.language = "c++" tomas@758: package.files = { DMD_DIR.."/idgen.c" } lindquist@1: package.buildoptions = { "-x c++" } tomas@758: package.postbuildcommands = { "./idgen", "mv -f id.c id.h "..DMD_DIR } tomas@758: package.defines = { DMD_V_DEF } lindquist@1: lindquist@268: -- impcnvgen lindquist@1: package = newpackage() lindquist@1: package.name = "impcnvgen" lindquist@1: package.kind = "exe" lindquist@1: package.language = "c++" tomas@758: package.files = { DMD_DIR.."/impcnvgen.c" } lindquist@1: package.buildoptions = { "-x c++" } tomas@758: package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c "..DMD_DIR } tomas@758: package.defines = { DMD_V_DEF } lindquist@336: kamm@663: -- ldc lindquist@1: package = newpackage() lindquist@35: package.bindir = "bin" tomas@758: package.name = DMDV2 and "ldc2" or "ldc" lindquist@1: package.kind = "exe" lindquist@1: package.language = "c++" tomas@758: package.files = { matchfiles(DMD_DIR.."/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") } tomas@758: package.excludes = { DMD_DIR.."/idgen.c", DMD_DIR.."/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", tomas@758: DMD_V_DEF, lindquist@268: "OPAQUE_VTBLS="..OPAQUE_VTBLS, lindquist@268: "USE_BOEHM_GC="..USE_BOEHM_GC, tomas@571: "POSIX="..POSIX, tomas@699: "DEFAULT_TARGET_TRIPLE=\\\""..TRIPLE.."\\\"", tomas@724: "X86_REVERSE_PARAMS="..X86_REVERSE_PARAMS, tomas@724: "X86_PASS_IN_EAX="..X86_PASS_IN_EAX, lindquist@193: } tomas@758: lindquist@1: package.config.Release.defines = { "LLVMD_NO_LOGGER" } lindquist@86: package.config.Debug.buildoptions = { "-g -O0" } tomas@758: lindquist@1: --package.targetprefix = "llvm" tomas@758: package.includepaths = { ".", DMD_DIR } tomas@758: lindquist@1: --package.postbuildcommands = { "cd runtime; ./build.sh; cd .." } tomas@758: lindquist@268: if USE_BOEHM_GC == 1 then lindquist@268: package.links = { "gc" } lindquist@268: end