1 diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua
2 index 535bd69..b017161 100644
3 --- a/src/luarocks/core/cfg.lua
4 +++ b/src/luarocks/core/cfg.lua
5 @@ -436,7 +436,7 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
6 defaults.external_lib_extension = "dylib"
7 defaults.arch = "macosx-"..target_cpu
8 defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load"
9 - local version = util.popen_read("sw_vers -productVersion")
10 + local version = os.getenv("MACOSX_DEPLOYMENT_TARGET") or "@darwinMinVersion@"
11 if not (version:match("^%d+%.%d+%.%d+$") or version:match("^%d+%.%d+$")) then
14 @@ -448,8 +448,8 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
16 defaults.gcc_rpath = false
18 - defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET="..tostring(version).." gcc"
19 - defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET="..tostring(version).." gcc"
20 + defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET="..tostring(version).." clang"
21 + defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET="..tostring(version).." clang"
22 defaults.web_browser = "open"