GLib compile error (ffi.h), but libffi is installed

后端 未结 5 1916
囚心锁ツ
囚心锁ツ 2021-02-02 04:36

After a succesful configure, make exits with snipped

gclosure.c:29:17: fatal error: ffi.h: No such file or directory
compilation terminated.
         


        
5条回答
  •  花落未央
    2021-02-02 05:19

    When compling libffi 3.0.9 from source code, the include/Makefile.in installs the includes in the ${PREFIX}/lib/libffi-3.0.9/include directory. I'm sure there's a WONDERFUL reason for that, but I'm annoyed by it.

    This line fixes it, when compiling libffi:

    /bin/perl -pe 's#^includesdir = .*#includesdir = \@includedir\@#' -i include/Makefile.in
    

    The includes will now be installed in ${PREFIX}/include, which is /usr/local/include for me.

    My full recipe is:

    cd /var/tmp
    rm -rf libffi-3.0.9
    untgz /usr/local/src/utils/libffi-3.0.9.tar.gz
    cd libffi-3.0.9
    /bin/perl -pe 's#^AM_CFLAGS = .*#AM_CFLAGS = -g#' -i Makefile.in
    /bin/perl -pe 's#^includesdir = .*#includesdir = \@includedir\@#' -i include/Makefile.in
    ./configure --prefix=/usr/local \
        --includedir=/usr/local/include
    gmake
    gmake install
    

提交回复
热议问题