Fix (or at least, work around) an issue with library order. Make sure the Basic
authorDavid Given <dg@cowlark.com>
Sun, 13 Nov 2016 12:28:09 +0000 (13:28 +0100)
committerDavid Given <dg@cowlark.com>
Sun, 13 Nov 2016 12:28:09 +0000 (13:28 +0100)
error symbols are actually defined.

first/ackbuilder.lua
first/build.lua
lang/basic/lib/error.c

index f66bcee..81e86b5 100644 (file)
@@ -729,9 +729,10 @@ definerule("simplerule",
 definerule("installable",
        {
                map = { type="targets", default={} },
+               deps = { type="targets", default={} },
        },
        function (e)
-               local deps = {}
+               local deps = filenamesof(e.deps)
                local commands = {}
                local srcs = {}
                local outs = {}
index 3240f9f..85df519 100644 (file)
@@ -226,6 +226,7 @@ definerule("cprogram",
        },
        function (e)
                local libs = matching(filenamesof(e.deps), "%.a$")
+               local srcs = {}
                if (#e.srcs > 0) then
                        for _, f in pairs(
                                matching(
@@ -240,7 +241,7 @@ definerule("cprogram",
                                        "%.a$"
                                )
                        ) do
-                               libs[#libs+1] = f
+                               srcs[#srcs+1] = f
                        end
                end
 
@@ -248,7 +249,7 @@ definerule("cprogram",
                        name = e.name,
                        cwd = e.cwd,
                        deps = e.deps,
-                       ins = libs,
+                       ins = { srcs, libs },
                        outleaves = { e.name },
                        commands = e.commands,
                }
index b2d893a..becc69d 100644 (file)
@@ -1,6 +1,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+int _errsym;
+int _erlsym;
+
 /* error takes an error value in the range of 0-255 */
 /* and generates a trap */
 
@@ -52,9 +55,6 @@ char *errortable[255]={
 error(index)
 int    index;
 {
-       extern int _errsym;
-       extern int _erlsym;
-
        _setline();
        if( index<0 || index >40 )
                printf("LINE %d:ERROR %d: Unprintable error\n",_erlsym,index);