Open rgchris opened 6 years ago
@zsx Has an FFI on mac build ever been done before?
@rgchris could you perhaps try getting basic support on StackOverflow for just building on Mac one of the ffi samples that uses closures?
http://www.chiark.greenend.org.uk/doc/libffi-dev/html/Closure-Example.html
There you can explain how you installed libffi (via brew) and what you've done.
@hostilefork Q: How to include FFI in OS X?
I did download LibFFI via Brew but did not link it.
Bad news: Mac OS indeed does not have the functions you are missing. Check out this, particularly Closure Allocation section. – user58697 2 hours ago
This is strange. @rgchris - while you can't build FFI now you have in the past, right? These calls aren't new...if you've ever built an R3 with FFI, you'd have had them.
Without those we'd have to #ifdef out two features: calling variadic functions (like printf
) because it depends on ffi_prep_cif_var
) and making callbacks...e.g. making it so that a Rebol function can be exposed as a C function. For an example of using callbacks, see:
https://github.com/metaeducation/ren-c/blob/master/tests/misc/qsort_r.r
I'm trying to build on OS X (version 10.13.2).
I've installed the XCode Command Line Tools in order to create the /usr/include folder. The resultant folder contains ffi.h within an ffi subfolder (/usr/include/ffi/ffi.h).
On invoking make -f makefile.boot I eventually get the resultant output:
I tried modifying the src/extensions/ffi/reb-struct.h file at line 31 to read:
With this result:
And subsequently:
What to try next?