From eda7553c0655ab3134742f5114617b2190345ee1 Mon Sep 17 00:00:00 2001 From: randomguy3 Date: Mon, 6 Feb 2012 13:47:05 +0000 Subject: GTK: Add in a test for a sane Foundation (ie: gnustep-base) git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@411 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64 --- tikzit/m4/objc.m4 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'tikzit/m4/objc.m4') diff --git a/tikzit/m4/objc.m4 b/tikzit/m4/objc.m4 index 1016b07..72d2ee6 100644 --- a/tikzit/m4/objc.m4 +++ b/tikzit/m4/objc.m4 @@ -1,3 +1,50 @@ +# Checks for a working Foundation +# tz_cv_objc_foundation +# to either "yes" or "no" +# +AC_DEFUN([TZ_OBJC_FOUNDATION], +[ +tz_old_objcflags="$OBJCFLAGS" +OBJCFLAGS="$OBJCFLAGS `eval "gnustep-config --objc-flags"`" + +AC_CACHE_CHECK([for Objective C Foundation], + [tz_cv_objc_foundation], +[AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ +#import + +@interface TestObj : NSObject { + int intVar; + NSObject *objVar; + NSString *strVar; +} +-(id)init; +@end + +@implementation TestObj +-(id)init { + self = [super init]; + intVar = 0; + objVar = nil; + strVar = @"Foo"; + return self; +} +@end + +int main(void) { + TestObj *obj = [[TestObj alloc] init]; + [obj release]; + return 0; +} + ]])], + [tz_cv_objc_foundation=yes], + [tz_cv_objc_foundation=no])]) + +OBJCFLAGS="$tz_old_objcflags" + +]) + + # Checks for Objective C 2 feature support # and sets the shell variables # tz_cv_objc_properties -- cgit v1.2.3