1
dnl -------------------------------------------------------- -*- autoconf -*-
2
dnl Copyright 2000-2005 The Apache Software Foundation
4
dnl Licensed under the Apache License, Version 2.0 (the "License");
5
dnl you may not use this file except in compliance with the License.
6
dnl You may obtain a copy of the License at
8
dnl http://www.apache.org/licenses/LICENSE-2.0
10
dnl Unless required by applicable law or agreed to in writing, software
11
dnl distributed under the License is distributed on an "AS IS" BASIS,
12
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
dnl See the License for the specific language governing permissions and
14
dnl limitations under the License.
16
dnl -----------------------------------------------------------------
17
dnl apr_hints.m4: APR's autoconf macros for platform-specific hints
19
dnl We preload various configure settings depending
20
dnl on previously obtained platform knowledge.
21
dnl We allow all settings to be overridden from
24
dnl We maintain the "format" that we've used
25
dnl under 1.3.x, so we don't exactly follow
26
dnl what is "recommended" by autoconf.
31
dnl Preload various ENV/makefile params such as CC, CFLAGS, etc
32
dnl based on outside knowledge
34
dnl Generally, we force the setting of CC, and add flags
35
dnl to CFLAGS, CPPFLAGS, LIBS and LDFLAGS.
37
AC_DEFUN(APR_PRELOAD, [
38
if test "x$apr_preload_done" != "xyes" ; then
40
apr_preload_done="yes"
42
echo "Applying APR hints file rules for $host"
46
APR_ADDTO(CPPFLAGS, [-DMINT])
47
APR_ADDTO(LIBS, [-lportlib])
50
APR_ADDTO(CPPFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE])
51
APR_ADDTO(LIBS, [-lsvipc -lcurses])
52
APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"])
55
APR_ADDTO(CPPFLAGS, [-DAUX3 -D_POSIX_SOURCE])
56
APR_ADDTO(LIBS, [-lposix -lbsd])
57
APR_ADDTO(LDFLAGS, [-s])
58
APR_SETVAR(SHELL, [/bin/ksh])
61
APR_ADDTO(CPPFLAGS, [-U__STR__ -D_THREAD_SAFE])
62
dnl _USR_IRS gets us the hstrerror() proto in netdb.h
65
APR_ADDTO(CPPFLAGS, [-D_USE_IRS])
68
APR_ADDTO(CPPFLAGS, [-D_USE_IRS])
71
APR_ADDTO(CPPFLAGS, [-D_USE_IRS])
74
dnl If using xlc, remember it, and give it the right options.
75
if $CC 2>&1 | grep 'xlc' > /dev/null; then
76
APR_SETIFNULL(AIX_XLC, [yes])
77
APR_ADDTO(CFLAGS, [-qHALT=E])
79
APR_SETIFNULL(apr_sysvsem_is_global, [yes])
80
APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
82
*-ibm-aix3* | *-ibm-aix4.1.*)
85
APR_ADDTO(LDFLAGS, [-Wl,-brtl])
90
APR_ADDTO(CPPFLAGS, [-DAPOLLO])
93
APR_ADDTO(CPPFLAGS, [-DDGUX])
96
APR_SETVAR(SHELL, [sh])
97
APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
98
APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
101
APR_ADDTO(CPPFLAGS, [-DHIUX])
104
APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED])
109
dnl # We know this is a problem in 10.01.
110
dnl # Not a problem in 10.20. Otherwise, who knows?
111
APR_ADDTO(CPPFLAGS, [-DSELECT_NEEDS_CAST])
114
APR_ADDTO(CPPFLAGS, [-D_REENTRANT])
117
APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT])
121
2.* ) APR_ADDTO(CPPFLAGS, [-DLINUX=2])
123
1.* ) APR_ADDTO(CPPFLAGS, [-DLINUX=1])
128
APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE])
131
APR_ADDTO(CPPFLAGS, [-DHURD -D_GNU_SOURCE])
134
APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS])
135
APR_ADDTO(LIBS, [-lbsd])
138
APR_ADDTO(CFLAGS, [-m486])
143
APR_ADDTO(CFLAGS, [-D_REENTRANT])
148
APR_ADDTO(CPPFLAGS, [-D_POSIX_THREADS])
149
# binding to an ephemeral port fails on OpenBSD so override
150
# the test for O_NONBLOCK inheritance across accept().
151
APR_SETIFNULL(ac_cv_o_nonblock_inherited, [yes])
154
APR_ADDTO(CPPFLAGS, [-DNETBSD])
155
# fcntl() lies about O_NONBLOCK on an accept()ed socket (PR kern/26950)
156
APR_SETIFNULL(ac_cv_o_nonblock_inherited, [yes])
159
APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE])
160
if test -x /sbin/sysctl; then
161
os_version=`/sbin/sysctl -n kern.osreldate`
165
# 502102 is when libc_r switched to libpthread (aka libkse).
166
if test $os_version -ge "502102"; then
167
apr_cv_pthreads_cflags="none"
168
apr_cv_pthreads_lib="-lpthread"
170
APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE -D_REENTRANT])
171
APR_SETIFNULL(enable_threads, [no])
173
# prevent use of KQueue before FreeBSD 4.8
174
if test $os_version -lt "480000"; then
175
APR_SETIFNULL(ac_cv_func_kqueue, no)
179
APR_SETIFNULL(CFLAGS, [-O])
180
APR_ADDTO(CPPFLAGS, [-DNEXT])
183
APR_SETIFNULL(CFLAGS, [-O])
184
APR_ADDTO(CPPFLAGS, [-DNEXT])
187
APR_ADDTO(CPPFLAGS, [-DRHAPSODY])
190
APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp])
191
APR_SETIFNULL(apr_posixsem_is_global, [yes])
192
APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332
194
# kqueue is broken on OS X, the poll tests work, but the socket tests
195
# hang when it's turned on. if you decide to reenable this please be
196
# sure to test that ALL the tests continue to work with it turned on.
197
APR_SETIFNULL(ac_cv_func_kqueue, [no])
200
APR_ADDTO(CPPFLAGS, [-DOSF1])
201
# process-shared mutexes don't seem to work in Tru64 5.0
202
APR_SETIFNULL(apr_cv_process_shared_works, [no])
207
APR_ADDTO(CPPFLAGS, [-DQNX])
208
APR_ADDTO(LIBS, [-N128k -lunix])
211
APR_ADDTO(CPPFLAGS, [-DQNX])
212
APR_ADDTO(CFLAGS, [-mf -3])
213
APR_ADDTO(LIBS, [-N128k -lunix])
216
APR_ADDTO(CPPFLAGS, [-posix -DISC])
217
APR_ADDTO(LDFLAGS, [-posix])
218
APR_ADDTO(LIBS, [-linet])
221
APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
222
if test "$GCC" = "no"; then
223
APR_ADDTO(CFLAGS, [-Oacgiltz])
225
APR_ADDTO(LIBS, [-lPW -lmalloc])
228
APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT])
231
APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
232
APR_ADDTO(LIBS, [-lPW -lmalloc])
235
PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'`
236
APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT])
237
APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE])
240
APR_ADDTO(CPPFLAGS, [-DSUNOS4])
243
APR_ADDTO(CPPFLAGS, [-DUW=100])
246
APR_ADDTO(CPPFLAGS, [-DUW=200])
247
APR_ADDTO(LIBS, [-lgen])
250
APR_ADDTO(CPPFLAGS, [-DUW=211])
251
APR_ADDTO(LIBS, [-lgen])
254
APR_ADDTO(CPPFLAGS, [-DUW=212])
255
APR_ADDTO(LIBS, [-lgen])
258
APR_ADDTO(CPPFLAGS, [-DUW=700])
259
APR_ADDTO(LIBS, [-lgen])
262
APR_ADDTO(CPPFLAGS, [-DSVR4])
263
APR_ADDTO(LIBS, [-lc -lgen])
266
APR_ADDTO(CPPFLAGS, [-DSVR4])
267
APR_ADDTO(LIBS, [-lgen])
270
APR_ADDTO(CPPFLAGS, [-DTPF -D_POSIX_SOURCE])
272
bs2000*-siemens-sysv*)
273
APR_SETIFNULL(CFLAGS, [-O])
274
APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -D_KMEMUSER])
275
APR_ADDTO(LIBS, [-lsocket])
276
APR_SETIFNULL(enable_threads, [no])
279
APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT])
280
APR_ADDTO(LIBS, [-lc])
282
pyramid-pyramid-svr4)
283
APR_ADDTO(CPPFLAGS, [-DSVR4 -DNO_LONG_DOUBLE])
284
APR_ADDTO(LIBS, [-lc])
286
DS/90\ 7000-*-sysv4*)
287
APR_ADDTO(CPPFLAGS, [-DUXPDS])
290
APR_ADDTO(CPPFLAGS, [-DSVR4])
293
APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS])
294
APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
297
APR_ADDTO(CPPFLAGS, [-DSVR4])
298
APR_ADDTO(LIBS, [-lc])
301
APR_ADDTO(CPPFLAGS, [-DSVR4 -DENCORE])
302
APR_ADDTO(LIBS, [-lPW])
305
PLATOSVERS=`echo $host | sed 's/^.*,//'`
307
2*) APR_ADDTO(CPPFLAGS, [-DUTS21])
308
APR_ADDTO(CFLAGS, [-Xa -eft])
309
APR_ADDTO(LIBS, [-lbsd -la])
311
*) APR_ADDTO(CPPFLAGS, [-DSVR4])
312
APR_ADDTO(CFLAGS, [-Xa])
317
APR_ADDTO(CPPFLAGS, [-DULTRIX])
318
APR_SETVAR(SHELL, [/bin/sh5])
320
*powerpc-tenon-machten*)
321
APR_ADDTO(LDFLAGS, [-Xlstack=0x14000 -Xldelcsect])
324
APR_ADDTO(LDFLAGS, [-stack 0x14000])
327
APR_ADDTO(CPPFLAGS, [-DCONVEXOS11])
328
APR_SETIFNULL(CFLAGS, [-O1])
329
APR_ADDTO(CFLAGS, [-ext])
332
APR_ADDTO(CPPFLAGS, [-DPARAGON])
335
APR_ADDTO(CPPFLAGS, [-DSEQUENT=20])
336
APR_ADDTO(CFLAGS, [-Wc,-pw])
337
APR_ADDTO(LIBS, [-linet -lc -lseq])
340
APR_ADDTO(CPPFLAGS, [-DSEQUENT=40])
341
APR_ADDTO(CFLAGS, [-Wc,-pw])
342
APR_ADDTO(LIBS, [-linet -lc])
344
*-sequent-ptx4.[[123]].*)
345
APR_ADDTO(CPPFLAGS, [-DSEQUENT=41])
346
APR_ADDTO(CFLAGS, [-Wc,-pw])
347
APR_ADDTO(LIBS, [-lc])
350
APR_ADDTO(CPPFLAGS, [-DSEQUENT=44])
351
APR_ADDTO(CFLAGS, [-Wc,-pw])
352
APR_ADDTO(LIBS, [-lc])
355
APR_ADDTO(CPPFLAGS, [-DSEQUENT=45])
356
APR_ADDTO(CFLAGS, [-Wc,-pw])
357
APR_ADDTO(LIBS, [-lc])
360
APR_ADDTO(CPPFLAGS, [-DSEQUENT=50])
361
APR_ADDTO(CFLAGS, [-Wc,-pw])
362
APR_ADDTO(LIBS, [-lc])
365
APR_ADDTO(CPPFLAGS, [-DNEWSOS])
368
APR_ADDTO(CPPFLAGS, [-DRISCIX])
369
APR_SETIFNULL(CFLAGS, [-O])
372
APR_ADDTO(CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS])
375
APR_ADDTO(CPPFLAGS, [-DBEOS])
376
PLATOSVERS=`uname -r`
377
APR_SETIFNULL(apr_process_lock_is_global, [yes])
380
APR_ADDTO(LDFLAGS, [-L/boot/beos/system/lib])
381
APR_ADDTO(LIBS, [-lbind -lsocket])
382
APR_ADDTO(CPPFLAGS,[-DBONE7])
385
APR_ADDTO(LDFLAGS, [-L/boot/beos/system/lib])
386
APR_ADDTO(LIBS, [-lbind -lsocket])
389
APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR])
392
APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS])
393
APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
396
APR_ADDTO(CPPFLAGS, [-DSVR4])
397
APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
400
APR_ADDTO(CPPFLAGS, [-D_CX_SX])
401
APR_ADDTO(CFLAGS, [-Xa])
404
APR_ADDTO(CPPFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1])
407
APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
408
APR_SETIFNULL(apr_sysvsem_is_global, [yes])
409
APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
410
APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
411
APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO -DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1])
414
APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
415
APR_SETIFNULL(apr_process_lock_is_global, [yes])
416
APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
417
APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
420
APR_ADDTO(CPPFLAGS, [-DCYGWIN])
421
APR_ADDTO(LIBS, [-lcrypt])
431
dnl Allows us to provide a default choice of compiler which
432
dnl the user can override.
433
AC_DEFUN(APR_CC_HINTS, [
436
APR_SETIFNULL(CC, [gcc])
438
bs2000*-siemens-sysv*)
439
APR_SETIFNULL(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow])
442
APR_SETIFNULL(CC, [cc])
445
APR_SETIFNULL(CC, [cc])
448
APR_SETIFNULL(CC, [icc])
451
APR_SETIFNULL(CC, [gcc])
454
APR_SETIFNULL(CC, [cc])
457
APR_SETIFNULL(CC, [cc])
460
APR_SETIFNULL(CC, [cc -F])
463
APR_SETIFNULL(CC, [c89])
466
APR_SETIFNULL(CC, [c89])