annotate premake.lua @ 699:ed9a9e6dd1cc

Started changing target triple stuff, part of fixing #97
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 13 Oct 2008 17:28:39 +0200
parents 37a7688a7494
children 06576ece1a1b
rev   line source
kamm@663 1 project.name = ldc
lindquist@1 2
lindquist@268 3 -- options
lindquist@295 4
lindquist@295 5 -- we always make vtables opaque, it simply kills performance...
lindquist@268 6 OPAQUE_VTBLS = 1
lindquist@295 7
lindquist@295 8 -- use of boehm gc
kamm@544 9 USE_BOEHM_GC = 0
kamm@544 10 if OS ~= "windows" then
kamm@544 11 addoption("enable-boehm-gc", "Enable use of the Boehm GC (broken!)")
lindquist@295 12
kamm@544 13 if options["enable-boehm-gc"] then
lindquist@295 14 USE_BOEHM_GC = 1
lindquist@295 15 end
lindquist@285 16 end
lindquist@268 17
tomas@571 18 -- are we on a Posix system?
tomas@571 19 POSIX = 1
tomas@571 20 if OS == "windows" then
tomas@571 21 POSIX = 0
tomas@571 22 end
tomas@571 23
tomas@699 24
tomas@699 25 -- guess the host machine description
tomas@699 26 -- also allow overriding it
tomas@699 27
tomas@699 28 addoption("target-override", "Override the default target machine");
tomas@699 29
tomas@699 30 TRIPLE = "";
tomas@699 31 if options["target-override"] then
tomas@699 32 TRIPLE = options["target-override"]
tomas@699 33 else
tomas@699 34 local p = io.popen("./config.guess")
tomas@699 35 TRIPLE = p:read()
tomas@699 36 end
tomas@699 37
lindquist@336 38 -- D version - don't change these !!!
lindquist@336 39 DMDV1 = "1"
lindquist@336 40
lindquist@268 41 -- idgen
lindquist@1 42 package = newpackage()
lindquist@1 43 package.name = "idgen"
lindquist@1 44 package.kind = "exe"
lindquist@1 45 package.language = "c++"
lindquist@1 46 package.files = { "dmd/idgen.c" }
lindquist@1 47 package.buildoptions = { "-x c++" }
lindquist@35 48 package.postbuildcommands = { "./idgen", "mv -f id.c id.h dmd" }
lindquist@336 49 package.defines = { "DMDV1="..DMDV1 }
lindquist@1 50
lindquist@268 51 -- impcnvgen
lindquist@1 52 package = newpackage()
lindquist@1 53 package.name = "impcnvgen"
lindquist@1 54 package.kind = "exe"
lindquist@1 55 package.language = "c++"
lindquist@1 56 package.files = { "dmd/impcnvgen.c" }
lindquist@1 57 package.buildoptions = { "-x c++" }
lindquist@35 58 package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c dmd" }
lindquist@336 59 package.defines = { "DMDV1="..DMDV1 }
lindquist@336 60
kamm@663 61 -- ldc
lindquist@1 62 package = newpackage()
lindquist@35 63 package.bindir = "bin"
kamm@663 64 package.name = "ldc"
lindquist@1 65 package.kind = "exe"
lindquist@1 66 package.language = "c++"
lindquist@136 67 package.files = { matchfiles("dmd/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") }
lindquist@366 68 package.excludes = { "dmd/idgen.c", "dmd/impcnvgen.c" }
lindquist@1 69 package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" }
lindquist@131 70 package.linkoptions = {
lindquist@131 71 -- long but it's faster than just 'all'
kamm@673 72 "`llvm-config --libs bitwriter linker ipo instrumentation backend`",
lindquist@193 73 "`llvm-config --ldflags`",
lindquist@131 74 }
lindquist@193 75 package.defines = {
lindquist@193 76 "IN_LLVM",
lindquist@193 77 "_DH",
lindquist@268 78 "OPAQUE_VTBLS="..OPAQUE_VTBLS,
lindquist@268 79 "USE_BOEHM_GC="..USE_BOEHM_GC,
lindquist@336 80 "DMDV1="..DMDV1,
tomas@571 81 "POSIX="..POSIX,
tomas@699 82 "DEFAULT_TARGET_TRIPLE=\\\""..TRIPLE.."\\\"",
lindquist@193 83 }
lindquist@1 84 package.config.Release.defines = { "LLVMD_NO_LOGGER" }
lindquist@86 85 package.config.Debug.buildoptions = { "-g -O0" }
lindquist@1 86 --package.targetprefix = "llvm"
lindquist@4 87 package.includepaths = { ".", "dmd" }
lindquist@1 88 --package.postbuildcommands = { "cd runtime; ./build.sh; cd .." }
lindquist@268 89 if USE_BOEHM_GC == 1 then
lindquist@268 90 package.links = { "gc" }
lindquist@268 91 end