ObjFW  Check-in [4551d29baf]

Overview
Comment:configure: Add missing objc_root_class attributes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4551d29baf3db20d35c742b77504b6cff037a65d4e539689473856d860bfbe07
User & Date: js on 2017-06-03 21:48:59
Other Links: manifest | tags
Context
2017-06-03
21:53
Fix two OF_ASSUME_NONNULL_BEGIN being too early check-in: ade26679ca user: js tags: trunk
21:48
configure: Add missing objc_root_class attributes check-in: 4551d29baf user: js tags: trunk
21:45
PLATFORMS.md: Update MorphOS check-in: 8077ba4633 user: js tags: trunk
Changes

Modified configure.ac from [16ece0f5c7] to [b056391836].

185
186
187
188
189
190
191





192
193
194
195
196
197
198
AX_CHECK_COMPILER_FLAGS(-Watomic-properties -Werror, [
	OBJCFLAGS="$OBJCFLAGS -Watomic-properties"
	TESTS_OBJCFLAGS="$TESTS_OBJCFLAGS -Wno-atomic-properties"
])

AC_MSG_CHECKING(whether Objective C compiler supports properties)
AC_TRY_COMPILE([





	@interface Foo
	{
		id bar;
	}

	@property (nonatomic, retain) id bar;
	@end







>
>
>
>
>







185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
AX_CHECK_COMPILER_FLAGS(-Watomic-properties -Werror, [
	OBJCFLAGS="$OBJCFLAGS -Watomic-properties"
	TESTS_OBJCFLAGS="$TESTS_OBJCFLAGS -Wno-atomic-properties"
])

AC_MSG_CHECKING(whether Objective C compiler supports properties)
AC_TRY_COMPILE([
	#ifdef __has_attribute
	# if __has_attribute(objc_root_class)
	__attribute__((__objc_root_class__))
	# endif
	#endif
	@interface Foo
	{
		id bar;
	}

	@property (nonatomic, retain) id bar;
	@end
294
295
296
297
298
299
300





301
302
303
304
305
306
307
			[Whether we use the ObjFW runtime])

		AC_MSG_CHECKING([whether -fobjc-runtime=objfw is supported])

		old_OBJCFLAGS="$OBJCFLAGS"
		OBJCFLAGS="$OBJCFLAGS -fobjc-runtime=objfw"
		AC_TRY_LINK([





			@interface Test
			+ (void)test;
			@end

			@implementation Test
			+ (void)test
			{







>
>
>
>
>







299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
			[Whether we use the ObjFW runtime])

		AC_MSG_CHECKING([whether -fobjc-runtime=objfw is supported])

		old_OBJCFLAGS="$OBJCFLAGS"
		OBJCFLAGS="$OBJCFLAGS -fobjc-runtime=objfw"
		AC_TRY_LINK([
			#ifdef __has_attribute
			# if __has_attribute(objc_root_class)
			__attribute__((__objc_root_class__))
			# endif
			#endif
			@interface Test
			+ (void)test;
			@end

			@implementation Test
			+ (void)test
			{
1263
1264
1265
1266
1267
1268
1269





1270
1271
1272
1273
1274
1275
1276
])

AS_IF([test x"$GOBJC" = x"yes"], [
	OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith -Werror"

	AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to GCC bugs)
	AC_TRY_COMPILE([





		@interface Foo
		{
			struct objc_class *_isa;
		}
		@end

		static struct {







>
>
>
>
>







1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
])

AS_IF([test x"$GOBJC" = x"yes"], [
	OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith -Werror"

	AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to GCC bugs)
	AC_TRY_COMPILE([
		#ifdef __has_attribute
		# if __has_attribute(objc_root_class)
		__attribute__((__objc_root_class__))
		# endif
		#endif
		@interface Foo
		{
			struct objc_class *_isa;
		}
		@end

		static struct {
1425
1426
1427
1428
1429
1430
1431





1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450





1451
1452
1453
1454
1455
1456
1457
	old_OBJCFLAGS="$OBJCFLAGS"
	OBJCFLAGS="$OBJCFLAGS -Wdocumentation"
	AC_MSG_CHECKING(whether -Wdocumentation works correctly)
	AC_TRY_COMPILE([
		/*!
		 * @class Test conftest.m conftest.m
		 */





		@interface Test
		@end
	], [
	], [
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
		OBJCFLAGS="$old_OBJCFLAGS"
	])

	AS_IF([test x"$check_pedantic" = x"yes"], [
		old_OBJCFLAGS="$OBJCFLAGS"
		OBJCFLAGS="$OBJCFLAGS -pedantic"
		AC_MSG_CHECKING(whether -pedantic is buggy)
		AC_TRY_COMPILE([
			#include <stdlib.h>

			#include <assert.h>






			@interface Foo
			{
				void *foo;
			}
			@end

			@interface Bar: Foo







>
>
>
>
>



















>
>
>
>
>







1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
	old_OBJCFLAGS="$OBJCFLAGS"
	OBJCFLAGS="$OBJCFLAGS -Wdocumentation"
	AC_MSG_CHECKING(whether -Wdocumentation works correctly)
	AC_TRY_COMPILE([
		/*!
		 * @class Test conftest.m conftest.m
		 */
		#ifdef __has_attribute
		# if __has_attribute(objc_root_class)
		__attribute__((__objc_root_class__))
		# endif
		#endif
		@interface Test
		@end
	], [
	], [
		AC_MSG_RESULT(yes)
	], [
		AC_MSG_RESULT(no)
		OBJCFLAGS="$old_OBJCFLAGS"
	])

	AS_IF([test x"$check_pedantic" = x"yes"], [
		old_OBJCFLAGS="$OBJCFLAGS"
		OBJCFLAGS="$OBJCFLAGS -pedantic"
		AC_MSG_CHECKING(whether -pedantic is buggy)
		AC_TRY_COMPILE([
			#include <stdlib.h>

			#include <assert.h>

			#ifdef __has_attribute
			# if __has_attribute(objc_root_class)
			__attribute__((__objc_root_class__))
			# endif
			#endif
			@interface Foo
			{
				void *foo;
			}
			@end

			@interface Bar: Foo