building gobject-introspection with Mingw

By error I clicked on send before I was finished.

I have been experimenting for a little while, trying to build gtk3 using Mingw.
I have done all the packages up to gtk itself.  gtk3 build failed with an error
message about fallback-c89.c.  I found this using Google:

I used the suggested patch.  The downside is that this seems to have required
autoreconf.  Now configure wants gobject-introspection.  I am not sure if this
is because the autoreconf changed something or just because I hadn't got that
far with the fallback problem.  Anyway, I tried building gobject-introspection
and that is where I am stuck now.

At this point, make failed with
    GISCAN GLib-2.0.gir
    env: Files/Microsoft: No such file or directory
I discovered that the build process doesn't like spaces in the PATH so I fixed
the PATH.

The next problem was this error:
    IOError: [Errno 2] No such file or directory: '.\\.libs\\.libs\\_giscanner.pyd'
    Why the double libs?
I found this
so it wasn't hard to find and fix that problem.

Now I am down to the part that has got me stumped.  I get this error:
Could not open C fd from OS handle

It wasn't hard to figure out that this is from giscanner/giscannermodule.c
I Googled this one and found
I see that the giscannermodule.c is included in that patch.  It appears that
this patch is not incorporated into gobject-introspection-1.31.22.  I also
notice that with or without the patch, there is something that doesn't seem
right (or at least I don't understand it).  I understand the use of
GetProcAddress to get the function from the dll.  I understand that on getting
the function pointer, it is then used in this way.

    p__get_osfhandle = GetProcAddress (msvcr71, "_get_osfhandle");
    if (!p__get_osfhandle)

    handle = p__get_osfhandle (fd);
    if (!p__get_osfhandle)

The part that I don't understand is why test p__get_osfhandle after using the
function rather than the result of the function which is handle.  Is this an
error or is this doing something that I just don't understand?  After looking
at the description of _get_osfhandle at
I would expect to see something like this:

    handle = (HANDLE) p__get_osfhandle (fd);
    if (handle == INVALID_HANDLE_VALUE)

Would this be wrong?  Either way, with the original code or the above, make fails.
I do notice that if I change to the above test for _get_osfhandle, the make
fails on that function and not on the following
    fd = p__open_osfhandle ((intptr_t) handle, _O_RDONLY);

Can anyone please help me with this?

Damon Register

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