[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Configure error(POSIX thread)



On Mon, May 28, MidoriOkuno wrote:

> configure: error: could not link with POSIX Threads
> "
> If you have any information about this , please advice me.

Try the attached patch.

-- 
With best regards,

Carsten Hoeger

SuSE, The Linux Experts, http://www.suse.com

Key fingerprint = E3B6 7FDB 4800 0F22 DC09  EB2B 7988 B6A8 6691 C94A
--- build/openldap.m4
+++ build/openldap.m4	2001/05/22 08:06:03
@@ -646,7 +646,7 @@
 	pthread_kill_other_threads_np();
 #endif
 
-	exit( status );
+	exit(0);
 ])
 
 AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
@@ -672,6 +672,29 @@
 			[$2=yes], [$2=no],
 			[AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
 				[$2=yes], [$2=no])])
+
+		# restore the LIBS
+		LIBS="$ol_LIBS"
+	])
+
+	if test $$2 = yes ; then
+		ol_link_pthreads="$1"
+		ol_link_threads=posix
+	fi
+fi
+])
+dnl
+dnl --------------------------------------------------------------------
+AC_DEFUN([OL_PTHREAD_TRY_LINK], [# Pthread try link: $1 ($2)
+if test "$ol_link_threads" = no ; then
+	# try $1
+	AC_CACHE_CHECK([for pthread link with $1], [$2], [
+		# save the flags
+		ol_LIBS="$LIBS"
+		LIBS="$1 $LIBS"
+
+			AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
+				[$2=yes], [$2=no])
 
 		# restore the LIBS
 		LIBS="$ol_LIBS"
--- configure.in
+++ configure.in	2001/05/22 08:06:03
@@ -1152,7 +1152,7 @@
 		OL_PTHREAD_TRY([-lpthread -Wl,-woff,85],
 			[ol_cv_pthread_lib_lpthread_woff])
 
-		OL_PTHREAD_TRY([-lpthread],	[ol_cv_pthread_lpthread])
+		OL_PTHREAD_TRY_LINK([-lpthread],	[ol_cv_pthread_lpthread])
 		OL_PTHREAD_TRY([-lc_r],		[ol_cv_pthread_lc_r])
 
 		OL_PTHREAD_TRY([-threads],	[ol_cv_pthread_threads])

Attachment: pgpxwTv1Xy830.pgp
Description: PGP signature