On 29/11/11 18:09, David Matthews wrote:
On 24/11/2011 17:34, Ian Zimmerman wrote:
Yes, it is quite common to have an autoconf option like
--with-system-libffi to force linking to an existing shared library. I
don't think there would be any objection to that.

I've now added libffi to the Poly/ML source. I was trying to find a good
name for the option to select building without the internal version of
libffi and --with-system-libffi seemed a good choice. So, if ./configure
is run without any option it will use the version included in the
source. If --with-system-libffi is given it tries to use pkg-config to
find libffi and if that fails it looks for the library and header files
using the default paths. With a bit of luck that should mean that
Poly/ML will build without needing anything special on all the platforms
we support.

I've just tried r1380 on my Fedora 15 x86_64 machine and have a couple of things to report:

1. I get a build error (see output below) for foreign.cpp. Perhaps my C compiler is more pedantic than most but it is just using the default options. I think the issue is that, on x86_64, void * is 8 bytes but unsigned (int) is 4 bytes.

2. When I specify --with-system-libffi, I see that configure still runs for the libffi bundled with Poly/ML. Perhaps that is intentional.

Phil


/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/lib64/libffi-3.0.10/include -Wall -O3 -MT foreign.lo -MD -MP -MF .deps/foreign.Tpo -c -o foreign.lo foreign.cpp libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/lib64/libffi-3.0.10/include -Wall -O3 -MT foreign.lo -MD -MP -MF .deps/foreign.Tpo -c foreign.cpp -fPIC -DPIC -o .libs/foreign.o foreign.cpp: In function 'void callbackEntryPt(ffi_cif*, void*, void**, void*)': foreign.cpp:1505:34: error: cast from 'void*' to 'unsigned int' loses precision [-fpermissive] foreign.cpp: In function 'SaveVecEntry* createCallbackFunction(TaskData*, Handle, ffi_abi)': foreign.cpp:1588:84: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
make[2]: *** [foreign.lo] Error 1
make[2]: Leaving directory `/home/pclayton/SML/PolyML/svn/trunk/polyml/libpolyml'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pclayton/SML/PolyML/svn/trunk/polyml'
make: *** [all] Error 2


_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to