use pkg-config for libffi when available

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34252 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2011-12-06 11:53:35 +00:00
parent a54d3f2bdd
commit b9f3958132
3 changed files with 31 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2011-12-06 Richard Frith-Macdonald <rfm@gnu.org>
* configure.ac: use pkg-config for libffi if/when available.
* configure: regenerate
2011-12-05 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSFileManager.m:

14
configure vendored
View file

@ -21926,6 +21926,13 @@ esac
fi
if test "$do_broken_libffi" = "no"; then
if test "$PKGCONFIG" = "yes"; then
if pkg-config --exists libffi; then
pkg_config_libffi=yes
ffi_CFLAGS=`pkg-config --cflags libffi`
CFLAGS="$CFLAGS $ffi_CFLAGS"
fi
fi
if test "${ac_cv_header_ffi_h+set}" = set; then
{ $as_echo "$as_me:$LINENO: checking for ffi.h" >&5
$as_echo_n "checking for ffi.h... " >&6; }
@ -22324,7 +22331,12 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
WITH_FFI=libffi
LIBS="-lffi $LIBS"
if test "$pkg_config_libffi" = "yes"; then
ffi_LIBS=`pkg-config --libs libffi`
else
ffi_LIBS=-lffi
fi
LIBS="$ffi_LIBS $LIBS"
if test "$cross_compiling" = yes; then
ffi_ok="yes"
else

View file

@ -2541,6 +2541,13 @@ GS_ADD_LIBRARY_PATH([${ffi_libdir}])
fi
if test "$do_broken_libffi" = "no"; then
if test "$PKGCONFIG" = "yes"; then
if pkg-config --exists libffi; then
pkg_config_libffi=yes
ffi_CFLAGS=`pkg-config --cflags libffi`
CFLAGS="$CFLAGS $ffi_CFLAGS"
fi
fi
AC_CHECK_HEADER(ffi.h, have_libffi=yes, have_libffi=no)
else
have_libffi=no
@ -2593,7 +2600,12 @@ if test $enable_libffi = yes; then
AC_DEFINE(USE_LIBFFI,1,
[Define if using the libffi library for invocations])
WITH_FFI=libffi
LIBS="-lffi $LIBS"
if test "$pkg_config_libffi" = "yes"; then
ffi_LIBS=`pkg-config --libs libffi`
else
ffi_LIBS=-lffi
fi
LIBS="$ffi_LIBS $LIBS"
AC_TRY_RUN([#include "$srcdir/config/config.ffi.c"],
ffi_ok="yes",ffi_ok="no",ffi_ok="yes")
if test $ffi_ok = yes; then