gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Commit r28657


From: Wolfgang Lux
Subject: Re: Commit r28657
Date: Wed, 23 Sep 2009 09:54:31 +0200

David Chisnall wrote:

On 22 Sep 2009, at 17:17, Wolfgang Lux wrote:

David Chisnall wrote:

On 22 Sep 2009, at 13:43, Nicola Pero wrote:

IIRC objc/runtime.h is a private header used internally while compiling libobjc. It is not for users and so it is not installed.

Very odd; looking at the Makefile, you seem to be correct, but it's installed on FreeBSD anyway. Could someone who understands how the configure script works add a check for the existence of runtime.h?

Given Nicola's comment may I suggest you change libobjc2 instead and move the relevant definitions to a publicly visible header, probably <objc/objc-api.h>.

The runtime.h header in libobjc2 contains the same function definitions as runtime.h on Apple's libobjc. It is there for source compatibility with the Apple runtime.

I think you will then be able to copy configure.ac's already existing logic that tests for the presence of objc_msg_forward2 and check for the availability of objc_msg_forward3 and/or objc_proxy_lookup and don't have to include non-portable headers.

runtime.h is the (only recommended) public header on OS X.

So then here is my take on the autoconf macros. I assume that you really want to test the presence of libobjc2 and take objc/runtime.h for granted (only) if using libobjc2. The following recipe therefore defines HAVE_LIBOBJC2 when it detects the new runtime.

Add the file config.forward3.m to the config directory (there are already config.forward.m and config.forward2.m):

#include <objc/runtime.h>

int main (void)
{
  struct objc_slot *(*__objc_msg_forward1)(id,SEL) = objc_msg_forward3;
  return 0;
}

Then add the following to configure.ac (e.g. below the test for objc_sync_enter):

AC_MSG_CHECKING(for libobjc2)
AC_COMPILE_IFELSE([#include "$srcdir/config/config.forward3.m"],
        have_libobjc2=yes, have_libobjc2=no)
if test $have_libobjc2 = yes; then
  AC_DEFINE(HAVE_LIBOBJC2,1,[Define if using libobjc2])
fi
AC_MSG_RESULT($have_libobjc2)

Finally update configure by running autoconf and autoheader and then test everything. Beware that I don't have libobjc2 installed at present, so I can't test it, and that its early in the morning :-)

Wolfgang







reply via email to

[Prev in Thread] Current Thread [Next in Thread]