bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pthread-spin doesn't define HAVE_PTHREAD_H


From: Collin Funk
Subject: pthread-spin doesn't define HAVE_PTHREAD_H
Date: Tue, 2 Apr 2024 13:23:48 -0700
User-agent: Mozilla Thunderbird

Hi Bruno,

It looks like it is time for me to start learning m4.

When running ./configure in findutils I see this warning:

     checking for pthread.h... yes
     ...
     ./configure: line 31218: test: =: unary operator expected
     checking for pthread_spin_init... yes
     checking for pthread_t... yes
     checking for pthread_spinlock_t... yes

Line 31218 is the first line in this block. I believe it is because
$HAVE_PTHREAD_H expands to nothing:

    if test $HAVE_PTHREAD_H = 0 || test $HAVE_PTHREAD_SPINLOCK_T = 0; then
      HAVE_PTHREAD_SPIN_INIT=0
      HAVE_PTHREAD_SPIN_LOCK=0
      HAVE_PTHREAD_SPIN_TRYLOCK=0
      HAVE_PTHREAD_SPIN_UNLOCK=0
      HAVE_PTHREAD_SPIN_DESTROY=0
    else

$ grep -n 'HAVE_PTHREAD_H' configure
810:HAVE_PTHREAD_H
5111:as_fn_append ac_header_c_list " pthread.h pthread_h HAVE_PTHREAD_H"
31218:    if test $HAVE_PTHREAD_H = 0 || test $HAVE_PTHREAD_SPINLOCK_T = 0; then
31368:    HAVE_PTHREAD_H=1
31373:        HAVE_PTHREAD_H=0
31377:    HAVE_PTHREAD_H=0
31382:     #if HAVE_PTHREAD_H
31394:     #if HAVE_PTHREAD_H
59474:    if test $HAVE_PTHREAD_H = 0; then

It looks like maybe it is due to this?

commit 4851abd89ce1ed641cc5d601f8764af23f987182
Author: Bruno Haible <bruno@clisp.org>
Date:   Thu Mar 28 22:05:39 2024 +0100

    pthread-h: Fix override of pthread_spinlock_t with non-GNU compilers.
    
    * m4/pthread-spin.m4 (gl_PTHREAD_SPIN): Define through AC_DEFUN_ONCE.
    Require gl_PTHREAD_H_DEFAULTS, not gl_PTHREAD_H.

Collin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]