aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-06-24 15:15:50 -0300
committerHisham Muhammad <hisham@gobolinux.org>2015-06-24 15:15:50 -0300
commit9ed2084649a3c8d930f903edd03c08c1ed6c9bf8 (patch)
tree857def08133d650cc45e4f990910c9ee23c0d281
parentca619eb7e29849c77783fdf3c7b0e2cfbe554629 (diff)
parent26167e826f7be938e9ac5186e54b0cd8b8115427 (diff)
downloadluarocks-9ed2084649a3c8d930f903edd03c08c1ed6c9bf8.tar.gz
luarocks-9ed2084649a3c8d930f903edd03c08c1ed6c9bf8.tar.bz2
luarocks-9ed2084649a3c8d930f903edd03c08c1ed6c9bf8.zip
Merge pull request #393 from Tieske/target_stuff
add target cpu info to configuration
-rw-r--r--src/luarocks/cfg.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index 73a8ecb2..2a92c4dd 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -32,8 +32,6 @@ if not ok then
32 site_config = {} 32 site_config = {}
33end 33end
34 34
35cfg.site_config = site_config
36
37cfg.program_version = "scm" 35cfg.program_version = "scm"
38cfg.program_series = "2.2" 36cfg.program_series = "2.2"
39cfg.major_version = (cfg.program_version:match("([^.]%.[^.])")) or cfg.program_series 37cfg.major_version = (cfg.program_version:match("([^.]%.[^.])")) or cfg.program_series
@@ -87,6 +85,7 @@ elseif proc:match("amd64") or proc:match("x86_64") then
87elseif proc:match("Power Macintosh") then 85elseif proc:match("Power Macintosh") then
88 proc = "powerpc" 86 proc = "powerpc"
89end 87end
88cfg.target_cpu = proc
90 89
91if system == "FreeBSD" then 90if system == "FreeBSD" then
92 detected.unix = true 91 detected.unix = true
@@ -151,7 +150,8 @@ env_for_config_file = {
151 home = cfg.home, 150 home = cfg.home,
152 lua_version = cfg.lua_version, 151 lua_version = cfg.lua_version,
153 platform = util.make_shallow_copy(detected), 152 platform = util.make_shallow_copy(detected),
154 processor = proc, 153 processor = cfg.target_cpu, -- remains for compat reasons
154 target_cpu = cfg.target_cpu, -- replaces `processor`
155 os_getenv = os.getenv, 155 os_getenv = os.getenv,
156 dump_env = function() 156 dump_env = function()
157 -- debug function, calling it from a config file will show all 157 -- debug function, calling it from a config file will show all
@@ -322,7 +322,7 @@ if detected.windows then
322 322
323 home_config_file = home_config_file and home_config_file:gsub("\\","/") 323 home_config_file = home_config_file and home_config_file:gsub("\\","/")
324 defaults.fs_use_modules = false 324 defaults.fs_use_modules = false
325 defaults.arch = "win32-"..proc 325 defaults.arch = "win32-"..cfg.target_cpu
326 defaults.platforms = {"win32", "windows" } 326 defaults.platforms = {"win32", "windows" }
327 defaults.lib_extension = "dll" 327 defaults.lib_extension = "dll"
328 defaults.external_lib_extension = "dll" 328 defaults.external_lib_extension = "dll"
@@ -440,7 +440,7 @@ end
440 440
441if detected.cygwin then 441if detected.cygwin then
442 defaults.lib_extension = "so" -- can be overridden in the config file for mingw builds 442 defaults.lib_extension = "so" -- can be overridden in the config file for mingw builds
443 defaults.arch = "cygwin-"..proc 443 defaults.arch = "cygwin-"..cfg.target_cpu
444 defaults.platforms = {"unix", "cygwin"} 444 defaults.platforms = {"unix", "cygwin"}
445 defaults.cmake_generator = "Unix Makefiles" 445 defaults.cmake_generator = "Unix Makefiles"
446 defaults.variables.CC = "echo -llua | xargs gcc" 446 defaults.variables.CC = "echo -llua | xargs gcc"
@@ -456,7 +456,7 @@ end
456if detected.macosx then 456if detected.macosx then
457 defaults.variables.MAKE = "make" 457 defaults.variables.MAKE = "make"
458 defaults.external_lib_extension = "dylib" 458 defaults.external_lib_extension = "dylib"
459 defaults.arch = "macosx-"..proc 459 defaults.arch = "macosx-"..cfg.target_cpu
460 defaults.platforms = {"unix", "bsd", "macosx"} 460 defaults.platforms = {"unix", "bsd", "macosx"}
461 defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load" 461 defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load"
462 defaults.variables.STAT = "/usr/bin/stat" 462 defaults.variables.STAT = "/usr/bin/stat"
@@ -476,12 +476,12 @@ if detected.macosx then
476end 476end
477 477
478if detected.linux then 478if detected.linux then
479 defaults.arch = "linux-"..proc 479 defaults.arch = "linux-"..cfg.target_cpu
480 defaults.platforms = {"unix", "linux"} 480 defaults.platforms = {"unix", "linux"}
481end 481end
482 482
483if detected.freebsd then 483if detected.freebsd then
484 defaults.arch = "freebsd-"..proc 484 defaults.arch = "freebsd-"..cfg.target_cpu
485 defaults.platforms = {"unix", "bsd", "freebsd"} 485 defaults.platforms = {"unix", "bsd", "freebsd"}
486 defaults.gcc_rpath = false 486 defaults.gcc_rpath = false
487 defaults.variables.CC = "cc" 487 defaults.variables.CC = "cc"
@@ -489,17 +489,17 @@ if detected.freebsd then
489end 489end
490 490
491if detected.openbsd then 491if detected.openbsd then
492 defaults.arch = "openbsd-"..proc 492 defaults.arch = "openbsd-"..cfg.target_cpu
493 defaults.platforms = {"unix", "bsd", "openbsd"} 493 defaults.platforms = {"unix", "bsd", "openbsd"}
494end 494end
495 495
496if detected.netbsd then 496if detected.netbsd then
497 defaults.arch = "netbsd-"..proc 497 defaults.arch = "netbsd-"..cfg.target_cpu
498 defaults.platforms = {"unix", "bsd", "netbsd"} 498 defaults.platforms = {"unix", "bsd", "netbsd"}
499end 499end
500 500
501if detected.solaris then 501if detected.solaris then
502 defaults.arch = "solaris-"..proc 502 defaults.arch = "solaris-"..cfg.target_cpu
503 defaults.platforms = {"unix", "solaris"} 503 defaults.platforms = {"unix", "solaris"}
504 defaults.variables.MAKE = "gmake" 504 defaults.variables.MAKE = "gmake"
505end 505end