@@ -2824,7 +2824,11 @@ if test "${with_threads+set}" = set; then
28242824
28252825case $withval in
28262826 yes)
2827- :
2827+
2828+ cat>> confdefs.h<< \_ACEOF
2829+ #define USE_THREADS 1
2830+ _ACEOF
2831+
28282832 ;;
28292833 no)
28302834:
@@ -2841,6 +2845,7 @@ else
28412845
28422846fi ;
28432847
2848+
28442849echo " $as_me :$LINENO : result:$with_threads " >&5
28452850echo " ${ECHO_T} $with_threads " >&6
28462851
@@ -3899,9 +3904,12 @@ case $host_os in
38993904# these require no special flags or libraries
39003905;;
39013906freebsd2* |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+ ;;
39053913* )
39063914# other operating systems might fail because they have pthread.h but need
39073915# 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,
39183926or libraries required for threading support.
39193927" >&2 ; }
39203928 { (exit 1); exit 1; }; }
3921- esac
3929+ esac
39223930fi
39233931
39243932
@@ -12818,6 +12826,97 @@ _ACEOF
1281812826fi
1281912827
1282012828
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+
1282112920
1282212921# This test makes sure that run tests work at all. Sometimes a shared
1282312922# 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
1760317702s,@with_rendezvous@,$with_rendezvous ,;t t
1760417703s,@with_openssl@,$with_openssl ,;t t
1760517704s,@ELF_SYS@,$ELF_SYS ,;t t
17606- s,@THREAD_LIBS@,$THREAD_LIBS ,;t t
1760717705s,@THREAD_CFLAGS@,$THREAD_CFLAGS ,;t t
17706+ s,@THREAD_LIBS@,$THREAD_LIBS ,;t t
1760817707s,@AWK@,$AWK ,;t t
1760917708s,@FLEX@,$FLEX ,;t t
1761017709s,@FLEXFLAGS@,$FLEXFLAGS ,;t t