On 8/23/05, Simon Morgan <[EMAIL PROTECTED]> wrote:
> FreeBSD 5.3 and above use -lpthread instead of -lkme. This patch checks for
> the existance of the pthread library and sets THREAD_LIBS accordingly.
Let's try again, shall we?
diff -ur speedtouch.orig/configure speedtouch/configure
--- speedtouch.orig/configure 2005-08-23 18:17:51.247036360 +0100
+++ speedtouch/configure 2005-08-23 18:18:53.210616464 +0100
@@ -4426,7 +4426,75 @@
;;
*-freebsd5*)
st_compile="modem_run pppoa2 pppoa3"
- THREAD_LIBS="-lkse"
+ echo "$as_me:$LINENO: checking for pthread_create in -lpthread"
>&5
+echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* 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 ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s
conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_pthread_pthread_create=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
+if test $ac_cv_lib_pthread_pthread_create = yes; then
+ THREAD_LIBS="-lpthread"
+else
+ THREAD_LIBS="-lkse"
+fi
+
if test "${ac_cv_header_semaphore_h+set}" = set; then
echo "$as_me:$LINENO: checking for semaphore.h" >&5
echo $ECHO_N "checking for semaphore.h... $ECHO_C" >&6
diff -ur speedtouch.orig/configure.in speedtouch/configure.in
--- speedtouch.orig/configure.in 2005-08-23 18:17:51.247036360 +0100
+++ speedtouch/configure.in 2005-08-23 18:18:24.995905752 +0100
@@ -105,7 +105,7 @@
;;
*-freebsd5*)
st_compile="modem_run pppoa2 pppoa3"
- THREAD_LIBS="-lkse"
+
AC_CHECK_LIB(pthread,pthread_create,THREAD_LIBS="-lpthread",THREAD_LIBS="-lkse")
AC_CHECK_HEADER(semaphore.h, , [AC_MSG_WARN([Missing header
file,
pppoa3 won't be compiled]); st_compile="modem_run pppoa2"])
DOCDIR="doc-bsd"
PUSB_SOURCE="pusb-bsd.c"
Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se désinscrire : mailto:[EMAIL PROTECTED]