Newer
Older
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
pthread_mutexattr_init(&mattr);
return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
apr_p_t_r=yes
else
apr_p_t_r=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
if test $apr_p_t_r = yes; then
apr_cv_pthreads_lib=$lib
break
fi
done
LIBS=$apr_ptc_libs
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_pthreads_lib" >&5
$as_echo "$apr_cv_pthreads_lib" >&6; }
if test -n "$apr_cv_pthreads_lib"; then
pthreads_working=yes
if test "x$LIBS" = "x"; then
test "x$silent" != "xyes" && echo " setting LIBS to \"$apr_cv_pthreads_lib\""
LIBS="$apr_cv_pthreads_lib"
else
apr_addto_bugger="$apr_cv_pthreads_lib"
for i in $apr_addto_bugger; do
apr_addto_duplicate="0"
for j in $LIBS; do
if test "x$i" = "x$j"; then
apr_addto_duplicate="1"
break
fi
done
if test $apr_addto_duplicate = "0"; then
test "x$silent" != "xyes" && echo " adding \"$i\" to LIBS"
LIBS="$LIBS $i"
fi
done
fi
fi
if test "$pthreads_working" = "yes"; then
threads_result="POSIX Threads found"
else
threads_result="POSIX Threads not found"
fi
if test "$GCC" = "yes"; then
SAVE_FL="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -w"
for ac_header in pthread.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
if test "x$ac_cv_header_pthread_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PTHREAD_H 1
_ACEOF
threads="1"
pthreadh="1"
pthreadser="1"
else
threads="0"
pthreadh="0"
pthreadser="0"
CFLAGS="$apr_pthsv_CFLAGS"
LIBS="$apr_pthsv_LIBS"
fi
done
CPPFLAGS="$SAVE_FL"
else
for ac_header in pthread.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
if test "x$ac_cv_header_pthread_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PTHREAD_H 1
_ACEOF
threads="1"
pthreadh="1"
pthreadser="1"
else
threads="0"
pthreadh="0"
pthreadser="0"
CFLAGS="$apr_pthsv_CFLAGS"
LIBS="$apr_pthsv_LIBS"
fi
done
fi
elif test "$enable_threads" = "system_threads"; then
threads="1"
pthreadh="0"
pthreadser="0"
else
# We basically specified that we wanted threads, but not how to implement
# them. In this case, just look for pthreads. In the future, we can check
# for other threading libraries as well.
apr_pthsv_CFLAGS="$CFLAGS"
apr_pthsv_LIBS="$LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS needed for pthreads" >&5
$as_echo_n "checking for CFLAGS needed for pthreads... " >&6; }
if ${apr_cv_pthreads_cflags+:} false; then :
$as_echo_n "(cached) " >&6
else
apr_ptc_cflags=$CFLAGS
for flag in none -kthread -pthread -pthreads -mt -mthreads -Kthread -threads; do
CFLAGS=$apr_ptc_cflags
test "x$flag" != "xnone" && CFLAGS="$CFLAGS $flag"
if test "$cross_compiling" = yes; then :
apr_p_t_r=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
#include <stddef.h>
void *thread_routine(void *data) {
return data;
}
int main() {
pthread_t thd;
pthread_mutexattr_t mattr;
pthread_once_t once_init = PTHREAD_ONCE_INIT;
int data = 1;
pthread_mutexattr_init(&mattr);
return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
apr_p_t_r=yes
else
apr_p_t_r=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
if test $apr_p_t_r = yes; then
apr_cv_pthreads_cflags="$flag"
break
fi
done
CFLAGS=$apr_ptc_cflags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_pthreads_cflags" >&5
$as_echo "$apr_cv_pthreads_cflags" >&6; }
if test -n "$apr_cv_pthreads_cflags"; then
pthreads_working=yes
if test "x$apr_cv_pthreads_cflags" != "xnone"; then
if test "x$CFLAGS" = "x"; then
test "x$silent" != "xyes" && echo " setting CFLAGS to \"$apr_cv_pthreads_cflags\""
CFLAGS="$apr_cv_pthreads_cflags"
else
apr_addto_bugger="$apr_cv_pthreads_cflags"
for i in $apr_addto_bugger; do
apr_addto_duplicate="0"
for j in $CFLAGS; do
if test "x$i" = "x$j"; then
apr_addto_duplicate="1"
break
fi
done
if test $apr_addto_duplicate = "0"; then
test "x$silent" != "xyes" && echo " adding \"$i\" to CFLAGS"
CFLAGS="$CFLAGS $i"
fi
done
fi
fi
fi
# The CFLAGS may or may not be sufficient to ensure that libapr
# depends on the pthreads library: some versions of libtool
# drop -pthread when passed on the link line; some versions of
# gcc ignore -pthread when linking a shared object. So always
# try and add the relevant library to LIBS too.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBS needed for pthreads" >&5
$as_echo_n "checking for LIBS needed for pthreads... " >&6; }
if ${apr_cv_pthreads_lib+:} false; then :
$as_echo_n "(cached) " >&6
else
apr_ptc_libs=$LIBS
for lib in -lpthread -lpthreads -lc_r; do
LIBS="$apr_ptc_libs $lib"
if test "$cross_compiling" = yes; then :
apr_p_t_r=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
#include <stddef.h>
void *thread_routine(void *data) {
return data;
}
int main() {
pthread_t thd;
pthread_mutexattr_t mattr;
pthread_once_t once_init = PTHREAD_ONCE_INIT;
int data = 1;
pthread_mutexattr_init(&mattr);
return pthread_create(&thd, NULL, thread_routine, &data);
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
apr_p_t_r=yes
else
apr_p_t_r=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
if test $apr_p_t_r = yes; then
apr_cv_pthreads_lib=$lib
break
fi
done
LIBS=$apr_ptc_libs
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_pthreads_lib" >&5
$as_echo "$apr_cv_pthreads_lib" >&6; }
if test -n "$apr_cv_pthreads_lib"; then
pthreads_working=yes
if test "x$LIBS" = "x"; then
test "x$silent" != "xyes" && echo " setting LIBS to \"$apr_cv_pthreads_lib\""
LIBS="$apr_cv_pthreads_lib"
else
apr_addto_bugger="$apr_cv_pthreads_lib"
for i in $apr_addto_bugger; do
apr_addto_duplicate="0"
for j in $LIBS; do
if test "x$i" = "x$j"; then
apr_addto_duplicate="1"
break
fi
done
if test $apr_addto_duplicate = "0"; then
test "x$silent" != "xyes" && echo " adding \"$i\" to LIBS"
LIBS="$LIBS $i"
fi
done
fi
fi
if test "$pthreads_working" = "yes"; then
threads_result="POSIX Threads found"
else
threads_result="POSIX Threads not found"
fi
if test "$GCC" = "yes"; then
SAVE_FL="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -w"
for ac_header in pthread.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
if test "x$ac_cv_header_pthread_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PTHREAD_H 1
_ACEOF
threads="1"
pthreadh="1"
pthreadser="1"
else
threads="0"
pthreadser="0"
pthreadh="0"
CFLAGS="$apr_pthsv_CFLAGS"
LIBS="$apr_pthsv_LIBS"
fi
done
CPPFLAGS="$SAVE_FL"
else
for ac_header in pthread.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
if test "x$ac_cv_header_pthread_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PTHREAD_H 1
_ACEOF
threads="1"
pthreadh="1"
pthreadser="1"
else
threads="0"
pthreadser="0"
pthreadh="0"
CFLAGS="$apr_pthsv_CFLAGS"
LIBS="$apr_pthsv_LIBS"
fi
done
fi
fi
if test "$pthreadh" = "1"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_getspecific takes two arguments" >&5
$as_echo_n "checking whether pthread_getspecific takes two arguments... " >&6; }
if ${ac_cv_pthread_getspecific_two_args+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
int
main ()
{
pthread_key_t key;
void *tmp;
pthread_getspecific(key,&tmp);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_pthread_getspecific_two_args=yes
else
ac_cv_pthread_getspecific_two_args=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_getspecific_two_args" >&5
$as_echo "$ac_cv_pthread_getspecific_two_args" >&6; }
if test "$ac_cv_pthread_getspecific_two_args" = "yes"; then
$as_echo "#define PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_attr_getdetachstate takes one argument" >&5
$as_echo_n "checking whether pthread_attr_getdetachstate takes one argument... " >&6; }
if ${ac_cv_pthread_attr_getdetachstate_one_arg+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <pthread.h>
int
main ()
{
pthread_attr_t *attr;
pthread_attr_getdetachstate(attr);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_pthread_attr_getdetachstate_one_arg=yes
else
ac_cv_pthread_attr_getdetachstate_one_arg=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_attr_getdetachstate_one_arg" >&5
$as_echo "$ac_cv_pthread_attr_getdetachstate_one_arg" >&6; }
if test "$ac_cv_pthread_attr_getdetachstate_one_arg" = "yes"; then
$as_echo "#define PTHREAD_ATTR_GETDETACHSTATE_TAKES_ONE_ARG 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for recursive mutex support" >&5
$as_echo_n "checking for recursive mutex support... " >&6; }
if ${apr_cv_mutex_recursive+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
apr_cv_mutex_recursive=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <pthread.h>
#include <stdlib.h>
int main() {
pthread_mutexattr_t attr;
pthread_mutex_t m;
exit (pthread_mutexattr_init(&attr)
|| pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE)
|| pthread_mutex_init(&m, &attr));
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
apr_cv_mutex_recursive=yes
else
apr_cv_mutex_recursive=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_mutex_recursive" >&5
$as_echo "$apr_cv_mutex_recursive" >&6; }
if test "$apr_cv_mutex_recursive" = "yes"; then
$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
fi
for ac_func in pthread_key_delete pthread_rwlock_init \
pthread_attr_setguardsize pthread_yield
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_rwlock_t" >&5
$as_echo_n "checking for pthread_rwlock_t... " >&6; }
if ${apr_cv_type_rwlock_t+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <pthread.h>
int
main ()
{
pthread_rwlock_t *rwlock;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
apr_cv_type_rwlock_t=yes
else
apr_cv_type_rwlock_t=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_type_rwlock_t" >&5
$as_echo "$apr_cv_type_rwlock_t" >&6; }
if test "$apr_cv_type_rwlock_t" = "yes"; then
$as_echo "#define HAVE_PTHREAD_RWLOCKS 1" >>confdefs.h
fi
fi
if test "$ac_cv_func_pthread_yield" = "no"; then
for ac_header in sched.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default"
if test "x$ac_cv_header_sched_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SCHED_H 1
_ACEOF
fi
done
for ac_func in sched_yield
do :
ac_fn_c_check_func "$LINENO" "sched_yield" "ac_cv_func_sched_yield"
if test "x$ac_cv_func_sched_yield" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SCHED_YIELD 1
_ACEOF
fi
done
fi
fi
fi
ac_cv_define_READDIR_IS_THREAD_SAFE=no
ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no
ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no
ac_cv_define_GETSERVBYNAME_IS_THREAD_SAFE=no
if test "$threads" = "1"; then
echo "APR will use threads"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for readdir in -lc_r" >&5
$as_echo_n "checking for readdir in -lc_r... " >&6; }
if ${ac_cv_lib_c_r_readdir+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc_r $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char readdir ();
int
main ()
{
return readdir ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_c_r_readdir=yes
else
ac_cv_lib_c_r_readdir=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_readdir" >&5
$as_echo "$ac_cv_lib_c_r_readdir" >&6; }
if test "x$ac_cv_lib_c_r_readdir" = xyes; then :
$as_echo "#define READDIR_IS_THREAD_SAFE 1" >>confdefs.h
fi
if test "x$apr_gethostbyname_is_thread_safe" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lc_r" >&5
$as_echo_n "checking for gethostbyname in -lc_r... " >&6; }
if ${ac_cv_lib_c_r_gethostbyname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc_r $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gethostbyname ();
int
main ()
{
return gethostbyname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_c_r_gethostbyname=yes
else
ac_cv_lib_c_r_gethostbyname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_gethostbyname" >&5
$as_echo "$ac_cv_lib_c_r_gethostbyname" >&6; }
if test "x$ac_cv_lib_c_r_gethostbyname" = xyes; then :
apr_gethostbyname_is_thread_safe=yes
fi
fi
if test "$apr_gethostbyname_is_thread_safe" = "yes"; then
$as_echo "#define GETHOSTBYNAME_IS_THREAD_SAFE 1" >>confdefs.h
fi
if test "x$apr_gethostbyaddr_is_thread_safe" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr in -lc_r" >&5
$as_echo_n "checking for gethostbyaddr in -lc_r... " >&6; }
if ${ac_cv_lib_c_r_gethostbyaddr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc_r $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gethostbyaddr ();
int
main ()
{
return gethostbyaddr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_c_r_gethostbyaddr=yes
else
ac_cv_lib_c_r_gethostbyaddr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_gethostbyaddr" >&5
$as_echo "$ac_cv_lib_c_r_gethostbyaddr" >&6; }
if test "x$ac_cv_lib_c_r_gethostbyaddr" = xyes; then :
apr_gethostbyaddr_is_thread_safe=yes
fi
fi
if test "$apr_gethostbyaddr_is_thread_safe" = "yes"; then
$as_echo "#define GETHOSTBYADDR_IS_THREAD_SAFE 1" >>confdefs.h
fi
if test "x$apr_getservbyname_is_thread_safe" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getservbyname in -lc_r" >&5
$as_echo_n "checking for getservbyname in -lc_r... " >&6; }
if ${ac_cv_lib_c_r_getservbyname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lc_r $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char getservbyname ();
int
main ()
{
return getservbyname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_c_r_getservbyname=yes
else
ac_cv_lib_c_r_getservbyname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_getservbyname" >&5
$as_echo "$ac_cv_lib_c_r_getservbyname" >&6; }
if test "x$ac_cv_lib_c_r_getservbyname" = xyes; then :
apr_getservbyname_is_thread_safe=yes
fi
fi
if test "$apr_getservbyname_is_thread_safe" = "yes"; then
$as_echo "#define GETSERVBYNAME_IS_THREAD_SAFE 1" >>confdefs.h
fi
for ac_func in gethostbyname_r gethostbyaddr_r getservbyname_r
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
else
echo "APR will be non-threaded"
fi
# Check whether --with-efence was given.
if test "${with_efence+set}" = set; then :
withval=$with_efence; apr_efence_dir="$withval"
if test "$apr_efence_dir" != "yes"; then
if test "x$LDFLAGS" = "x"; then
test "x$silent" != "xyes" && echo " setting LDFLAGS to \"-L$apr_efence_dir/lib\""
LDFLAGS="-L$apr_efence_dir/lib"
else
apr_addto_bugger="-L$apr_efence_dir/lib"
for i in $apr_addto_bugger; do
apr_addto_duplicate="0"
for j in $LDFLAGS; do
if test "x$i" = "x$j"; then
apr_addto_duplicate="1"
break
fi
done
if test $apr_addto_duplicate = "0"; then
test "x$silent" != "xyes" && echo " adding \"$i\" to LDFLAGS"
LDFLAGS="$LDFLAGS $i"
fi
done
fi
if test "x$apr_platform_runtime_link_flag" != "x"; then
if test "x$LDFLAGS" = "x"; then
test "x$silent" != "xyes" && echo " setting LDFLAGS to \"$apr_platform_runtime_link_flag$apr_efence_dir/lib\""
LDFLAGS="$apr_platform_runtime_link_flag$apr_efence_dir/lib"
else
apr_addto_bugger="$apr_platform_runtime_link_flag$apr_efence_dir/lib"
for i in $apr_addto_bugger; do
apr_addto_duplicate="0"
for j in $LDFLAGS; do
if test "x$i" = "x$j"; then
apr_addto_duplicate="1"
break
fi
done
if test $apr_addto_duplicate = "0"; then
test "x$silent" != "xyes" && echo " adding \"$i\" to LDFLAGS"
LDFLAGS="$LDFLAGS $i"
fi
done
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lefence" >&5
$as_echo_n "checking for malloc in -lefence... " >&6; }
if ${ac_cv_lib_efence_malloc+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lefence $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char malloc ();
int
main ()
{
return malloc ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_efence_malloc=yes
else
ac_cv_lib_efence_malloc=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_efence_malloc" >&5
$as_echo "$ac_cv_lib_efence_malloc" >&6; }
if test "x$ac_cv_lib_efence_malloc" = xyes; then :
if test "x$LIBS" = "x"; then
test "x$silent" != "xyes" && echo " setting LIBS to \"-lefence\""
LIBS="-lefence"
else
apr_addto_bugger="-lefence"
for i in $apr_addto_bugger; do
apr_addto_duplicate="0"
for j in $LIBS; do
if test "x$i" = "x$j"; then
apr_addto_duplicate="1"
break
fi
done
if test $apr_addto_duplicate = "0"; then
test "x$silent" != "xyes" && echo " adding \"$i\" to LIBS"
LIBS="$LIBS $i"
fi
done
fi
else
as_fn_error $? "Electric Fence requested but not detected" "$LINENO" 5
fi
fi
# Check whether --with-valgrind was given.
if test "${with_valgrind+set}" = set; then :
withval=$with_valgrind; if test "$withval" != no; then
if test "$withval" = yes; then
withval=/usr/include/valgrind
fi
if test "x$CPPFLAGS" = "x"; then
test "x$silent" != "xyes" && echo " setting CPPFLAGS to \"-I$withval\""
CPPFLAGS="-I$withval"
else
apr_addto_bugger="-I$withval"
for i in $apr_addto_bugger; do
apr_addto_duplicate="0"
for j in $CPPFLAGS; do
if test "x$i" = "x$j"; then
apr_addto_duplicate="1"
break
fi
done
if test $apr_addto_duplicate = "0"; then
test "x$silent" != "xyes" && echo " adding \"$i\" to CPPFLAGS"
CPPFLAGS="$CPPFLAGS $i"
fi
done
fi
for ac_header in valgrind.h memcheck.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
ac_rc=yes
for ac_spec in header:valgrind.h header:memcheck.h; do
ac_type=`echo "$ac_spec" | sed -e 's/:.*$//'`
ac_item=`echo "$ac_spec" | sed -e 's/^.*://'`
case $ac_type in
header )
ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
ac_var="ac_cv_header_$ac_item"
;;
file )
ac_item=`echo "$ac_item" | sed 'y%./+-%__p_%'`
ac_var="ac_cv_file_$ac_item"
;;
func ) ac_var="ac_cv_func_$ac_item" ;;
struct ) ac_var="ac_cv_struct_$ac_item" ;;
define ) ac_var="ac_cv_define_$ac_item" ;;
custom ) ac_var="$ac_item" ;;
esac
eval "ac_val=\$$ac_var"
if test ".$ac_val" != .yes; then
ac_rc=no
break
fi
done
if test ".$ac_rc" = .yes; then
:
$as_echo "#define HAVE_VALGRIND 1" >>confdefs.h
else
:
as_fn_error $? "valgrind headers not found" "$LINENO" 5
fi
fi
fi
for ac_func in sigsuspend
do :
ac_fn_c_check_func "$LINENO" "sigsuspend" "ac_cv_func_sigsuspend"
if test "x$ac_cv_func_sigsuspend" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SIGSUSPEND 1
_ACEOF
have_sigsuspend="1"
else
have_sigsuspend="0"
fi
done
for ac_func in sigwait
do :
ac_fn_c_check_func "$LINENO" "sigwait" "ac_cv_func_sigwait"
if test "x$ac_cv_func_sigwait" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SIGWAIT 1
_ACEOF
have_sigwait="1"
else
have_sigwait="0"
fi