summaryrefslogtreecommitdiff
path: root/tikzit/m4
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-09 11:00:50 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-09 11:00:50 +0000
commita8a8dfb90d6a51ae369c042c95162f45754c7c4b (patch)
tree0e7a5f82febebe7129ebfb015f05b114064c39fd /tikzit/m4
parente1cf0babff63e670e0d550b4072c22649a117fa7 (diff)
Move tikzit into "trunk" directory
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@365 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/m4')
-rw-r--r--tikzit/m4/objc.m487
1 files changed, 87 insertions, 0 deletions
diff --git a/tikzit/m4/objc.m4 b/tikzit/m4/objc.m4
new file mode 100644
index 0000000..1016b07
--- /dev/null
+++ b/tikzit/m4/objc.m4
@@ -0,0 +1,87 @@
+# Checks for Objective C 2 feature support
+# and sets the shell variables
+# tz_cv_objc_properties
+# tz_cv_objc_fast_enumeration
+# tz_cv_objc_optional_keyword
+# to either "yes" or "no"
+#
+AC_DEFUN([TZ_OBJC2_FEATURES],
+[
+tz_old_objcflags="$OBJCFLAGS"
+OBJCFLAGS="$OBJCFLAGS `eval "gnustep-config --objc-flags"`"
+
+AC_CACHE_CHECK([for Objective C 2 @property support],
+ [tz_cv_objc_properties],
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+#import <Foundation/Foundation.h>
+
+@interface TestObj : NSObject {
+ int intProp1;
+ NSObject *copyObjProp;
+ NSObject *fooProp;
+}
+@property (assign,nonatomic) int intProp;
+@property (retain,readonly) NSObject *retainObjProp;
+@property (copy,readwrite) NSObject *copyObjProp;
+@property (retain,getter=foo,setter=foo1:) NSObject *fooProp;
+@end
+
+@implementation TestObj
+@synthesize intProp=intProp1;
+@dynamic retainObjProp;
+- (NSObject*) retainObjProp { return nil; }
+@synthesize copyObjProp;
+@synthesize fooProp;
+@end
+
+int main(void) {
+ TestObj *obj = [[TestObj alloc] init];
+ obj.intProp = 4;
+ NSObject *result = obj.retainObjProp;
+ return 0;
+}
+ ]])],
+ [tz_cv_objc_properties=yes],
+ [tz_cv_objc_properties=no])])
+
+
+AC_CACHE_CHECK([for Objective C 2 fast enumeration support],
+ [tz_cv_objc_fast_enumeration],
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+#import <Foundation/Foundation.h>
+
+int main(void) {
+ NSArray *array = [NSArray arrayWithObjects: @"One", @"Two", @"Three", @"Four", nil];
+ for (NSString *element in array) {
+ NSLog(@"element: %@", element);
+ }
+ return 0;
+}
+ ]])],
+ [tz_cv_objc_fast_enumeration=yes],
+ [tz_cv_objc_fast_enumeration=no])])
+
+AC_CACHE_CHECK([for Objective C 2 @optional support],
+ [tz_cv_objc_optional_keyword],
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+#import <Foundation/Foundation.h>
+
+@protocol Foo
+@optional
+- (void) foo;
+@required
+- (void) bar;
+@end
+
+int main(void) {
+ return 0;
+}
+ ]])],
+ [tz_cv_objc_optional_keyword=yes],
+ [tz_cv_objc_optional_keyword=no])])
+
+OBJCFLAGS="$tz_old_objcflags"
+])