ObjFW  Check-in [9c2c934851]

Overview
Comment:Better way to conditionally compile files.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9c2c93485177399d8e31a47f9fd64a2d2e3c73e24a2d17b1b9d780b674a43407
User & Date: js on 2013-01-12 18:52:31
Other Links: manifest | tags
Context
2013-01-12
20:21
Fix --disable-threads. check-in: 85b8efadbc user: js tags: trunk
18:52
Better way to conditionally compile files. check-in: 9c2c934851 user: js tags: trunk
17:29
Rename *UsingEncoding: to *WithEncoding:. check-in: 9ddd33a258 user: js tags: trunk
Changes

Modified configure.ac from [6f34bfbc74] to [d7fb42e5f4].

100
101
102
103
104
105
106
107

108
109
110
111
112
113
114
115
116
117
118
100
101
102
103
104
105
106

107

108
109

110
111
112
113
114
115
116







-
+
-


-







	AC_SUBST(OBJFW_STATIC_LIB, "libobjfw.a")
	AC_SUBST(EXCEPTIONS_A, "exceptions.a")
	AC_SUBST(EXCEPTIONS_EXCEPTIONS_A, "exceptions/exceptions.a")
])

AC_DEFINE_UNQUOTED(PLUGIN_SUFFIX, "$PLUGIN_SUFFIX", [Suffix for plugins])
AS_IF([test x"$PLUGIN_SUFFIX" != x""], [
	AC_SUBST(OFPLUGIN_M, "OFPlugin.m")
	AC_SUBST(USE_SRCS_PLUGINS, '${SRCS_PLUGINS}')
	AC_SUBST(OFPLUGINTESTS_M, "OFPluginTests.m")
	AC_SUBST(TESTPLUGIN, "plugin")
	AC_DEFINE(OF_PLUGINS, 1, [Whether we have plugin support])
	AC_SUBST(OFPLUGINS_DEF, "-DOF_PLUGINS")
])

objc_runtime="ObjFW runtime"
AC_CHECK_HEADER(objc/objc.h)
AC_MSG_CHECKING(which Objective C runtime to use)
AC_ARG_ENABLE(runtime,
	AS_HELP_STRING([--enable-runtime], [use the included runtime]))
453
454
455
456
457
458
459
460

461
462
463
464
465
466
467
468
469
470

471
472
473
474
475
476
477
451
452
453
454
455
456
457

458










459
460
461
462
463
464
465
466







-
+
-
-
-
-
-
-
-
-
-
-
+







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

	AC_DEFINE(OF_THREADS, 1, [Whether we have threads])
	AC_SUBST(THREADING_SOURCES, "	\
	AC_SUBST(USE_SRCS_THREADS, '${SRCS_THREADS}')
		OFThread.m		\
		OFThreadPool.m		\
		OFTLSKey.m		\
		OFMutex.m		\
		OFRecursiveMutex.m	\
		OFCondition.m		\
	")
	AC_SUBST(OFTHREADTESTS_M, "OFThreadTests.m")
	AC_SUBST(OFHTTPCLIENTTESTS_M, "OFHTTPClientTests.m")
	AC_SUBST(THREADING_H, "threading.h")
	AC_SUBST(USE_INCLUDES_THREADS, '${INCLUDES_THREADS}')

	AC_MSG_CHECKING(whether __thread works)
	AC_TRY_LINK([
		/* It seems __thread is buggy with GCC 4.1 */
		#if __GNUC__ == 4 && __GNUC_MINOR__ < 2
		# error buggy
		#endif

Modified extra.mk.in from [05e2d217e1] to [385b9923fb].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45



20
21
22
23
24
25
26



27
28
29

30
31
32
33
34
35
36
37
38
39


40
41
42







-
-
-



-










-
-
+
+
+
EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@
FOUNDATION_COMPAT_M = @FOUNDATION_COMPAT_M@
INSTANCE_M = @INSTANCE_M@
LOOKUP_S = @LOOKUP_S@
OFBLOCKTESTS_M = @OFBLOCKTESTS_M@
OBJC_PROPERTIES_M = @OBJC_PROPERTIES_M@
OBJC_SYNC_M = @OBJC_SYNC_M@
OFHTTPCLIENTTESTS_M = @OFHTTPCLIENTTESTS_M@
OFPLUGIN_M = @OFPLUGIN_M@
OFPLUGINTESTS_M = @OFPLUGINTESTS_M@
OFSTREAMOBSERVER_KQUEUE_M = @OFSTREAMOBSERVER_KQUEUE_M@
OFSTREAMOBSERVER_POLL_M = @OFSTREAMOBSERVER_POLL_M@
OFSTREAMOBSERVER_SELECT_M = @OFSTREAMOBSERVER_SELECT_M@
OFTHREADTESTS_M = @OFTHREADTESTS_M@
PROPERTIESTESTS_M = @PROPERTIESTESTS_M@
REEXPORT_LIBOBJC = @REEXPORT_LIBOBJC@
RUNTIME = @RUNTIME@
RUNTIME_A = @RUNTIME_A@
RUNTIME_RUNTIME_A = @RUNTIME_RUNTIME_A@
RUNTIME_RUNTIME_LIB_A = @RUNTIME_RUNTIME_LIB_A@
RUNTIME_LIB_A = @RUNTIME_LIB_A@
TESTPLUGIN = @TESTPLUGIN@
TESTS = @TESTS@
TEST_LAUNCHER = @TEST_LAUNCHER@
THREADING_H = @THREADING_H@
THREADING_SOURCES = @THREADING_SOURCES@
USE_INCLUDES_THREADS = @USE_INCLUDES_THREADS@
USE_SRCS_PLUGINS = @USE_SRCS_PLUGINS@
USE_SRCS_THREADS = @USE_SRCS_THREADS@

Modified src/Makefile from [40e8cefe6e] to [8c24021c12].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
33
34
35
36
37
38
39

40
41
42
43
44
45
46







-







       OFMutableDictionary.m		\
       OFMutableSet.m			\
       OFMutableString.m		\
       OFNull.m				\
       OFNumber.m			\
       OFObject.m			\
       OFObject+Serialization.m		\
       ${OFPLUGIN_M}			\
       OFProcess.m			\
       OFRunLoop.m			\
       OFSeekableStream.m		\
       OFSet.m				\
       OFSHA1Hash.m			\
       OFSortedList.m			\
       OFStream.m			\
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
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







-



-
+
+
+
+
+
+
+
+
+
+

+














-
+







       OFXMLComment.m			\
       OFXMLElement.m			\
       OFXMLElement+Serialization.m	\
       OFXMLElementBuilder.m		\
       OFXMLNode.m			\
       OFXMLParser.m			\
       OFXMLProcessingInstructions.m	\
       ${THREADING_SOURCES}		\
       base64.m				\
       of_asprintf.m			\
       of_strptime.m			\
       unicode.m
       unicode.m			\
       ${USE_SRCS_PLUGINS}		\
       ${USE_SRCS_THREADS}
SRCS_PLUGINS = OFPlugin.m
SRCS_THREADS = OFCondition.m		\
	       OFMutex.m		\
	       OFRecursiveMutex.m	\
	       OFThread.m		\
	       OFThreadPool.m		\
	       OFTLSKey.m

INCLUDES_THREADS = threading.h
INCLUDES := ${SRCS:.m=.h}		\
	    OFCollection.h		\
	    OFJSONRepresentation.h	\
	    OFLocking.h			\
	    OFSerialization.h		\
	    OFTLSSocket.h		\
	    ObjFW.h			\
	    asprintf.h			\
	    autorelease.h		\
	    ${ATOMIC_H}			\
	    block.h			\
	    instance.h			\
	    macros.h			\
	    objfw-defs.h		\
	    ${THREADING_H}
	    ${USE_INCLUDES_THREADS}

SRCS += OFArray_adjacent.m		\
	OFArray_adjacentSubarray.m	\
	${AUTORELEASE_M}		\
	${INSTANCE_M}			\
	OFCountedSet_hashtable.m	\
	OFDictionary_hashtable.m	\

Modified tests/Makefile from [919fabd591] to [9b8d4ab488].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31






32
33
34
35
36
37
38
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16

17
18
19
20
21
22

23
24
25
26
27

28
29
30
31
32
33
34
35
36
37
38
39
40











-





-






-





-
+
+
+
+
+
+







include ../extra.mk

SUBDIRS = ${TESTPLUGIN}

PROG_NOINST = tests${PROG_SUFFIX}
SRCS = ForwardingTests.m		\
       OFArrayTests.m			\
       ${OFBLOCKTESTS_M}		\
       OFDataArrayTests.m		\
       OFDateTests.m			\
       OFDictionaryTests.m		\
       ${OFHTTPCLIENTTESTS_M}		\
       OFJSONTests.m			\
       OFListTests.m			\
       OFMD5HashTests.m			\
       OFNumberTests.m			\
       OFObjectTests.m			\
       ${OFPLUGINTESTS_M}		\
       OFSerializationTests.m		\
       OFSet.m				\
       OFSHA1HashTests.m		\
       OFStreamTests.m			\
       OFStringTests.m			\
       OFTCPSocketTests.m		\
       ${OFTHREADTESTS_M}		\
       OFURLTests.m			\
       OFXMLElementBuilderTests.m	\
       OFXMLNodeTests.m			\
       OFXMLParserTests.m		\
       ${PROPERTIESTESTS_M}		\
       TestsAppDelegate.m
       TestsAppDelegate.m		\
       ${USE_SRCS_PLUGINS}		\
       ${USE_SRCS_THREADS}
SRCS_PLUGINS = OFPluginTests.m
SRCS_THREADS = OFThreadTests.m		\
	       OFHTTPClientTests.m

IOS_USER ?= mobile
IOS_TMP ?= /tmp/objfw-test

.PHONY: run run-tests run-on-ios
run: all
	if [ -z "${DONT_RUN_TESTS}" ]; then ${MAKE} ${MFLAGS} run-tests; fi