From 7084039296fde5bceff654e9523a6f54d2635c8c Mon Sep 17 00:00:00 2001 From: Richard Frith-MacDonald Date: Thu, 1 May 2008 20:14:05 +0000 Subject: [PATCH] try to build with correct ffcall/ffi depending on target system git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26483 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSNotificationCenter.m | 3 +++ configure | 26 +++++++++++++++++++++++--- configure.ac | 24 +++++++++++++++++++++--- 4 files changed, 52 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 86d1b9f53..12d07d268 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-01 Richard Frith-Macdonald + + * configure.ac: try to use libffi on sparc64 as libffcall does not + work. Warn if user tries to enable libffcall. + 2008-04-25 Richard Frith-Macdonald * Source/NSPropertyList.m: diff --git a/Source/NSNotificationCenter.m b/Source/NSNotificationCenter.m index ac6951a89..7f9f68e07 100644 --- a/Source/NSNotificationCenter.m +++ b/Source/NSNotificationCenter.m @@ -135,6 +135,9 @@ struct NCTbl; /* Notification Center Table structure */ * each -addObserver... request. It holds the requested selector, * name and object. Each struct is placed in one LinkedList, * as keyed by the NAME/OBJECT parameters. + * If 'next' is 0 then the observation is unused (ie it has been + * removed from, or not yet added to any list). The end of a + * list is marked by 'next' being set to 'ENDOBS'. */ typedef struct Obs { diff --git a/configure b/configure index 622397b98..eca2ae89e 100755 --- a/configure +++ b/configure @@ -16099,9 +16099,21 @@ fi #-------------------------------------------------------------------- # Check for FFI interface libraries for invocations -# We enable ffcall by default now. +# We enable ffcall by default now, except on sparc64 (where we think +# it's broken). #-------------------------------------------------------------------- -do_enable_libffi=no +case "$target_cpu" in + sparc64*) + do_broken_libffi=no; + do_broken_libffcall=yes; + do_enable_libffi=yes; + do_enable_libffcall=no;; + *) + do_broken_libffi=no; + do_broken_libffcall=no; + do_enable_libffi=no; + do_enable_libffcall=yes;; +esac # Check whether --enable-libffi was given. if test "${enable_libffi+set}" = set; then @@ -16115,7 +16127,7 @@ fi if test "${enable_ffcall+set}" = set; then enableval=$enable_ffcall; else - enable_ffcall=yes + enable_ffcall=$do_enable_libffcall fi @@ -16588,6 +16600,10 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ { echo "$as_me:$LINENO: result: libffi" >&5 echo "${ECHO_T}libffi" >&6; } fi + if test $do_broken_libffi = yes; then + { echo "$as_me:$LINENO: WARNING: ffi may be broken on this system ... try enabling ffcall" >&5 +echo "$as_me: WARNING: ffi may be broken on this system ... try enabling ffcall" >&2;} + fi elif test $enable_ffcall = yes; then cat >>confdefs.h <<\_ACEOF @@ -16643,6 +16659,10 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ { echo "$as_me:$LINENO: result: ffcall" >&5 echo "${ECHO_T}ffcall" >&6; } fi + if test $do_broken_libffcall = yes; then + { echo "$as_me:$LINENO: WARNING: ffcall may be broken on this system ... try enabling ffi" >&5 +echo "$as_me: WARNING: ffcall may be broken on this system ... try enabling ffi" >&2;} + fi else ffi_ok=no fi diff --git a/configure.ac b/configure.ac index 99ad0917f..670e55aa1 100644 --- a/configure.ac +++ b/configure.ac @@ -1868,9 +1868,21 @@ fi #-------------------------------------------------------------------- # Check for FFI interface libraries for invocations -# We enable ffcall by default now. +# We enable ffcall by default now, except on sparc64 (where we think +# it's broken). #-------------------------------------------------------------------- -do_enable_libffi=no +case "$target_cpu" in + sparc64*) + do_broken_libffi=no; + do_broken_libffcall=yes; + do_enable_libffi=yes; + do_enable_libffcall=no;; + *) + do_broken_libffi=no; + do_broken_libffcall=no; + do_enable_libffi=no; + do_enable_libffcall=yes;; +esac AC_ARG_ENABLE(libffi, [ --enable-libffi Enable use of libffi library],, @@ -1878,7 +1890,7 @@ AC_ARG_ENABLE(libffi, AC_ARG_ENABLE(ffcall, [ --enable-ffcall Enable use of ffcall library],, - enable_ffcall=yes) + enable_ffcall=$do_enable_libffcall) AC_ARG_ENABLE(do, [ --disable-do Compile even if DO-dependencies are not met],, @@ -1948,6 +1960,9 @@ if test $enable_libffi = yes; then if test $ffi_ok = yes; then AC_MSG_RESULT(libffi) fi + if test $do_broken_libffi = yes; then + AC_MSG_WARN([ffi may be broken on this system ... try enabling ffcall]) + fi elif test $enable_ffcall = yes; then AC_DEFINE(USE_FFCALL,1, [Define if using the ffcall library for invocations]) @@ -1957,6 +1972,9 @@ elif test $enable_ffcall = yes; then if test $ffi_ok = yes; then AC_MSG_RESULT(ffcall) fi + if test $do_broken_libffcall = yes; then + AC_MSG_WARN([ffcall may be broken on this system ... try enabling ffi]) + fi else ffi_ok=no fi