ObjFW  Diff

Differences From Artifact [255ae73185]:

To Artifact [1ca508f214]:


115
116
117
118
119
120
121


122
123
124
125
126
127
128
129
130
131

AC_CHECK_HEADERS([objfw-rt.h objc/objc.h])

test x"$ac_cv_header_objfw_rt_h" = x"yes" && objc_runtime="ObjFW-RT"

AC_MSG_CHECKING(which Objective C runtime we use)
AS_IF([test x"$ac_cv_header_objc_objc_h" = x"yes"], [


	AC_EGREP_CPP(yes, [
		#import <objc/objc.h>
		#ifdef __GNU_LIBOBJC__
		yes
		#endif
	], [
		test x"$objc_runtime" = x"" && objc_runtime="GNU"
	], [
		dnl TODO: This is ugly. Let's think of a better check.
		AC_EGREP_CPP(yes, [







>
>


|







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

AC_CHECK_HEADERS([objfw-rt.h objc/objc.h])

test x"$ac_cv_header_objfw_rt_h" = x"yes" && objc_runtime="ObjFW-RT"

AC_MSG_CHECKING(which Objective C runtime we use)
AS_IF([test x"$ac_cv_header_objc_objc_h" = x"yes"], [
	dnl Only accept it if it's from gcc >= 4.7, as the one in 4.6 is buggy
	dnl when using the new API.
	AC_EGREP_CPP(yes, [
		#import <objc/objc.h>
		#ifdef __GNU_LIBOBJC__ >= 20110608
		yes
		#endif
	], [
		test x"$objc_runtime" = x"" && objc_runtime="GNU"
	], [
		dnl TODO: This is ugly. Let's think of a better check.
		AC_EGREP_CPP(yes, [
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
		AC_CHECK_LIB(objc, objc_msgSend, [
			LIBS="-lobjc $LIBS"
		], [
			AC_MSG_ERROR([libobjc not found!])
		])
		;;
	GNU)
		# The new API of the new GNU runtime is currently too broken to
		# be of any use, thus we even use the old API when the new one
		# is detected until the new one has been fixed and offers a way
		# to detect if it is the fixed one.
		dnl AC_DEFINE(OF_GNU_RUNTIME, 1,
		dnl	[Whether we use the GNU ObjC runtime])
		AC_DEFINE(OF_OLD_GNU_RUNTIME, 1,
			[Whether we use the old GNU ObjC runtime])

		AC_CHECK_LIB(objc, objc_msg_lookup, [
			LIBS="-lobjc $LIBS"
		], [
			AC_MSG_ERROR([libobjc not found!])
		])
		;;







<
<
<
<
|
|
<
<







164
165
166
167
168
169
170




171
172


173
174
175
176
177
178
179
		AC_CHECK_LIB(objc, objc_msgSend, [
			LIBS="-lobjc $LIBS"
		], [
			AC_MSG_ERROR([libobjc not found!])
		])
		;;
	GNU)




		AC_DEFINE(OF_GNU_RUNTIME, 1,
			[Whether we use the GNU ObjC runtime])



		AC_CHECK_LIB(objc, objc_msg_lookup, [
			LIBS="-lobjc $LIBS"
		], [
			AC_MSG_ERROR([libobjc not found!])
		])
		;;