@@ -2824,7 +2824,11 @@ if test "${with_threads+set}" = set; then
2824
2824
2825
2825
case $withval in
2826
2826
yes)
2827
- :
2827
+
2828
+ cat>> confdefs.h<< \_ACEOF
2829
+ #define USE_THREADS 1
2830
+ _ACEOF
2831
+
2828
2832
;;
2829
2833
no)
2830
2834
:
@@ -2841,6 +2845,7 @@ else
2841
2845
2842
2846
fi ;
2843
2847
2848
+
2844
2849
echo " $as_me :$LINENO : result:$with_threads " >&5
2845
2850
echo " ${ECHO_T} $with_threads " >&6
2846
2851
@@ -3899,9 +3904,12 @@ case $host_os in
3899
3904
# these require no special flags or libraries
3900
3905
;;
3901
3906
freebsd2* |freebsd3* |freebsd4* ) THREAD_CFLAGS=" -pthread" ;;
3902
- freebsd* ) THREAD_LIBS=" -lc_r" ;;
3903
- linux* ) THREAD_LIBS=" -lpthread"
3904
- THREAD_CFLAGS=" -D_REENTRANT" ;;
3907
+ freebsd* )
3908
+ THREAD_LIBS=" -lc_r"
3909
+ ;;
3910
+ linux* ) THREAD_CFLAGS=" -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
3911
+ THREAD_LIBS=" -lpthread"
3912
+ ;;
3905
3913
* )
3906
3914
# other operating systems might fail because they have pthread.h but need
3907
3915
# special libs we don't know about yet.
@@ -3918,7 +3926,7 @@ so it can be added to the next release. Report any compile or link flags,
3918
3926
or libraries required for threading support.
3919
3927
" >&2 ; }
3920
3928
{ (exit 1); exit 1; }; }
3921
- esac
3929
+ esac
3922
3930
fi
3923
3931
3924
3932
@@ -12818,6 +12826,97 @@ _ACEOF
12818
12826
fi
12819
12827
12820
12828
12829
+ #
12830
+ # Check for re-entrant versions of certain functions
12831
+ #
12832
+ # Include special flags if required
12833
+ #
12834
+ _CFLAGS=" $CFLAGS "
12835
+ _LIB=" $LIBS "
12836
+ CFLAGS=" $CFLAGS $TREAD_CFLAGS "
12837
+ LIBS=" $LIBS $THREAD_LIBS "
12838
+
12839
+
12840
+
12841
+ for ac_func in strerror_r getpwuid_r gethostbyname_r
12842
+ do
12843
+ as_ac_var=` echo" ac_cv_func_$ac_func " | $as_tr_sh `
12844
+ echo " $as_me :$LINENO : checking for$ac_func " >&5
12845
+ echo $ECHO_N " checking for$ac_func ...$ECHO_C " >&6
12846
+ if eval " test\"\$ {$as_ac_var +set}\" = set" ; then
12847
+ echo $ECHO_N " (cached)$ECHO_C " >&6
12848
+ else
12849
+ cat> conftest.$ac_ext << _ACEOF
12850
+ #line$LINENO "configure"
12851
+ #include "confdefs.h"
12852
+ /* System header to define __stub macros and hopefully few prototypes,
12853
+ which can conflict with char$ac_func (); below. */
12854
+ #include <assert.h>
12855
+ /* Override any gcc2 internal prototype to avoid an error. */
12856
+ #ifdef __cplusplus
12857
+ extern "C"
12858
+ #endif
12859
+ /* We use char because int might match the return type of a gcc2
12860
+ builtin and then its argument prototype would still apply. */
12861
+ char$ac_func ();
12862
+ char (*f) ();
12863
+
12864
+ #ifdef F77_DUMMY_MAIN
12865
+ # ifdef __cplusplus
12866
+ extern "C"
12867
+ # endif
12868
+ int F77_DUMMY_MAIN() { return 1; }
12869
+ #endif
12870
+ int
12871
+ main ()
12872
+ {
12873
+ /* The GNU C library defines this for functions which it implements
12874
+ to always fail with ENOSYS. Some functions are actually named
12875
+ something starting with __ and the normal name is an alias. */
12876
+ #if defined (__stub_$ac_func ) || defined (__stub___$ac_func )
12877
+ choke me
12878
+ #else
12879
+ f =$ac_func ;
12880
+ #endif
12881
+
12882
+ ;
12883
+ return 0;
12884
+ }
12885
+ _ACEOF
12886
+ rm -f conftest.$ac_objext conftest$ac_exeext
12887
+ if { (evalecho " $as_me :$LINENO :\" $ac_link \" " )>&5
12888
+ (eval$ac_link )2>&5
12889
+ ac_status=$?
12890
+ echo " $as_me :$LINENO :\$ ? =$ac_status " >&5
12891
+ (exit$ac_status ); }&&
12892
+ { ac_try=' test -s conftest$ac_exeext'
12893
+ { (evalecho " $as_me :$LINENO :\" $ac_try \" " )>&5
12894
+ (eval$ac_try )2>&5
12895
+ ac_status=$?
12896
+ echo " $as_me :$LINENO :\$ ? =$ac_status " >&5
12897
+ (exit$ac_status ); }; }; then
12898
+ eval " $as_ac_var =yes"
12899
+ else
12900
+ echo " $as_me : failed program was:" >&5
12901
+ cat conftest.$ac_ext >&5
12902
+ eval " $as_ac_var =no"
12903
+ fi
12904
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12905
+ fi
12906
+ echo " $as_me :$LINENO : result:` evalecho ' ${' $as_ac_var ' }' ` " >&5
12907
+ echo " ${ECHO_T} ` evalecho ' ${' $as_ac_var ' }' ` " >&6
12908
+ if test ` evalecho ' ${' $as_ac_var ' }' ` = yes; then
12909
+ cat>> confdefs.h<< _ACEOF
12910
+ #define` echo" HAVE_$ac_func " | $as_tr_cpp ` 1
12911
+ _ACEOF
12912
+
12913
+ fi
12914
+ done
12915
+
12916
+ CFLAGS=" $_CFLAGS "
12917
+ LIB=" $_LIBS "
12918
+
12919
+
12821
12920
12822
12921
# This test makes sure that run tests work at all. Sometimes a shared
12823
12922
# library is found by the linker, but the runtime linker can't find it.
@@ -17603,8 +17702,8 @@ s,@with_pam@,$with_pam,;t t
17603
17702
s,@with_rendezvous@,$with_rendezvous ,;t t
17604
17703
s,@with_openssl@,$with_openssl ,;t t
17605
17704
s,@ELF_SYS@,$ELF_SYS ,;t t
17606
- s,@THREAD_LIBS@,$THREAD_LIBS ,;t t
17607
17705
s,@THREAD_CFLAGS@,$THREAD_CFLAGS ,;t t
17706
+ s,@THREAD_LIBS@,$THREAD_LIBS ,;t t
17608
17707
s,@AWK@,$AWK ,;t t
17609
17708
s,@FLEX@,$FLEX ,;t t
17610
17709
s,@FLEXFLAGS@,$FLEXFLAGS ,;t t