Skip to contentSkip to conversation

configure.ac: bring back pthread-stubs check

PATCH In review Emil Velikov 2 participants 3 messages Mar 30, 2017 – Apr 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure.ac: bring back pthread-stubs check

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")
---
 configure.ac | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
configure.ac +16 -4
index 9ac8929b..18b7e8ba 100644
@@ -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)
Signature · 6 lines
2.11.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Emil 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")
Quoted 38 lines
---
 configure.ac | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
configure.ac +16 -4
index 9ac8929b..18b7e8ba 100644
@@ -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)
Signature · 1 line
2.11.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 5 lines · Eric Engestrom
Quoted 4 lines · Emil 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.

Quoted 8 lines
Quoted 5 lines

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")

Thanks. Pushed to master.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel