Skip to content

Commit

Permalink
maint: sync luke with upstream.
Browse files Browse the repository at this point in the history
* build-aux/luke: Sync with upstream.
* NEWS.md (Bug fixes): Update.

Signed-off-by: Gary V. Vaughan <[email protected]>
  • Loading branch information
gvvaughan committed Aug 29, 2020
1 parent baafb4d commit 5769e7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Noteworthy changes in release ?.? (????-??-??) [?]

### Bug fixes

- `luke` really propagates `LDFLAGS` to module compilation
commands.


## Noteworthy changes in release 6.2.5 (2020-04-15) [stable]

Expand Down
4 changes: 2 additions & 2 deletions build-aux/luke
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end,fatal=fatal,}
end
package.preload['luke.cli']=function()
local _ENV=require'std.normalize'{'luke._base','luke.lukefile','luke.platforms','std.functional',}local function version()print[[
luke (Luke) 0.2.0
luke (Luke) 0.2.1
Written by Gary V. Vaughan <[email protected]>, 2014
Copyright (C) 2020, Gary V. Vaughan
Expand Down Expand Up @@ -102,7 +102,7 @@ abspath=abspath..'.lua'return src,(gsub(abspath,'/[^/]+%.lua$',''))end
local function module_to_path(module,sources,objdir)return dropuntil(sources,function(source)return case(source,{['.*%.[ch]']=bind(c_source,{module,objdir}),['(.*%.[ch])%.in']=bind(c_source,{module,objdir}),['.*%.lua']=bind(lua_source,{module}),['(.*%.lua)%.in']=bind(lua_source,{module}),function(src)fatal("unsupported source type '%s'",src)end,})end)end
return{build_c_module=function(L,env,luke,name)local rules=luke.modules[name]local c_module=c_module_path(luke.variables.objdir,name)local command={'$MAKEDIRS',dirname(c_module)}local status,err,out=spawn(env,unpack(command))if status~=0 then
stdout:write(concat(command,' ')..'\n')stderr:write(err..'\n')exit(status)end
return run(L,env,flatten('$CC $CFLAGS $LIBFLAG $PKGFLAGS $CPPFLAGS',defines(env,except(list(rules.defines,luke.defines),nil)),incdirs(rules.incdirs,luke.incdirs),rules.sources,'-o',c_module,libdirs(rules.libdirs,luke.libdirs),'$LIBS',rules.libraries,luke.libraries))end,c_modules=function(modules)return filter(keys(modules),function(name)return dropuntil(modules[name].sources,bind(match,{[2]='%.[ch]$'}))end)end,incdirs=incdirs,install_modules=function(L,env,luke,modules)return reduce(keys(modules),0,function(status,name)if status==0 then
return run(L,env,flatten('$CC $CFLAGS $LIBFLAG $PKGFLAGS $CPPFLAGS',defines(env,except(list(rules.defines,luke.defines),nil)),incdirs(rules.incdirs,luke.incdirs),rules.sources,'-o',c_module,'$LDFLAGS',libdirs(rules.libdirs,luke.libdirs),'$LIBS',rules.libraries,luke.libraries))end,c_modules=function(modules)return filter(keys(modules),function(name)return dropuntil(modules[name].sources,bind(match,{[2]='%.[ch]$'}))end)end,incdirs=incdirs,install_modules=function(L,env,luke,modules)return reduce(keys(modules),0,function(status,name)if status==0 then
local src,dir=module_to_path(name,modules[name].sources,luke.variables.objdir)if not exists(interpolate(env,dir))then
status=run(L,env,{'$MAKEDIRS',dir})end
if status==0 then
Expand Down

0 comments on commit 5769e7e

Please sign in to comment.