ObjFW  Diff

Differences From Artifact [9eadb6c419]:

To Artifact [2dac0a970f]:


72
73
74
75
76
77
78


79
80
81
82
83
84
85
	], [
	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_SUBST(OBJC_PROPERTIES_M, "objc_properties.m")])

AC_CHECK_FUNC(objc_enumerationMutation, [
	AC_DEFINE(HAVE_OBJC_ENUMERATIONMUTATION, 1,
		[Whether we have objc_enumerationMutation])])

BUILDSYS_LIB







>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
	], [
	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")])

AC_CHECK_FUNC(objc_enumerationMutation, [
	AC_DEFINE(HAVE_OBJC_ENUMERATIONMUTATION, 1,
		[Whether we have objc_enumerationMutation])])

BUILDSYS_LIB
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163






164
165
166
167
168
169
170
171
172
173

AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")

AC_ARG_ENABLE(threads,
	AS_HELP_STRING([--disable-threads], [disable thread support]))
if test x"$enable_threads" != x"no"; then
	case "$host_os" in
		mingw*)
			AC_MSG_CHECKING(for threads)
			AC_MSG_RESULT(win32)
			;;
		*)
			ACX_PTHREAD([
				CPPLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
				LIBS="$LIBS $PTHREAD_LIBS"
				AC_DEFINE(OF_HAVE_PTHREADS, 1,
					[Whether we have pthreads])






				], [
				AC_MSG_ERROR(No supported threads found!)])
			;;
	esac

	AC_DEFINE(OF_THREADS, 1, [Whether we have threads])
	AC_SUBST(OFTHREAD_M, "OFThread.m")
	AC_SUBST(THREADING_H, "threading.h")

	AC_CHECK_FUNC(objc_sync_enter,, [







|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
|
|
|







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181

AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")

AC_ARG_ENABLE(threads,
	AS_HELP_STRING([--disable-threads], [disable thread support]))
if test x"$enable_threads" != x"no"; then
	case "$host_os" in
	mingw*)
		AC_MSG_CHECKING(for threads)
		AC_MSG_RESULT(win32)
		;;
	*)
		ACX_PTHREAD([
			CPPLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
			LIBS="$LIBS $PTHREAD_LIBS"
			AC_DEFINE(OF_HAVE_PTHREADS, 1,
				[Whether we have pthreads])
			AC_CHECK_FUNC(pthread_spin_lock, [
				AC_DEFINE(OF_HAVE_PTHREAD_SPINLOCKS, 1,
					[Whether we have pthread spinlocks])])
			AC_CHECK_FUNC(sched_yield, [
				AC_DEFINE(OF_HAVE_SCHED_YIELD, 1,
					[Whether we have sched_yield])])
			], [
			AC_MSG_ERROR(No supported threads found!)])
		;;
	esac

	AC_DEFINE(OF_THREADS, 1, [Whether we have threads])
	AC_SUBST(OFTHREAD_M, "OFThread.m")
	AC_SUBST(THREADING_H, "threading.h")

	AC_CHECK_FUNC(objc_sync_enter,, [
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
		AC_DEFINE(OF_ATOMIC_OPS, 1, [Whether we have atomic operations])
		AC_MSG_RESULT(gcc builtins)
	elif test x"$have_libkern_osatomic_h" = x"yes"; then
		AC_DEFINE(OF_ATOMIC_OPS, 1, [Whether we have atomic operations])
		AC_MSG_RESULT(libkern/OSAtomic.h)
	else
		AC_MSG_RESULT(none)
		AC_MSG_ERROR(No atomic operations found! Try --disable-threads.)
	fi
else
	dnl We can only have one thread - therefore everything is atomic
	AC_DEFINE(OF_ATOMIC_OPS, 1, [Whether we have atomic operations])
fi

AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")







<







220
221
222
223
224
225
226

227
228
229
230
231
232
233
		AC_DEFINE(OF_ATOMIC_OPS, 1, [Whether we have atomic operations])
		AC_MSG_RESULT(gcc builtins)
	elif test x"$have_libkern_osatomic_h" = x"yes"; then
		AC_DEFINE(OF_ATOMIC_OPS, 1, [Whether we have atomic operations])
		AC_MSG_RESULT(libkern/OSAtomic.h)
	else
		AC_MSG_RESULT(none)

	fi
else
	dnl We can only have one thread - therefore everything is atomic
	AC_DEFINE(OF_ATOMIC_OPS, 1, [Whether we have atomic operations])
fi

AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")