2
2
# When this file changes, rerun autogen.sh.
3
3
#
4
4
5
- AC_PREREQ ( 2.59 )
6
- AC_INIT ( [ libdispatch] , [ 1.2 ] , [ libdispatch@macosforge.org] , [ libdispatch] )
5
+ AC_PREREQ ( 2.69 )
6
+ AC_INIT ( [ libdispatch] , [ 1.3 ] , [ libdispatch@macosforge.org] , [ libdispatch] , [ http://libdispatch.macosforge.org ] )
7
7
AC_REVISION ( [ $$] )
8
8
AC_CONFIG_AUX_DIR ( config )
9
9
AC_CONFIG_HEADER([ config/config.h] )
@@ -14,32 +14,42 @@ AM_MAINTAINER_MODE
14
14
AC_PROG_CC ( [ clang gcc cc] )
15
15
AC_PROG_CXX ( [ clang++ g++ c++] )
16
16
AC_PROG_OBJC ( [ clang gcc cc] )
17
+ AC_PROG_OBJCXX ( [ clang++ g++ c++] )
17
18
18
19
#
19
20
# On Mac OS X, some required header files come from other source packages;
20
21
# allow specifying where those are.
21
22
#
22
- AC_ARG_WITH ( [ apple-libc-source] ,
23
- [ AS_HELP_STRING ( [ --with-apple-libc-source] ,
24
- [ Specify path to Apple Libc source] ) ] , [
25
- apple_libc_source_pthreads_path=${withval}/pthreads
26
- CPPFLAGS="$CPPFLAGS -I$apple_libc_source_pthreads_path"
23
+ AC_ARG_WITH ( [ apple-libpthread-source] ,
24
+ [ AS_HELP_STRING ( [ --with-apple-libpthread-source] ,
25
+ [ Specify path to Apple libpthread source] ) ] , [
26
+ apple_libpthread_source_path=${withval}
27
+ CPPFLAGS="$CPPFLAGS -isystem $apple_libpthread_source_path"
28
+ ] )
29
+
30
+ AC_ARG_WITH ( [ apple-libplatform-source] ,
31
+ [ AS_HELP_STRING ( [ --with-apple-libplatform-source] ,
32
+ [ Specify path to Apple libplatform source] ) ] , [
33
+ apple_libplatform_source_include_path=${withval}/include
34
+ CPPFLAGS="$CPPFLAGS -isystem $apple_libplatform_source_include_path"
27
35
] )
28
36
29
37
AC_ARG_WITH ( [ apple-libclosure-source] ,
30
38
[ AS_HELP_STRING ( [ --with-apple-libclosure-source] ,
31
39
[ Specify path to Apple libclosure source] ) ] , [
32
40
apple_libclosure_source_path=${withval}
33
- CPPFLAGS="$CPPFLAGS -I $apple_libclosure_source_path"
41
+ CPPFLAGS="$CPPFLAGS -isystem $apple_libclosure_source_path"
34
42
] )
35
43
36
44
AC_ARG_WITH ( [ apple-xnu-source] ,
37
45
[ AS_HELP_STRING ( [ --with-apple-xnu-source] ,
38
46
[ Specify path to Apple XNU source] ) ] , [
47
+ apple_xnu_source_libsyscall_path=${withval}/libsyscall
48
+ apple_xnu_source_libproc_path=${withval}/libsyscall/wrappers/libproc
39
49
apple_xnu_source_libkern_path=${withval}/libkern
40
50
apple_xnu_source_bsd_path=${withval}/bsd
41
51
apple_xnu_source_osfmk_path=${withval}/osfmk
42
- CPPFLAGS="$CPPFLAGS -idirafter $apple_xnu_source_libkern_path -isystem $apple_xnu_source_bsd_path"
52
+ CPPFLAGS="$CPPFLAGS -idirafter $apple_xnu_source_libkern_path -isystem $apple_xnu_source_bsd_path -isystem $apple_xnu_source_libsyscall_path -isystem $apple_xnu_source_libproc_path "
43
53
] )
44
54
45
55
AC_ARG_WITH ( [ apple-objc4-source] ,
@@ -52,15 +62,15 @@ AC_ARG_WITH([apple-libauto-source],
52
62
[ AS_HELP_STRING ( [ --with-apple-libauto-source] ,
53
63
[ Specify path to Apple libauto source] ) ] , [
54
64
apple_libauto_source_path=${withval}
55
- CPPFLAGS="$CPPFLAGS -I $apple_libauto_source_path"
65
+ CPPFLAGS="$CPPFLAGS -isystem $apple_libauto_source_path"
56
66
] )
57
67
58
68
AC_CACHE_CHECK ( [ for System.framework/PrivateHeaders] , dispatch_cv_system_privateheaders ,
59
69
[ AS_IF ( [ test -d /System/Library/Frameworks/System.framework/PrivateHeaders] ,
60
70
[ dispatch_cv_system_privateheaders=yes] , [ dispatch_cv_system_privateheaders=no] ) ]
61
71
)
62
72
AS_IF ( [ test "x$dispatch_cv_system_privateheaders" != "xno"] ,
63
- [ CPPFLAGS="$CPPFLAGS -I /System/Library/Frameworks/System.framework/PrivateHeaders"]
73
+ [ CPPFLAGS="$CPPFLAGS -isystem /System/Library/Frameworks/System.framework/PrivateHeaders"]
64
74
)
65
75
66
76
#
@@ -97,6 +107,12 @@ LT_INIT([disable-static])
97
107
98
108
AC_PROG_INSTALL
99
109
AC_PATH_PROGS ( MIG , mig )
110
+ AC_PATH_PROG ( DTRACE , dtrace )
111
+ AS_IF ( [ test "x$DTRACE" != "x"] , [ use_dtrace=true] ,[
112
+ use_dtrace=false
113
+ CPPFLAGS="$CPPFLAGS -DDISPATCH_USE_DTRACE=0"
114
+ ] )
115
+ AM_CONDITIONAL(USE_DTRACE, $use_dtrace)
100
116
AC_PATH_PROG ( LEAKS , leaks )
101
117
AS_IF ( [ test "x$LEAKS" != "x"] ,
102
118
[ AC_DEFINE ( HAVE_LEAKS , 1 , [ Define if Apple leaks program is present] ) ]
@@ -128,21 +144,38 @@ AC_CHECK_HEADER(sys/event.h, [],
128
144
# Checks for header files.
129
145
#
130
146
AC_HEADER_STDC
131
- AC_CHECK_HEADERS ( [ TargetConditionals.h pthread_np.h malloc/malloc.h libkern/OSCrossEndian.h libkern/OSAtomic.h sys/guarded.h libproc_internal .h] )
147
+ AC_CHECK_HEADERS ( [ TargetConditionals.h pthread_np.h malloc/malloc.h libkern/OSCrossEndian.h libkern/OSAtomic.h sys/guarded.h fcntl .h] )
132
148
133
- # hack for pthread_machdep.h's #include <System/machine/cpu_capabilities.h>
134
- AS_IF ( [ test -n "$apple_xnu_source_osfmk_path"] , [
149
+ # hack for pthread/private headers
150
+ AS_IF ( [ test -n "$apple_libpthread_source_path" -a -n "$ apple_xnu_source_osfmk_path"] , [
135
151
saveCPPFLAGS="$CPPFLAGS"
136
152
CPPFLAGS="$CPPFLAGS -I."
153
+ ln -fsh "$apple_libpthread_source_path"/private/tsd_private.h pthread_machdep.h
154
+ ln -fsh "$apple_libpthread_source_path"/private pthread
137
155
ln -fsh "$apple_xnu_source_osfmk_path" System
156
+ mkdir -p mach && ln -fsh "$apple_xnu_source_osfmk_path"/mach/coalition.h mach
138
157
] )
139
- AC_CHECK_HEADERS ( [ pthread_machdep.h] )
140
- AS_IF ( [ test -n "$apple_xnu_source_osfmk_path"] , [
141
- rm -f System
158
+ AC_CHECK_HEADERS ( [ pthread_machdep.h pthread/qos.h] )
159
+ AC_CHECK_HEADERS ( [ pthread/workqueue_private.h pthread_workqueue.h] ,
160
+ [ AC_DEFINE ( HAVE_PTHREAD_WORKQUEUES , 1 , [ Define if pthread work queues are present] ) ]
161
+ )
162
+ AC_CHECK_HEADERS ( [ libproc_internal.h] , [ ] , [ ] , [ #include <mach/mach.h>] )
163
+ AC_CHECK_FUNCS ( [ pthread_workqueue_setdispatch_np _pthread_workqueue_init] )
164
+ AS_IF ( [ test -n "$apple_libpthread_source_path" -a -n "$apple_xnu_source_osfmk_path"] , [
165
+ rm -f pthread_machdep.h pthread System mach/coalition.h
142
166
CPPFLAGS="$saveCPPFLAGS"
167
+ AC_CONFIG_COMMANDS ( [ src/pthread_machdep.h] ,
168
+ [ ln -fsh "$apple_libpthread_source_path"/private/tsd_private.h src/pthread_machdep.h] ,
169
+ [ apple_libpthread_source_path="$apple_libpthread_source_path"] )
170
+ AC_CONFIG_COMMANDS ( [ src/pthread] ,
171
+ [ ln -fsh "$apple_libpthread_source_path"/private src/pthread] ,
172
+ [ apple_libpthread_source_path="$apple_libpthread_source_path"] )
143
173
AC_CONFIG_COMMANDS ( [ src/System] ,
144
174
[ ln -fsh "$apple_xnu_source_osfmk_path" src/System] ,
145
175
[ apple_xnu_source_osfmk_path="$apple_xnu_source_osfmk_path"] )
176
+ AC_CONFIG_COMMANDS ( [ src/mach/coalition.h] ,
177
+ [ ln -fsh "$apple_xnu_source_osfmk_path"/mach/coalition.h src/mach] ,
178
+ [ apple_xnu_source_osfmk_path="$apple_xnu_source_osfmk_path"] )
146
179
] )
147
180
# hack for xnu/bsd/sys/event.h EVFILT_SOCK declaration
148
181
AS_IF ( [ test -n "$apple_xnu_source_bsd_path"] , [
@@ -194,15 +227,6 @@ AC_CHECK_HEADER([mach/mach.h], [
194
227
)
195
228
AM_CONDITIONAL(USE_MIG, $have_mach)
196
229
197
- #
198
- # We use the availability of pthread_workqueue.h to decide whether to compile
199
- # in support for pthread work queues.
200
- #
201
- AC_CHECK_HEADER ( [ pthread_workqueue.h] ,
202
- [ AC_DEFINE ( HAVE_PTHREAD_WORKQUEUES , 1 , [ Define if pthread work queues are present] ) ]
203
- )
204
- AC_CHECK_FUNCS ( [ pthread_workqueue_setdispatch_np] )
205
-
206
230
#
207
231
# Find functions and declarations we care about.
208
232
#
@@ -295,5 +319,11 @@ AC_COMPILE_IFELSE(
295
319
#
296
320
# Generate Makefiles.
297
321
#
298
- AC_CONFIG_FILES ( [ Makefile dispatch/Makefile man/Makefile os/Makefile private/Makefile src/Makefile] )
322
+ AC_CONFIG_FILES ( [ Makefile dispatch/Makefile man/Makefile os/Makefile private/Makefile src/Makefile tests/Makefile] )
323
+
324
+ #
325
+ # Generate testsuite links
326
+ #
327
+ AC_CONFIG_LINKS ( [ tests/dispatch:${x:+}private tests/leaks-wrapper:tests/leaks-wrapper.sh] )
328
+
299
329
AC_OUTPUT
0 commit comments