Changeset View
Changeset View
Standalone View
Standalone View
lua-luarocks/files/patch-src_luarocks_core_cfg.lua
- Add DragonFly support | - Add DragonFly support | ||||
- Respect CC/CFLAGS/LD/LDFLAGS | - Respect CC/CFLAGS/LD/LDFLAGS | ||||
- Prefer system compiler over GCC on BSDs/Solaris | - Prefer system compiler over GCC on BSDs/Solaris | ||||
- OpenBSD uses Clang by default, so don't pass GCC RPATH | - OpenBSD uses Clang by default, so don't pass GCC RPATH | ||||
--- src/luarocks/core/cfg.lua.orig 2018-08-14 16:30:42 UTC | --- src/luarocks/core/cfg.lua.orig 2018-10-30 17:31:40 UTC | ||||
+++ src/luarocks/core/cfg.lua | +++ src/luarocks/core/cfg.lua | ||||
@@ -35,6 +35,7 @@ local platform_order = { | @@ -36,6 +36,7 @@ local platform_order = { | ||||
"netbsd", | "netbsd", | ||||
"openbsd", | "openbsd", | ||||
"freebsd", | "freebsd", | ||||
+ "dragonfly", | + "dragonfly", | ||||
"linux", | "linux", | ||||
"macosx", | "macosx", | ||||
"cygwin", | "cygwin", | ||||
@@ -154,6 +155,7 @@ end | @@ -153,6 +154,7 @@ do | ||||
local function make_platforms(system) | end | ||||
if system then | |||||
if system == "Linux" then return { unix = true, linux = true } | local platform_sets = { | ||||
+ elseif system == "DragonFly" then return { unix = true, bsd = true, dragonfly = true } | + dragonfly = { unix = true, bsd = true, dragonfly = true }, | ||||
elseif system == "FreeBSD" then return { unix = true, bsd = true, freebsd = true } | freebsd = { unix = true, bsd = true, freebsd = true }, | ||||
elseif system == "OpenBSD" then return { unix = true, bsd = true, openbsd = true } | openbsd = { unix = true, bsd = true, openbsd = true }, | ||||
elseif system == "NetBSD" then return { unix = true, bsd = true, netbsd = true } | solaris = { unix = true, solaris = true }, | ||||
@@ -357,13 +359,13 @@ local function make_defaults(lua_version, target_cpu, | @@ -359,13 +361,13 @@ local function make_defaults(lua_version | ||||
defaults.external_lib_extension = "so" | defaults.external_lib_extension = "so" | ||||
defaults.obj_extension = "o" | defaults.obj_extension = "o" | ||||
defaults.external_deps_dirs = { "/usr/local", "/usr", "/" } | defaults.external_deps_dirs = { "/usr/local", "/usr", "/" } | ||||
- defaults.variables.CFLAGS = "-O2" | - defaults.variables.CFLAGS = "-O2" | ||||
+ defaults.variables.CFLAGS = os.getenv("CFLAGS") or "-O2" | + defaults.variables.CFLAGS = os.getenv("CFLAGS") or "-O2" | ||||
defaults.cmake_generator = "Unix Makefiles" | defaults.cmake_generator = "Unix Makefiles" | ||||
- defaults.variables.CC = "gcc" | - defaults.variables.CC = "gcc" | ||||
- defaults.variables.LD = "gcc" | - defaults.variables.LD = "gcc" | ||||
+ -- Assume "cc" is a modern GCC-compatible compiler | + -- Assume "cc" is a modern GCC-compatible compiler | ||||
+ defaults.variables.CC = os.getenv("CC") or defaults.variables.CC | + defaults.variables.CC = os.getenv("CC") or defaults.variables.CC | ||||
+ defaults.variables.LD = os.getenv("CC") or defaults.variables.CC | + defaults.variables.LD = os.getenv("CC") or defaults.variables.CC | ||||
defaults.gcc_rpath = true | defaults.gcc_rpath = true | ||||
- defaults.variables.LIBFLAG = "-shared" | - defaults.variables.LIBFLAG = "-shared" | ||||
- | - | ||||
+ defaults.variables.LIBFLAG = (os.getenv("LDFLAGS") or "").." -shared" | + defaults.variables.LIBFLAG = (os.getenv("LDFLAGS") or "").." -shared" | ||||
defaults.external_deps_patterns = { | defaults.external_deps_patterns = { | ||||
bin = { "?" }, | bin = { "?" }, | ||||
lib = { "lib?.a", "lib?.so", "lib?.so.*" }, | lib = { "lib?.a", "lib?.so", "lib?.so.*" }, | ||||
@@ -449,15 +451,18 @@ local function make_defaults(lua_version, target_cpu, | @@ -451,15 +453,18 @@ local function make_defaults(lua_version | ||||
end | end | ||||
end | end | ||||
+ if platforms.dragonfly then | + if platforms.dragonfly then | ||||
+ defaults.arch = "dragonfly-"..target_cpu | + defaults.arch = "dragonfly-"..target_cpu | ||||
+ end | + end | ||||
+ | + | ||||
if platforms.freebsd then | if platforms.freebsd then | ||||
Show All 12 Lines |