+target_osx=no
+target_ios=no
+
+if test "x$platform_darwin" = "xyes"; then
+ AC_TRY_COMPILE([#include "TargetConditionals.h"],[
+ #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
+ #error fail this for ios
+ #endif
+ return 0;
+ ], [
+ AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
+ target_osx=yes
+ ], [
+ AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
+ target_ios=yes
+ ])
+ AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms])
+fi
+