Skip to content

Commit

Permalink
Merge branch '0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Auvinen committed Jun 17, 2016
2 parents 9de512b + a69bc37 commit 86cd7b4
Show file tree
Hide file tree
Showing 72 changed files with 14,193 additions and 7,633 deletions.
10 changes: 9 additions & 1 deletion license.txt → COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
Copyright (c) 2009 Magnus Auvinen

Important Notice:
The source code under src/lua is a slimmed down version of the Lua distribution and
is under a different license. Please get a complete distribution of it if you
intend to use it yourself. Please see the src/lua/COPYRIGHT for more information.

----------------------------------------------------------------------------------

Copyright (c) 2016 Magnus Auvinen

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
4 changes: 2 additions & 2 deletions make_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ fi

# the actual compile
echo "compiling using $CC..." >&2
$CC -Wall -ansi -pedantic src/tools/txt2c.c -o src/tools/txt2c
$CC -Wall -pedantic src/tools/txt2c.c -o src/tools/txt2c
src/tools/txt2c src/base.lua src/tools.lua src/driver_gcc.lua src/driver_clang.lua src/driver_cl.lua > src/internal_base.h
$CC -Wall -ansi -pedantic src/*.c src/lua/*.c -o bam -I src/lua -lm -lpthread $ldl -O2 -rdynamic $*
$CC -Wall -pedantic src/*.c src/lua/*.c -o bam -I src/lua -lm -lpthread $ldl -O2 -rdynamic $*
14 changes: 10 additions & 4 deletions src/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ModifyPriority = bam_modify_priority

--[[@UNITTESTS
err=1 : bam_add_dependency_cpp("missing node")
err=0: PseudoTarget("fakenode"); bam_add_dependency_cpp("fakenode")
err=0 : PseudoTarget("fakenode"); bam_add_dependency_cpp("fakenode")
@END]]--

--[[@UNITTESTS
Expand Down Expand Up @@ -42,16 +42,22 @@ end
--[[@FUNCTION Execute(command)
Executes the ^command^ in the shell and returns the error code.
@END]]--
Execute = os.execute
--[[@UNITTESTS
err=0 : Execute("echo")
@END]]--
function Execute(command)
local res,str,code = os.execute(command)
return code
end

--[[@FUNCTION ExecuteSilent(command)
Does the same as ^Execute(command)^ but supresses stdout and stderr of
that command.
@END]]--
if family == "windows" then
ExecuteSilent = function(command) return os.execute(command .. " >nul 2>&1") end
ExecuteSilent = function(command) return Execute(command .. " >nul 2>&1") end
else
ExecuteSilent = function(command) return os.execute(command .. " >/dev/null 2>/dev/null") end
ExecuteSilent = function(command) return Execute(command .. " >/dev/null 2>/dev/null") end
end

--[[@GROUP Path Manipulation @END]]--
Expand Down
12 changes: 9 additions & 3 deletions src/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const char *context_get_path(lua_State *L)
{
const char *path;
lua_pushstring(L, CONTEXT_LUA_PATH);
lua_gettable(L, LUA_GLOBALSINDEX);
lua_gettable(L, LUA_REGISTRYINDEX);
path = lua_tostring(L, -1);
lua_pop(L, 1);
return path;
Expand Down Expand Up @@ -377,6 +377,7 @@ static void threads_run(void *u)
struct THREADINFO *info = (struct THREADINFO *)u;
struct CONTEXT *context = info->context;
struct JOB *job;
int backofftime = 1;

/* lock the dependency graph */
criticalsection_enter();
Expand All @@ -398,14 +399,19 @@ static void threads_run(void *u)
job = find_job(context);
if(job)
{
backofftime = 1;
run_job(context, job, info->id + 1);
}
else
{
/* if we didn't find a job todo, be a bit nice to the processor */
/* TODO: we should wait for an event here */
criticalsection_leave();
threads_yield();
/* TODO: we should wait for an event here */
/* back off more and more up to 200ms */
backofftime *= 2;
if(backofftime > 200)
backofftime = 200;
threads_sleep(backofftime);
criticalsection_enter();
}
}
Expand Down
36 changes: 4 additions & 32 deletions src/lua/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
Lua License
-----------
Copyright © 1994–2016 Lua.org, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Lua is licensed under the terms of the MIT license reproduced below.
This means that Lua is free software and can be used for both academic
and commercial purposes at absolutely no cost.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

For details and rationale, see http://www.lua.org/license.html .

===============================================================================

Copyright (C) 1994-2008 Lua.org, PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

===============================================================================

(end of COPYRIGHT)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 0 additions & 2 deletions src/lua/IMPORTANTINFO

This file was deleted.

37 changes: 0 additions & 37 deletions src/lua/README

This file was deleted.

Loading

0 comments on commit 86cd7b4

Please sign in to comment.