From 5a92bdd749b6e5c4f4daae301ccac6e1307f57f2 Mon Sep 17 00:00:00 2001 From: Adam Fedor Date: Tue, 30 Nov 2004 04:25:38 +0000 Subject: [PATCH] * configure.ac: Check for libffi or callback/avcall libs (Patch from Matt Rice). Fixes bug #11134. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20396 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++ configure | 109 +++++++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 17 ++++++-- 3 files changed, 124 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c62f83ca4..b3badb491 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-11-29 Adam Fedor + + * configure.ac: Check for libffi or callback/avcall libs + (Patch from Matt Rice). Fixes bug #11134. + 2004-11-25 Richard Frith-Macdonald * Tools/gdomap.c: make respond to --help as to -H diff --git a/configure b/configure index 30fc6df81..05a38f674 100755 --- a/configure +++ b/configure @@ -13878,8 +13878,56 @@ _ACEOF WITH_FFI=libffi LIBS="-lffi $LIBS" - echo "$as_me:$LINENO: result: libffi" >&5 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ffi_ok="yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ffi_ok="no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ffi_ok = yes; then + echo "$as_me:$LINENO: result: libffi" >&5 echo "${ECHO_T}libffi" >&6 + fi elif test $enable_ffcall = yes; then cat >>confdefs.h <<\_ACEOF @@ -13888,16 +13936,69 @@ _ACEOF WITH_FFI=ffcall LIBS="-lcallback -lavcall $LIBS" - echo "$as_me:$LINENO: result: ffcall" >&5 -echo "${ECHO_T}ffcall" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ffi_ok="yes" else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ffi_ok="no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ffi_ok = yes; then + echo "$as_me:$LINENO: result: ffcall" >&5 +echo "${ECHO_T}ffcall" >&6 + fi +else + ffi_ok=no +fi + +if test $ffi_ok = no; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 echo if test $have_forward_hook = no; then echo "You do not have an up-to-date libobjc library installed" else - echo "You do not have either ffcall or libffi installed" + echo "You do not have either ffcall or libffi installed, or configure needs" + echo "--with-ffi-include and/or --with-ffi-library flags so GNUstep can find them" fi echo "GNUstep requires ffcall or libffi and proper libobjc hooks to do" echo "invocations and DO." diff --git a/configure.ac b/configure.ac index e1e7fa3b6..4ec1160cf 100644 --- a/configure.ac +++ b/configure.ac @@ -997,20 +997,31 @@ if test $enable_libffi = yes; then [Define if using the libffi library for invocations]) WITH_FFI=libffi LIBS="-lffi $LIBS" - AC_MSG_RESULT(libffi) + AC_TRY_LINK([#include ], ,ffi_ok="yes", ffi_ok="no") + if test $ffi_ok = yes; then + AC_MSG_RESULT(libffi) + fi elif test $enable_ffcall = yes; then AC_DEFINE(USE_FFCALL,1, [Define if using the ffcall library for invocations]) WITH_FFI=ffcall LIBS="-lcallback -lavcall $LIBS" - AC_MSG_RESULT(ffcall) + AC_TRY_LINK([#include ], , ffi_ok="yes", ffi_ok="no") + if test $ffi_ok = yes; then + AC_MSG_RESULT(ffcall) + fi else + ffi_ok=no +fi + +if test $ffi_ok = no; then AC_MSG_RESULT(none) echo if test $have_forward_hook = no; then echo "You do not have an up-to-date libobjc library installed" else - echo "You do not have either ffcall or libffi installed" + echo "You do not have either ffcall or libffi installed, or configure needs" + echo "--with-ffi-include and/or --with-ffi-library flags so GNUstep can find them" fi echo "GNUstep requires ffcall or libffi and proper libobjc hooks to do" echo "invocations and DO."