fi
-ol_link_threads=no
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
- -o $ol_with_threads = posix ; then
+for ac_func in \
+ ctime_r \
+ gethostbyaddr_r \
+ gethostbyname_r \
- for ac_hdr in pthread.h sched.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3986: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3985: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3991 "configure"
+#line 3990 "configure"
#include "confdefs.h"
-#include <$ac_hdr>
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:4013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ eval "ac_cv_func_$ac_func=yes"
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+#define $ac_tr_func 1
EOF
else
done
- if test $ac_cv_header_pthread_h = yes ; then
- echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
-echo "configure:4025: checking POSIX thread version" >&5
-if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
+if test "$ac_cv_func_ctime_r" = yes ; then
+ echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
+echo "configure:4040: checking number of arguments of ctime_r" >&5
+if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
-
- cat > conftest.$ac_ext <<EOF
-#line 4031 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 4045 "configure"
#include "confdefs.h"
-
-# include <pthread.h>
- /* this check could be improved */
-# ifdef PTHREAD_ONCE_INIT
- pthread_version_final
-# endif
-
+#include <time.h>
+int main() {
+time_t ti; char *buffer; ctime_r(&ti,buffer,32);
+; return 0; }
EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "pthread_version_final" >/dev/null 2>&1; then
+if { (eval echo configure:4052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- ol_pthread_final=yes
+ ol_cv_func_ctime_r_nargs=3
else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_pthread_final=no
+ ol_cv_func_ctime_r_nargs=0
fi
rm -f conftest*
-
-
- cat > conftest.$ac_ext <<EOF
-#line 4053 "configure"
+ if test $ol_cv_func_ctime_r_nargs = 0 ; then
+ cat > conftest.$ac_ext <<EOF
+#line 4064 "configure"
#include "confdefs.h"
-
-# include <pthread.h>
- /* this check could be improved */
-# ifdef pthread_once_init
- pthread_version_draft4
-# endif
-
+#include <time.h>
+int main() {
+time_t ti; char *buffer;
+ ctime_r(&ti,buffer);
+; return 0; }
EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "pthread_version_draft4" >/dev/null 2>&1; then
+if { (eval echo configure:4072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- ol_pthread_draft4=yes
+ ol_cv_func_ctime_r_nargs=2
else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_pthread_draft4=no
+ ol_cv_func_ctime_r_nargs=0
fi
rm -f conftest*
-
-
- if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
- ol_cv_pthread_version=final
- elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
- ol_cv_pthread_version=draft4
- else
- ol_cv_pthread_version=unknown
- fi
-
+ fi
+
fi
-echo "$ac_t""$ol_cv_pthread_version" 1>&6
-
-
- if test $ol_cv_pthread_version = final ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_PTHREADS_FINAL 1
-EOF
-
- elif test $ol_cv_pthread_version = draft4 ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_PTHREADS_D4 1
+echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
+ if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
+ cat >> confdefs.h <<EOF
+#define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
EOF
- else
- { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
- fi
-
- # consider threads found
- ol_with_threads=found
+ fi
-
-echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:4106: checking for LinuxThreads" >&5
-if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
else
-
- res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
- if test "$res" -gt 0 ; then
- ol_cv_linux_threads=yes
- else
- ol_cv_linux_threads=no
- fi
-
+ ol_cv_func_ctime_r_nargs=0
fi
-echo "$ac_t""$ol_cv_linux_threads" 1>&6
-
-
- if test $ol_cv_linux_threads = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_LINUX_THREADS 1
-EOF
-
- fi
-
-
- echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
-echo "configure:4132: checking for pthread_create" >&5
-if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
+if test "$ac_cv_func_gethostbyname_r" = yes ; then
+ echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
+echo "configure:4100: checking number of arguments of gethostbyname_r" >&5
+if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4137 "configure"
+#line 4105 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char pthread_create(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_create();
-
+#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #define BUFSIZE (sizeof(struct hostent)+10)
int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_pthread_create) || defined (__stub___pthread_create)
-choke me
-#else
-pthread_create();
-#endif
-
+struct hostent hent; char buffer[BUFSIZE];
+ int bufsize=BUFSIZE;int h_errno;
+ (void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &h_errno);
+ return 0;
; return 0; }
EOF
-if { (eval echo configure:4160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- eval "ac_cv_func_pthread_create=yes"
+ ol_cv_func_gethostbyname_r_nargs=5
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_pthread_create=no"
+ ol_cv_func_gethostbyname_r_nargs=0
fi
rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ol_link_threads=yes
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
- if test $ol_link_threads = no ; then
- echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
-echo "configure:4182: checking for pthread_create with -kthread" >&5
-if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- save_LIBS="$LIBS"
- LIBS="-kthread $LIBS"
- cat > conftest.$ac_ext <<EOF
-#line 4190 "configure"
+ if test $ol_cv_func_gethostbyname_r_nargs = 0 ; then
+ cat > conftest.$ac_ext <<EOF
+#line 4131 "configure"
#include "confdefs.h"
-#include <pthread.h>
+#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #define BUFSIZE (sizeof(struct hostent)+10)
int main() {
-
-#if HAVE_PTHREADS_D4
- pthread_create(NULL,pthread_attr_default,NULL,NULL);
-#else
- pthread_create(NULL,NULL,NULL,NULL);
-#endif
-
+struct hostent hent;struct hostent *rhent;
+ char buffer[BUFSIZE];
+ int bufsize=BUFSIZE;int h_errno;
+ (void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &rhent, &h_errno);
+ return 0;
; return 0; }
EOF
-if { (eval echo configure:4203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- ol_cv_kthread_flag=yes
+ ol_cv_func_gethostbyname_r_nargs=6
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_kthread_flag=no
+ ol_cv_func_gethostbyname_r_nargs=0
fi
rm -f conftest*
- LIBS="$save_LIBS"
-
+ fi
+
fi
-echo "$ac_t""$ol_cv_kthread_flag" 1>&6
+echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
+ if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
+ cat >> confdefs.h <<EOF
+#define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
+EOF
- if test $ol_cv_kthread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
- ol_link_threads=posix
- fi
- fi
+ fi
- if test $ol_link_threads = no ; then
- echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
-echo "configure:4227: checking for pthread_create with -pthread" >&5
-if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
+else
+ ol_cv_func_gethostbyname_r_nargs=0
+fi
+
+if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
+ echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
+echo "configure:4174: checking number of arguments of gethostbyaddr_r" >&5
+if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
-
- save_LIBS="$LIBS"
- LIBS="-pthread $LIBS"
- cat > conftest.$ac_ext <<EOF
-#line 4235 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 4179 "configure"
#include "confdefs.h"
-#include <pthread.h>
+#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #define BUFSIZE (sizeof(struct hostent)+10)
int main() {
-
-#if HAVE_PTHREADS_D4
- pthread_create(NULL,pthread_attr_default,NULL,NULL);
-#else
- pthread_create(NULL,NULL,NULL,NULL);
-#endif
-
+struct hostent hent; char buffer[BUFSIZE];
+ struct in_addr add={0x70707070};
+ size_t alen=sizeof(struct in_addr);
+ int bufsize=BUFSIZE;int h_errno;
+ (void)gethostbyaddr_r( (void *)&(add.s_addr),
+ alen, AF_INET, &hent, buffer, bufsize, &h_errno);
+ return 0;
; return 0; }
EOF
-if { (eval echo configure:4248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- ol_cv_pthread_flag=yes
+ ol_cv_func_gethostbyaddr_r_nargs=7
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_pthread_flag=no
+ ol_cv_func_gethostbyaddr_r_nargs=0
fi
rm -f conftest*
- LIBS="$save_LIBS"
-
-fi
-
-echo "$ac_t""$ol_cv_pthread_flag" 1>&6
-
- if test $ol_cv_pthread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
- ol_link_threads=posix
- fi
- fi
-
- if test $ol_link_threads = no ; then
- echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
-echo "configure:4272: checking for pthread_create with -pthreads" >&5
-if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- save_LIBS="$LIBS"
- LIBS="-pthreads $LIBS"
- cat > conftest.$ac_ext <<EOF
-#line 4280 "configure"
+ if test $ol_cv_func_gethostbyaddr_r_nargs = 0 ; then
+ cat > conftest.$ac_ext <<EOF
+#line 4208 "configure"
#include "confdefs.h"
-#include <pthread.h>
+#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #define BUFSIZE (sizeof(struct hostent)+10)
int main() {
-
-#if HAVE_PTHREADS_D4
- pthread_create(NULL,pthread_attr_default,NULL,NULL);
-#else
- pthread_create(NULL,NULL,NULL,NULL);
-#endif
-
+struct hostent hent; struct hostent *rhent; char buffer[BUFSIZE];
+ struct in_addr add={0x70707070};
+ size_t alen=sizeof(struct in_addr);
+ int bufsize=BUFSIZE;int h_errno;
+ (void)gethostbyaddr_r( (void *)&(add.s_addr),
+ alen, AF_INET, &hent, buffer, bufsize,
+ &rhent, &h_errno);
+ return 0;
; return 0; }
EOF
-if { (eval echo configure:4293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- ol_cv_pthreads_flag=yes
+ ol_cv_func_gethostbyaddr_r_nargs=8
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_pthreads_flag=no
+ ol_cv_func_gethostbyaddr_r_nargs=0
fi
rm -f conftest*
- LIBS="$save_LIBS"
-
+ fi
+
fi
-echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
+echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
+ if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
+ cat >> confdefs.h <<EOF
+#define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
+EOF
- if test $ol_cv_pthreads_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
- ol_link_threads=posix
- fi
- fi
+ fi
- if test $ol_link_threads = no ; then
- echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
-echo "configure:4317: checking for pthread_create with -thread" >&5
-if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
+else
+ ol_cv_func_gethostbyaddr_r_nargs=0
+fi
+
+if test "$ac_cv_func_ctime_r" = yes \
+ -a "$ol_cv_func_ctime_r_nargs" -ge 2 -a "$ol_cv_func_ctime_r_nargs" -le 3 \
+ -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
+ -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
+ -a "$ac_cv_func_gethostbyaddr_r" = yes \
+ -a "$ac_cv_func_gethostbyname_r" = yes \
+ ; then
+
+ cat >> confdefs.h <<\EOF
+#define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
+EOF
+
+fi
+
+if test $ol_link_threads != no ; then
+ cat >> confdefs.h <<\EOF
+#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
+EOF
+
+fi
+
+
+ol_link_threads=no
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+ -o $ol_with_threads = posix ; then
+
+ for ac_hdr in pthread.h sched.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4282: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
-
- save_LIBS="$LIBS"
- LIBS="-thread $LIBS"
- cat > conftest.$ac_ext <<EOF
-#line 4325 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 4287 "configure"
#include "confdefs.h"
-char pthread_create();
-int main() {
-pthread_create();
-; return 0; }
+#include <$ac_hdr>
EOF
-if { (eval echo configure:4332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
rm -rf conftest*
- ol_cv_thread_flag=yes
+ eval "ac_cv_header_$ac_safe=yes"
else
+ echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_thread_flag=no
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
- LIBS="$save_LIBS"
-
fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
-echo "$ac_t""$ol_cv_thread_flag" 1>&6
-
- if test $ol_cv_thread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -thread"
- ol_link_threads=posix
- fi
- fi
- if test $ol_link_threads = no ; then
- echo $ac_n "checking for pthread_create with -mt""... $ac_c" 1>&6
-echo "configure:4356: checking for pthread_create with -mt" >&5
-if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
+ if test $ac_cv_header_pthread_h = yes ; then
+ echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
+echo "configure:4321: checking POSIX thread version" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- save_LIBS="$LIBS"
- LIBS="-mt $LIBS"
- cat > conftest.$ac_ext <<EOF
-#line 4364 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 4327 "configure"
#include "confdefs.h"
-char pthread_create();
-int main() {
-pthread_create();
-; return 0; }
+
+# include <pthread.h>
+ /* this check could be improved */
+# ifdef PTHREAD_ONCE_INIT
+ pthread_version_final
+# endif
+
EOF
-if { (eval echo configure:4371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "pthread_version_final" >/dev/null 2>&1; then
rm -rf conftest*
- ol_cv_thread_flag=yes
+ ol_pthread_final=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_thread_flag=no
+ ol_pthread_final=no
fi
rm -f conftest*
- LIBS="$save_LIBS"
-
-fi
-
-echo "$ac_t""$ol_cv_thread_flag" 1>&6
- if test $ol_cv_thread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -mt"
- ol_link_threads=posix
- fi
- fi
- if test $ol_link_threads = no ; then
- save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_mutex_unlock in -lpthread""... $ac_c" 1>&6
-echo "configure:4396: checking for pthread_mutex_unlock in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4404 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 4349 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_mutex_unlock();
-int main() {
-pthread_mutex_unlock()
-; return 0; }
+# include <pthread.h>
+ /* this check could be improved */
+# ifdef pthread_once_init
+ pthread_version_draft4
+# endif
+
EOF
-if { (eval echo configure:4415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "pthread_version_draft4" >/dev/null 2>&1; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ ol_pthread_draft4=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ ol_pthread_draft4=no
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
-
+
+ if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
+ ol_cv_pthread_version=final
+ elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
+ ol_cv_pthread_version=draft4
+ else
+ ol_cv_pthread_version=unknown
+ fi
+
+fi
+
+echo "$ac_t""$ol_cv_pthread_version" 1>&6
+
+
+ if test $ol_cv_pthread_version = final ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PTHREADS_FINAL 1
+EOF
+
+ elif test $ol_cv_pthread_version = draft4 ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PTHREADS_D4 1
+EOF
+
+ else
+ { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
+ fi
+
+ # consider threads found
+ ol_with_threads=found
+
+
+echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
+echo "configure:4402: checking for LinuxThreads" >&5
+if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- echo "$ac_t""no" 1>&6
-:
+
+ res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
+ if test "$res" -gt 0 ; then
+ ol_cv_linux_threads=yes
+ else
+ ol_cv_linux_threads=no
+ fi
+
fi
- LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_linux_threads" 1>&6
+
+
+ if test $ol_cv_linux_threads = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LINUX_THREADS 1
+EOF
+
fi
- if test $ol_link_threads = no ; then
- save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
-echo "configure:4448: checking for pthread_mutex_lock in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+ echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
+echo "configure:4428: checking for pthread_create" >&5
+if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lpthread -lmach -lexc $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4456 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 4433 "configure"
#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char pthread_create(); below. */
+#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char pthread_mutex_lock();
+char pthread_create();
int main() {
-pthread_mutex_lock()
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_pthread_create) || defined (__stub___pthread_create)
+choke me
+#else
+pthread_create();
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ eval "ac_cv_func_pthread_create=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ eval "ac_cv_func_pthread_create=no"
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
echo "$ac_t""yes" 1>&6
-
- ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
-
+ ol_link_threads=yes
else
echo "$ac_t""no" 1>&6
-:
fi
- LIBS="$save_LIBS"
- fi
if test $ol_link_threads = no ; then
- save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_mutex_trylock in -lpthread""... $ac_c" 1>&6
-echo "configure:4500: checking for pthread_mutex_trylock in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
+echo "configure:4478: checking for pthread_create with -kthread" >&5
+if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lpthread -lexc $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4508 "configure"
+
+ save_LIBS="$LIBS"
+ LIBS="-kthread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 4486 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_mutex_trylock();
-
+#include <pthread.h>
int main() {
-pthread_mutex_trylock()
+
+#if HAVE_PTHREADS_D4
+ pthread_create(NULL,pthread_attr_default,NULL,NULL);
+#else
+ pthread_create(NULL,NULL,NULL,NULL);
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:4519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ ol_cv_kthread_flag=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ ol_cv_kthread_flag=no
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
-
-else
- echo "$ac_t""no" 1>&6
-:
+ LIBS="$save_LIBS"
+
fi
- LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_kthread_flag" 1>&6
+
+ if test $ol_cv_kthread_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
+ ol_link_threads=posix
+ fi
fi
if test $ol_link_threads = no ; then
- save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:4552: checking for pthread_create in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
+echo "configure:4523: checking for pthread_create with -pthread" >&5
+if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lpthread $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4560 "configure"
+
+ save_LIBS="$LIBS"
+ LIBS="-pthread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 4531 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_create();
-
+#include <pthread.h>
int main() {
-pthread_create()
+
+#if HAVE_PTHREADS_D4
+ pthread_create(NULL,pthread_attr_default,NULL,NULL);
+#else
+ pthread_create(NULL,NULL,NULL,NULL);
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:4571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ ol_cv_pthread_flag=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ ol_cv_pthread_flag=no
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
-else
- echo "$ac_t""no" 1>&6
-:
+ LIBS="$save_LIBS"
+
fi
- LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthread_flag" 1>&6
+
+ if test $ol_cv_pthread_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
+ ol_link_threads=posix
+ fi
fi
if test $ol_link_threads = no ; then
- save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:4600: checking for pthread_create in -lc_r" >&5
-ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
+echo "configure:4568: checking for pthread_create with -pthreads" >&5
+if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lc_r $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4608 "configure"
+
+ save_LIBS="$LIBS"
+ LIBS="-pthreads $LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 4576 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_create();
-
+#include <pthread.h>
int main() {
-pthread_create()
+
+#if HAVE_PTHREADS_D4
+ pthread_create(NULL,pthread_attr_default,NULL,NULL);
+#else
+ pthread_create(NULL,NULL,NULL,NULL);
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:4619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ ol_cv_pthreads_flag=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ ol_cv_pthreads_flag=no
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
-else
- echo "$ac_t""no" 1>&6
-:
+ LIBS="$save_LIBS"
+
fi
- LIBS="$save_LIBS"
+echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
+
+ if test $ol_cv_pthreads_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
+ ol_link_threads=posix
+ fi
fi
if test $ol_link_threads = no ; then
- save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:4648: checking for pthread_create in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
+echo "configure:4613: checking for pthread_create with -thread" >&5
+if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lpthreads $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4656 "configure"
+
+ save_LIBS="$LIBS"
+ LIBS="-thread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 4621 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char pthread_create();
-
int main() {
-pthread_create()
+pthread_create();
; return 0; }
EOF
-if { (eval echo configure:4667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ ol_cv_thread_flag=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ ol_cv_thread_flag=no
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
-else
- echo "$ac_t""no" 1>&6
-:
+ LIBS="$save_LIBS"
+
fi
- LIBS="$save_LIBS"
- fi
-
- if test $ol_link_threads = no ; then
- save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
-echo "configure:4696: checking for pthread_join in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lpthreads -Wl,-woff,85 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4704 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char pthread_join();
-
-int main() {
-pthread_join()
-; return 0; }
-EOF
-if { (eval echo configure:4715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+echo "$ac_t""$ol_cv_thread_flag" 1>&6
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
+ if test $ol_cv_thread_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -thread"
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
-
-else
- echo "$ac_t""no" 1>&6
-:
-fi
-
- LIBS="$save_LIBS"
+ fi
fi
if test $ol_link_threads = no ; then
- echo $ac_n "checking for pthread_create with -threads""... $ac_c" 1>&6
-echo "configure:4744: checking for pthread_create with -threads" >&5
+ echo $ac_n "checking for pthread_create with -mt""... $ac_c" 1>&6
+echo "configure:4652: checking for pthread_create with -mt" >&5
if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
save_LIBS="$LIBS"
- LIBS="-threads $LIBS"
+ LIBS="-mt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4752 "configure"
+#line 4660 "configure"
#include "confdefs.h"
char pthread_create();
int main() {
-
- pthread_create();
-
+pthread_create();
; return 0; }
EOF
-if { (eval echo configure:4761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ol_cv_thread_flag=yes
else
echo "$ac_t""$ol_cv_thread_flag" 1>&6
if test $ol_cv_thread_flag = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -threads"
+ LTHREAD_LIBS="$LTHREAD_LIBS -mt"
ol_link_threads=posix
fi
fi
if test $ol_link_threads = no ; then
save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
-echo "configure:4786: checking for pthread_mutex_unlock in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for pthread_mutex_unlock in -lpthread""... $ac_c" 1>&6
+echo "configure:4692: checking for pthread_mutex_unlock in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
+LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4794 "configure"
+#line 4700 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_mutex_unlock()
; return 0; }
EOF
-if { (eval echo configure:4805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""yes" 1>&6
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
if test $ol_link_threads = no ; then
save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_mutex_lock in -lpthreads""... $ac_c" 1>&6
-echo "configure:4838: checking for pthread_mutex_lock in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
+echo "configure:4744: checking for pthread_mutex_lock in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lpthreads -lmach -lexc $LIBS"
+LIBS="-lpthread -lmach -lexc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4846 "configure"
+#line 4752 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_mutex_lock()
; return 0; }
EOF
-if { (eval echo configure:4857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""yes" 1>&6
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc"
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc"
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
if test $ol_link_threads = no ; then
save_LIBS="$LIBS"
- echo $ac_n "checking for pthread_mutex_trylock in -lpthreads""... $ac_c" 1>&6
-echo "configure:4890: checking for pthread_mutex_trylock in -lpthreads" >&5
-ac_lib_var=`echo pthreads'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for pthread_mutex_trylock in -lpthread""... $ac_c" 1>&6
+echo "configure:4796: checking for pthread_mutex_trylock in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lpthreads -lexc $LIBS"
+LIBS="-lpthread -lexc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4898 "configure"
+#line 4804 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_mutex_trylock()
; return 0; }
EOF
-if { (eval echo configure:4909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""yes" 1>&6
ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
LIBS="$save_LIBS"
fi
- if test $ol_link_threads != no ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_PTHREADS 1
-EOF
-
-
- save_CPPFLAGS="$CPPFLAGS"
- save_LIBS="$LIBS"
- LIBS="$LTHREAD_LIBS $LIBS"
-
- for ac_func in sched_yield pthread_yield
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4952: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ if test $ol_link_threads = no ; then
+ save_LIBS="$LIBS"
+ echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
+echo "configure:4848: checking for pthread_create in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 4957 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthread $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4856 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char pthread_create();
int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
+pthread_create()
; return 0; }
EOF
-if { (eval echo configure:4980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
+
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
else
echo "$ac_t""no" 1>&6
+:
fi
-done
+ LIBS="$save_LIBS"
+ fi
- if test $ac_cv_func_sched_yield = no -a \
- $ac_cv_func_pthread_yield = no ; then
- echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:5008: checking for sched_yield in -lrt" >&5
-ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
+ if test $ol_link_threads = no ; then
+ save_LIBS="$LIBS"
+ echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
+echo "configure:4896: checking for pthread_create in -lc_r" >&5
+ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lrt $LIBS"
+LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5016 "configure"
+#line 4904 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char sched_yield();
+char pthread_create();
int main() {
-sched_yield()
+pthread_create()
; return 0; }
EOF
-if { (eval echo configure:5027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
- cat >> confdefs.h <<\EOF
-#define HAVE_SCHED_YIELD 1
-EOF
-
- ac_cv_func_sched_yield=yes
+
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
else
echo "$ac_t""no" 1>&6
-ac_cv_func_sched_yield=no
+:
fi
- fi
- if test $ac_cv_func_sched_yield = no -a \
- $ac_cv_func_pthread_yield = no ; then
- for ac_func in thr_yield
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5059: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ LIBS="$save_LIBS"
+ fi
+
+ if test $ol_link_threads = no ; then
+ save_LIBS="$LIBS"
+ echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
+echo "configure:4944: checking for pthread_create in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 5064 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthreads $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4952 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char pthread_create();
int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
+pthread_create()
; return 0; }
EOF
-if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
+
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
else
echo "$ac_t""no" 1>&6
+:
fi
-done
- fi
- if test $ac_cv_func_sched_yield = no -a \
- $ac_cv_func_pthread_yield = no -a \
- "$ac_cv_func_thr_yield" = no ; then
- echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
- fi
+ LIBS="$save_LIBS"
+ fi
- for ac_func in pthread_kill
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5121: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ if test $ol_link_threads = no ; then
+ save_LIBS="$LIBS"
+ echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
+echo "configure:4992: checking for pthread_join in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 5126 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthreads -Wl,-woff,85 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5000 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char pthread_join();
int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
+pthread_join()
; return 0; }
EOF
-if { (eval echo configure:5149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
+
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
+
else
echo "$ac_t""no" 1>&6
+:
fi
-done
+ LIBS="$save_LIBS"
+ fi
- echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
-echo "configure:5175: checking for pthread_detach with <pthread.h>" >&5
-if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
+ if test $ol_link_threads = no ; then
+ echo $ac_n "checking for pthread_create with -threads""... $ac_c" 1>&6
+echo "configure:5040: checking for pthread_create with -threads" >&5
+if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 5181 "configure"
+ save_LIBS="$LIBS"
+ LIBS="-threads $LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 5048 "configure"
#include "confdefs.h"
-#include <pthread.h>
+char pthread_create();
int main() {
-pthread_detach(NULL);
+
+ pthread_create();
+
; return 0; }
EOF
-if { (eval echo configure:5188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ol_cv_func_pthread_detach=yes
+ ol_cv_thread_flag=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_func_pthread_detach=no
+ ol_cv_thread_flag=no
fi
rm -f conftest*
+ LIBS="$save_LIBS"
fi
-echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
+echo "$ac_t""$ol_cv_thread_flag" 1>&6
- if test $ol_cv_func_pthread_detach = no ; then
- { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
+ if test $ol_cv_thread_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -threads"
+ ol_link_threads=posix
fi
+ fi
- cat >> confdefs.h <<\EOF
-#define HAVE_PTHREAD_DETACH 1
-EOF
-
-
- for ac_func in \
- pthread_setconcurrency \
- pthread_getconcurrency \
- thr_setconcurrency \
- thr_getconcurrency \
-
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5220: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ if test $ol_link_threads = no ; then
+ save_LIBS="$LIBS"
+ echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
+echo "configure:5082: checking for pthread_mutex_unlock in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 5225 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5090 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char pthread_mutex_unlock();
int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
+pthread_mutex_unlock()
; return 0; }
EOF
-if { (eval echo configure:5248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
+
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
+ if test $ol_with_yielding_select = auto ; then
+ ol_with_yielding_select=yes
+ fi
+
else
echo "$ac_t""no" 1>&6
+:
fi
-done
+ LIBS="$save_LIBS"
+ fi
- echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
-echo "configure:5274: checking if pthread_create() works" >&5
- if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
+ if test $ol_link_threads = no ; then
+ save_LIBS="$LIBS"
+ echo $ac_n "checking for pthread_mutex_lock in -lpthreads""... $ac_c" 1>&6
+echo "configure:5134: checking for pthread_mutex_lock in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
-
- if test "$cross_compiling" = yes; then
- ol_cv_pthread_create_works=yes
-else
- cat > conftest.$ac_ext <<EOF
-#line 5283 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthreads -lmach -lexc $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5142 "configure"
#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_mutex_lock();
-#include <pthread.h>
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-static void *task(p)
- void *p;
-{
- return (void *) (p == NULL);
-}
-
-int main(argc, argv)
- int argc;
- char **argv;
-{
- pthread_t t;
-#if HAVE_PTHREADS_D4
- exit(pthread_create(&t, pthread_attr_default, task, NULL));
-#else
- exit(pthread_create(&t, NULL, task, NULL));
-#endif
-}
-
+int main() {
+pthread_mutex_lock()
+; return 0; }
EOF
-if { (eval echo configure:5310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ol_cv_pthread_create_works=yes
+if { (eval echo configure:5153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- rm -fr conftest*
- ol_cv_pthread_create_works=no
-fi
-rm -fr conftest*
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc"
+ if test $ol_with_yielding_select = auto ; then
+ ol_with_yielding_select=yes
+ fi
+
+else
+ echo "$ac_t""no" 1>&6
+:
fi
- echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
-
- if test $ol_cv_pthread_create_works = no ; then
- { echo "configure: error: pthread.h and pthread_create are not compatible" 1>&2; exit 1; }
- fi
+ LIBS="$save_LIBS"
+ fi
- if test $ol_with_yielding_select = auto ; then
- echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
-echo "configure:5332: checking if select yields when using pthreads" >&5
- if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
+ if test $ol_link_threads = no ; then
+ save_LIBS="$LIBS"
+ echo $ac_n "checking for pthread_mutex_trylock in -lpthreads""... $ac_c" 1>&6
+echo "configure:5186: checking for pthread_mutex_trylock in -lpthreads" >&5
+ac_lib_var=`echo pthreads'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
-
- if test "$cross_compiling" = yes; then
-
- { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
-else
- cat > conftest.$ac_ext <<EOF
-#line 5342 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <pthread.h>
-#ifndef NULL
-#define NULL (void*) 0
-#endif
-
-static int fildes[2];
-
-static void *task(p)
- void *p;
-{
- int i;
- struct timeval tv;
-
- fd_set rfds;
-
- tv.tv_sec=10;
- tv.tv_usec=0;
-
- FD_ZERO(&rfds);
- FD_SET(fildes[0], &rfds);
-
- /* we're not interested in any fds */
- i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
-
- if(i < 0) {
- perror("select");
- exit(10);
- }
-
- exit(0); /* if we exit here, the select blocked the whole process */
-}
-
-int main(argc, argv)
- int argc;
- char **argv;
-{
- pthread_t t;
-
- /* create a pipe to select */
- if(pipe(&fildes[0])) {
- perror("select");
- exit(1);
- }
-
-#ifdef HAVE_PTHREAD_SETCONCURRENCY
- (void) pthread_setconcurrency(2);
-#else
-#ifdef HAVE_THR_SETCONCURRENCY
- /* Set Solaris LWP concurrency to 2 */
- thr_setconcurrency(2);
-#endif
-#endif
-
-#if HAVE_PTHREADS_D4
- pthread_create(&t, pthread_attr_default, task, NULL);
-#else
- pthread_create(&t, NULL, task, NULL);
-#endif
-
-#if HAVE_SCHED_YIELD
- sched_yield(); /* make sure task runs first */
-#else
-#ifdef HAVE_PTHREAD_YIELD
- pthread_yield(); /* make sure task runs first */
-#endif
-#endif
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthreads -lexc $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5194 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_mutex_trylock();
- exit(2);
-}
+int main() {
+pthread_mutex_trylock()
+; return 0; }
EOF
-if { (eval echo configure:5418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ol_cv_pthread_select_yields=no
+if { (eval echo configure:5205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- rm -fr conftest*
- ol_cv_pthread_select_yields=yes
-fi
-rm -fr conftest*
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
fi
-
- echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
-
- if test $ol_cv_pthread_select_yields = yes ; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ ol_link_threads=posix
+ LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
+ if test $ol_with_yielding_select = auto ; then
ol_with_yielding_select=yes
fi
- fi
+
+else
+ echo "$ac_t""no" 1>&6
+:
+fi
- CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
- else
- { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
fi
- fi
- if test $ol_with_threads = posix ; then
- { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
- fi
-fi
+ if test $ol_link_threads != no ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_PTHREADS 1
+EOF
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
- -o $ol_with_threads = mach ; then
- for ac_hdr in mach/cthreads.h
+ save_CPPFLAGS="$CPPFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$LTHREAD_LIBS $LIBS"
+
+ for ac_func in sched_yield pthread_yield
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5458: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5248: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5463 "configure"
+#line 5253 "configure"
#include "confdefs.h"
-#include <$ac_hdr>
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:5276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ eval "ac_cv_func_$ac_func=yes"
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+#define $ac_tr_func 1
EOF
else
fi
done
- if test $ac_cv_header_mach_cthreads_h = yes ; then
- ol_with_threads=found
- echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
-echo "configure:5498: checking for cthread_fork" >&5
-if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
+ if test $ac_cv_func_sched_yield = no -a \
+ $ac_cv_func_pthread_yield = no ; then
+ echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
+echo "configure:5304: checking for sched_yield in -lrt" >&5
+ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lrt $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5312 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sched_yield();
+
+int main() {
+sched_yield()
+; return 0; }
+EOF
+if { (eval echo configure:5323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
+ cat >> confdefs.h <<\EOF
+#define HAVE_SCHED_YIELD 1
+EOF
+
+ ac_cv_func_sched_yield=yes
+else
+ echo "$ac_t""no" 1>&6
+ac_cv_func_sched_yield=no
+fi
+
+ fi
+ if test $ac_cv_func_sched_yield = no -a \
+ $ac_cv_func_pthread_yield = no ; then
+ for ac_func in thr_yield
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5355: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5503 "configure"
+#line 5360 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char cthread_fork(); below. */
+ which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char cthread_fork();
+char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-cthread_fork();
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_cthread_fork=yes"
+ eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_cthread_fork=no"
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ol_link_threads=yes
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
else
echo "$ac_t""no" 1>&6
fi
+done
+ fi
+ if test $ac_cv_func_sched_yield = no -a \
+ $ac_cv_func_pthread_yield = no -a \
+ "$ac_cv_func_thr_yield" = no ; then
+ echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
+ fi
- if test $ol_link_threads = no ; then
- echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
-echo "configure:5548: checking for cthread_fork with -all_load" >&5
-if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
+ for ac_func in pthread_kill
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:5417: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
-
- save_LIBS="$LIBS"
- LIBS="-all_load $LIBS"
- cat > conftest.$ac_ext <<EOF
-#line 5556 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 5422 "configure"
#include "confdefs.h"
-#include <mach/cthreads.h>
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
int main() {
- cthread_fork((void *)0, (void *)0);
-
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:5565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ol_cv_cthread_all_load=yes
+ eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_cthread_all_load=no
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
- LIBS="$save_LIBS"
-
-fi
-
-echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
-
- if test $ol_cv_cthread_all_load = yes ; then
- LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
- ol_link_threads=mach
- fi
- fi
-
- if test $ol_link_threads != no ; then
- : check for cthread specific functionality here
- cat >> confdefs.h <<\EOF
-#define HAVE_MACH_CTHREADS 1
-EOF
-
- else
- { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
- fi
- fi
-
- if test $ol_with_threads = mach ; then
- { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
- fi
fi
-if test $ol_with_threads = auto -o $ol_with_threads = yes \
- -o $ol_with_threads = lwp ; then
-
- for ac_hdr in thread.h synch.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5610: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 5615 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+#define $ac_tr_func 1
EOF
else
fi
done
- if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
- echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
-echo "configure:5648: checking for thr_create in -lthread" >&5
-ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+
+ echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
+echo "configure:5471: checking for pthread_detach with <pthread.h>" >&5
+if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lthread $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5656 "configure"
+
+ cat > conftest.$ac_ext <<EOF
+#line 5477 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char thr_create();
-
+#include <pthread.h>
int main() {
-thr_create()
+pthread_detach(NULL);
; return 0; }
EOF
-if { (eval echo configure:5667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ ol_cv_func_pthread_detach=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ ol_cv_func_pthread_detach=no
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- have_thr=yes
-else
- echo "$ac_t""no" 1>&6
-have_thr=no
+
fi
+echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
+
+ if test $ol_cv_func_pthread_detach = no ; then
+ { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
+ fi
- if test $have_thr = yes ; then
cat >> confdefs.h <<\EOF
-#define HAVE_THR 1
+#define HAVE_PTHREAD_DETACH 1
EOF
- LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
- ol_link_threads=thr
-
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=yes
- fi
for ac_func in \
+ pthread_setconcurrency \
+ pthread_getconcurrency \
thr_setconcurrency \
thr_getconcurrency \
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5707: checking for $ac_func" >&5
+echo "configure:5516: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5712 "configure"
+#line 5521 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:5735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
fi
done
- fi
- fi
- for ac_hdr in lwp/lwp.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5766: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
+echo "configure:5570: checking if pthread_create() works" >&5
+ if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
+
+ if test "$cross_compiling" = yes; then
+ ol_cv_pthread_create_works=yes
+else
cat > conftest.$ac_ext <<EOF
-#line 5771 "configure"
+#line 5579 "configure"
#include "confdefs.h"
-#include <$ac_hdr>
+
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*)0
+#endif
+
+static void *task(p)
+ void *p;
+{
+ return (void *) (p == NULL);
+}
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t t;
+#if HAVE_PTHREADS_D4
+ exit(pthread_create(&t, pthread_attr_default, task, NULL));
+#else
+ exit(pthread_create(&t, NULL, task, NULL));
+#endif
+}
+
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+if { (eval echo configure:5606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ol_cv_pthread_create_works=yes
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ rm -fr conftest*
+ ol_cv_pthread_create_works=no
fi
-rm -f conftest*
+rm -fr conftest*
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+
fi
-done
- if test $ac_cv_header_lwp_lwp_h = yes ; then
- echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
-echo "configure:5804: checking for lwp_create in -llwp" >&5
-ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
+
+ if test $ol_cv_pthread_create_works = no ; then
+ { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
+ fi
+
+ if test $ol_with_yielding_select = auto ; then
+ echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
+echo "configure:5628: checking if select yields when using pthreads" >&5
+ if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-llwp $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5812 "configure"
+
+ if test "$cross_compiling" = yes; then
+
+ { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5638 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char lwp_create();
-int main() {
-lwp_create()
-; return 0; }
-EOF
-if { (eval echo configure:5823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+#ifndef NULL
+#define NULL (void*) 0
+#endif
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- have_lwp=yes
-else
- echo "$ac_t""no" 1>&6
-have_lwp=no
-fi
+static int fildes[2];
+
+static void *task(p)
+ void *p;
+{
+ int i;
+ struct timeval tv;
+ fd_set rfds;
- if test $have_lwp = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_LWP 1
+ tv.tv_sec=10;
+ tv.tv_usec=0;
+
+ FD_ZERO(&rfds);
+ FD_SET(fildes[0], &rfds);
+
+ /* we're not interested in any fds */
+ i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
+
+ if(i < 0) {
+ perror("select");
+ exit(10);
+ }
+
+ exit(0); /* if we exit here, the select blocked the whole process */
+}
+
+int main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t t;
+
+ /* create a pipe to select */
+ if(pipe(&fildes[0])) {
+ perror("select");
+ exit(1);
+ }
+
+#ifdef HAVE_PTHREAD_SETCONCURRENCY
+ (void) pthread_setconcurrency(2);
+#else
+#ifdef HAVE_THR_SETCONCURRENCY
+ /* Set Solaris LWP concurrency to 2 */
+ thr_setconcurrency(2);
+#endif
+#endif
+
+#if HAVE_PTHREADS_D4
+ pthread_create(&t, pthread_attr_default, task, NULL);
+#else
+ pthread_create(&t, NULL, task, NULL);
+#endif
+
+#if HAVE_SCHED_YIELD
+ sched_yield(); /* make sure task runs first */
+#else
+#ifdef HAVE_PTHREAD_YIELD
+ pthread_yield(); /* make sure task runs first */
+#endif
+#endif
+
+ exit(2);
+}
EOF
+if { (eval echo configure:5714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ol_cv_pthread_select_yields=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ol_cv_pthread_select_yields=yes
+fi
+rm -fr conftest*
+fi
- LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
- ol_link_threads=lwp
+fi
- if test $ol_with_yielding_select = auto ; then
- ol_with_yielding_select=no
+ echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
+
+ if test $ol_cv_pthread_select_yields = yes ; then
+ ol_with_yielding_select=yes
+ fi
fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+ else
+ { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
fi
fi
-fi
-
-if test $ol_with_yielding_select = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_YIELDING_SELECT 1
-EOF
+ if test $ol_with_threads = posix ; then
+ { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
+ fi
fi
-if test $ol_with_threads = manual ; then
- ol_link_threads=yes
-
- echo "configure: warning: thread defines and link options must be set manually" 1>&2
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+ -o $ol_with_threads = mach ; then
- for ac_hdr in pthread.h sched.h
+ for ac_hdr in mach/cthreads.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5876: checking for $ac_hdr" >&5
+echo "configure:5754: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5881 "configure"
+#line 5759 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
- for ac_func in sched_yield pthread_yield
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5915: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ if test $ac_cv_header_mach_cthreads_h = yes ; then
+ ol_with_threads=found
+
+ echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
+echo "configure:5794: checking for cthread_fork" >&5
+if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5920 "configure"
+#line 5799 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
+ which can conflict with char cthread_fork(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char cthread_fork();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
choke me
#else
-$ac_func();
+cthread_fork();
#endif
; return 0; }
EOF
-if { (eval echo configure:5943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_func_cthread_fork=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_func_cthread_fork=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
+ ol_link_threads=yes
else
echo "$ac_t""no" 1>&6
fi
-done
-
-
-echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
-echo "configure:5969: checking for LinuxThreads" >&5
-if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
- if test "$res" -gt 0 ; then
- ol_cv_linux_threads=yes
- else
- ol_cv_linux_threads=no
- fi
-
-fi
-
-echo "$ac_t""$ol_cv_linux_threads" 1>&6
- for ac_hdr in mach/cthreads.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5990: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ if test $ol_link_threads = no ; then
+ echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
+echo "configure:5844: checking for cthread_fork with -all_load" >&5
+if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 5995 "configure"
+
+ save_LIBS="$LIBS"
+ LIBS="-all_load $LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 5852 "configure"
#include "confdefs.h"
-#include <$ac_hdr>
+#include <mach/cthreads.h>
+int main() {
+
+ cthread_fork((void *)0, (void *)0);
+
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:5861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ ol_cv_cthread_all_load=yes
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ol_cv_cthread_all_load=no
fi
rm -f conftest*
+ LIBS="$save_LIBS"
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+
+echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
+
+ if test $ol_cv_cthread_all_load = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
+ ol_link_threads=mach
+ fi
+ fi
+
+ if test $ol_link_threads != no ; then
+ : check for cthread specific functionality here
+ cat >> confdefs.h <<\EOF
+#define HAVE_MACH_CTHREADS 1
EOF
-
-else
- echo "$ac_t""no" 1>&6
+
+ else
+ { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
+ fi
+ fi
+
+ if test $ol_with_threads = mach ; then
+ { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
+ fi
fi
-done
- for ac_hdr in lwp/lwp.h
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+ -o $ol_with_threads = lwp ; then
+
+ for ac_hdr in thread.h synch.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6030: checking for $ac_hdr" >&5
+echo "configure:5906: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6035 "configure"
+#line 5911 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
- for ac_hdr in thread.h synch.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6070: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
+ echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
+echo "configure:5944: checking for thr_create in -lthread" >&5
+ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 6075 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lthread $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5952 "configure"
#include "confdefs.h"
-#include <$ac_hdr>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char thr_create();
+
+int main() {
+thr_create()
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:5963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+ have_thr=yes
else
echo "$ac_t""no" 1>&6
+have_thr=no
fi
-done
-fi
-if test $ol_link_threads != no ; then
+ if test $have_thr = yes ; then
cat >> confdefs.h <<\EOF
-#define REENTRANT 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define _REENTRANT 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define THREAD_SAFE 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define _THREAD_SAFE 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define THREADSAFE 1
+#define HAVE_THR 1
EOF
- cat >> confdefs.h <<\EOF
-#define _THREADSAFE 1
-EOF
+ LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
+ ol_link_threads=thr
+ if test $ol_with_yielding_select = auto ; then
+ ol_with_yielding_select=yes
+ fi
- echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
-echo "configure:6135: checking for thread specific errno" >&5
-if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
+ for ac_func in \
+ thr_setconcurrency \
+ thr_getconcurrency \
+
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6003: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
-
- cat > conftest.$ac_ext <<EOF
-#line 6141 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 6008 "configure"
#include "confdefs.h"
-#include <errno.h>
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
int main() {
-int x = errno;
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:6148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ol_cv_errno_thread_specific=yes
+ eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_errno_thread_specific=no
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
-
fi
-echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
-
- if test $ol_cv_errno_thread_specific != yes ; then
- LIBS="$LTHREAD_LIBS $LIBS"
- LTHREAD_LIBS=""
- fi
-
-fi
-
-
-if test $ol_link_threads = no ; then
- if test $ol_with_threads = yes ; then
- { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
- fi
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
- if test $ol_with_threads = auto ; then
- echo "configure: warning: no suitable thread support, disabling threads" 1>&2
- ol_with_threads=no
+ fi
fi
- cat >> confdefs.h <<\EOF
-#define NO_THREADS 1
+ for ac_hdr in lwp/lwp.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:6062: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6067 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
EOF
-
- LTHREAD_LIBS=""
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
fi
-
-ol_link_ldbm=no
-if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
- echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
-echo "configure:6191: checking for DB2 library" >&5
-if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
else
- ol_LIBS="$LIBS"
- echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
-echo "configure:6197: checking for db_open in -ldb" >&5
-ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ if test $ac_cv_header_lwp_lwp_h = yes ; then
+ echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
+echo "configure:6100: checking for lwp_create in -llwp" >&5
+ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-ldb $LIBS"
+LIBS="-llwp $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6205 "configure"
+#line 6108 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char db_open();
+char lwp_create();
int main() {
-db_open()
+lwp_create()
; return 0; }
EOF
-if { (eval echo configure:6216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ol_cv_lib_db2=-ldb
+ have_lwp=yes
else
echo "$ac_t""no" 1>&6
-ol_cv_lib_db2=no
+have_lwp=no
fi
- LIBS="$ol_LIBS"
+ if test $have_lwp = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LWP 1
+EOF
+
+ LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
+ ol_link_threads=lwp
+
+ if test $ol_with_yielding_select = auto ; then
+ ol_with_yielding_select=no
+ fi
+ fi
+ fi
fi
-echo "$ac_t""$ol_cv_lib_db2" 1>&6
+if test $ol_with_yielding_select = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_YIELDING_SELECT 1
+EOF
-for ac_hdr in db.h
+fi
+
+if test $ol_with_threads = manual ; then
+ ol_link_threads=yes
+
+ echo "configure: warning: thread defines and link options must be set manually" 1>&2
+
+ for ac_hdr in pthread.h sched.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6247: checking for $ac_hdr" >&5
+echo "configure:6172: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6252 "configure"
+#line 6177 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
-if test $ac_cv_header_db_h = yes ; then
- echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
-echo "configure:6285: checking if db.h is DB2" >&5
-if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
+ for ac_func in sched_yield pthread_yield
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6211: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
-
- cat > conftest.$ac_ext <<EOF
-#line 6291 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 6216 "configure"
#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
-# include <db.h>
- /* this check could be improved */
-# ifdef DB_VERSION_MAJOR
-# if DB_VERSION_MAJOR == 2
- __db_version_2
-# endif
-# endif
-
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "__db_version_2" >/dev/null 2>&1; then
+if { (eval echo configure:6239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ol_cv_header_db2=yes
+ eval "ac_cv_func_$ac_func=yes"
else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_header_db2=no
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
-
fi
-echo "$ac_t""$ol_cv_header_db2" 1>&6
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
else
- ol_cv_header_db2=no
+ echo "$ac_t""no" 1>&6
fi
+done
-
-
- echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
-echo "configure:6323: checking for Berkeley DB2" >&5
-if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
+
+echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
+echo "configure:6265: checking for LinuxThreads" >&5
+if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
- ol_cv_berkeley_db2=no
+ res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
+ if test "$res" -gt 0 ; then
+ ol_cv_linux_threads=yes
else
- ol_cv_berkeley_db2=yes
+ ol_cv_linux_threads=no
fi
fi
-echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
- if test $ol_cv_berkeley_db2 = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_BERKELEY_DB2 1
-EOF
-
- fi
-
-
- if test $ol_cv_berkeley_db2 = yes ; then
- ol_link_ldbm=db2
- ol_with_ldbm_api=db2
-
- if test $ol_with_ldbm_type = hash ; then
- cat >> confdefs.h <<\EOF
-#define LDBM_USE_DBHASH 1
-EOF
-
- else
- cat >> confdefs.h <<\EOF
-#define LDBM_USE_DBBTREE 1
-EOF
-
- fi
-
- if test $ol_cv_lib_db2 != yes ; then
- LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
- fi
- fi
-fi
+echo "$ac_t""$ol_cv_linux_threads" 1>&6
-ol_link_bdb2=no
-if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
- ol_link_bdb2=yes
-fi
-if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
- echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
-echo "configure:6374: checking for Berkeley DB library" >&5
-if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ol_LIBS="$LIBS"
- echo $ac_n "checking for dbopen""... $ac_c" 1>&6
-echo "configure:6380: checking for dbopen" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
+ for ac_hdr in mach/cthreads.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:6286: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6385 "configure"
+#line 6291 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dbopen(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dbopen();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_dbopen) || defined (__stub___dbopen)
-choke me
-#else
-dbopen();
-#endif
-
-; return 0; }
+#include <$ac_hdr>
EOF
-if { (eval echo configure:6408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
rm -rf conftest*
- eval "ac_cv_func_dbopen=yes"
+ eval "ac_cv_header_$ac_safe=yes"
else
+ echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_dbopen=no"
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
-
-if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ol_cv_lib_db=yes
-else
- echo "$ac_t""no" 1>&6
-
- echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
-echo "configure:6427: checking for dbopen in -ldb" >&5
-ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-ldb $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6435 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dbopen();
-
-int main() {
-dbopen()
-; return 0; }
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
EOF
-if { (eval echo configure:6446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ol_cv_lib_db=-ldb
+
else
echo "$ac_t""no" 1>&6
-ol_cv_lib_db=no
-fi
-
-
-fi
-
- LIBS="$ol_LIBS"
-
fi
+done
-echo "$ac_t""$ol_cv_lib_db" 1>&6
-
-
-for ac_hdr in db_185.h
+ for ac_hdr in lwp/lwp.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6481: checking for $ac_hdr" >&5
+echo "configure:6326: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6486 "configure"
+#line 6331 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
-if test "$ol_cv_header_db2" = yes ; then
-
- ol_cv_header_db=$ac_cv_header_db_185_h
-else
- ol_cv_header_db=$ac_cv_header_db_h
-fi
-
-
-
- echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
-echo "configure:6527: checking for Berkeley DB" >&5
-if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
- ol_cv_berkeley_db=no
- else
- ol_cv_berkeley_db=yes
- fi
-
-fi
-
-echo "$ac_t""$ol_cv_berkeley_db" 1>&6
- if test $ol_cv_berkeley_db = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_BERKELEY_DB 1
-EOF
-
- fi
-
-
- if test $ol_cv_berkeley_db = yes ; then
- ol_link_ldbm=db
- ol_with_ldbm_api=db
-
- if test $ol_with_ldbm_type = hash ; then
- cat >> confdefs.h <<\EOF
-#define LDBM_USE_DBHASH 1
-EOF
-
- else
- cat >> confdefs.h <<\EOF
-#define LDBM_USE_DBBTREE 1
-EOF
-
- fi
-
- if test $ol_cv_lib_db != yes ; then
- LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
- fi
- fi
-fi
-
-if test $ol_with_ldbm_api = manual ; then
- ol_link_ldbm=yes
-
- echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
-
- for ac_hdr in db.h db_185.h gdbm.h ndbm.h
+ for ac_hdr in thread.h synch.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6580: checking for $ac_hdr" >&5
+echo "configure:6366: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6585 "configure"
+#line 6371 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
-if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
- echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
- ol_with_ldbm_api=none
-fi
+if test $ol_link_threads != no ; then
+ cat >> confdefs.h <<\EOF
+#define REENTRANT 1
+EOF
-if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
- echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
-echo "configure:6625: checking for GDBM library" >&5
-if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ol_LIBS="$LIBS"
- echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
-echo "configure:6631: checking for gdbm_open" >&5
-if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 6636 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char gdbm_open(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gdbm_open();
+ cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
-int main() {
+ cat >> confdefs.h <<\EOF
+#define THREAD_SAFE 1
+EOF
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
-choke me
-#else
-gdbm_open();
-#endif
+ cat >> confdefs.h <<\EOF
+#define _THREAD_SAFE 1
+EOF
-; return 0; }
+ cat >> confdefs.h <<\EOF
+#define THREADSAFE 1
EOF
-if { (eval echo configure:6659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_gdbm_open=yes"
+
+ cat >> confdefs.h <<\EOF
+#define _THREADSAFE 1
+EOF
+
+
+ echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
+echo "configure:6431: checking for thread specific errno" >&5
+if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 6437 "configure"
+#include "confdefs.h"
+#include <errno.h>
+int main() {
+int x = errno;
+; return 0; }
+EOF
+if { (eval echo configure:6444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ol_cv_errno_thread_specific=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_gdbm_open=no"
+ ol_cv_errno_thread_specific=no
fi
rm -f conftest*
+
fi
-if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ol_cv_lib_gdbm=yes
-else
- echo "$ac_t""no" 1>&6
+echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
- echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:6678: checking for gdbm_open in -lgdbm" >&5
-ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
+ if test $ol_cv_errno_thread_specific != yes ; then
+ LIBS="$LTHREAD_LIBS $LIBS"
+ LTHREAD_LIBS=""
+ fi
+
+fi
+
+
+if test $ol_link_threads = no ; then
+ if test $ol_with_threads = yes ; then
+ { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
+ fi
+
+ if test $ol_with_threads = auto ; then
+ echo "configure: warning: no suitable thread support, disabling threads" 1>&2
+ ol_with_threads=no
+ fi
+
+ cat >> confdefs.h <<\EOF
+#define NO_THREADS 1
+EOF
+
+ LTHREAD_LIBS=""
+fi
+
+ol_link_ldbm=no
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
+ echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
+echo "configure:6487: checking for DB2 library" >&5
+if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ol_LIBS="$LIBS"
+ echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
+echo "configure:6493: checking for db_open in -ldb" >&5
+ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lgdbm $LIBS"
+LIBS="-ldb $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6686 "configure"
+#line 6501 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char gdbm_open();
+char db_open();
int main() {
-gdbm_open()
+db_open()
; return 0; }
EOF
-if { (eval echo configure:6697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ol_cv_lib_gdbm=-lgdbm
+ ol_cv_lib_db2=-ldb
else
echo "$ac_t""no" 1>&6
-ol_cv_lib_gdbm=no
-fi
-
-
+ol_cv_lib_db2=no
fi
LIBS="$ol_LIBS"
fi
-echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
-
+echo "$ac_t""$ol_cv_lib_db2" 1>&6
- for ac_hdr in gdbm.h
+for ac_hdr in db.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6732: checking for $ac_hdr" >&5
+echo "configure:6543: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6737 "configure"
+#line 6548 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
- echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:6769: checking for db" >&5
-if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
+if test $ac_cv_header_db_h = yes ; then
+ echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
+echo "configure:6581: checking if db.h is DB2" >&5
+if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
- ol_cv_gdbm=no
+ cat > conftest.$ac_ext <<EOF
+#line 6587 "configure"
+#include "confdefs.h"
+
+# include <db.h>
+ /* this check could be improved */
+# ifdef DB_VERSION_MAJOR
+# if DB_VERSION_MAJOR == 2
+ __db_version_2
+# endif
+# endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "__db_version_2" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ol_cv_header_db2=yes
+else
+ rm -rf conftest*
+ ol_cv_header_db2=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ol_cv_header_db2" 1>&6
+else
+ ol_cv_header_db2=no
+fi
+
+
+
+ echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
+echo "configure:6619: checking for Berkeley DB2" >&5
+if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
+ ol_cv_berkeley_db2=no
else
- ol_cv_gdbm=yes
+ ol_cv_berkeley_db2=yes
fi
fi
-echo "$ac_t""$ol_cv_gdbm" 1>&6
- if test $ol_cv_gdbm = yes ; then
+echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
+ if test $ol_cv_berkeley_db2 = yes ; then
cat >> confdefs.h <<\EOF
-#define HAVE_GDBM 1
+#define HAVE_BERKELEY_DB2 1
EOF
fi
- if test $ol_cv_gdbm = yes ; then
- ol_link_ldbm=gdbm
- ol_with_ldbm_api=gdbm
+ if test $ol_cv_berkeley_db2 = yes ; then
+ ol_link_ldbm=db2
+ ol_with_ldbm_api=db2
- if test $ol_cv_lib_gdbm != yes ; then
- LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
+ if test $ol_with_ldbm_type = hash ; then
+ cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBHASH 1
+EOF
+
+ else
+ cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBBTREE 1
+EOF
+
+ fi
+
+ if test $ol_cv_lib_db2 != yes ; then
+ LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
fi
fi
fi
-if test $ol_with_ldbm_api = auto ; then
- echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
-elif test $ol_with_ldbm_api = ndbm ; then
- echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
-echo "configure:6805: checking for NDBM library" >&5
-if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
+ol_link_bdb2=no
+if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
+ ol_link_bdb2=yes
+fi
+
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
+ echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
+echo "configure:6670: checking for Berkeley DB library" >&5
+if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ol_LIBS="$LIBS"
- echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:6811: checking for dbm_open" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
+ echo $ac_n "checking for dbopen""... $ac_c" 1>&6
+echo "configure:6676: checking for dbopen" >&5
+if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6816 "configure"
+#line 6681 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dbm_open(); below. */
+ which can conflict with char dbopen(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char dbm_open();
+char dbopen();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_dbm_open) || defined (__stub___dbm_open)
+#if defined (__stub_dbopen) || defined (__stub___dbopen)
choke me
#else
-dbm_open();
+dbopen();
#endif
; return 0; }
EOF
-if { (eval echo configure:6839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_dbm_open=yes"
+ eval "ac_cv_func_dbopen=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_dbm_open=no"
+ eval "ac_cv_func_dbopen=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ol_cv_lib_ndbm=yes
-else
- echo "$ac_t""no" 1>&6
-
- echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:6858: checking for dbm_open in -lndbm" >&5
-ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lndbm $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6866 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dbm_open();
-
-int main() {
-dbm_open()
-; return 0; }
-EOF
-if { (eval echo configure:6877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ol_cv_lib_ndbm=-lndbm
+ ol_cv_lib_db=yes
else
echo "$ac_t""no" 1>&6
- echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:6897: checking for dbm_open in -ldbm" >&5
-ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
+echo "configure:6723: checking for dbopen in -ldb" >&5
+ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-ldbm $LIBS"
+LIBS="-ldb $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6905 "configure"
+#line 6731 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char dbm_open();
+char dbopen();
int main() {
-dbm_open()
+dbopen()
; return 0; }
EOF
-if { (eval echo configure:6916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ol_cv_lib_ndbm=-ldbm
+ ol_cv_lib_db=-ldb
else
echo "$ac_t""no" 1>&6
-ol_cv_lib_ndbm=no
-fi
-
+ol_cv_lib_db=no
fi
fi
-echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
+echo "$ac_t""$ol_cv_lib_db" 1>&6
- for ac_hdr in ndbm.h
+for ac_hdr in db_185.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6953: checking for $ac_hdr" >&5
+echo "configure:6777: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6958 "configure"
+#line 6782 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
- echo $ac_n "checking for db""... $ac_c" 1>&6
-echo "configure:6990: checking for db" >&5
-if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if test "$ol_cv_header_db2" = yes ; then
+
+ ol_cv_header_db=$ac_cv_header_db_185_h
else
-
- if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
- ol_cv_ndbm=no
+ ol_cv_header_db=$ac_cv_header_db_h
+fi
+
+
+
+ echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
+echo "configure:6823: checking for Berkeley DB" >&5
+if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
+ ol_cv_berkeley_db=no
else
- ol_cv_ndbm=yes
+ ol_cv_berkeley_db=yes
fi
fi
-echo "$ac_t""$ol_cv_ndbm" 1>&6
- if test $ol_cv_ndbm = yes ; then
+echo "$ac_t""$ol_cv_berkeley_db" 1>&6
+ if test $ol_cv_berkeley_db = yes ; then
cat >> confdefs.h <<\EOF
-#define HAVE_NDBM 1
+#define HAVE_BERKELEY_DB 1
EOF
fi
- if test $ol_cv_ndbm = yes ; then
- ol_link_ldbm=ndbm
- ol_with_ldbm_api=ndbm
+ if test $ol_cv_berkeley_db = yes ; then
+ ol_link_ldbm=db
+ ol_with_ldbm_api=db
- if test $ol_cv_lib_ndbm != yes ; then
- LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
+ if test $ol_with_ldbm_type = hash ; then
+ cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBHASH 1
+EOF
+
+ else
+ cat >> confdefs.h <<\EOF
+#define LDBM_USE_DBBTREE 1
+EOF
+
+ fi
+
+ if test $ol_cv_lib_db != yes ; then
+ LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
fi
fi
fi
-if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
- echo "configure: warning: could not find suitable LDBM backend" 1>&2
- if test $ol_enable_ldbm = yes ; then
- { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
- fi
+if test $ol_with_ldbm_api = manual ; then
+ ol_link_ldbm=yes
- echo "configure: warning: disabling LDBM" 1>&2
- ol_enable_ldbm=no
-fi
+ echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
-if test $ol_enable_wrappers != no ; then
- for ac_hdr in tcpd.h
+ for ac_hdr in db.h db_185.h gdbm.h ndbm.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7037: checking for $ac_hdr" >&5
+echo "configure:6876: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7042 "configure"
+#line 6881 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
-
- if test $ac_cv_header_tcpd_h != yes ; then
- have_wrappers=no
- else
- echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
-echo "configure:7078: checking for main in -lwrap" >&5
-ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lwrap $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7086 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:7093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- have_wrappers=yes
-else
- echo "$ac_t""no" 1>&6
-have_wrappers=no
fi
- fi
-
- if test $have_wrappers = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_TCPD 1
-EOF
-
- SLAPD_LIBS="$SLAPD_LIBS -lwrap"
- else
- echo "configure: warning: could not find -lwrap" 1>&2
- if test $ol_enable_wrappers = yes ; then
- { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
- fi
-
- echo "configure: warning: disabling wrappers support" 1>&2
- ol_enable_wrappers=no
- fi
+if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
+ echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
+ ol_with_ldbm_api=none
fi
-if test $ol_enable_syslog != no ; then
- echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:7135: checking for openlog" >&5
-if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
+ echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
+echo "configure:6921: checking for GDBM library" >&5
+if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ol_LIBS="$LIBS"
+ echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
+echo "configure:6927: checking for gdbm_open" >&5
+if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7140 "configure"
+#line 6932 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char openlog(); below. */
+ which can conflict with char gdbm_open(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char openlog();
+char gdbm_open();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_openlog) || defined (__stub___openlog)
+#if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
choke me
#else
-openlog();
+gdbm_open();
#endif
; return 0; }
EOF
-if { (eval echo configure:7163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_openlog=yes"
+ eval "ac_cv_func_gdbm_open=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_openlog=no"
+ eval "ac_cv_func_gdbm_open=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
- { echo "configure: error: could not find syslog" 1>&2; exit 1; }
- fi
- ol_enable_syslog=$ac_cv_func_openlog
-fi
-
-if test $ol_enable_dmalloc != no ; then
- for ac_hdr in dmalloc.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7193: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 7198 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+ ol_cv_lib_gdbm=yes
else
echo "$ac_t""no" 1>&6
-fi
-done
- echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
-echo "configure:7230: checking for dmalloc_shutdown in -ldmalloc" >&5
-ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
+echo "configure:6974: checking for gdbm_open in -lgdbm" >&5
+ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-ldmalloc $LIBS"
+LIBS="-lgdbm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7238 "configure"
+#line 6982 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char dmalloc_shutdown();
+char gdbm_open();
int main() {
-dmalloc_shutdown()
+gdbm_open()
; return 0; }
EOF
-if { (eval echo configure:7249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-ldmalloc $LIBS"
-
+ ol_cv_lib_gdbm=-lgdbm
else
echo "$ac_t""no" 1>&6
+ol_cv_lib_gdbm=no
fi
+
fi
-if test $ol_enable_tcl != no ; then
- for ac_hdr in tcl.h
+ LIBS="$ol_LIBS"
+
+fi
+
+echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
+
+
+ for ac_hdr in gdbm.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7283: checking for $ac_hdr" >&5
+echo "configure:7028: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7288 "configure"
+#line 7033 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
-
- if test $ac_cv_header_tcl_h != yes ; then
- have_tcl=no
- else
- echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
-echo "configure:7324: checking for main in -ltcl" >&5
-ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "checking for db""... $ac_c" 1>&6
+echo "configure:7065: checking for db" >&5
+if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-ltcl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7332 "configure"
-#include "confdefs.h"
+
+ if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
+ ol_cv_gdbm=no
+ else
+ ol_cv_gdbm=yes
+ fi
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:7339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
-else
- echo "$ac_t""no" 1>&6
-have_tcl=no
-fi
+echo "$ac_t""$ol_cv_gdbm" 1>&6
+ if test $ol_cv_gdbm = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GDBM 1
+EOF
+ fi
- if test $have_tcl != yes; then
- echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
-echo "configure:7363: checking for main in -ltcl7.6" >&5
-ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
+
+ if test $ol_cv_gdbm = yes ; then
+ ol_link_ldbm=gdbm
+ ol_with_ldbm_api=gdbm
+
+ if test $ol_cv_lib_gdbm != yes ; then
+ LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
+ fi
+ fi
+fi
+
+if test $ol_with_ldbm_api = auto ; then
+ echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
+elif test $ol_with_ldbm_api = ndbm ; then
+ echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
+echo "configure:7101: checking for NDBM library" >&5
+if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ol_LIBS="$LIBS"
+ echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
+echo "configure:7107: checking for dbm_open" >&5
+if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7112 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dbm_open(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbm_open();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dbm_open) || defined (__stub___dbm_open)
+choke me
+#else
+dbm_open();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:7135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_dbm_open=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_dbm_open=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ol_cv_lib_ndbm=yes
+else
+ echo "$ac_t""no" 1>&6
+
+ echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
+echo "configure:7154: checking for dbm_open in -lndbm" >&5
+ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-ltcl7.6 $LIBS"
+LIBS="-lndbm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7371 "configure"
+#line 7162 "configure"
#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbm_open();
int main() {
-main()
+dbm_open()
; return 0; }
EOF
-if { (eval echo configure:7378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
+ ol_cv_lib_ndbm=-lndbm
else
echo "$ac_t""no" 1>&6
-have_tcl=no
-fi
-
- fi
- if test $have_tcl != yes; then
- echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
-echo "configure:7403: checking for main in -ltcl8.0" >&5
-ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
+echo "configure:7193: checking for dbm_open in -ldbm" >&5
+ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-ltcl8.0 $LIBS"
+LIBS="-ldbm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7411 "configure"
+#line 7201 "configure"
#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dbm_open();
int main() {
-main()
+dbm_open()
; return 0; }
EOF
-if { (eval echo configure:7418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
+ ol_cv_lib_ndbm=-ldbm
else
echo "$ac_t""no" 1>&6
-have_tcl=no
+ol_cv_lib_ndbm=no
+fi
+
fi
- fi
- fi
+
+fi
- if test $have_tcl != yes ; then
- echo "configure: warning: could not find -ltcl" 1>&2
- if test $ol_enable_tcl = yes ; then
- { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
- fi
+ LIBS="$ol_LIBS"
- ol_enable_tcl=no
- fi
fi
-# ud needs termcap (should insert check here)
-ol_link_termcap=no
-for ac_hdr in termcap.h ncurses.h
+echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
+
+
+ for ac_hdr in ndbm.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7458: checking for $ac_hdr" >&5
+echo "configure:7249: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7463 "configure"
+#line 7254 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
+ echo $ac_n "checking for db""... $ac_c" 1>&6
+echo "configure:7286: checking for db" >&5
+if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
+ ol_cv_ndbm=no
+ else
+ ol_cv_ndbm=yes
+ fi
+
+fi
-if test $ol_link_termcap = no ; then
- echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
-echo "configure:7497: checking for tputs in -ltermcap" >&5
-ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo "$ac_t""$ol_cv_ndbm" 1>&6
+ if test $ol_cv_ndbm = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_NDBM 1
+EOF
+
+ fi
+
+
+ if test $ol_cv_ndbm = yes ; then
+ ol_link_ldbm=ndbm
+ ol_with_ldbm_api=ndbm
+
+ if test $ol_cv_lib_ndbm != yes ; then
+ LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
+ fi
+ fi
+fi
+
+if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
+ echo "configure: warning: could not find suitable LDBM backend" 1>&2
+ if test $ol_enable_ldbm = yes ; then
+ { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
+ fi
+
+ echo "configure: warning: disabling LDBM" 1>&2
+ ol_enable_ldbm=no
+fi
+
+if test $ol_enable_wrappers != no ; then
+ for ac_hdr in tcpd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:7333: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-ltermcap $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 7505 "configure"
+ cat > conftest.$ac_ext <<EOF
+#line 7338 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char tputs();
-
-int main() {
-tputs()
-; return 0; }
+#include <$ac_hdr>
EOF
-if { (eval echo configure:7516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
+ eval "ac_cv_header_$ac_safe=yes"
else
+ echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
-LIBS="$ac_save_LIBS"
-
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_termcap=yes
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
else
echo "$ac_t""no" 1>&6
-have_termcap=no
fi
+done
- if test $have_termcap = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_TERMCAP 1
-EOF
-
- ol_link_termcap=yes
- TERMCAP_LIBS=-ltermcap
- fi
-fi
-if test $ol_link_termcap = no ; then
- echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:7549: checking for initscr in -lncurses" >&5
-ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
+ if test $ac_cv_header_tcpd_h != yes ; then
+ have_wrappers=no
+ else
+ echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
+echo "configure:7374: checking for main in -lwrap" >&5
+ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lncurses $LIBS"
+LIBS="-lwrap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7557 "configure"
+#line 7382 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char initscr();
int main() {
-initscr()
+main()
; return 0; }
EOF
-if { (eval echo configure:7568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_ncurses=yes
+ have_wrappers=yes
else
echo "$ac_t""no" 1>&6
-have_ncurses=no
+have_wrappers=no
fi
- if test $have_ncurses = yes ; then
+ fi
+
+ if test $have_wrappers = yes ; then
cat >> confdefs.h <<\EOF
-#define HAVE_NCURSES 1
+#define HAVE_TCPD 1
EOF
- ol_link_termcap=yes
- TERMCAP_LIBS=-lncurses
+ SLAPD_LIBS="$SLAPD_LIBS -lwrap"
+ else
+ echo "configure: warning: could not find -lwrap" 1>&2
+ if test $ol_enable_wrappers = yes ; then
+ { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
+ fi
+
+ echo "configure: warning: disabling wrappers support" 1>&2
+ ol_enable_wrappers=no
fi
fi
-if test $ol_link_termcap = no ; then
- cat >> confdefs.h <<\EOF
-#define NO_TERMCAP 1
-EOF
-
- TERMCAP_LIBS=
-fi
-
-# FreeBSD (and others) have crypt(3) in -lcrypt
-if test $ol_enable_crypt != no ; then
- echo $ac_n "checking for crypt""... $ac_c" 1>&6
-echo "configure:7610: checking for crypt" >&5
-if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
+if test $ol_enable_syslog != no ; then
+ echo $ac_n "checking for openlog""... $ac_c" 1>&6
+echo "configure:7431: checking for openlog" >&5
+if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7615 "configure"
+#line 7436 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char crypt(); below. */
+ which can conflict with char openlog(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char crypt();
+char openlog();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_crypt) || defined (__stub___crypt)
+#if defined (__stub_openlog) || defined (__stub___openlog)
choke me
#else
-crypt();
+openlog();
#endif
; return 0; }
EOF
-if { (eval echo configure:7638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_crypt=yes"
+ eval "ac_cv_func_openlog=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_crypt=no"
+ eval "ac_cv_func_openlog=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_crypt=yes
+ :
else
echo "$ac_t""no" 1>&6
+fi
- echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:7657: checking for crypt in -lcrypt" >&5
-ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
+ if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
+ { echo "configure: error: could not find syslog" 1>&2; exit 1; }
+ fi
+ ol_enable_syslog=$ac_cv_func_openlog
+fi
+
+if test $ol_enable_dmalloc != no ; then
+ for ac_hdr in dmalloc.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:7489: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7494 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
+echo "configure:7526: checking for dmalloc_shutdown in -ldmalloc" >&5
+ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lcrypt $LIBS"
+LIBS="-ldmalloc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7665 "configure"
+#line 7534 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char crypt();
+char dmalloc_shutdown();
int main() {
-crypt()
+dmalloc_shutdown()
; return 0; }
EOF
-if { (eval echo configure:7676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
- have_crypt=yes
+ ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-ldmalloc $LIBS"
+
else
echo "$ac_t""no" 1>&6
-have_crypt=no
-fi
-
fi
-
- if test $have_crypt = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_CRYPT 1
-EOF
-
- else
- echo "configure: warning: could not find crypt" 1>&2
- if test $ol_enable_crypt = yes ; then
- { echo "configure: error: could not find crypt" 1>&2; exit 1; }
- fi
-
- echo "configure: warning: disabling crypt support" 1>&2
- ol_enable_crypt=no
- fi
fi
-# FreeBSD (and others) have setproctitle(3) in -lutil
-if test $ol_enable_proctitle != no ; then
- echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
-echo "configure:7720: checking for setproctitle" >&5
-if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
+if test $ol_enable_tcl != no ; then
+ for ac_hdr in tcl.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:7579: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7725 "configure"
+#line 7584 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char setproctitle(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char setproctitle();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_setproctitle) || defined (__stub___setproctitle)
-choke me
-#else
-setproctitle();
-#endif
-
-; return 0; }
+#include <$ac_hdr>
EOF
-if { (eval echo configure:7748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
rm -rf conftest*
- eval "ac_cv_func_setproctitle=yes"
+ eval "ac_cv_header_$ac_safe=yes"
else
+ echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_setproctitle=no"
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
-
-if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_setproctitle=yes
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
else
echo "$ac_t""no" 1>&6
+fi
+done
- echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
-echo "configure:7767: checking for setproctitle in -lutil" >&5
-ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
+
+ if test $ac_cv_header_tcl_h != yes ; then
+ have_tcl=no
+ else
+ echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
+echo "configure:7620: checking for main in -ltcl" >&5
+ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lutil $LIBS"
+LIBS="-ltcl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7775 "configure"
+#line 7628 "configure"
#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char setproctitle();
int main() {
-setproctitle()
+main()
; return 0; }
EOF
-if { (eval echo configure:7786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- have_setproctitle=yes
- LUTIL_LIBS="$LUTIL_LIBS -lutil"
+ have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
else
echo "$ac_t""no" 1>&6
-have_setproctitle=no
- LIBOBJS="$LIBOBJS setproctitle.o"
-fi
-
+have_tcl=no
fi
- if test $have_setproctitle = yes ; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SETPROCTITLE 1
-EOF
-
- fi
-fi
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:7821: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ if test $have_tcl != yes; then
+ echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
+echo "configure:7659: checking for main in -ltcl7.6" >&5
+ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 7826 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-ltcl7.6 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7667 "configure"
#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
+
+int main() {
+main()
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+if { (eval echo configure:7674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ac_cv_header_stdc=yes
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ac_cv_header_stdc=no
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
+LIBS="$ac_save_LIBS"
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 7851 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
else
- rm -rf conftest*
- ac_cv_header_stdc=no
+ echo "$ac_t""no" 1>&6
+have_tcl=no
fi
-rm -f conftest*
-fi
+ fi
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ if test $have_tcl != yes; then
+ echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
+echo "configure:7699: checking for main in -ltcl8.0" >&5
+ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ltcl8.0 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7869 "configure"
+#line 7707 "configure"
#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 7890 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+int main() {
+main()
+; return 0; }
EOF
-if { (eval echo configure:7901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
+if { (eval echo configure:7714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
+else
+ echo "$ac_t""no" 1>&6
+have_tcl=no
fi
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
+ fi
+ fi
+ if test $have_tcl != yes ; then
+ echo "configure: warning: could not find -ltcl" 1>&2
+ if test $ol_enable_tcl = yes ; then
+ { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
+ fi
-if test $ac_cv_header_stdc != yes; then
- echo "configure: warning: could not Standard C compliant headers" 1>&2
+ ol_enable_tcl=no
+ fi
fi
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+# ud needs termcap (should insert check here)
+ol_link_termcap=no
+for ac_hdr in termcap.h ncurses.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:7934: checking for $ac_hdr that defines DIR" >&5
-if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:7754: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7939 "configure"
+#line 7759 "configure"
#include "confdefs.h"
-#include <sys/types.h>
#include <$ac_hdr>
-int main() {
-DIR *dirp = 0;
-; return 0; }
EOF
-if { (eval echo configure:7947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
rm -rf conftest*
- eval "ac_cv_header_dirent_$ac_safe=yes"
+ eval "ac_cv_header_$ac_safe=yes"
else
+ echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_dirent_$ac_safe=no"
+ eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
- ac_header_dirent=$ac_hdr; break
+
else
echo "$ac_t""no" 1>&6
fi
done
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
-echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:7972: checking for opendir in -ldir" >&5
-ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
+
+
+if test $ol_link_termcap = no ; then
+ echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
+echo "configure:7793: checking for tputs in -ltermcap" >&5
+ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-ldir $LIBS"
+LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7980 "configure"
+#line 7801 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char opendir();
+char tputs();
int main() {
-opendir()
+tputs()
; return 0; }
EOF
-if { (eval echo configure:7991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -ldir"
+ have_termcap=yes
else
echo "$ac_t""no" 1>&6
+have_termcap=no
fi
-else
-echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:8013: checking for opendir in -lx" >&5
-ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+ if test $have_termcap = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_TERMCAP 1
+EOF
+
+ ol_link_termcap=yes
+ TERMCAP_LIBS=-ltermcap
+ fi
+fi
+
+if test $ol_link_termcap = no ; then
+ echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
+echo "configure:7845: checking for initscr in -lncurses" >&5
+ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lx $LIBS"
+LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8021 "configure"
+#line 7853 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char opendir();
+char initscr();
int main() {
-opendir()
+initscr()
; return 0; }
EOF
-if { (eval echo configure:8032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lx"
+ have_ncurses=yes
else
echo "$ac_t""no" 1>&6
+have_ncurses=no
fi
+ if test $have_ncurses = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_NCURSES 1
+EOF
+
+ ol_link_termcap=yes
+ TERMCAP_LIBS=-lncurses
+ fi
fi
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:8055: checking for sys/wait.h that is POSIX.1 compatible" >&5
-if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
+if test $ol_link_termcap = no ; then
+ cat >> confdefs.h <<\EOF
+#define NO_TERMCAP 1
+EOF
+
+ TERMCAP_LIBS=
+fi
+
+# FreeBSD (and others) have crypt(3) in -lcrypt
+if test $ol_enable_crypt != no ; then
+ echo $ac_n "checking for crypt""... $ac_c" 1>&6
+echo "configure:7906: checking for crypt" >&5
+if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8060 "configure"
+#line 7911 "configure"
#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char crypt(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char crypt();
+
int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_crypt) || defined (__stub___crypt)
+choke me
+#else
+crypt();
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:8076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ac_cv_header_sys_wait_h=yes
+ eval "ac_cv_func_crypt=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ac_cv_header_sys_wait_h=no
+ eval "ac_cv_func_crypt=no"
fi
rm -f conftest*
fi
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
-if test $ac_cv_header_sys_wait_h = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SYS_WAIT_H 1
-EOF
-
-fi
+if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_crypt=yes
+else
+ echo "$ac_t""no" 1>&6
-echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
-echo "configure:8097: checking POSIX termios" >&5
-if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
+ echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
+echo "configure:7953: checking for crypt in -lcrypt" >&5
+ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 8102 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lcrypt $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7961 "configure"
#include "confdefs.h"
-#include <sys/types.h>
-#include <unistd.h>
-#include <termios.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char crypt();
+
int main() {
-/* SunOS 4.0.3 has termios.h but not the library calls. */
- tcgetattr(0, 0);
+crypt()
; return 0; }
EOF
-if { (eval echo configure:8112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- am_cv_sys_posix_termios=yes
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- am_cv_sys_posix_termios=no
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
-
-echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
-
+LIBS="$ac_save_LIBS"
- echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:8128: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
-if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
+ have_crypt=yes
else
- am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
+ echo "$ac_t""no" 1>&6
+have_crypt=no
+fi
- gwinsz_in_termios_h=no
- if test $am_cv_sys_posix_termios = yes; then
- cat > conftest.$ac_ext <<EOF
-#line 8137 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-# include <termios.h>
-# ifdef TIOCGWINSZ
- yes
-# endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- gwinsz_in_termios_h=yes
fi
-rm -f conftest*
+
+
+ if test $have_crypt = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_CRYPT 1
+EOF
+
+ else
+ echo "configure: warning: could not find crypt" 1>&2
+ if test $ol_enable_crypt = yes ; then
+ { echo "configure: error: could not find crypt" 1>&2; exit 1; }
+ fi
+
+ echo "configure: warning: disabling crypt support" 1>&2
+ ol_enable_crypt=no
+ fi
+fi
+
+# FreeBSD (and others) have setproctitle(3) in -lutil
+if test $ol_enable_proctitle != no ; then
+ echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
+echo "configure:8016: checking for setproctitle" >&5
+if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8021 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char setproctitle(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char setproctitle();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_setproctitle) || defined (__stub___setproctitle)
+choke me
+#else
+setproctitle();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:8044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_setproctitle=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_setproctitle=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_setproctitle=yes
+else
+ echo "$ac_t""no" 1>&6
+
+ echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
+echo "configure:8063: checking for setproctitle in -lutil" >&5
+ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lutil $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8071 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char setproctitle();
+
+int main() {
+setproctitle()
+; return 0; }
+EOF
+if { (eval echo configure:8082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_setproctitle=yes
+ LUTIL_LIBS="$LUTIL_LIBS -lutil"
+else
+ echo "$ac_t""no" 1>&6
+have_setproctitle=no
+ LIBOBJS="$LIBOBJS setproctitle.o"
+fi
+
+fi
+
+
+ if test $have_setproctitle = yes ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_SETPROCTITLE 1
+EOF
+
+ fi
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:8117: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8122 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 8147 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 8165 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8186 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:8197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+
+if test $ac_cv_header_stdc != yes; then
+ echo "configure: warning: could not Standard C compliant headers" 1>&2
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:8230: checking for $ac_hdr that defines DIR" >&5
+if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8235 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:8243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ ac_header_dirent=$ac_hdr; break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:8268: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldir $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8276 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:8287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -ldir"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:8309: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lx $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8317 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:8328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lx"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
+echo "configure:8351: checking for sys/wait.h that is POSIX.1 compatible" >&5
+if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8356 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+int main() {
+int s;
+wait (&s);
+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+; return 0; }
+EOF
+if { (eval echo configure:8372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_header_sys_wait_h=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_sys_wait_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+if test $ac_cv_header_sys_wait_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_SYS_WAIT_H 1
+EOF
+
+fi
+
+echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
+echo "configure:8393: checking POSIX termios" >&5
+if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8398 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <unistd.h>
+#include <termios.h>
+int main() {
+/* SunOS 4.0.3 has termios.h but not the library calls. */
+ tcgetattr(0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:8408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ am_cv_sys_posix_termios=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_sys_posix_termios=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
+
+
+ echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
+echo "configure:8424: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
+if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
+
+ gwinsz_in_termios_h=no
+ if test $am_cv_sys_posix_termios = yes; then
+ cat > conftest.$ac_ext <<EOF
+#line 8433 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+# include <termios.h>
+# ifdef TIOCGWINSZ
+ yes
+# endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ gwinsz_in_termios_h=yes
+fi
+rm -f conftest*
fi
if test $gwinsz_in_termios_h = no; then
cat > conftest.$ac_ext <<EOF
-#line 8157 "configure"
+#line 8453 "configure"
#include "confdefs.h"
#include <sys/types.h>
# include <sys/ioctl.h>
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8231: checking for $ac_hdr" >&5
+echo "configure:8527: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8236 "configure"
+#line 8532 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:8269: checking for uid_t in sys/types.h" >&5
+echo "configure:8565: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8274 "configure"
+#line 8570 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:8303: checking type of array argument to getgroups" >&5
+echo "configure:8599: checking type of array argument to getgroups" >&5
if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 8311 "configure"
+#line 8607 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
}
EOF
-if { (eval echo configure:8336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_type_getgroups=gid_t
else
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 8350 "configure"
+#line 8646 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
EOF
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:8373: checking for mode_t" >&5
+echo "configure:8669: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8378 "configure"
+#line 8674 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:8406: checking for off_t" >&5
+echo "configure:8702: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8411 "configure"
+#line 8707 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:8439: checking for pid_t" >&5
+echo "configure:8735: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8444 "configure"
+#line 8740 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
-echo "configure:8472: checking for ptrdiff_t" >&5
+echo "configure:8768: checking for ptrdiff_t" >&5
if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8477 "configure"
+#line 8773 "configure"
#include "confdefs.h"
#include <stddef.h>
int main() {
ptrdiff_t p
; return 0; }
EOF
-if { (eval echo configure:8484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_type_ptrdiff_t=yes
else
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:8505: checking return type of signal handlers" >&5
+echo "configure:8801: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8510 "configure"
+#line 8806 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:8527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
-echo "configure:8546: checking for sig_atomic_t" >&5
+echo "configure:8842: checking for sig_atomic_t" >&5
if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8551 "configure"
+#line 8847 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
sig_atomic_t atomic;
; return 0; }
EOF
-if { (eval echo configure:8558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_type_sig_atomic_t=yes
else
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:8579: checking for size_t" >&5
+echo "configure:8875: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8584 "configure"
+#line 8880 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:8612: checking for st_blksize in struct stat" >&5
+echo "configure:8908: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8617 "configure"
+#line 8913 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:8625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:8646: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:8942: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8651 "configure"
+#line 8947 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:8660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:8681: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:8977: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8686 "configure"
+#line 8982 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:8694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
-echo "configure:8717: checking if toupper() requires islower()" >&5
+echo "configure:9013: checking if toupper() requires islower()" >&5
if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ol_cv_c_upper_lower=safe
else
cat > conftest.$ac_ext <<EOF
-#line 8726 "configure"
+#line 9022 "configure"
#include "confdefs.h"
#include <ctype.h>
exit(1);
}
EOF
-if { (eval echo configure:8738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ol_cv_c_upper_lower=no
else
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:8761: checking for working const" >&5
+echo "configure:9057: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8766 "configure"
+#line 9062 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:8815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
-echo "configure:8836: checking if compiler understands volatile" >&5
+echo "configure:9132: checking if compiler understands volatile" >&5
if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8841 "configure"
+#line 9137 "configure"
#include "confdefs.h"
int x, y, z;
int main() {
*b = 0;
; return 0; }
EOF
-if { (eval echo configure:8850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_c_volatile=yes
else
else
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:8880: checking whether byte ordering is bigendian" >&5
+echo "configure:9176: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 8887 "configure"
+#line 9183 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
#endif
; return 0; }
EOF
-if { (eval echo configure:8898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 8902 "configure"
+#line 9198 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
#endif
; return 0; }
EOF
-if { (eval echo configure:8913: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 8933 "configure"
+#line 9229 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:8946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
fi
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:8970: checking size of short" >&5
+echo "configure:9266: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 8978 "configure"
+#line 9274 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:8989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_short=`cat conftestval`
else
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:9009: checking size of int" >&5
+echo "configure:9305: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 9017 "configure"
+#line 9313 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:9028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:9048: checking size of long" >&5
+echo "configure:9344: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 9056 "configure"
+#line 9352 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:9067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
ac_cv_sizeof_long=0
fi
rm -fr conftest*
-fi
-
-fi
-echo "$ac_t""$ac_cv_sizeof_long" 1>&6
-cat >> confdefs.h <<EOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-EOF
-
-
-fi
-
-echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:9089: checking for 8-bit clean memcmp" >&5
-if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_memcmp_clean=no
-else
- cat > conftest.$ac_ext <<EOF
-#line 9097 "configure"
-#include "confdefs.h"
-
-main()
-{
- char c0 = 0x40, c1 = 0x80, c2 = 0x81;
- exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
-}
-
-EOF
-if { (eval echo configure:9107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_memcmp_clean=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_memcmp_clean=no
-fi
-rm -fr conftest*
-fi
-
-fi
-
-echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
-
-echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:9125: checking for strftime" >&5
-if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 9130 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char strftime(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char strftime();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_strftime) || defined (__stub___strftime)
-choke me
-#else
-strftime();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:9153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_strftime=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_strftime=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_STRFTIME 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-# strftime is in -lintl on SCO UNIX.
-echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:9175: checking for strftime in -lintl" >&5
-ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lintl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 9183 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char strftime();
-
-int main() {
-strftime()
-; return 0; }
-EOF
-if { (eval echo configure:9194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_STRFTIME 1
-EOF
-
-LIBS="-lintl $LIBS"
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:9221: checking for vprintf" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 9226 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char vprintf(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char vprintf();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_vprintf) || defined (__stub___vprintf)
-choke me
-#else
-vprintf();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:9249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_vprintf=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_vprintf=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
+fi
+
+fi
+echo "$ac_t""$ac_cv_sizeof_long" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
EOF
-else
- echo "$ac_t""no" 1>&6
+
fi
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:9273: checking for _doprnt" >&5
-if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
+echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
+echo "configure:9385: checking for 8-bit clean memcmp" >&5
+if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 9278 "configure"
+#line 9393 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char _doprnt(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char _doprnt();
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub__doprnt) || defined (__stub____doprnt)
-choke me
-#else
-_doprnt();
-#endif
+main()
+{
+ char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+ exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+}
-; return 0; }
EOF
-if { (eval echo configure:9301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func__doprnt=yes"
+if { (eval echo configure:9403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_memcmp_clean=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func__doprnt=no"
-fi
-rm -f conftest*
+ rm -fr conftest*
+ ac_cv_func_memcmp_clean=no
fi
-
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_DOPRNT 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+rm -fr conftest*
fi
fi
+echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
-if test $ac_cv_func_vprintf = yes ; then
- for ac_func in vsnprintf vsprintf
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9330: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking for strftime""... $ac_c" 1>&6
+echo "configure:9421: checking for strftime" >&5
+if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9335 "configure"
+#line 9426 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
+ which can conflict with char strftime(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char strftime();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub_strftime) || defined (__stub___strftime)
choke me
#else
-$ac_func();
+strftime();
#endif
; return 0; }
EOF
-if { (eval echo configure:9358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_func_strftime=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_func_strftime=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRFTIME 1
EOF
-
+
else
echo "$ac_t""no" 1>&6
-fi
-done
-
-fi
-
-for ac_func in \
- bcopy \
- flock \
- getdtablesize \
- gethostname \
- getpwuid \
- gettimeofday \
- lockf \
- memcpy \
- memmove \
- mkstemp \
- select \
- setpwfile \
- setsid \
- signal \
- sigset \
- snprintf \
- socket \
- strdup \
- strerror \
- strpbrk \
- strrchr \
- strsep \
- strstr \
- strtol \
- strtoul \
- strspn \
- sysconf \
- waitpid \
-
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9416: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+# strftime is in -lintl on SCO UNIX.
+echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
+echo "configure:9471: checking for strftime in -lintl" >&5
+ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 9421 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lintl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 9479 "configure"
#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char strftime();
int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
+strftime()
; return 0; }
EOF
-if { (eval echo configure:9444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRFTIME 1
EOF
-
+
+LIBS="-lintl $LIBS"
else
echo "$ac_t""no" 1>&6
fi
-done
+fi
-# these functions are required to build a thread_safe -lldap
-for ac_func in \
- ctime_r \
- gethostbyaddr_r \
- gethostbyname_r \
-
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9477: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+echo $ac_n "checking for vprintf""... $ac_c" 1>&6
+echo "configure:9517: checking for vprintf" >&5
+if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9482 "configure"
+#line 9522 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
+ which can conflict with char vprintf(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char $ac_func();
+char vprintf();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub_vprintf) || defined (__stub___vprintf)
choke me
#else
-$ac_func();
+vprintf();
#endif
; return 0; }
EOF
-if { (eval echo configure:9505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+ eval "ac_cv_func_vprintf=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ eval "ac_cv_func_vprintf=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+ cat >> confdefs.h <<\EOF
+#define HAVE_VPRINTF 1
EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-if test "$ac_cv_func_ctime_r" = yes ; then
- echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
-echo "configure:9532: checking number of arguments of ctime_r" >&5
-if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 9537 "configure"
-#include "confdefs.h"
-#include <time.h>
-int main() {
-time_t ti; char *buffer; ctime_r(&ti,buffer,32);
-; return 0; }
-EOF
-if { (eval echo configure:9544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ol_cv_func_ctime_r_nargs=3
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ol_cv_func_ctime_r_nargs=0
-fi
-rm -f conftest*
- if test $ol_cv_func_ctime_r_nargs = 0 ; then
- cat > conftest.$ac_ext <<EOF
-#line 9556 "configure"
-#include "confdefs.h"
-#include <time.h>
-int main() {
-time_t ti; char *buffer;
- ctime_r(&ti,buffer);
-; return 0; }
-EOF
-if { (eval echo configure:9564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ol_cv_func_ctime_r_nargs=2
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ol_cv_func_ctime_r_nargs=0
-fi
-rm -f conftest*
- fi
-
+ echo "$ac_t""no" 1>&6
fi
-echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
- if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
- cat >> confdefs.h <<EOF
-#define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
-EOF
-
- fi
-
- echo $ac_n "checking return type of ctime_r""... $ac_c" 1>&6
-echo "configure:9587: checking return type of ctime_r" >&5
-if eval "test \"`echo '$''{'ol_cv_func_ctime_r_type'+set}'`\" = set"; then
+if test "$ac_cv_func_vprintf" != yes; then
+echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
+echo "configure:9569: checking for _doprnt" >&5
+if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9592 "configure"
+#line 9574 "configure"
#include "confdefs.h"
-#include <time.h>
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char _doprnt();
+
int main() {
-int ctime_r();
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub__doprnt) || defined (__stub____doprnt)
+choke me
+#else
+_doprnt();
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:9599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ol_cv_func_ctime_r_type="int"
+ eval "ac_cv_func__doprnt=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_func_ctime_r_type="charp"
+ eval "ac_cv_func__doprnt=no"
fi
rm -f conftest*
-
fi
-echo "$ac_t""$ol_cv_func_ctime_r_type" 1>&6
- if test $ol_cv_func_ctime_r_type = "int" ; then
- cat >> confdefs.h <<\EOF
-#define CTIME_R_RETURNS_INT 1
+if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_DOPRNT 1
EOF
- fi
-
else
- ol_cv_func_ctime_r_nargs=0
+ echo "$ac_t""no" 1>&6
fi
-if test "$ac_cv_func_gethostbyname_r" = yes ; then
- echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
-echo "configure:9626: checking number of arguments of gethostbyname_r" >&5
-if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
+fi
+
+
+if test $ac_cv_func_vprintf = yes ; then
+ for ac_func in vsnprintf vsprintf
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:9626: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 9631 "configure"
#include "confdefs.h"
-#include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netdb.h>
- #define BUFSIZE (sizeof(struct hostent)+10)
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
int main() {
-struct hostent hent; char buffer[BUFSIZE];
- int bufsize=BUFSIZE;int h_errno;
- (void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &h_errno);
- return 0;
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:9645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ol_cv_func_gethostbyname_r_nargs=5
+ eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_func_gethostbyname_r_nargs=0
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
- if test $ol_cv_func_gethostbyname_r_nargs = 0 ; then
- cat > conftest.$ac_ext <<EOF
-#line 9657 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netdb.h>
- #define BUFSIZE (sizeof(struct hostent)+10)
-int main() {
-struct hostent hent;struct hostent *rhent;
- char buffer[BUFSIZE];
- int bufsize=BUFSIZE;int h_errno;
- (void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &rhent, &h_errno);
- return 0;
-; return 0; }
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
EOF
-if { (eval echo configure:9672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ol_cv_func_gethostbyname_r_nargs=6
+
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ol_cv_func_gethostbyname_r_nargs=0
-fi
-rm -f conftest*
- fi
-
+ echo "$ac_t""no" 1>&6
fi
+done
-echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
- if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
- cat >> confdefs.h <<EOF
-#define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
-EOF
+fi
- fi
+for ac_func in \
+ bcopy \
+ flock \
+ getdtablesize \
+ gethostname \
+ getpwuid \
+ gettimeofday \
+ lockf \
+ memcpy \
+ memmove \
+ mkstemp \
+ select \
+ setpwfile \
+ setsid \
+ signal \
+ sigset \
+ snprintf \
+ socket \
+ strdup \
+ strerror \
+ strpbrk \
+ strrchr \
+ strsep \
+ strstr \
+ strtol \
+ strtoul \
+ strspn \
+ sysconf \
+ waitpid \
-else
- ol_cv_func_gethostbyname_r_nargs=0
-fi
-
-if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
- echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
-echo "configure:9700: checking number of arguments of gethostbyaddr_r" >&5
-if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:9712: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9705 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netdb.h>
- #define BUFSIZE (sizeof(struct hostent)+10)
-int main() {
-struct hostent hent; char buffer[BUFSIZE];
- struct in_addr add={0x70707070};
- size_t alen=sizeof(struct in_addr);
- int bufsize=BUFSIZE;int h_errno;
- (void)gethostbyaddr_r( (void *)&(add.s_addr),
- alen, AF_INET, &hent, buffer, bufsize, &h_errno);
- return 0;
-; return 0; }
-EOF
-if { (eval echo configure:9722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ol_cv_func_gethostbyaddr_r_nargs=7
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ol_cv_func_gethostbyaddr_r_nargs=0
-fi
-rm -f conftest*
- if test $ol_cv_func_gethostbyaddr_r_nargs = 0 ; then
- cat > conftest.$ac_ext <<EOF
-#line 9734 "configure"
+#line 9717 "configure"
#include "confdefs.h"
-#include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netdb.h>
- #define BUFSIZE (sizeof(struct hostent)+10)
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
int main() {
-struct hostent hent; struct hostent *rhent; char buffer[BUFSIZE];
- struct in_addr add={0x70707070};
- size_t alen=sizeof(struct in_addr);
- int bufsize=BUFSIZE;int h_errno;
- (void)gethostbyaddr_r( (void *)&(add.s_addr),
- alen, AF_INET, &hent, buffer, bufsize,
- &rhent, &h_errno);
- return 0;
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
; return 0; }
EOF
-if { (eval echo configure:9752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ol_cv_func_gethostbyaddr_r_nargs=8
+ eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ol_cv_func_gethostbyaddr_r_nargs=0
+ eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
- fi
-
fi
-echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
- if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
- cat >> confdefs.h <<EOF
-#define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
EOF
-
- fi
-
+
else
- ol_cv_func_gethostbyaddr_r_nargs=0
-fi
-
-if test "$ac_cv_func_ctime_r" = yes \
- -a "$ol_cv_func_ctime_r_nargs" -ge 2 -a "$ol_cv_func_ctime_r_nargs" -le 3 \
- -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
- -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
- -a "$ac_cv_func_gethostbyaddr_r" = yes \
- -a "$ac_cv_func_gethostbyname_r" = yes \
- ; then
-
- cat >> confdefs.h <<\EOF
-#define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
-EOF
-
+ echo "$ac_t""no" 1>&6
fi
+done
-if test $ol_link_threads != no ; then
- cat >> confdefs.h <<\EOF
-#define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
-EOF
-
-fi
for ac_func in getopt tempnam
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9802: checking for $ac_func" >&5
+echo "configure:9768: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9807 "configure"
+#line 9773 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:9830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# Check Configuration
echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
-echo "configure:9860: checking declaration of sys_errlist" >&5
+echo "configure:9826: checking declaration of sys_errlist" >&5
if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9866 "configure"
+#line 9832 "configure"
#include "confdefs.h"
#include <stdio.h>
char *c = (char *) *sys_errlist
; return 0; }
EOF
-if { (eval echo configure:9876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_dcl_sys_errlist=yes
else
EOF
echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
-echo "configure:9897: checking existence of sys_errlist" >&5
+echo "configure:9863: checking existence of sys_errlist" >&5
if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9903 "configure"
+#line 9869 "configure"
#include "confdefs.h"
#include <errno.h>
int main() {
char *c = (char *) *sys_errlist
; return 0; }
EOF
-if { (eval echo configure:9910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ol_cv_have_sys_errlist=yes
else