ObjFW  Check-in [d9ce8955ac]

Overview
Comment:Support for linking tests against objfw_rt.library
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d9ce8955ac55a46bc570cf35fb851d66f0baec1b0fdd99fc0e47ae9008e18c12
User & Date: js on 2018-05-21 20:12:05
Other Links: manifest | tags
Context
2018-05-21
21:03
Symlink objfw_rt.library into tests directory check-in: c1a477e22c user: js tags: trunk
20:12
Support for linking tests against objfw_rt.library check-in: d9ce8955ac user: js tags: trunk
16:14
OFDate: Avoid useless float -> double cast check-in: 2829d3ecbd user: js tags: trunk
Changes

Modified configure.ac from [3de6df6b10] to [8eb83ad5f5].

32
33
34
35
36
37
38

39
40
41
42

43
44
45
46
47
48
49

50
51
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
		])
		LDFLAGS="$LDFLAGS -noixemul"

		enable_shared="no"
		enable_threads="no"
		enable_sockets="no"
		enable_files="yes"	# Required for reading ENV:

		ac_cv_snprintf_useful_ret="yes"

		AC_SUBST(NOIXEMUL, -noixemul)
		AC_SUBST(OBJFW_RT_AMIGA_LIB, objfw_rt.library)

		AC_SUBST(SFDC_TARGET, m68k-amigaos)
		dnl For 68000, GCC emits calls to helper functions that
		dnl do not work properly in a library.
		AC_SUBST(AMIGA_LIB_CFLAGS, "-mcpu=68020 -fbaserel")
		AC_SUBST(AMIGA_LIB_LDFLAGS,
			"-mcpu=68020 -fbaserel -resident -nostartfiles")
		AC_SUBST(LINKLIB, linklib)

		;;
	powerpc-*-amigaos*)
		enable_shared="no"
		enable_threads="no"
		;;
	*-morphos*)
		AS_IF([test x"$with_ixemul" != x"yes"], [
			AS_IF([test x"$OBJCFLAGS" != x""], [
				OBJCFLAGS="$OBJCFLAGS -noixemul"
			], [
				OBJCFLAGS="-O2 -g -noixemul"
			])
			LDFLAGS="$LDFLAGS -noixemul"
			enable_files="yes"	# Required for reading ENV:


			AC_SUBST(NOIXEMUL, -noixemul)
			AC_SUBST(OBJFW_RT_AMIGA_LIB, objfw_rt.library)

			AC_SUBST(SFDC_TARGET, ppc-morphos)
			AC_SUBST(AMIGA_LIB_CFLAGS, "-mresident32 -fno-builtin")
			AC_SUBST(AMIGA_LIB_LDFLAGS,
				"-mresident32 -nostartfiles -nodefaultlibs -lc")

			AC_SUBST(LINKLIB, linklib)

		])

		enable_shared="no"
		enable_threads="no"
		;;
	*-msdosdjgpp*)
		enable_shared="no"







>



|
>
|
|
|
|
|
|
<
>














>


|
>
|
|
|
|
>
|
>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

51
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
		])
		LDFLAGS="$LDFLAGS -noixemul"

		enable_shared="no"
		enable_threads="no"
		enable_sockets="no"
		enable_files="yes"	# Required for reading ENV:
		supports_amiga_lib="yes"
		ac_cv_snprintf_useful_ret="yes"

		AC_SUBST(NOIXEMUL, -noixemul)

		AS_IF([test x"$enable_amiga_lib" != x"no"], [
			AC_SUBST(SFDC_TARGET, m68k-amigaos)
			dnl For 68000, GCC emits calls to helper functions that
			dnl do not work properly in a library.
			AC_SUBST(AMIGA_LIB_CFLAGS, "-mcpu=68020 -fbaserel")
			AC_SUBST(AMIGA_LIB_LDFLAGS,
				"-mcpu=68020 -fbaserel -resident -nostartfiles")

		])
		;;
	powerpc-*-amigaos*)
		enable_shared="no"
		enable_threads="no"
		;;
	*-morphos*)
		AS_IF([test x"$with_ixemul" != x"yes"], [
			AS_IF([test x"$OBJCFLAGS" != x""], [
				OBJCFLAGS="$OBJCFLAGS -noixemul"
			], [
				OBJCFLAGS="-O2 -g -noixemul"
			])
			LDFLAGS="$LDFLAGS -noixemul"
			enable_files="yes"	# Required for reading ENV:
			supports_amiga_lib="yes"

			AC_SUBST(NOIXEMUL, -noixemul)

			AS_IF([test x"$enable_amiga_lib" != x"no"], [
				AC_SUBST(SFDC_TARGET, ppc-morphos)
				tmp="-mresident32 -fno-builtin"
				AC_SUBST(AMIGA_LIB_CFLAGS, $tmp)
				tmp="-mresident32 -nostartfiles -nodefaultlibs"
				tmp="$tmp -lc"
				AC_SUBST(AMIGA_LIB_LDFLAGS, $tmp)
			])
		])

		enable_shared="no"
		enable_threads="no"
		;;
	*-msdosdjgpp*)
		enable_shared="no"
283
284
285
286
287
288
289

290
291
292
293
294
295
296
], [
	AC_MSG_RESULT(no)
	AC_MSG_ERROR(Compiler does not support properties!)
])

AC_CHECK_TOOL(AR, ar)
AC_PROG_RANLIB

AC_ARG_ENABLE(shared,
	AS_HELP_STRING([--disable-shared], [do not build shared library]))
AS_IF([test x"$enable_shared" != x"no"], [
	BUILDSYS_SHARED_LIB
	AC_SUBST(OBJFW_SHARED_LIB, "${LIB_PREFIX}objfw${LIB_SUFFIX}")
	AC_SUBST(EXCEPTIONS_LIB_A, "exceptions.lib.a")
	AC_SUBST(EXCEPTIONS_EXCEPTIONS_LIB_A, "exceptions/exceptions.lib.a")







>







289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
], [
	AC_MSG_RESULT(no)
	AC_MSG_ERROR(Compiler does not support properties!)
])

AC_CHECK_TOOL(AR, ar)
AC_PROG_RANLIB

AC_ARG_ENABLE(shared,
	AS_HELP_STRING([--disable-shared], [do not build shared library]))
AS_IF([test x"$enable_shared" != x"no"], [
	BUILDSYS_SHARED_LIB
	AC_SUBST(OBJFW_SHARED_LIB, "${LIB_PREFIX}objfw${LIB_SUFFIX}")
	AC_SUBST(EXCEPTIONS_LIB_A, "exceptions.lib.a")
	AC_SUBST(EXCEPTIONS_EXCEPTIONS_LIB_A, "exceptions/exceptions.lib.a")
305
306
307
308
309
310
311


















312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
		AC_SUBST(OBJFW_FRAMEWORK, "ObjFW.framework")
		build_framework="yes"
	])
], [
	AC_SUBST(LIBOBJFW_DEP, "../src/libobjfw.a")
	AC_SUBST(LIBOBJFW_DEP_LVL2, "../../src/libobjfw.a")
])


















AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [
	AC_SUBST(OBJFW_STATIC_LIB, "libobjfw.a")
	AC_SUBST(EXCEPTIONS_A, "exceptions.a")
	AC_SUBST(EXCEPTIONS_EXCEPTIONS_A, "exceptions/exceptions.a")
	AC_SUBST(FORWARDING_A, "forwarding.a")
	AC_SUBST(FORWARDING_FORWARDING_A, "forwarding/forwarding.a")
	AC_SUBST(INVOCATION_A, "invocation.a")
	AC_SUBST(INVOCATION_INVOCATION_A, "invocation/invocation.a")
	AC_SUBST(LOOKUP_ASM_A, "lookup-asm.a")
	AC_SUBST(LOOKUP_ASM_LOOKUP_ASM_A, "lookup-asm/lookup-asm.a")
])

AS_IF([test x"$build_framework" = x"yes"], [
	TESTS_LIBS="-framework ObjFW \${RUNTIME_FRAMEWORK_LIBS} $TESTS_LIBS"
	TESTS_LIBS="-F../src -F../src/runtime $TESTS_LIBS"
], [
	TESTS_LIBS="-lobjfw \${RUNTIME_LIBS} $TESTS_LIBS"
	TESTS_LIBS="-L../src -L../src/runtime $TESTS_LIBS"
])

AC_DEFINE_UNQUOTED(PLUGIN_SUFFIX, "$PLUGIN_SUFFIX", [Suffix for plugins])
AS_IF([test x"$enable_files" != x"no" -a x"$PLUGIN_SUFFIX" != x""], [
	AC_SUBST(USE_SRCS_PLUGINS, '${SRCS_PLUGINS}')
	AC_SUBST(TESTPLUGIN, "plugin")
	AC_DEFINE(OF_HAVE_PLUGINS, 1, [Whether we have plugin support])

	AS_IF([test x"$build_framework" = x"yes"], [







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|











<
<
<
<
<
<
<
<







312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349








350
351
352
353
354
355
356
		AC_SUBST(OBJFW_FRAMEWORK, "ObjFW.framework")
		build_framework="yes"
	])
], [
	AC_SUBST(LIBOBJFW_DEP, "../src/libobjfw.a")
	AC_SUBST(LIBOBJFW_DEP_LVL2, "../../src/libobjfw.a")
])

AS_IF([test x"$build_framework" = x"yes"], [
	TESTS_LIBS="-framework ObjFW \${RUNTIME_FRAMEWORK_LIBS} $TESTS_LIBS"
	TESTS_LIBS="-F../src -F../src/runtime $TESTS_LIBS"
], [
	TESTS_LIBS="\${RUNTIME_LIBS} $TESTS_LIBS"
	TESTS_LIBS="-L../src/runtime -L../src/runtime/linklib $TESTS_LIBS"
	TESTS_LIBS="-L../src -lobjfw $TESTS_LIBS"
])

AC_ARG_ENABLE(amiga-lib,
	AS_HELP_STRING([--disable-amiga-lib], [do not build Amiga library]))
AS_IF([test x"$supports_amiga_lib" != x"yes"], [enable_amiga_lib="no"])

AS_IF([test x"$enable_shared" = x"no" -a x"$enable_amiga_lib" = x"no"], [
	enable_static="yes"
])

AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_static" = x"yes" -o x"$enable_amiga_lib" != x"no"], [
	AC_SUBST(OBJFW_STATIC_LIB, "libobjfw.a")
	AC_SUBST(EXCEPTIONS_A, "exceptions.a")
	AC_SUBST(EXCEPTIONS_EXCEPTIONS_A, "exceptions/exceptions.a")
	AC_SUBST(FORWARDING_A, "forwarding.a")
	AC_SUBST(FORWARDING_FORWARDING_A, "forwarding/forwarding.a")
	AC_SUBST(INVOCATION_A, "invocation.a")
	AC_SUBST(INVOCATION_INVOCATION_A, "invocation/invocation.a")
	AC_SUBST(LOOKUP_ASM_A, "lookup-asm.a")
	AC_SUBST(LOOKUP_ASM_LOOKUP_ASM_A, "lookup-asm/lookup-asm.a")
])









AC_DEFINE_UNQUOTED(PLUGIN_SUFFIX, "$PLUGIN_SUFFIX", [Suffix for plugins])
AS_IF([test x"$enable_files" != x"no" -a x"$PLUGIN_SUFFIX" != x""], [
	AC_SUBST(USE_SRCS_PLUGINS, '${SRCS_PLUGINS}')
	AC_SUBST(TESTPLUGIN, "plugin")
	AC_DEFINE(OF_HAVE_PLUGINS, 1, [Whether we have plugin support])

	AS_IF([test x"$build_framework" = x"yes"], [
443
444
445
446
447
448
449

450
451
452
453






454




455
456
457

458
459

460


461

462
463
464
465
466
467
468
469
470
471
		AC_SUBST(RUNTIME, "runtime")
		AC_SUBST(RUNTIME_FLAGS)

		AS_IF([test x"$enable_shared" != x"no"], [
			AC_SUBST(OBJFW_RT_SHARED_LIB,
				"${LIB_PREFIX}objfw_rt${LIB_SUFFIX}")
		])

		AS_IF([test x"$enable_static" = x"yes" \
			-o x"$enable_shared" = x"no"], [
			AC_SUBST(OBJFW_RT_STATIC_LIB, "libobjfw_rt.a")
		])






		AS_IF([test x"$enable_shared" = x"no"], [




			AC_SUBST(LIBOBJFW_RT_DEP,
				"../src/runtime/libobjfw_rt.a")
			AC_SUBST(LIBOBJFW_RT_DEP_LVL2,

				"../../src/runtime/libobjfw_rt.a")
		])

		AS_IF([test x"$build_framework" = x"yes"], [


			AC_SUBST(OBJFW_RT_FRAMEWORK, "ObjFW_RT.framework")

		])
		AC_SUBST(RUNTIME_LIBS, "-lobjfw_rt")
		AC_SUBST(RUNTIME_FRAMEWORK_LIBS, "-framework ObjFW_RT")

		AS_IF([test x"$enable_seluid24" = x"yes"], [
			AC_DEFINE(OF_SELUID24, 1,
				[Whether to use 24 bit selector UIDs])
		])

		AC_MSG_CHECKING(for exception type)







>
|
<


>
>
>
>
>
>
|
>
>
>
>
|
<
|
>
|

>
|
>
>
|
>

<
<







460
461
462
463
464
465
466
467
468

469
470
471
472
473
474
475
476
477
478
479
480
481
482

483
484
485
486
487
488
489
490
491
492
493


494
495
496
497
498
499
500
		AC_SUBST(RUNTIME, "runtime")
		AC_SUBST(RUNTIME_FLAGS)

		AS_IF([test x"$enable_shared" != x"no"], [
			AC_SUBST(OBJFW_RT_SHARED_LIB,
				"${LIB_PREFIX}objfw_rt${LIB_SUFFIX}")
		])

		AS_IF([test x"$enable_static" = x"yes"], [

			AC_SUBST(OBJFW_RT_STATIC_LIB, "libobjfw_rt.a")
		])

		AS_IF([test x"$build_framework" = x"yes"], [
			AC_SUBST(OBJFW_RT_FRAMEWORK, "ObjFW_RT.framework")
			AC_SUBST(RUNTIME_FRAMEWORK_LIBS, "-framework ObjFW_RT")
		])

		AS_IF([test x"$enable_amiga_lib" != x"no"], [
			AC_SUBST(OBJFW_RT_AMIGA_LIB, objfw_rt.library)
			AC_SUBST(RUNTIME_LIBS, "-lobjfw_rt.library")
			AC_SUBST(LINKLIB, linklib)
			tmp="../src/runtime/linklib/libobjfw_rt.library.a"
			AC_SUBST(LIBOBJFW_RT_DEP, "$tmp")

			AC_SUBST(LIBOBJFW_RT_DEP_LVL2, "../$tmp")
		], [
			AC_SUBST(RUNTIME_LIBS, "-lobjfw_rt")
		])

		AS_IF([test x"$enable_shared" = x"no" \
				-a x"$enable_amiga_lib" = x"no"], [
			tmp="../src/runtime/libobjfw_rt.a"
			AC_SUBST(LIBOBJFW_RT_DEP, "$tmp")
			AC_SUBST(LIBOBJFW_RT_DEP_LVL2, "../$tmp")
		])



		AS_IF([test x"$enable_seluid24" = x"yes"], [
			AC_DEFINE(OF_SELUID24, 1,
				[Whether to use 24 bit selector UIDs])
		])

		AC_MSG_CHECKING(for exception type)

Modified utils/ofhash/Makefile from [64cd73be43] to [9510c81193].

12
13
14
15
16
17
18
19


20
21
${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFW_RT_DEP_LVL2}

CPPFLAGS += -I../../src					\
	    -I../../src/runtime				\
	    -I../../src/exceptions			\
	    -I../..					\
	    -DLANGUAGE_DIR=\"${datadir}/ofhash/lang\"
LIBS := -L../../src -lobjfw -L../../src/runtime ${RUNTIME_LIBS} ${LIBS}


LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}







|
>
>


12
13
14
15
16
17
18
19
20
21
22
23
${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFW_RT_DEP_LVL2}

CPPFLAGS += -I../../src					\
	    -I../../src/runtime				\
	    -I../../src/exceptions			\
	    -I../..					\
	    -DLANGUAGE_DIR=\"${datadir}/ofhash/lang\"
LIBS := -L../../src -lobjfw						\
	-L../../src/runtime -L../../src/runtime/linklib ${RUNTIME_LIBS}	\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}

Modified utils/ofhttp/Makefile from [fac5a260ff] to [5bee3112e5].

13
14
15
16
17
18
19
20


21
22
${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFW_RT_DEP_LVL2}

CPPFLAGS += -I../../src					\
	    -I../../src/runtime				\
	    -I../../src/exceptions			\
	    -I../..					\
	    -DLANGUAGE_DIR=\"${datadir}/ofhttp/lang\"
LIBS := -L../../src -lobjfw -L../../src/runtime ${RUNTIME_LIBS} ${LIBS}


LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}







|
>
>


13
14
15
16
17
18
19
20
21
22
23
24
${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFW_RT_DEP_LVL2}

CPPFLAGS += -I../../src					\
	    -I../../src/runtime				\
	    -I../../src/exceptions			\
	    -I../..					\
	    -DLANGUAGE_DIR=\"${datadir}/ofhttp/lang\"
LIBS := -L../../src -lobjfw						\
	-L../../src/runtime -L../../src/runtime/linklib ${RUNTIME_LIBS}	\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}

Modified utils/ofzip/Makefile from [8aa01bc05c] to [91d9609a89].

15
16
17
18
19
20
21
22


23
24
${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFW_RT_DEP_LVL2}

CPPFLAGS += -I../../src					\
	    -I../../src/runtime				\
	    -I../../src/exceptions			\
	    -I../..					\
	    -DLANGUAGE_DIR=\"${datadir}/ofzip/lang\"
LIBS := -L../../src -lobjfw -L../../src/runtime ${RUNTIME_LIBS} ${LIBS}


LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}







|
>
>


15
16
17
18
19
20
21
22
23
24
25
26
${PROG}: ${LIBOBJFW_DEP_LVL2} ${LIBOBJFW_RT_DEP_LVL2}

CPPFLAGS += -I../../src					\
	    -I../../src/runtime				\
	    -I../../src/exceptions			\
	    -I../..					\
	    -DLANGUAGE_DIR=\"${datadir}/ofzip/lang\"
LIBS := -L../../src -lobjfw						\
	-L../../src/runtime -L../../src/runtime/linklib ${RUNTIME_LIBS}	\
	${LIBS}
LD = ${OBJC}
LDFLAGS += ${LDFLAGS_RPATH}