mascarenhas/alien — pull request #16 by gvvaughan (2012-06-14 20:28:59+00:00)
Title: Pull request/darwin support

This isn't complete, but is a start at making darwin builds work out of the box.

I still need to pass CPPFLAGS=-DDARWIN manually at configure time, or else the dlopen code is not compiled in. Would you prefer to change the .c files to use `#ifdef __APPLE__` instead of `#ifdef DARWIN`, or have DARWIN defined in `config.h` when configure/config.guess detect a darwin system at build time?

At this stage, the build completes without warnings, but `make check` SIGSEGVs before `alientest.c:_testfunc_i_bhilfd` returns. If I uncomment the `printf`, that displays correctly, so execution is reaching the called function through libffi. But even if I return an integer constant, alien segfaults before reaching the next test. I'm completely new to libffi, so any advice on where to look gratefully received :)