[Mesa-dev] [PATCH 1/2] configure.ac: Don't set PTHREAD_LIBS when it is not present

Gurchetan Singh gurchetansingh at chromium.org
Wed Nov 9 21:22:53 UTC 2016


AX_PTHREADS sets PTHREAD_CFLAGS and PTHREAD_LIBS, and we should
not append to it.

This breaks building EGL since PTHREAD_CFLAGS isn't specified, so
let's add it here.

I couldn't find any other places where this breaks the build in
my configuration.  If other configurations get broken, we should
add PTHREAD_CFLAGS where needed.

---
 configure.ac        | 4 ----
 src/egl/Makefile.am | 1 +
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4761c59..9b6976f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -821,10 +821,6 @@ AX_PTHREAD
 if test "x$ax_pthread_ok" = xno; then
     AC_MSG_ERROR([Building mesa on this platform requires pthreads])
 fi
-dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
-dnl to -pthread, which causes problems if we need -lpthread to appear in
-dnl pkgconfig files.
-test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
 
 dnl pthread-stubs is mandatory on targets where it exists
 case "$host_os" in
diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
index 304b0d3..83fad15 100644
--- a/src/egl/Makefile.am
+++ b/src/egl/Makefile.am
@@ -30,6 +30,7 @@ AM_CFLAGS = \
 	$(VISIBILITY_CFLAGS) \
 	$(LIBDRM_CFLAGS) \
 	$(EGL_CFLAGS) \
+	$(PTHREAD_CFLAGS) \
 	-D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM)
 
 lib_LTLIBRARIES = libEGL.la
-- 
2.8.0.rc3.226.g39d4020



More information about the mesa-dev mailing list