bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr / build / apr_hints.m4
1 dnl -----------------------------------------------------------------
2 dnl apr_hints.m4: APR's autoconf macros for platform-specific hints
3 dnl
4 dnl  We preload various configure settings depending
5 dnl  on previously obtained platform knowledge.
6 dnl  We allow all settings to be overridden from
7 dnl  the command-line.
8 dnl
9 dnl  We maintain the "format" that we've used
10 dnl  under 1.3.x, so we don't exactly follow
11 dnl  what is "recommended" by autoconf.
12
13 dnl
14 dnl APR_PRELOAD
15 dnl
16 dnl  Preload various ENV/makefile params such as CC, CFLAGS, etc
17 dnl  based on outside knowledge
18 dnl
19 dnl  Generally, we force the setting of CC, and add flags
20 dnl  to CFLAGS, CPPFLAGS, LIBS and LDFLAGS. 
21 dnl
22 AC_DEFUN(APR_PRELOAD, [
23 if test "x$apr_preload_done" != "xyes" ; then
24
25   apr_preload_done="yes"
26
27   echo "Applying APR hints file rules for $host"
28
29   case "$host" in
30     *mint)
31         APR_ADDTO(CPPFLAGS, [-DMINT])
32         APR_ADDTO(LIBS, [-lportlib])
33         ;;
34     *MPE/iX*)
35         APR_ADDTO(CPPFLAGS, [-DMPE -D_POSIX_SOURCE -D_SOCKET_SOURCE])
36         APR_ADDTO(LIBS, [-lsvipc -lcurses])
37         APR_ADDTO(LDFLAGS, [-Xlinker \"-WL,cap=ia,ba,ph;nmstack=1024000\"])
38         ;;
39     *-apple-aux3*)
40         APR_ADDTO(CPPFLAGS, [-DAUX3 -D_POSIX_SOURCE])
41         APR_ADDTO(LIBS, [-lposix -lbsd])
42         APR_ADDTO(LDFLAGS, [-s])
43         APR_SETVAR(SHELL, [/bin/ksh])
44         ;;
45     *-ibm-aix*)
46         APR_ADDTO(CPPFLAGS, [-U__STR__ -D_THREAD_SAFE])
47         dnl _USR_IRS gets us the hstrerror() proto in netdb.h
48         case $host in
49             *-ibm-aix4.3)
50                 APR_ADDTO(CPPFLAGS, [-D_USE_IRS])
51                 ;;
52             *-ibm-aix5*)
53                 APR_ADDTO(CPPFLAGS, [-D_USE_IRS])
54                 ;;
55             *-ibm-aix4.3.*)
56                 APR_ADDTO(CPPFLAGS, [-D_USE_IRS])
57                 ;;
58         esac
59         dnl If using xlc, remember it, and give it the right options.
60         if $CC 2>&1 | grep 'xlc' > /dev/null; then
61           APR_SETIFNULL(AIX_XLC, [yes])
62           APR_ADDTO(CFLAGS, [-qHALT=E])
63         fi
64         APR_SETIFNULL(apr_sysvsem_is_global, [yes])
65         APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
66         case $host in
67             *-ibm-aix3* | *-ibm-aix4.1.*)
68                 ;;
69             *)
70                 APR_ADDTO(LDFLAGS, [-Wl,-brtl])
71                 ;;
72         esac
73         ;;
74     *-apollo-*)
75         APR_ADDTO(CPPFLAGS, [-DAPOLLO])
76         ;;
77     *-dg-dgux*)
78         APR_ADDTO(CPPFLAGS, [-DDGUX])
79         ;;
80     *os2_emx*)
81         APR_SETVAR(SHELL, [sh])
82         APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
83         APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
84         ;;
85     *-hi-hiux)
86         APR_ADDTO(CPPFLAGS, [-DHIUX])
87         ;;
88     *-hp-hpux11.*)
89         APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED])
90         ;;
91     *-hp-hpux10.*)
92         case $host in
93           *-hp-hpux10.01)
94 dnl            # We know this is a problem in 10.01.
95 dnl            # Not a problem in 10.20.  Otherwise, who knows?
96                APR_ADDTO(CPPFLAGS, [-DSELECT_NEEDS_CAST])
97                ;;            
98         esac
99         APR_ADDTO(CPPFLAGS, [-D_REENTRANT])
100         ;;
101     *-hp-hpux*)
102         APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT])
103         ;;
104     *-linux*)
105         case `uname -r` in
106             2.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=2])
107                    ;;
108             1.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=1])
109                    ;;
110             * )
111                    ;;
112         esac
113         APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE])
114         ;;
115     *-GNU*)
116         APR_ADDTO(CPPFLAGS, [-DHURD -D_GNU_SOURCE])
117         ;;
118     *-lynx-lynxos)
119         APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS])
120         APR_ADDTO(LIBS, [-lbsd])
121         ;;
122     *486-*-bsdi*)
123         APR_ADDTO(CFLAGS, [-m486])
124         ;;
125     *-*-bsdi*)
126         case $host in
127             *bsdi4.1)
128                 APR_ADDTO(CFLAGS, [-D_REENTRANT])
129                 ;;
130         esac
131         ;;
132     *-openbsd*)
133         APR_ADDTO(CPPFLAGS, [-D_POSIX_THREADS])
134         # getsockname() reports the wrong address on a socket
135         # bound to an ephmeral port so the test fails.
136         APR_SETIFNULL(ac_cv_o_nonblock_inherited, [yes])
137         ;;
138     *-netbsd*)
139         APR_ADDTO(CPPFLAGS, [-DNETBSD])
140         # fcntl() lies about O_NONBLOCK on an accept()ed socket (PR kern/26950)
141         APR_SETIFNULL(ac_cv_o_nonblock_inherited, [yes])
142         ;;
143     *-freebsd*)
144         case $host in
145             *freebsd[2345]*)
146                 APR_ADDTO(CFLAGS, [-funsigned-char])
147                 ;;
148         esac
149         APR_SETIFNULL(enable_threads, [no])
150         APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE])
151         APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE])
152         ;;
153     *-next-nextstep*)
154         APR_SETIFNULL(CFLAGS, [-O])
155         APR_ADDTO(CPPFLAGS, [-DNEXT])
156         ;;
157     *-next-openstep*)
158         APR_SETIFNULL(CFLAGS, [-O])
159         APR_ADDTO(CPPFLAGS, [-DNEXT])
160         ;;
161     *-apple-rhapsody*)
162         APR_ADDTO(CPPFLAGS, [-DRHAPSODY])
163         ;;
164     *-apple-darwin*)
165         APR_ADDTO(CPPFLAGS, [-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp])
166         APR_SETIFNULL(apr_posixsem_is_global, [yes])
167         APR_SETIFNULL(ac_cv_func_poll, [no]) # See issue 34332
168         ;;
169     *-dec-osf*)
170         APR_ADDTO(CPPFLAGS, [-DOSF1])
171         # process-shared mutexes don't seem to work in Tru64 5.0
172         APR_SETIFNULL(apr_cv_process_shared_works, [no])
173         ;;
174     *-nto-qnx*)
175         ;;
176     *-qnx)
177         APR_ADDTO(CPPFLAGS, [-DQNX])
178         APR_ADDTO(LIBS, [-N128k -lunix])
179         ;;
180     *-qnx32)
181         APR_ADDTO(CPPFLAGS, [-DQNX])
182         APR_ADDTO(CFLAGS, [-mf -3])
183         APR_ADDTO(LIBS, [-N128k -lunix])
184         ;;
185     *-isc4*)
186         APR_ADDTO(CPPFLAGS, [-posix -DISC])
187         APR_ADDTO(LDFLAGS, [-posix])
188         APR_ADDTO(LIBS, [-linet])
189         ;;
190     *-sco3.2v[[234]]*)
191         APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
192         if test "$GCC" = "no"; then
193             APR_ADDTO(CFLAGS, [-Oacgiltz])
194         fi
195         APR_ADDTO(LIBS, [-lPW -lmalloc])
196         ;;
197     *-sco3.2v5*)
198         APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT])
199         ;;
200     *-sco_sv*|*-SCO_SV*)
201         APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
202         APR_ADDTO(LIBS, [-lPW -lmalloc])
203         ;;
204     *-solaris2*)
205         PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'`
206         APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT])
207         APR_SETIFNULL(apr_lock_method, [USE_FCNTL_SERIALIZE])
208         ;;
209     *-sunos4*)
210         APR_ADDTO(CPPFLAGS, [-DSUNOS4])
211         ;;
212     *-unixware1)
213         APR_ADDTO(CPPFLAGS, [-DUW=100])
214         ;;
215     *-unixware2)
216         APR_ADDTO(CPPFLAGS, [-DUW=200])
217         APR_ADDTO(LIBS, [-lgen])
218         ;;
219     *-unixware211)
220         APR_ADDTO(CPPFLAGS, [-DUW=211])
221         APR_ADDTO(LIBS, [-lgen])
222         ;;
223     *-unixware212)
224         APR_ADDTO(CPPFLAGS, [-DUW=212])
225         APR_ADDTO(LIBS, [-lgen])
226         ;;
227     *-unixware7)
228         APR_ADDTO(CPPFLAGS, [-DUW=700])
229         APR_ADDTO(LIBS, [-lgen])
230         ;;
231     maxion-*-sysv4*)
232         APR_ADDTO(CPPFLAGS, [-DSVR4])
233         APR_ADDTO(LIBS, [-lc -lgen])
234         ;;
235     *-*-powermax*)
236         APR_ADDTO(CPPFLAGS, [-DSVR4])
237         APR_ADDTO(LIBS, [-lgen])
238         ;;
239     TPF)
240        APR_ADDTO(CPPFLAGS, [-DTPF -D_POSIX_SOURCE])
241        ;;
242     bs2000*-siemens-sysv*)
243         APR_SETIFNULL(CFLAGS, [-O])
244         APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -D_KMEMUSER])
245         APR_ADDTO(LIBS, [-lsocket])
246         APR_SETIFNULL(enable_threads, [no])
247         ;;
248     *-siemens-sysv4*)
249         APR_ADDTO(CPPFLAGS, [-DSVR4 -D_XPG_IV -DHAS_DLFCN -DUSE_MMAP_FILES -DUSE_SYSVSEM_SERIALIZED_ACCEPT])
250         APR_ADDTO(LIBS, [-lc])
251         ;;
252     pyramid-pyramid-svr4)
253         APR_ADDTO(CPPFLAGS, [-DSVR4 -DNO_LONG_DOUBLE])
254         APR_ADDTO(LIBS, [-lc])
255         ;;
256     DS/90\ 7000-*-sysv4*)
257         APR_ADDTO(CPPFLAGS, [-DUXPDS])
258         ;;
259     *-tandem-sysv4*)
260         APR_ADDTO(CPPFLAGS, [-DSVR4])
261         ;;
262     *-ncr-sysv4)
263         APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS])
264         APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
265         ;;
266     *-sysv4*)
267         APR_ADDTO(CPPFLAGS, [-DSVR4])
268         APR_ADDTO(LIBS, [-lc])
269         ;;
270     88k-encore-sysv4)
271         APR_ADDTO(CPPFLAGS, [-DSVR4 -DENCORE])
272         APR_ADDTO(LIBS, [-lPW])
273         ;;
274     *-uts*)
275         PLATOSVERS=`echo $host | sed 's/^.*,//'`
276         case $PLATOSVERS in
277             2*) APR_ADDTO(CPPFLAGS, [-DUTS21])
278                 APR_ADDTO(CFLAGS, [-Xa -eft])
279                 APR_ADDTO(LIBS, [-lbsd -la])
280                 ;;
281             *)  APR_ADDTO(CPPFLAGS, [-DSVR4])
282                 APR_ADDTO(CFLAGS, [-Xa])
283                 ;;
284         esac
285         ;;
286     *-ultrix)
287         APR_ADDTO(CPPFLAGS, [-DULTRIX])
288         APR_SETVAR(SHELL, [/bin/sh5])
289         ;;
290     *powerpc-tenon-machten*)
291         APR_ADDTO(LDFLAGS, [-Xlstack=0x14000 -Xldelcsect])
292         ;;
293     *-machten*)
294         APR_ADDTO(LDFLAGS, [-stack 0x14000])
295         ;;
296     *convex-v11*)
297         APR_ADDTO(CPPFLAGS, [-DCONVEXOS11])
298         APR_SETIFNULL(CFLAGS, [-O1])
299         APR_ADDTO(CFLAGS, [-ext])
300         ;;
301     i860-intel-osf1)
302         APR_ADDTO(CPPFLAGS, [-DPARAGON])
303         ;;
304     *-sequent-ptx2.*.*)
305         APR_ADDTO(CPPFLAGS, [-DSEQUENT=20])
306         APR_ADDTO(CFLAGS, [-Wc,-pw])
307         APR_ADDTO(LIBS, [-linet -lc -lseq])
308         ;;
309     *-sequent-ptx4.0.*)
310         APR_ADDTO(CPPFLAGS, [-DSEQUENT=40])
311         APR_ADDTO(CFLAGS, [-Wc,-pw])
312         APR_ADDTO(LIBS, [-linet -lc])
313         ;;
314     *-sequent-ptx4.[[123]].*)
315         APR_ADDTO(CPPFLAGS, [-DSEQUENT=41])
316         APR_ADDTO(CFLAGS, [-Wc,-pw])
317         APR_ADDTO(LIBS, [-lc])
318         ;;
319     *-sequent-ptx4.4.*)
320         APR_ADDTO(CPPFLAGS, [-DSEQUENT=44])
321         APR_ADDTO(CFLAGS, [-Wc,-pw])
322         APR_ADDTO(LIBS, [-lc])
323         ;;
324     *-sequent-ptx4.5.*)
325         APR_ADDTO(CPPFLAGS, [-DSEQUENT=45])
326         APR_ADDTO(CFLAGS, [-Wc,-pw])
327         APR_ADDTO(LIBS, [-lc])
328         ;;
329     *-sequent-ptx5.0.*)
330         APR_ADDTO(CPPFLAGS, [-DSEQUENT=50])
331         APR_ADDTO(CFLAGS, [-Wc,-pw])
332         APR_ADDTO(LIBS, [-lc])
333         ;;
334     *NEWS-OS*)
335         APR_ADDTO(CPPFLAGS, [-DNEWSOS])
336         ;;
337     *-riscix)
338         APR_ADDTO(CPPFLAGS, [-DRISCIX])
339         APR_SETIFNULL(CFLAGS, [-O])
340         ;;
341     *-irix*)
342         APR_ADDTO(CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS])
343         ;;
344     *beos*)
345         APR_ADDTO(CPPFLAGS, [-DBEOS])
346         PLATOSVERS=`uname -r`
347         APR_SETIFNULL(apr_process_lock_is_global, [yes])
348         case $PLATOSVERS in
349             5.0.4)
350                 APR_ADDTO(LDFLAGS, [-L/boot/beos/system/lib])
351                 APR_ADDTO(LIBS, [-lbind -lsocket])
352                 APR_ADDTO(CPPFLAGS,[-DBONE7])
353                 ;;
354             5.1)
355                 APR_ADDTO(LDFLAGS, [-L/boot/beos/system/lib])
356                 APR_ADDTO(LIBS, [-lbind -lsocket])
357                 ;;
358         esac
359         APR_ADDTO(CPPFLAGS, [-DSIGPROCMASK_SETS_THREAD_MASK -DAP_AUTH_DBM_USE_APR])
360         ;;
361     4850-*.*)
362         APR_ADDTO(CPPFLAGS, [-DSVR4 -DMPRAS])
363         APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
364         ;;
365     drs6000*)
366         APR_ADDTO(CPPFLAGS, [-DSVR4])
367         APR_ADDTO(LIBS, [-lc -L/usr/ucblib -lucb])
368         ;;
369     m88k-*-CX/SX|CYBER)
370         APR_ADDTO(CPPFLAGS, [-D_CX_SX])
371         APR_ADDTO(CFLAGS, [-Xa])
372         ;;
373     *-tandem-oss)
374         APR_ADDTO(CPPFLAGS, [-D_TANDEM_SOURCE -D_XOPEN_SOURCE_EXTENDED=1])
375         ;;
376     *-ibm-os390)
377        APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
378        APR_SETIFNULL(apr_sysvsem_is_global, [yes])
379        APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
380        APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
381        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])
382        ;;
383     *-ibm-as400)
384        APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
385        APR_SETIFNULL(apr_process_lock_is_global, [yes])
386        APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
387        APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
388        ;;
389     *cygwin*)
390         APR_ADDTO(CPPFLAGS, [-DCYGWIN])
391         APR_ADDTO(LIBS, [-lcrypt])
392         ;;
393   esac
394
395 fi
396 ])
397
398 dnl
399 dnl APR_CC_HINTS
400 dnl
401 dnl  Allows us to provide a default choice of compiler which
402 dnl  the user can override.
403 AC_DEFUN(APR_CC_HINTS, [
404 case "$host" in
405   *-apple-aux3*)
406       APR_SETIFNULL(CC, [gcc])
407       ;;
408   bs2000*-siemens-sysv*)
409       APR_SETIFNULL(CC, [c89 -XLLML -XLLMK -XL -Kno_integer_overflow])
410       ;;
411   *convex-v11*)
412       APR_SETIFNULL(CC, [cc])
413       ;;
414   *-ibm-os390)
415       APR_SETIFNULL(CC, [cc])
416       ;;
417   *-ibm-as400)
418       APR_SETIFNULL(CC, [icc])
419       ;;
420   *-isc4*)
421       APR_SETIFNULL(CC, [gcc])
422       ;;
423   m88k-*-CX/SX|CYBER)
424       APR_SETIFNULL(CC, [cc])
425       ;;
426   *-next-openstep*)
427       APR_SETIFNULL(CC, [cc])
428       ;;
429   *-qnx32)
430       APR_SETIFNULL(CC, [cc -F])
431       ;;
432   *-tandem-oss)
433       APR_SETIFNULL(CC, [c89])
434       ;;
435   TPF)
436       APR_SETIFNULL(CC, [c89])
437       ;;
438 esac
439 ])