Make libffi auto-detected by configure

Bug #288748 reported by Michael D. Adams
2
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
Wishlist
Abdulaziz Ghuloum

Bug Description

Presently --enable-libffi is off by default and give an error if it is turned on and libffi is not found. I prose that there be three modes: "yes", "no" and "auto" in the same way that doxygen detection is done at [1] except that [1] doesn't have an explicit "auto" mode it can only be handled implicitly. However, the "auto" mode while it should be the default should also be able to be specified explicitly (see [2] for an example of an explicit argument that is more than just "yes" and "no").

If how to do this isn't clear, let me know and I may be able to work up the autoconf magic to do this.

[1] http://svn.apache.org/repos/asf/logging/log4cxx/trunk/configure.in

[2] http://www.shlomifish.org/lecture/Autotools/slides/common_macros/AC_ARG_ENABLE.html

Related branches

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 288748] [NEW] Make libffi auto-detected by configure

On Oct 24, 2008, at 10:47 AM, Michael D. Adams wrote:

> Presently --enable-libffi is off by default and give an error if it is
> turned on and libffi is not found. I prose that there be three modes:
> "yes", "no" and "auto" in the same way that doxygen detection is
> done at
> [1] except that [1] doesn't have an explicit "auto" mode it can
> only be
> handled implicitly.

I agree with this. For now, as I hope to push a new release soon, I
wish to leave ffi to be explicitly enabled, and disabled by default.
I will do this once I make the release.

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Andreas Rottmann (rotty) wrote :

I've attached a patch that does this, FWIW.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 288748] Re: Make libffi auto-detected by configure

On Apr 7, 2009, at 8:54 PM, Andreas Rottmann wrote:

> I've attached a patch that does this, FWIW.
>
> ** Attachment added: "t_libffi-detect.diff"
> http://launchpadlibrarian.net/24967801/t_libffi-detect.diff

Can you give a standard patch file? This one doesn't work.
Thanks.

Revision history for this message
Andreas Rottmann (rotty) wrote :

Abdulaziz Ghuloum <email address hidden> writes:

> On Apr 7, 2009, at 8:54 PM, Andreas Rottmann wrote:
>
>> I've attached a patch that does this, FWIW.
>>
>> ** Attachment added: "t_libffi-detect.diff"
>> http://launchpadlibrarian.net/24967801/t_libffi-detect.diff
>
> Can you give a standard patch file? This one doesn't work.
>
Hmm, it is supposed to be a standard patch file; I can apply it cleanly
to the bzr checkout with:

% patch -p1 < t_libffi-detect.diff

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

On Apr 8, 2009, at 3:46 PM, Andreas Rottmann wrote:

> Hmm, it is supposed to be a standard patch file; I can apply it
> cleanly
> to the bzr checkout with:
>
> % patch -p1 < t_libffi-detect.diff

Okay, got it. (The patches I'm used to receiving are patched with -p0
so that threw me off a bit)

Anyways, I tried your patch, but it doesn't build on my machine. It
seems that to use this, you need to have the pkg-config program
installed and properly configured. This program may be standard on
linux, but it's definitely not standard on Mac OS or Cygwin and I
don't know much about the *BSD flavors to say for sure. It seems a
little silly to require installing some piece of software on which
Ikarus does not depend just to get it to build. Is there no other
way of doing this without requiring additional software installed?

Aziz,,,

Revision history for this message
Andreas Rottmann (rotty) wrote :

Abdulaziz Ghuloum <email address hidden> writes:

> On Apr 8, 2009, at 3:46 PM, Andreas Rottmann wrote:
>
>> Hmm, it is supposed to be a standard patch file; I can apply it
>> cleanly
>> to the bzr checkout with:
>>
>> % patch -p1 < t_libffi-detect.diff
>
> Okay, got it. (The patches I'm used to receiving are patched with -p0
> so that threw me off a bit)
>
> Anyways, I tried your patch, but it doesn't build on my machine. It
> seems that to use this, you need to have the pkg-config program
> installed and properly configured. This program may be standard on
> linux, but it's definitely not standard on Mac OS or Cygwin and I
> don't know much about the *BSD flavors to say for sure. It seems a
> little silly to require installing some piece of software on which
> Ikarus does not depend just to get it to build. Is there no other
> way of doing this without requiring additional software installed?
>
Uh, I totally not thought about that I introduced a build-dependency on
pkg-config, as it is indeed installed in probably nearly all modern
Linux development boxen. I have attached a reworked patch not depend on
pkg-config.

The behaviour should be the following:

* If --disable-libffi is specified, support will be disabled (and the
  checks skipped). This is for people who just don't want an FFI.

* If --enable-libffi is specified, and libffi is not found, configure
  will abort with an error message. Useful for making sure the build
  includes an FFI.

* If neither --enable-libffi nor --disable-libffi is specified:

  If libffi is found, support for it will be automatically enabled,
  otherwise a warning will be issued. A decent default behaviour, IMO.

--Rotty

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Fixed in revision 1814. Thanks Andreas for the good patch.

Changed in ikarus:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.