diff --git a/ChangeLog b/ChangeLog index d60c62d01..9a6bcd1ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-04-16 Richard Frith-Macdonald + + * config/config.forward2.m: Test for forward2 function in runtime. + * configure.ac: Run forward2 test + * Headers/Additions/GNUstepBase/config.h.in: record forward2 test. + * configure: regenerate + 2007-04-15 Richard Frith-Macdonald * configure.ac: check for wide character support in printf diff --git a/Headers/Additions/GNUstepBase/config.h.in b/Headers/Additions/GNUstepBase/config.h.in index cfc20120b..19dcac013 100644 --- a/Headers/Additions/GNUstepBase/config.h.in +++ b/Headers/Additions/GNUstepBase/config.h.in @@ -196,6 +196,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H +/* Define if libobjc has the __objc_msg_forward2 function */ +#undef HAVE_FORWARD2 + /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD diff --git a/config/config.forward2.m b/config/config.forward2.m new file mode 100644 index 000000000..becbf4f9b --- /dev/null +++ b/config/config.forward2.m @@ -0,0 +1,7 @@ +#include + +int main (void) +{ + IMP (*__objc_msg_forward1)(id,SEL) = __objc_msg_forward2; + return 0; +} diff --git a/configure b/configure index 5d90b8ad5..f8b8764ea 100755 --- a/configure +++ b/configure @@ -15985,6 +15985,42 @@ CPPFLAGS="$CPPFLAGS $OBJCFLAGS -x objective-c" { echo "$as_me:$LINENO: checking for forwarding callback in runtime" >&5 echo $ECHO_N "checking for forwarding callback in runtime... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF +#include "$srcdir/config/config.forward2.m" +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 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); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + have_forward_hook=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + have_forward_hook=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $have_forward_hook = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FORWARD2 1 +_ACEOF + +else + cat >conftest.$ac_ext <<_ACEOF #include "$srcdir/config/config.forward.m" _ACEOF rm -f conftest.$ac_objext @@ -16013,6 +16049,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi { echo "$as_me:$LINENO: result: $have_forward_hook" >&5 echo "${ECHO_T}$have_forward_hook" >&6; } if test $have_forward_hook = no; then diff --git a/configure.ac b/configure.ac index 5a8acfb19..854ad2922 100644 --- a/configure.ac +++ b/configure.ac @@ -1862,8 +1862,15 @@ have_forward_hook=yes saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $OBJCFLAGS -x objective-c" AC_MSG_CHECKING(for forwarding callback in runtime) -AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward.m"], +AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward2.m"], have_forward_hook=yes, have_forward_hook=no) +if test $have_forward_hook = yes; then + AC_DEFINE(HAVE_FORWARD2,1, + [Define if libobjc has the __objc_msg_forward2 function]) +else + AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward.m"], + have_forward_hook=yes, have_forward_hook=no) +fi AC_MSG_RESULT($have_forward_hook) if test $have_forward_hook = no; then enable_libffi=no