[Ecls-list] libffi configure test

Jerry James loganjerry at gmail.com
Tue Mar 1 22:02:55 UTC 2011


I saw this in the configure output for the latest sources:

checking for ffi_call in -lffi... yes
checking ffi/ffi.h usability... no
checking ffi/ffi.h presence... no
checking for ffi/ffi.h... no
checking ffi.h usability... yes
checking ffi.h presence... yes
checking for ffi.h... yes
checking whether we can use the existing libffi library ... no

Why can't we use the existing libffi library?  I think the problem is
in this snippet from src/aclocal.m4:

 AC_CHECK_LIB( ffi, ffi_call, [system_libffi=yes], [system_libffi=no] )
 if test "${system_libffi}" = yes; then
   AC_CHECK_HEADER([ffi/ffi.h],[ECL_LIBFFI_HEADER='ffi/ffi.h'],[system_libffi=no],[])
   if test -z "$ECL_LIBFFI_HEADER"; then
     AC_CHECK_HEADER([ffi.h],[ECL_LIBFFI_HEADER='ffi.h'],[system_libffi=no],[])
   fi
 fi

We find ffi_call in libffi, so system_libffi=yes.  The we check for
the header ffi/ffi.h and don't find it, so system_libffi=no.  Then we
check for the header ffi.h and find it ... and leave system_libffi set
to "no".  I think that should instead be:

 AC_CHECK_LIB( ffi, ffi_call, [system_libffi=yes], [system_libffi=no] )
 if test "${system_libffi}" = yes; then
   AC_CHECK_HEADER([ffi/ffi.h],[ECL_LIBFFI_HEADER='ffi/ffi.h'],
    [AC_CHECK_HEADER([ffi.h],[ECL_LIBFFI_HEADER='ffi.h'],[system_libffi=no],[])],[])
 fi

or maybe this:

AC_CHECK_LIB(ffi, ffi_call,
  [AC_CHECK_HEADERS([ffi/ffi.h ffi.h], [ECL_LIBFFI_HEADER=$ac_header;
system_libffi=yes; break], [system_libffi=no],[])],
  [system_libffi=no])

Beware my untested code! :-)

(Sorry for not using the sourceforge tracker for this.  My sourceforge
account has been busted since the big Sourceforge brouhaha a few weeks
ago.  I've sent multiple emails to Sourceforge support asking them to
please fix my account, but with no response so far.  I guess they're
still pretty busy dealing with the aftermath.)
-- 
Jerry James
http://www.jamezone.org/




More information about the ecl-devel mailing list