10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
AC_PROG_INSTALL
AC_PROG_EGREP
CPP="$OBJCPP"
CPPFLAGS="$CPPFLAGS $OBJCPPFLAGS"
OBJCFLAGS="$OBJCFLAGS -Wall -fexceptions -fobjc-exceptions"
OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstString"
LIBS="$LIBS -lobjc"
AX_CHECK_COMPILER_FLAGS(-pipe, [OBJCFLAGS="$OBJCFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCFLAGS="$OBJCFLAGS -fno-common"])
AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings, [
NO_CONST_CFSTRINGS="-fno-constant-cfstrings"
OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings"])
AC_SUBST(NO_CONST_CFSTRINGS)
|
<
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
AC_PROG_INSTALL
AC_PROG_EGREP
CPP="$OBJCPP"
CPPFLAGS="$CPPFLAGS $OBJCPPFLAGS"
OBJCFLAGS="$OBJCFLAGS -Wall -fexceptions -fobjc-exceptions"
OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstString"
AX_CHECK_COMPILER_FLAGS(-pipe, [OBJCFLAGS="$OBJCFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCFLAGS="$OBJCFLAGS -fno-common"])
AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings, [
NO_CONST_CFSTRINGS="-fno-constant-cfstrings"
OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings"])
AC_SUBST(NO_CONST_CFSTRINGS)
|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
[foo bar];
], [
AC_DEFINE(OF_HAVE_PROPERTIES, 1, [Compiler support for properties])
AC_SUBST(PROPERTIES_M, "properties.m")
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)])
AC_MSG_CHECKING(which Objective C runtime we use)
dnl TODO: This is ugly. Let's think of a better check.
AC_EGREP_CPP(gnu, [
#import <objc/objc.h>
#ifdef __objc_INCLUDE_GNU
gnu
#endif
], [
AC_DEFINE(OF_GNU_RUNTIME, 1, [Whether we use the GNU ObjC runtime])
AC_SUBST(RUNTIME_DEF, "-DOF_GNU_RUNTIME")
objc_runtime="GNU"
], [
AC_DEFINE(OF_APPLE_RUNTIME, 1, [Whether we use the Apple ObjC runtime])
AC_SUBST(RUNTIME_DEF, "-DOF_APPLE_RUNTIME")
objc_runtime="Apple"])
AC_MSG_RESULT($objc_runtime)
AC_CHECK_FUNC(objc_getProperty,, [
AC_DEFINE(NEED_OBJC_PROPERTIES_INIT, 1,
[Whether objc_properties_init needs to be called])
AC_SUBST(OBJC_PROPERTIES_M, "objc_properties.m")])
|
>
|
>
>
>
|
|
|
|
|
|
|
>
|
>
|
>
|
>
|
>
>
>
>
>
>
|
>
>
>
>
|
>
|
>
>
>
>
>
>
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
[foo bar];
], [
AC_DEFINE(OF_HAVE_PROPERTIES, 1, [Compiler support for properties])
AC_SUBST(PROPERTIES_M, "properties.m")
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)])
AC_CHECK_HEADERS([objfw-rt.h objc/objc.h])
test x"$ac_cv_header_objfw_rt_h" = x"yes" && objc_runtime="ObjFW-RT"
if test x"$ac_cv_header_objc_objc_h" = x"yes"; then
dnl TODO: This is ugly. Let's think of a better check.
AC_EGREP_CPP(gnu, [
#import <objc/objc.h>
#ifdef __objc_INCLUDE_GNU
gnu
#endif
],
[test x"$objc_runtime" = "x" && objc_runtime="GNU"],
[objc_runtime="Apple"])
fi
AC_MSG_CHECKING(which Objective C runtime we use)
case $objc_runtime in
ObjFW-RT)
AC_DEFINE(OF_OBJFW_RUNTIME, 1,
[Whether we use the ObjFW runtime])
AC_SUBST(GNU_RUNTIME, "-fgnu-runtime")
OBJCFLAGS="$OBJCFLAGS -fgnu-runtime"
LIBS="$LIBS -lobjfw-rt"
;;
Apple)
AC_DEFINE(OF_APPLE_RUNTIME, 1,
[Whether we use the Apple ObjC runtime])
LIBS="$LIBS -lobjc"
;;
GNU)
AC_DEFINE(OF_GNU_RUNTIME, 1,
[Whether we use the GNU ObjC runtime])
LIBS="$LIBS -lobjc"
;;
*)
AC_MSG_RESULT(none)
AC_MSG_ERROR(No ObjC runtime found! Please install ObjFW-RT!)
;;
esac
AC_MSG_RESULT($objc_runtime)
AC_CHECK_FUNC(objc_getProperty,, [
AC_DEFINE(NEED_OBJC_PROPERTIES_INIT, 1,
[Whether objc_properties_init needs to be called])
AC_SUBST(OBJC_PROPERTIES_M, "objc_properties.m")])
|
372
373
374
375
376
377
378
|
AC_SUBST(CPP)
AC_SUBST(CPPFLAGS)
AC_SUBST(PACKAGE, ObjFW)
AC_CONFIG_FILES([buildsys.mk extra.mk objfw-config])
AC_CONFIG_HEADERS([config.h src/objfw-defs.h])
AC_OUTPUT
|
>
>
>
>
>
>
>
|
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
AC_SUBST(CPP)
AC_SUBST(CPPFLAGS)
AC_SUBST(PACKAGE, ObjFW)
AC_CONFIG_FILES([buildsys.mk extra.mk objfw-config])
AC_CONFIG_HEADERS([config.h src/objfw-defs.h])
AC_OUTPUT
if test x"$objc_runtime" = x"GNU"; then
echo
echo "Warning: You are using GNU libobjc! Support for GNU libobjc will "
echo "be dropped in the next version! You should upgrade to ObjFW-RT"
echo "(the ObjFW runtime) instead!"
fi
|