bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic objects (was: .ONESEHLL not working as expected in 3.82)


From: Tim Murphy
Subject: Re: Dynamic objects (was: .ONESEHLL not working as expected in 3.82)
Date: Mon, 29 Apr 2013 18:19:09 +0100

Sorry to keep adding in my 2c but I have also submitted a plugin implementation so I have a couple of ideas


On 29 April 2013 17:33, Eli Zaretskii <address@hidden> wrote:

2. The fact that the dynamic object's file extension (.so) is exposed
   to the Makefile is unfortunate, because it will hurt portability of
   Makefiles: the extension on Windows is .dll.  Can we omit the
   extension and append it internally?

"load" allows one to build the plugin from within the makefile so you have to deal with platform specific problems right there.
 
4. It would be good to have at least a single simple example of a
   dynamic extension, either in the tarball or in the manual.  The
   only ones I found are in the test suite; did I miss something?

This is a great idea.
 
6. API:

   . I suggest to request that the buffers for expansions and
     evaluation by gmk_expand and gmk_eval be provided by the caller.
     It is not safe (and not very convenient) to return buffers
     allocated internally by these functions, because the dynamic
     object might be compiled/linked with an incompatible
     implementation of memory allocation routines.

Yes!

IMHO the plugin needs to be able to allocate and deallocate memory in "gmakes world" i.e. you need gmk_alloc() and gmk_free().

Here's one of the tests:
static char * func_test (const char *funcname, int argc, char **argv)
{
    if (strcmp (funcname, "test-expand") == 0)
        return test_expand (argv[0]);

    if (strcmp (funcname, "test-eval") == 0)
        return test_eval (argv[0]);

    return strdup ("unknown");
}

That strdup at the end should be a gmk_strdup() if possible.

:-) Probably seems like over-engineering.

Regards, Tim
_______________________________________________
Bug-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-make



--
You could help some brave and decent people to have access to uncensored news by making a donation at:

http://www.thezimbabwean.co.uk/friends/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]