unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matt Wette <matt.wette@gmail.com>
To: Guile User <guile-user@gnu.org>
Subject: Re: ffi-helper: looking for C libraries to try
Date: Tue, 1 Aug 2017 09:20:33 -0700	[thread overview]
Message-ID: <56AA0CAA-F1D0-4E1D-A01E-64C6CBF4185D@gmail.com> (raw)
In-Reply-To: <BD269A3D-D806-4156-8D46-C7F13BBB053E@gmail.com>


> On Jul 15, 2017, at 6:15 AM, Matt Wette <matt.wette@gmail.com> wrote:
> 
> 
>> On Jul 14, 2017, at 9:35 PM, Matt Wette <matt.wette@gmail.com> wrote:
>> 
>> 
>>> On Jul 14, 2017, at 5:44 PM, Amirouche Boubekki <amirouche@hypermove.net> wrote:
>>> 
>>> On 2017-07-15 01:17, Matt Wette wrote:
>>>> I tried git2 but those headers are too
>>>> broken.
>>> 
>>> What do you mean by "too broken"? Maybe it will be easier in the long run to maintain our own version of the headers than manually bind everything. Even if it requires to create a shim layer in scheme to have a proper set of bindings that schemer will enjoy. Also, git is a good candidate since there are some tests already in guile-git [1].
>> 
>> Maybe another bug in my CPP.  
>> 
>> (define-ffi-module (libgit2)
>> #:include '("git2.h")
>> #:inc-dirs '("/opt/local/include")
>> #:library '("git2")
>> )
>> 
>> mwette$ guild compile-ffi libgit2.ffi 
>> (unknown):1: not found: “common.h"
>> 
> 
> I claim libgit2 headers are broken.  The standard says, essentially, “how headers are located is implementation defined”.
> 
> The file …/include/git2.h states:
> #include “git2/annotated_commit.h”
> #include “git2/common.h”
> …
> 
> But the file include/git2/annotated_commit.h states:
> #include “common.h”
> 
> Note this is “common.h" not “git2/common.h” How does gcc find common.h?  
> The directory include/git2 is not in the include path.  
> These are the ugly, undocumented, non-standard items that scare me.

I found a reference for include file searching in gcc: 
	https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html

I have returned to working on libgit2.  It turns out glib uses this, and include_next as well.
So I have added this behavior plus include_next.  Test/debug of the fyi-helper goes on …

I have been able too compile-ffi, almost everything from cairo, gdbm, sqlite3.  
Now working on rsvp and libgit2. 

Not supported so far is va-args.  That will require some help from the user.  (Libffi does not support va-args.)

Matt


  reply	other threads:[~2017-08-01 16:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 23:17 ffi-helper: looking for C libraries to try Matt Wette
2017-07-15  0:04 ` Mike Gran
2017-07-15  0:44 ` Amirouche Boubekki
2017-07-15  4:35   ` Matt Wette
2017-07-15  8:24     ` Amirouche
2017-07-15 12:37       ` Matt Wette
2017-07-15 12:42         ` Matt Wette
2017-07-15 13:15     ` Matt Wette
2017-08-01 16:20       ` Matt Wette [this message]
2017-07-15  0:55 ` Amirouche
2017-07-15  3:01   ` Matt Wette
2017-08-08 10:00 ` Catonano
2017-08-12 19:55   ` Matt Wette

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56AA0CAA-F1D0-4E1D-A01E-64C6CBF4185D@gmail.com \
    --to=matt.wette@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).