diff 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
line wrap: on
line diff
--- a/premake.lua	Mon Oct 13 16:51:38 2008 +0200
+++ b/premake.lua	Mon Oct 13 17:28:39 2008 +0200
@@ -21,6 +21,20 @@
     POSIX = 0
 end
 
+
+-- guess the host machine description
+-- also allow overriding it
+
+addoption("target-override", "Override the default target machine");
+
+TRIPLE = "";
+if options["target-override"] then
+    TRIPLE = options["target-override"]
+else
+    local p = io.popen("./config.guess")
+    TRIPLE = p:read()
+end
+
 -- D version - don't change these !!!
 DMDV1 = "1"
 
@@ -65,6 +79,7 @@
     "USE_BOEHM_GC="..USE_BOEHM_GC,
     "DMDV1="..DMDV1,
     "POSIX="..POSIX,
+    "DEFAULT_TARGET_TRIPLE=\\\""..TRIPLE.."\\\"",
 }
 package.config.Release.defines = { "LLVMD_NO_LOGGER" }
 package.config.Debug.buildoptions = { "-g -O0" }