Add test for presence of __objc_msg_forward2

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25059 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-04-16 05:02:18 +00:00
parent 869dbca2b2
commit cc4cd447b5
5 changed files with 62 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2007-04-16 Richard Frith-Macdonald <rfm@gnu.org>
* 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 <rfm@gnu.org>
* configure.ac: check for wide character support in printf

View file

@ -196,6 +196,9 @@
/* Define to 1 if you have the <float.h> 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

7
config/config.forward2.m Normal file
View file

@ -0,0 +1,7 @@
#include <objc/objc-api.h>
int main (void)
{
IMP (*__objc_msg_forward1)(id,SEL) = __objc_msg_forward2;
return 0;
}

37
configure vendored
View file

@ -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

View file

@ -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