652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
|
AC_CHECK_LIB(objc, objc_msgSend, [
AC_SUBST(RUNTIME_LIBS, "-lobjc")
AC_SUBST(RUNTIME_FRAMEWORK_LIBS, "-lobjc")
], [
AC_MSG_ERROR([libobjc not found!])
])
AC_CHECK_FUNC(objc_autoreleasePoolPush, [], [
AC_SUBST(RUNTIME_AUTORELEASE_M, "runtime/autorelease.m")
])
AC_CHECK_FUNC(objc_constructInstance, [], [
AC_SUBST(RUNTIME_INSTANCE_M, "runtime/instance.m")
])
;;
esac
AC_CHECK_FUNCS(_Unwind_Backtrace)
case "$host_os" in
darwin*)
|
>
>
>
>
>
|
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
|
AC_CHECK_LIB(objc, objc_msgSend, [
AC_SUBST(RUNTIME_LIBS, "-lobjc")
AC_SUBST(RUNTIME_FRAMEWORK_LIBS, "-lobjc")
], [
AC_MSG_ERROR([libobjc not found!])
])
old_OBJCFLAGS="$OBJCFLAGS"
OBJCFLAGS="$OBJCFLAGS -lobjc"
AC_CHECK_FUNC(objc_autoreleasePoolPush, [], [
AC_SUBST(RUNTIME_AUTORELEASE_M, "runtime/autorelease.m")
])
AC_CHECK_FUNC(objc_constructInstance, [], [
AC_SUBST(RUNTIME_INSTANCE_M, "runtime/instance.m")
])
OBJCFLAGS="$old_OBJCFLAGS"
;;
esac
AC_CHECK_FUNCS(_Unwind_Backtrace)
case "$host_os" in
darwin*)
|
694
695
696
697
698
699
700
701
702
703
704
705
706
707
|
AS_IF([test x"$host_is_ios" = x"yes"], [
AC_SUBST(TESTS_STATIC_LIB, tests.a)
TESTS_LIBS="$TESTS_LIBS -framework CoreFoundation"
])
;;
esac
AC_C_BIGENDIAN([
AC_DEFINE(OF_BIG_ENDIAN, 1, [Whether we are big endian])
])
AS_IF([test x"$ac_cv_c_bigendian" = x"universal"], [
AC_DEFINE(OF_UNIVERSAL, 1, [Whether we are building a universal binary])
])
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
|
AS_IF([test x"$host_is_ios" = x"yes"], [
AC_SUBST(TESTS_STATIC_LIB, tests.a)
TESTS_LIBS="$TESTS_LIBS -framework CoreFoundation"
])
;;
esac
AC_MSG_CHECKING(whether Objective C compiler supports ARC)
old_OBJCFLAGS="$OBJCFLAGS"
OBJCFLAGS="$OBJCFLAGS -fobjc-arc -fobjc-arc-exceptions"
AC_TRY_COMPILE([
#ifdef __has_attribute
# if __has_attribute(objc_root_class)
__attribute__((__objc_root_class__))
# endif
#endif
@interface Foo
{
struct objc_class *_isa;
}
+ (id)alloc;
@end
@implementation Foo
+ (id)alloc
{
return (id)0;
}
@end
], [
__weak id foo = [Foo alloc];
(void)foo;
], [
AC_MSG_RESULT(yes)
AC_DEFINE(COMPILER_SUPPORTS_ARC, 1, [Whether the compiler supports ARC])
AC_SUBST(RUNTIME_ARC_TESTS_M, RuntimeARCTests.m)
], [
AC_MSG_RESULT(no)
])
OBJCFLAGS="$old_OBJCFLAGS"
AC_C_BIGENDIAN([
AC_DEFINE(OF_BIG_ENDIAN, 1, [Whether we are big endian])
])
AS_IF([test x"$ac_cv_c_bigendian" = x"universal"], [
AC_DEFINE(OF_UNIVERSAL, 1, [Whether we are building a universal binary])
])
|