All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm] configure.ac: bring back pthread-stubs check
@ 2017-03-30 17:01 Emil Velikov
  2017-03-30 23:17 ` Eric Engestrom
  0 siblings, 1 reply; 3+ messages in thread
From: Emil Velikov @ 2017-03-30 17:01 UTC (permalink / raw)
  To: dri-devel; +Cc: emil.l.velikov

Accidentally removed with earlier commit. Although rather than simply
adding the check for all platforms, use the same heuristics as we do in
mesa.

Namely: pthread-stubs is a thing only for BSD platforms. Everyone else
should have lightweight pthread API in their C runtime library.

Fixes: 4ecd1ef010b ("xf86drm: fix null termination of string buffer")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 configure.ac | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9ac8929b..18b7e8ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,10 +61,22 @@ AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
 
-
-
-AC_SUBST(PTHREADSTUBS_CFLAGS)
-AC_SUBST(PTHREADSTUBS_LIBS)
+dnl pthread-stubs is mandatory on BSD platforms, due to the nature of the
+dnl project. Even then there's a notable issue as described in the project README
+case "$host_os" in
+linux* | cygwin* | darwin* | solaris* | gnu*)
+    pthread_stubs_possible="no"
+    ;;
+* )
+    pthread_stubs_possible="yes"
+    ;;
+esac
+
+if test "x$pthread_stubs_possible" = xyes; then
+    PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs >= 0.4)
+    AC_SUBST(PTHREADSTUBS_CFLAGS)
+    AC_SUBST(PTHREADSTUBS_LIBS)
+fi
 
 pkgconfigdir=${libdir}/pkgconfig
 AC_SUBST(pkgconfigdir)
-- 
2.11.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH libdrm] configure.ac: bring back pthread-stubs check
  2017-03-30 17:01 [PATCH libdrm] configure.ac: bring back pthread-stubs check Emil Velikov
@ 2017-03-30 23:17 ` Eric Engestrom
  2017-04-03 17:06   ` Emil Velikov
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Engestrom @ 2017-03-30 23:17 UTC (permalink / raw)
  To: Emil Velikov; +Cc: dri-devel

On Thursday, 2017-03-30 18:01:12 +0100, Emil Velikov wrote:
> Accidentally removed with earlier commit. Although rather than simply
> adding the check for all platforms, use the same heuristics as we do in
> mesa.
> 
> Namely: pthread-stubs is a thing only for BSD platforms. Everyone else
> should have lightweight pthread API in their C runtime library.
> 
> Fixes: 4ecd1ef010b ("xf86drm: fix null termination of string buffer")
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Reviewed-by: Eric Engestrom <eric@engestrom.ch>

> ---
>  configure.ac | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 9ac8929b..18b7e8ba 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -61,10 +61,22 @@ AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])
>  LT_PREREQ([2.2])
>  LT_INIT([disable-static])
>  
> -
> -
> -AC_SUBST(PTHREADSTUBS_CFLAGS)
> -AC_SUBST(PTHREADSTUBS_LIBS)
> +dnl pthread-stubs is mandatory on BSD platforms, due to the nature of the
> +dnl project. Even then there's a notable issue as described in the project README
> +case "$host_os" in
> +linux* | cygwin* | darwin* | solaris* | gnu*)
> +    pthread_stubs_possible="no"
> +    ;;
> +* )
> +    pthread_stubs_possible="yes"
> +    ;;
> +esac
> +
> +if test "x$pthread_stubs_possible" = xyes; then
> +    PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs >= 0.4)
> +    AC_SUBST(PTHREADSTUBS_CFLAGS)
> +    AC_SUBST(PTHREADSTUBS_LIBS)
> +fi
>  
>  pkgconfigdir=${libdir}/pkgconfig
>  AC_SUBST(pkgconfigdir)
> -- 
> 2.11.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH libdrm] configure.ac: bring back pthread-stubs check
  2017-03-30 23:17 ` Eric Engestrom
@ 2017-04-03 17:06   ` Emil Velikov
  0 siblings, 0 replies; 3+ messages in thread
From: Emil Velikov @ 2017-04-03 17:06 UTC (permalink / raw)
  To: Eric Engestrom; +Cc: ML dri-devel

On 31 March 2017 at 00:17, Eric Engestrom <eric@engestrom.ch> wrote:
> On Thursday, 2017-03-30 18:01:12 +0100, Emil Velikov wrote:
>> Accidentally removed with earlier commit. Although rather than simply
>> adding the check for all platforms, use the same heuristics as we do in
>> mesa.
>>
>> Namely: pthread-stubs is a thing only for BSD platforms. Everyone else
>> should have lightweight pthread API in their C runtime library.
>>
>> Fixes: 4ecd1ef010b ("xf86drm: fix null termination of string buffer")
>> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
>
> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
>
Thanks. Pushed to master.

-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-03 17:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30 17:01 [PATCH libdrm] configure.ac: bring back pthread-stubs check Emil Velikov
2017-03-30 23:17 ` Eric Engestrom
2017-04-03 17:06   ` Emil Velikov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.