Disable ffcall if native exceptions are in use.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27156 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-11-27 16:43:17 +00:00
parent 6a344a1499
commit bf6ddf132e
3 changed files with 59 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2008-11-27 Richard Frith-Macdonald <rfm@gnu.org>
* configure.ac: check for native exceptions use.
* configure: regenerate
Disable the use of ffcall with native exceptions as the two are
incompatible (ffcall changes the stack so that throwing an exception
will crash the process).
2008-11-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSDistributedNotificationCenter.m:

26
configure vendored
View file

@ -1379,6 +1379,13 @@ if test -z "$GNUSTEP_MAKEFILES"; then
GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>&5`
fi
exceptions=`gnustep-config --objc-flags | grep _NATIVE_OBJC_EXCEPTIONS 2>&5`
if test -z "$exceptions"; then
exceptions=no
else
exceptions=yes
fi
if test -z "$GNUSTEP_MAKEFILES"; then
{ { echo "$as_me:$LINENO: error: You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" >&5
echo "$as_me: error: You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" >&2;}
@ -16550,7 +16557,6 @@ case "$target_cpu" in
sparc64*)
case "$target_os" in
solaris*)
do_broken_libffi=no;
do_broken_libffcall=yes;
do_enable_libffi=yes;
do_enable_libffcall=no;;
@ -16559,6 +16565,12 @@ case "$target_cpu" in
*) ;;
esac
if test "$exceptions" = "yes"; then
# ffcall will mess up native exceptions, so we must disable it.
do_broken_libffcall=yes
do_enable_libffcall=no
fi
# Check whether --enable-libffi or --disable-libffi was given.
if test "${enable_libffi+set}" = set; then
enableval="$enable_libffi"
@ -16622,6 +16634,7 @@ esac
fi
if test "$do_broken_ffi" = "no"; then
if test "${ac_cv_header_ffi_h+set}" = set; then
echo "$as_me:$LINENO: checking for ffi.h" >&5
echo $ECHO_N "checking for ffi.h... $ECHO_C" >&6
@ -16766,6 +16779,10 @@ else
fi
else
have_libffi=no
fi
if test "$do_broken_ffcall" = "no"; then
for ac_header in callback.h
do
@ -16918,6 +16935,9 @@ fi
done
else
have_ffcall=no
fi
if test $have_ffcall = no; then
enable_ffcall=no
# If we don't have ffcall but do have libffi, use libffi
@ -17202,7 +17222,9 @@ echo "${ECHO_T}none" >&6
echo "we recommend installing libffi instead."
else
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"
echo "--with-ffi-include and/or --with-ffi-library flags so GNUstep can find them,"
echo "or you have ffcall but gnustep-make is configured to use native exceptions"
echo "(native exceptions are not compatible with ffcall)."
fi
echo "GNUstep requires ffcall or libffi and proper libobjc hooks to do"
echo "invocations and DO."

View file

@ -39,6 +39,13 @@ if test -z "$GNUSTEP_MAKEFILES"; then
GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>&5`
fi
exceptions=`gnustep-config --objc-flags | grep _NATIVE_OBJC_EXCEPTIONS 2>&5`
if test -z "$exceptions"; then
exceptions=no
else
exceptions=yes
fi
if test -z "$GNUSTEP_MAKEFILES"; then
AC_MSG_ERROR([You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!])
fi
@ -1910,7 +1917,6 @@ case "$target_cpu" in
sparc64*)
case "$target_os" in
solaris*)
do_broken_libffi=no;
do_broken_libffcall=yes;
do_enable_libffi=yes;
do_enable_libffcall=no;;
@ -1919,6 +1925,12 @@ case "$target_cpu" in
*) ;;
esac
if test "$exceptions" = "yes"; then
# ffcall will mess up native exceptions, so we must disable it.
do_broken_libffcall=yes
do_enable_libffcall=no
fi
AC_ARG_ENABLE(libffi,
[ --enable-libffi Enable use of libffi library],,
enable_libffi=$do_enable_libffi)
@ -1951,8 +1963,16 @@ if test ${ffi_libdir} != "no"; then
GS_ADD_LIBRARY_PATH([${ffi_libdir}])
fi
if test "$do_broken_ffi" = "no"; then
AC_CHECK_HEADER(ffi.h, have_libffi=yes, have_libffi=no)
else
have_libffi=no
fi
if test "$do_broken_ffcall" = "no"; then
AC_CHECK_HEADERS(callback.h, have_ffcall=yes, have_ffcall=no)
else
have_ffcall=no
fi
if test $have_ffcall = no; then
enable_ffcall=no
# If we don't have ffcall but do have libffi, use libffi
@ -2041,7 +2061,9 @@ if test $ffi_ok = no; then
echo "we recommend installing libffi instead."
else
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"
echo "--with-ffi-include and/or --with-ffi-library flags so GNUstep can find them,"
echo "or you have ffcall but gnustep-make is configured to use native exceptions"
echo "(native exceptions are not compatible with ffcall)."
fi
echo "GNUstep requires ffcall or libffi and proper libobjc hooks to do"
echo "invocations and DO."