From 36f6fd122162c49fd1737344c1a9de7cc7bf3758 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 11 Apr 2022 17:02:06 -0300 Subject: add DragonFly BSD support --- src/luarocks/core/cfg.lua | 28 ++++++++++------------------ src/luarocks/core/sysdetect.lua | 3 +++ 2 files changed, 13 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index 6a2518c0..9122c877 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -37,6 +37,7 @@ local platform_order = { "netbsd", "openbsd", "freebsd", + "dragonfly", "linux", "macosx", "cygwin", @@ -151,6 +152,7 @@ end local platform_sets = { freebsd = { unix = true, bsd = true, freebsd = true }, openbsd = { unix = true, bsd = true, openbsd = true }, + dragonfly = { unix = true, bsd = true, dragonfly = true }, solaris = { unix = true, solaris = true }, windows = { windows = true, win32 = true }, cygwin = { unix = true, cygwin = true }, @@ -451,6 +453,9 @@ local function make_defaults(lua_version, target_cpu, platforms, home) if platforms.bsd then defaults.variables.MAKE = "gmake" + defaults.gcc_rpath = false + defaults.variables.CC = "cc" + defaults.variables.LD = defaults.variables.CC end if platforms.macosx then @@ -492,27 +497,14 @@ local function make_defaults(lua_version, target_cpu, platforms, home) if platforms.freebsd then defaults.arch = "freebsd-"..target_cpu - defaults.gcc_rpath = false - defaults.variables.CC = "cc" - defaults.variables.LD = defaults.variables.CC - defaults.variables.LIBFLAG = "-shared" - end - - if platforms.openbsd then + elseif platforms.dragonfly then + defaults.arch = "dragonfly-"..target_cpu + elseif platforms.openbsd then defaults.arch = "openbsd-"..target_cpu - defaults.gcc_rpath = false - defaults.variables.CC = "cc" - defaults.variables.LD = defaults.variables.CC - defaults.variables.LIBFLAG = "-shared" - end - - if platforms.netbsd then + elseif platforms.netbsd then defaults.arch = "netbsd-"..target_cpu - end - - if platforms.solaris then + elseif platforms.solaris then defaults.arch = "solaris-"..target_cpu - --defaults.platforms = {"unix", "solaris"} defaults.variables.MAKE = "gmake" end diff --git a/src/luarocks/core/sysdetect.lua b/src/luarocks/core/sysdetect.lua index 02b8a492..d999203a 100644 --- a/src/luarocks/core/sysdetect.lua +++ b/src/luarocks/core/sysdetect.lua @@ -153,6 +153,9 @@ local function detect_elf_system(fd, hdr, sections) return "netbsd" elseif sections[".note.openbsd.ident"] then return "openbsd" + elseif sections[".note.tag"] and + sections[".note.tag"].namedata == "DragonFly" then + return "dragonfly" end local gnu_version_r = sections[".gnu.version_r"] -- cgit v1.2.3-55-g6feb