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

mesa: Changes to 'debian-experimental'



 Android.common.mk                               |    2 -
 configure.ac                                    |   45 ++++++++++++------------
 debian/changelog                                |    2 -
 debian/patches/04_osmesa_version.diff           |   12 +++---
 debian/patches/06_kfreebsd-ftbfs.diff           |    4 +-
 debian/patches/14-fix-osmesa-build.diff         |    4 +-
 docs/dispatch.html                              |    2 -
 scons/gallium.py                                |    2 -
 src/egl/main/eglcurrent.c                       |    6 +--
 src/egl/main/eglmutex.h                         |    2 -
 src/glsl/Makefile.am                            |    6 +--
 src/glsl/tests/Makefile.am                      |    8 ++--
 src/glx/apple/Makefile                          |    2 -
 src/glx/glxclient.h                             |    8 ++--
 src/glx/glxcurrent.c                            |    4 +-
 src/glx/tests/Makefile.am                       |    3 +
 src/mapi/glapi/gen/gl_SPARC_asm.py              |    2 -
 src/mapi/glapi/gen/gl_x86-64_asm.py             |    6 +--
 src/mapi/glapi/gen/gl_x86_asm.py                |    6 +--
 src/mapi/glapi/glapi_entrypoint.c               |    6 +--
 src/mapi/glapi/tests/Makefile.am                |    3 +
 src/mapi/mapi/stub.c                            |    2 -
 src/mapi/mapi/u_thread.h                        |    8 ++--
 src/mapi/shared-glapi/tests/Makefile.am         |    3 +
 src/mesa/Makefile.am                            |   10 +++--
 src/mesa/drivers/dri/common/Makefile.am         |    3 +
 src/mesa/drivers/dri/i915/Makefile.am           |    5 +-
 src/mesa/drivers/dri/i965/Makefile.am           |    5 +-
 src/mesa/drivers/dri/i965/gen6_clip_state.c     |    1 
 src/mesa/drivers/dri/i965/gen6_viewport_state.c |   24 +++++-------
 src/mesa/drivers/dri/i965/gen7_clip_state.c     |    1 
 src/mesa/drivers/dri/i965/gen7_viewport_state.c |   19 ++--------
 src/mesa/drivers/dri/nouveau/Makefile.am        |    5 +-
 src/mesa/drivers/dri/r200/Makefile.am           |    5 +-
 src/mesa/drivers/dri/radeon/Makefile.am         |    5 +-
 src/mesa/drivers/dri/swrast/Makefile.am         |    3 +
 src/mesa/drivers/osmesa/Makefile.am             |   19 +++++++---
 src/mesa/main/tests/Makefile.am                 |    6 ++-
 38 files changed, 137 insertions(+), 122 deletions(-)

New commits:
commit 6f7632b5c542197f8360d46691fba1b7f14bafd1
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Thu Oct 4 12:56:06 2012 +0300

    refresh patches

diff --git a/debian/patches/04_osmesa_version.diff b/debian/patches/04_osmesa_version.diff
index 63cfcfd..bad5f7b 100644
--- a/debian/patches/04_osmesa_version.diff
+++ b/debian/patches/04_osmesa_version.diff
@@ -1,15 +1,15 @@
 --- a/src/mesa/drivers/osmesa/Makefile.am
 +++ b/src/mesa/drivers/osmesa/Makefile.am
-@@ -35,7 +35,7 @@
- 
+@@ -37,7 +37,7 @@
+ nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy.cpp
  lib@OSMESA_LIB@_la_SOURCES = osmesa.c
  
 -lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
 +lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number 6:5:3 -no-undefined
- lib@OSMESA_LIB@_la_LIBADD = \
- 	$(top_builddir)/src/mesa/libmesa.la \
- 	$(top_builddir)/src/mapi/glapi/libglapi.la
-@@ -46,7 +46,7 @@
+ 
+ if HAVE_SHARED_GLAPI
+ GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
+@@ -55,7 +55,7 @@
  all-local: lib@OSMESA_LIB@.la
  	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
  	ln -f .libs/lib@OSMESA_LIB@.so $(top_builddir)/$(LIB_DIR)/lib@OSMESA_LIB@.so;
diff --git a/debian/patches/06_kfreebsd-ftbfs.diff b/debian/patches/06_kfreebsd-ftbfs.diff
index b6618a6..e0b134f 100644
--- a/debian/patches/06_kfreebsd-ftbfs.diff
+++ b/debian/patches/06_kfreebsd-ftbfs.diff
@@ -7,12 +7,12 @@ Debian bug: http://bugs.debian.org/524690
 
 --- a/configure.ac
 +++ b/configure.ac
-@@ -1022,7 +1022,7 @@
+@@ -1026,7 +1026,7 @@
              ;;
          esac
          ;;
 -    freebsd* | dragonfly* | *netbsd*)
 +    freebsd* | dragonfly* | *netbsd* | kfreebsd*-gnu*)
-         DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
+         DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
          DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
  
diff --git a/debian/patches/14-fix-osmesa-build.diff b/debian/patches/14-fix-osmesa-build.diff
index 61823ab..00581d0 100644
--- a/debian/patches/14-fix-osmesa-build.diff
+++ b/debian/patches/14-fix-osmesa-build.diff
@@ -1,10 +1,10 @@
 --- a/src/mesa/drivers/osmesa/Makefile.am
 +++ b/src/mesa/drivers/osmesa/Makefile.am
-@@ -28,6 +28,7 @@
+@@ -25,6 +25,7 @@
  	-I$(top_srcdir)/include \
  	-I$(top_srcdir)/src/mapi \
  	-I$(top_srcdir)/src/mesa/ \
 +	-I$(top_builddir)/src/mapi \
  	$(DEFINES) \
  	$(API_DEFINES)
- 
+ AM_CFLAGS = $(PTHREAD_CFLAGS) \

commit 468fcf9433ada623d83d9fbc529279349a28f79c
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Thu Oct 4 12:42:24 2012 +0300

    bump the changelog

diff --git a/debian/changelog b/debian/changelog
index c59f970..10788a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa (9.0~git20121002.9fc4a39d-1) UNRELEASED; urgency=low
+mesa (9.0~git20121004.b2048c5e-1) UNRELEASED; urgency=low
 
   [ Julien Cristau ]
   * Use xz for all binary packages not just *-dbg.

commit b2048c5e905cb6321212e33391926fc720b89121
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Sep 21 10:10:54 2012 +0200

    i965: Use visibility cflags on the driver code.
    (cherry picked from commit 837f06b42fd46fdfdc0c85734dbad5497ea6d19f)
    
    The only symbols that need to be public (those in intel_screen.c that the
    loader looks for) are already marked public.  Saves 100k of compiled driver
    size.
    
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Matt Turner <mattst88@gmail.com>

diff --git a/src/mesa/drivers/dri/i965/Makefile.am b/src/mesa/drivers/dri/i965/Makefile.am
index c9ea1c3..01a6f78 100644
--- a/src/mesa/drivers/dri/i965/Makefile.am
+++ b/src/mesa/drivers/dri/i965/Makefile.am
@@ -36,6 +36,7 @@ AM_CFLAGS = \
 	-I$(top_srcdir)/src/mesa/drivers/dri/intel/server \
 	$(DEFINES) \
 	$(API_DEFINES) \
+	$(VISIBILITY_CFLAGS) \
 	$(INTEL_CFLAGS)
 
 AM_CXXFLAGS = $(AM_CFLAGS)

commit ddb9ecca3b0f820feb4dee6bd8901f8b6e3ee0d8
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 20 15:08:02 2012 -0700

    build: Don't build libdricore if not building classic drivers
    (cherry picked from commit 523c01524638b3d1bb363f4c0a647b0777840b7a)

diff --git a/configure.ac b/configure.ac
index 0ae8da3..1a795ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1089,6 +1089,7 @@ if test "x$enable_dri" = xyes; then
     DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
     GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
 fi
+AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
 AC_SUBST([DRI_DIRS])
 AC_SUBST([EXPAT_INCLUDES])
 AC_SUBST([DRI_LIB_DEPS])
diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index a76df8c..feec107 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -19,7 +19,11 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
-SUBDIRS = x86 x86-64 . libdricore drivers
+if NEED_LIBDRICORE
+DRICORE_SUBDIR = libdricore
+endif
+
+SUBDIRS = x86 x86-64 . $(DRICORE_SUBDIR) drivers
 
 gldir = $(includedir)/GL
 gl_HEADERS = $(top_srcdir)/include/GL/*.h

commit 76732c9ca5ae857ba8fa4773b25847299b50d098
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 15:35:15 2012 -0700

    build: Add visibility CFLAGS to OSMesa
    (cherry picked from commit 24ded898761757ec68e8f6dbe7de1f18c0be3f63)

diff --git a/src/mesa/drivers/osmesa/Makefile.am b/src/mesa/drivers/osmesa/Makefile.am
index 21b8dfb..c4b178b 100644
--- a/src/mesa/drivers/osmesa/Makefile.am
+++ b/src/mesa/drivers/osmesa/Makefile.am
@@ -27,8 +27,10 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/src/mesa/ \
 	$(DEFINES) \
 	$(API_DEFINES)
-AM_CFLAGS = $(PTHREAD_CFLAGS)
-AM_CXXFLAGS = $(PTHREAD_CFLAGS)
+AM_CFLAGS = $(PTHREAD_CFLAGS) \
+	$(VISIBILITY_CFLAGS)
+AM_CXXFLAGS = $(PTHREAD_CFLAGS) \
+	$(VISIBILITY_CXXFLAGS)
 
 lib_LTLIBRARIES = lib@OSMESA_LIB@.la
 

commit c8669c7ba7a01780d4cfd1cfc6ab8cc6f7fc2510
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 13:56:27 2012 -0700

    build: Link OSMesa with glapi, libdl, libstdc++
    (cherry picked from commit 1762ec28db4bfb85eeb6e61377839a3889f77216)
    
    Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=399813
              https://bugs.freedesktop.org/show_bug.cgi?id=53179

diff --git a/src/mesa/drivers/osmesa/Makefile.am b/src/mesa/drivers/osmesa/Makefile.am
index 6d087f2..21b8dfb 100644
--- a/src/mesa/drivers/osmesa/Makefile.am
+++ b/src/mesa/drivers/osmesa/Makefile.am
@@ -21,24 +21,31 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
-# Hack to make some of the non-automake variables work.
-TOP=$(top_builddir)
-
-AM_CFLAGS = \
+AM_CPPFLAGS = \
 	-I$(top_srcdir)/include \
 	-I$(top_srcdir)/src/mapi \
 	-I$(top_srcdir)/src/mesa/ \
 	$(DEFINES) \
 	$(API_DEFINES)
+AM_CFLAGS = $(PTHREAD_CFLAGS)
+AM_CXXFLAGS = $(PTHREAD_CFLAGS)
 
 lib_LTLIBRARIES = lib@OSMESA_LIB@.la
 
+nodist_EXTRA_lib@OSMESA_LIB@_la_SOURCES = dummy.cpp
 lib@OSMESA_LIB@_la_SOURCES = osmesa.c
 
 lib@OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
+
+if HAVE_SHARED_GLAPI
+GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
+else
+GLAPI_LIB = $(top_builddir)/src/mapi/glapi/libglapi.la
+endif
 lib@OSMESA_LIB@_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesa.la \
-	$(top_builddir)/src/mapi/glapi/libglapi.la
+	$(GLAPI_LIB) \
+	$(OSMESA_LIB_DEPS)
 
 if BUILD_SHARED
 # Provide compatibility with scripts for the old Mesa build system for

commit f9a8673a7ad286af46931a09761bef435074bfe8
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 13:29:08 2012 -0700

    build: Set visibility CFLAGS in dri/swrast
    (cherry picked from commit 4cfff7211c7897353a07c48ad80a681c8e1e8298)

diff --git a/src/mesa/drivers/dri/swrast/Makefile.am b/src/mesa/drivers/dri/swrast/Makefile.am
index 16a3441..244aa8b 100644
--- a/src/mesa/drivers/dri/swrast/Makefile.am
+++ b/src/mesa/drivers/dri/swrast/Makefile.am
@@ -34,7 +34,8 @@ AM_CFLAGS = \
 	-I$(top_srcdir)/src/mesa/ \
 	-I$(top_srcdir)/src/mesa/drivers/dri/common \
 	$(DEFINES) \
-	$(API_DEFINES)
+	$(API_DEFINES) \
+	$(VISIBILITY_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 

commit f88046a1f04a4ea20544de8d1a554350d3efa1b2
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 13:29:01 2012 -0700

    build: Set visibility CFLAGS in dri/r200
    (cherry picked from commit 362840270702f32c1b4e5a52e04f4cad3f1de004)

diff --git a/src/mesa/drivers/dri/r200/Makefile.am b/src/mesa/drivers/dri/r200/Makefile.am
index 8920ab0..c8947a8 100644
--- a/src/mesa/drivers/dri/r200/Makefile.am
+++ b/src/mesa/drivers/dri/r200/Makefile.am
@@ -36,6 +36,7 @@ AM_CFLAGS = \
 	-I$(top_srcdir)/src/mesa/drivers/dri/r200/server \
 	$(DEFINES) \
 	$(API_DEFINES) \
+	$(VISIBILITY_CFLAGS) \
 	$(RADEON_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)

commit 8ebcf34d87002334a0df0dbdfb2a43ce2aecd7e9
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 13:28:54 2012 -0700

    build: Set visibility CFLAGS in dri/radeon
    (cherry picked from commit 55d45efdd8276ec4b2795e82e3d9bb57c3b1425d)

diff --git a/src/mesa/drivers/dri/radeon/Makefile.am b/src/mesa/drivers/dri/radeon/Makefile.am
index 36b852e..f93dcf4 100644
--- a/src/mesa/drivers/dri/radeon/Makefile.am
+++ b/src/mesa/drivers/dri/radeon/Makefile.am
@@ -36,6 +36,7 @@ AM_CFLAGS = \
 	-I$(top_srcdir)/src/mesa/drivers/dri/radeon/server \
 	$(DEFINES) \
 	$(API_DEFINES) \
+	$(VISIBILITY_CFLAGS) \
 	$(RADEON_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)

commit 3b794e4a5680a201c429c6943c12c7cf92478edf
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 13:28:45 2012 -0700

    build: Set visibility CFLAGS in dri/nouveau
    (cherry picked from commit 340637d54db171d9b5ee95ee943b590c416c0b66)

diff --git a/src/mesa/drivers/dri/nouveau/Makefile.am b/src/mesa/drivers/dri/nouveau/Makefile.am
index 4589b05..8bfbf92 100644
--- a/src/mesa/drivers/dri/nouveau/Makefile.am
+++ b/src/mesa/drivers/dri/nouveau/Makefile.am
@@ -34,6 +34,7 @@ AM_CFLAGS = \
 	-I$(top_srcdir)/src/mesa/drivers/dri/common \
 	$(DEFINES) \
 	$(API_DEFINES) \
+	$(VISIBILITY_CFLAGS) \
 	$(NOUVEAU_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)

commit 0470fa395fef898b3e13203bb5fa62bd854799af
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 13:28:37 2012 -0700

    build: Set visibility CFLAGS in dri/i915
    (cherry picked from commit 381d120b8af9e25d3bcb829a250e602b61d0971a)

diff --git a/src/mesa/drivers/dri/i915/Makefile.am b/src/mesa/drivers/dri/i915/Makefile.am
index cbdcf84..32986d1 100644
--- a/src/mesa/drivers/dri/i915/Makefile.am
+++ b/src/mesa/drivers/dri/i915/Makefile.am
@@ -37,6 +37,7 @@ AM_CFLAGS = \
 	-I$(top_srcdir)/src/mesa/drivers/dri/intel/server \
 	$(DEFINES) \
 	$(API_DEFINES) \
+	$(VISIBILITY_CFLAGS) \
 	$(INTEL_CFLAGS)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)

commit 6512610f9acb7dab70f66a8dc0d316b120b9f167
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 13:28:27 2012 -0700

    build: Set visibility CFLAGS in dri/common
    (cherry picked from commit d2872b561258d66e1b606310d12398a64002a25d)

diff --git a/src/mesa/drivers/dri/common/Makefile.am b/src/mesa/drivers/dri/common/Makefile.am
index d81bc0e..742fecc 100644
--- a/src/mesa/drivers/dri/common/Makefile.am
+++ b/src/mesa/drivers/dri/common/Makefile.am
@@ -26,7 +26,8 @@ AM_CFLAGS = \
 	-I$(top_srcdir)/src/mesa/ \
 	$(DEFINES) \
 	$(API_DEFINES) \
-	$(LIBDRM_CFLAGS)
+	$(LIBDRM_CFLAGS) \
+	$(VISIBILITY_CFLAGS)
 
 noinst_LTLIBRARIES = libdricommon.la
 

commit 03cfc8d66002f653d5a946521c664b4050f861d3
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 27 13:13:25 2012 -0700

    build: Build src/glsl with visibility CFLAGS
    (cherry picked from commit 8746f641bb47d210fa16bb99aeb8150b06aff674)

diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 20639c9..1ecc003 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -23,7 +23,7 @@
 # builtin_compiler is built before libglsl to generate builtin_function.cpp for libglsl.
 # For this to work, a dummy version of builtin_function.cpp, builtin_stubs.cpp, is used.
 
-AM_CFLAGS = \
+AM_CPPFLAGS = \
 	-I$(top_srcdir)/include \
 	-I$(top_srcdir)/src/mapi \
 	-I$(top_srcdir)/src/mesa/ \
@@ -31,8 +31,8 @@ AM_CFLAGS = \
 	$(DEFINES) \
 	$(LIBRARY_DEFINES) \
 	$(API_DEFINES)
-
-AM_CXXFLAGS = $(AM_CFLAGS)
+AM_CFLAGS = $(VISIBILITY_CFLAGS)
+AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS)
 
 AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c
 

commit a1f1add42d5ee0122627df3b2b5f4ab12e49752b
Author: Matt Turner <mattst88@gmail.com>
Date:   Thu Sep 20 15:56:10 2012 -0700

    build: Turn on visibility CFLAGS for core mesa
    (cherry picked from commit 710a90ccaf6ebdaad71b5d1d3fbb3e84773271ce)

diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index 8e4530d..a76df8c 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -94,8 +94,8 @@ BUILDDIR = $(top_builddir)/src/mesa/
 include sources.mak
 
 AM_CPPFLAGS = $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS)
-AM_CFLAGS = $(LLVM_CFLAGS)
-AM_CXXFLAGS = $(LLVM_CFLAGS)
+AM_CFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CFLAGS)
+AM_CXXFLAGS = $(LLVM_CFLAGS) $(VISIBILITY_CXXFLAGS)
 
 # cannot just add $(MESA_ASM_FILES) to libmesa_la_SOURCES as it contains a configure substitution
 MESA_ASM_FILES_FOR_ARCH =

commit a2f28ceea22254f09ee37039eec873ccdf689e6c
Author: Matt Turner <mattst88@gmail.com>
Date:   Tue Sep 18 22:09:26 2012 -0700

    build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definition
    (cherry picked from commit 814345f54b74eee2597cf84f3c34817488f07522)
    
    Conflicts:
    
    	src/mapi/glapi/gen/gl_x86-64_asm.py
    	src/mapi/glapi/gen/gl_x86_asm.py

diff --git a/Android.common.mk b/Android.common.mk
index 1e9f040..18e5726 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -40,7 +40,7 @@ LOCAL_CFLAGS += \
 	-DANDROID_VERSION=0x0$(major)0$(minor)
 
 LOCAL_CFLAGS += \
-	-DPTHREADS \
+	-DHAVE_PTHREAD=1 \
 	-fvisibility=hidden \
 	-Wno-sign-compare
 
diff --git a/configure.ac b/configure.ac
index d34754f..0ae8da3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,13 +160,13 @@ DEFINES=""
 AC_SUBST([DEFINES])
 case "$host_os" in
 linux*|*-gnu*|gnu*)
-    DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
+    DEFINES="$DEFINES -D_GNU_SOURCE"
     ;;
 solaris*)
-    DEFINES="$DEFINES -DPTHREADS -DSVR4"
+    DEFINES="$DEFINES -DSVR4"
     ;;
 cygwin*)
-    DEFINES="$DEFINES -DPTHREADS"
+    DEFINES="$DEFINES"
     ;;
 esac
 
@@ -942,8 +942,8 @@ AC_ARG_ENABLE([glx-tls],
     [GLX_USE_TLS=no])
 AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
 
-AS_IF([test "x$GLX_USE_TLS" = xyes],
-      [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
+AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
+      [DEFINES="${DEFINES} -DGLX_USE_TLS"])
 
 dnl
 dnl More DRI setup
@@ -1027,7 +1027,7 @@ if test "x$enable_dri" = xyes; then
         esac
         ;;
     freebsd* | dragonfly* | *netbsd*)
-        DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
+        DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
         DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
 
         if test "x$DRI_DIRS" = "xyes"; then
diff --git a/docs/dispatch.html b/docs/dispatch.html
index e40b41a..bdbf4bf 100644
--- a/docs/dispatch.html
+++ b/docs/dispatch.html
@@ -197,7 +197,7 @@ few preprocessor defines.</p>
 
 <ul>
 <li>If <tt>GLX_USE_TLS</tt> is defined, method #4 is used.</li>
-<li>If <tt>PTHREADS</tt> is defined, method #3 is used.</li>
+<li>If <tt>HAVE_PTHREAD</tt> is defined, method #3 is used.</li>
 <li>If <tt>WIN32_THREADS</tt> is defined, method #2 is used.</li>
 <li>If none of the preceeding are defined, method #1 is used.</li>
 </ul>
diff --git a/scons/gallium.py b/scons/gallium.py
index 1dd4e81..c3f33a0 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -251,7 +251,7 @@ def generate(env):
             '_SVID_SOURCE',
             '_BSD_SOURCE',
             '_GNU_SOURCE',
-            'PTHREADS',
+            'HAVE_PTHREAD',
             'HAVE_POSIX_MEMALIGN',
         ]
         if env['platform'] == 'darwin':
diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c
index 54fc4f7..859c02c 100644
--- a/src/egl/main/eglcurrent.c
+++ b/src/egl/main/eglcurrent.c
@@ -42,7 +42,7 @@
 static _EGLThreadInfo dummy_thread = _EGL_THREAD_INFO_INITIALIZER;
 
 
-#if PTHREADS
+#if HAVE_PTHREAD
 #include <pthread.h>
 
 static _EGL_DECLARE_MUTEX(_egl_TSDMutex);
@@ -108,7 +108,7 @@ static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
    return EGL_TRUE;
 }
 
-#else /* PTHREADS */
+#else /* HAVE_PTHREAD */
 static const _EGLThreadInfo *_egl_TSD;
 static void (*_egl_FreeTSD)(_EGLThreadInfo *);
 
@@ -137,7 +137,7 @@ static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
    return EGL_TRUE;
 }
 
-#endif /* !PTHREADS */
+#endif /* !HAVE_PTHREAD */
 
 
 static void
diff --git a/src/egl/main/eglmutex.h b/src/egl/main/eglmutex.h
index 852e251..e464864 100644
--- a/src/egl/main/eglmutex.h
+++ b/src/egl/main/eglmutex.h
@@ -31,7 +31,7 @@
 
 #include "eglcompiler.h"
 
-#ifdef PTHREADS
+#ifdef HAVE_PTHREAD
 #include <pthread.h>
 
 typedef pthread_mutex_t _EGLMutex;
diff --git a/src/glx/apple/Makefile b/src/glx/apple/Makefile
index ef12eb0..f6faa1e 100644
--- a/src/glx/apple/Makefile
+++ b/src/glx/apple/Makefile
@@ -7,7 +7,7 @@ top_srcdir = $(TOP)
 include $(TOP)/configs/current
 
 #CC=gcc
-#GL_CFLAGS=-Wall -ggdb3 -Os -DPTHREADS -D_REENTRANT $(RC_CFLAGS) $(CFLAGS)
+#GL_CFLAGS=-Wall -ggdb3 -Os -DHAVE_PTHREAD -D_REENTRANT $(RC_CFLAGS) $(CFLAGS)
 #GL_LDFLAGS=-L$(INSTALL_DIR)/lib -L$(X11_DIR)/lib $(LDFLAGS) -Wl,-single_module
 
 TCLSH=tclsh8.5
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index 91577a8..bce7f8a 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -53,7 +53,7 @@
 #include "GL/glxproto.h"
 #include "glxconfig.h"
 #include "glxhash.h"
-#if defined( PTHREADS )
+#if defined( HAVE_PTHREAD )
 # include <pthread.h>
 #endif
 
@@ -623,7 +623,7 @@ extern void __glXPreferEGL(int state);
 extern int __glXDebug;
 
 /* This is per-thread storage in an MT environment */
-#if defined( PTHREADS )
+#if defined( HAVE_PTHREAD )
 
 extern void __glXSetCurrentContext(struct glx_context * c);
 
@@ -646,7 +646,7 @@ extern struct glx_context *__glXcurrentContext;
 #define __glXGetCurrentContext() __glXcurrentContext
 #define __glXSetCurrentContext(gc) __glXcurrentContext = gc
 
-#endif /* defined( PTHREADS ) */
+#endif /* defined( HAVE_PTHREAD ) */
 
 extern void __glXSetCurrentContextNull(void);
 
@@ -655,7 +655,7 @@ extern void __glXSetCurrentContextNull(void);
 ** Global lock for all threads in this address space using the GLX
 ** extension
 */
-#if defined( PTHREADS )
+#if defined( HAVE_PTHREAD )
 extern pthread_mutex_t __glXmutex;
 #define __glXLock()    pthread_mutex_lock(&__glXmutex)
 #define __glXUnlock()  pthread_mutex_unlock(&__glXmutex)
diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index c92a2fd..3d8893c 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -33,7 +33,7 @@
  * Client-side GLX interface for current context management.
  */
 
-#ifdef PTHREADS
+#ifdef HAVE_PTHREAD
 #include <pthread.h>
 #endif
 
@@ -73,7 +73,7 @@ struct glx_context dummyContext = {
  * Current context management and locking
  */
 
-#if defined( PTHREADS )
+#if defined( HAVE_PTHREAD )
 
 _X_HIDDEN pthread_mutex_t __glXmutex = PTHREAD_MUTEX_INITIALIZER;
 
diff --git a/src/mapi/glapi/gen/gl_SPARC_asm.py b/src/mapi/glapi/gen/gl_SPARC_asm.py
index 400e684..5539596 100644
--- a/src/mapi/glapi/gen/gl_SPARC_asm.py
+++ b/src/mapi/glapi/gen/gl_SPARC_asm.py
@@ -120,7 +120,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '\t sethi\tGL_OFF(off), %g3;\t\t\t\\'
 		print '\t.size\tfn,.-fn;'
 		print ''
-		print '#elif defined(PTHREADS)'
+		print '#elif defined(HAVE_PTHREAD)'
 		print ''
 		print '\t/* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */'
 		print '\t/* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */'
diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py b/src/mapi/glapi/gen/gl_x86-64_asm.py
index ef759bf..60e7c2a 100644
--- a/src/mapi/glapi/gen/gl_x86-64_asm.py
+++ b/src/mapi/glapi/gen/gl_x86-64_asm.py
@@ -138,7 +138,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '#  define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
 		print '# endif'
 		print ''
-		print '#if defined(PTHREADS) || defined(WIN32)'
+		print '#if defined(HAVE_PTHREAD) || defined(WIN32)'
 		print '#  define THREADS'
 		print '#endif'
 		print ''
@@ -158,7 +158,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '\tret'
 		print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch'
 		print ''
-		print '#elif defined(PTHREADS)'
+		print '#elif defined(HAVE_PTHREAD)'
 		print ''
 		print '\t.extern\t_glapi_Dispatch'
 		print '\t.extern\t_gl_DispatchTSD'
@@ -251,7 +251,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '\tcall\t_x86_64_get_dispatch@PLT'
 		print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
 		print '\tjmp\t*%r11'
-		print '#elif defined(PTHREADS)'
+		print '#elif defined(HAVE_PTHREAD)'
 		
 		save_all_regs(registers)
 		print '\tcall\t_x86_64_get_dispatch@PLT'
diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py
index b43b65d..4e795e7 100644
--- a/src/mapi/glapi/gen/gl_x86_asm.py
+++ b/src/mapi/glapi/gen/gl_x86_asm.py
@@ -78,7 +78,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '#define GLOBL_FN(x) GLOBL x'
 		print '#endif'
 		print ''
-		print '#if defined(PTHREADS) || defined(WIN32)'
+		print '#if defined(HAVE_PTHREAD) || defined(WIN32)'
 		print '#  define THREADS'
 		print '#endif'
 		print ''
@@ -98,7 +98,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '\tCTX_INSNS ;					\\'
 		print '\tJMP(GL_OFFSET(off))'
 		print ''
-		print '#elif defined(PTHREADS)'
+		print '#elif defined(HAVE_PTHREAD)'
 		print '#  define GL_STUB(fn,off,fn_alt)\t\t\t\\'
 		print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
 		print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
@@ -152,7 +152,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
 		print '\tmovl	_glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax'
 		print '\tret'
 		print ''
-		print '#elif defined(PTHREADS)'
+		print '#elif defined(HAVE_PTHREAD)'
 		print 'EXTERN GLNAME(_glapi_Dispatch)'
 		print 'EXTERN GLNAME(_gl_DispatchTSD)'
 		print 'EXTERN GLNAME(pthread_getspecific)'
diff --git a/src/mapi/glapi/glapi_entrypoint.c b/src/mapi/glapi/glapi_entrypoint.c
index 993ccb94..7a0eb35 100644
--- a/src/mapi/glapi/glapi_entrypoint.c
+++ b/src/mapi/glapi/glapi_entrypoint.c
@@ -136,7 +136,7 @@ extern void __glapi_sparc_icache_flush(unsigned int *);
 static void
 init_glapi_relocs( void )
 {
-#if defined(PTHREADS) || defined(GLX_USE_TLS)
+#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS)
     static const unsigned int template[] = {
 #ifdef GLX_USE_TLS
 	0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */
@@ -266,7 +266,7 @@ init_glapi_relocs( void )
 _glapi_proc
 generate_entrypoint(GLuint functionOffset)
 {
-#if defined(PTHREADS) || defined(GLX_USE_TLS)
+#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS)
    static const unsigned int template[] = {
       0x07000000, /* sethi %hi(0), %g3 */
       0x8210000f, /* mov  %o7, %g1 */
@@ -337,7 +337,7 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset)
 void
 init_glapi_relocs_once( void )
 {
-#if defined(PTHREADS) || defined(GLX_USE_TLS)
+#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS)
    static pthread_once_t once_control = PTHREAD_ONCE_INIT;
    pthread_once( & once_control, init_glapi_relocs );
 #endif
diff --git a/src/mapi/mapi/stub.c b/src/mapi/mapi/stub.c
index 99b475a..6fb8556 100644
--- a/src/mapi/mapi/stub.c
+++ b/src/mapi/mapi/stub.c
@@ -55,7 +55,7 @@ static int next_dynamic_slot = MAPI_TABLE_NUM_STATIC;
 void
 stub_init_once(void)
 {
-#ifdef PTHREADS
+#ifdef HAVE_PTHREAD
    static pthread_once_t once = PTHREAD_ONCE_INIT;
    pthread_once(&once, entry_patch_public);
 #else
diff --git a/src/mapi/mapi/u_thread.h b/src/mapi/mapi/u_thread.h
index ffe17b2..5c06537 100644
--- a/src/mapi/mapi/u_thread.h
+++ b/src/mapi/mapi/u_thread.h
@@ -46,14 +46,14 @@
 #include <stdlib.h>
 #include "u_compiler.h"
 
-#if defined(PTHREADS)
+#if defined(HAVE_PTHREAD)
 #include <pthread.h> /* POSIX threads headers */
 #endif
 #ifdef _WIN32
 #include <windows.h>
 #endif
 
-#if defined(PTHREADS) || defined(_WIN32)
+#if defined(HAVE_PTHREAD) || defined(_WIN32)
 #ifndef THREADS
 #define THREADS
 #endif
@@ -88,7 +88,7 @@ extern "C" {
  * compiler flag.  On Solaris with gcc, use -D_REENTRANT to enable
  * proper compiling for MT-safe libc etc.
  */
-#if defined(PTHREADS)
+#if defined(HAVE_PTHREAD)
 
 struct u_tsd {
    pthread_key_t key;
@@ -145,7 +145,7 @@ u_tsd_set(struct u_tsd *tsd, void *ptr)
    }
 }
 
-#endif /* PTHREADS */
+#endif /* HAVE_PTHREAD */
 
 
 /*

commit 421dda800de3aff588e97ccb6398b94e780590cd
Author: Matt Turner <mattst88@gmail.com>
Date:   Tue Sep 18 21:51:25 2012 -0700

    build: Use PTHREAD_LIBS and PTHREAD_CFLAGS
    (cherry picked from commit b6651ae6ad314a93287e431a41f5c7a8f8f6c855)
    
    Conflicts:
    
    	src/mesa/main/tests/Makefile.am

diff --git a/configure.ac b/configure.ac
index 216367d..d34754f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -858,8 +858,8 @@ xyesyes)
     GL_PC_REQ_PRIV="x11 xext"
     X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
     GL_LIB_DEPS="$XLIBGL_LIBS"
-    GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
-    GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
+    GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+    GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
     ;;
 xyesno)
     # DRI-based GLX
@@ -886,9 +886,9 @@ xyesno)
     X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
     GL_LIB_DEPS="$DRIGL_LIBS"
 
-    # need DRM libs, -lpthread, etc.
-    GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
-    GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
+    # need DRM libs, $PTHREAD_LIBS, etc.
+    GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+    GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
     ;;
 esac
 
@@ -896,10 +896,10 @@ esac
 # builds.
 AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
 
-GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
-GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
-GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
-GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
+GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
+GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
 
 AC_SUBST([GL_LIB_DEPS])
 AC_SUBST([GL_PC_REQ_PRIV])
@@ -1086,8 +1086,8 @@ if test "x$enable_dri" = xyes; then
     fi
 
     # put all the necessary libs together
-    DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
-    GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
+    DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+    GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
 fi
 AC_SUBST([DRI_DIRS])
 AC_SUBST([EXPAT_INCLUDES])
@@ -1183,12 +1183,12 @@ esac
 if test "x$enable_osmesa" = xyes; then
     # only link libraries with osmesa if shared
     if test "$enable_static" = no; then
-        OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
+        OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
     else
         OSMESA_LIB_DEPS=""
     fi
     OSMESA_MESA_DEPS=""
-    OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
+    OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
 fi
 
 AC_SUBST([OSMESA_LIB_DEPS])
@@ -1234,7 +1234,7 @@ EGL_CLIENT_APIS=""
 
 if test "x$enable_egl" = xyes; then
     SRC_DIRS="$SRC_DIRS egl"
-    EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
+    EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
 
     AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
 
@@ -1357,11 +1357,11 @@ if test "x$enable_openvg" = xyes; then
     fi
 
     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
-    VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
+    VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
     CORE_DIRS="$CORE_DIRS mapi/vgapi"
     GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
     HAVE_ST_VEGA=yes
-    VG_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
+    VG_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
     AC_SUBST([VG_PC_LIB_PRIV])
 fi
 
diff --git a/src/glsl/tests/Makefile.am b/src/glsl/tests/Makefile.am
index 33e634d..ee3cef6 100644
--- a/src/glsl/tests/Makefile.am
+++ b/src/glsl/tests/Makefile.am
@@ -24,12 +24,14 @@ uniform_initializer_test_SOURCES =		\
 	copy_constant_to_storage_tests.cpp	\
 	set_uniform_initializer_tests.cpp	\
 	uniform_initializer_utils.cpp
-
+uniform_initializer_test_CFLAGS = 		\
+	$(PTHREAD_CFLAGS)
 uniform_initializer_test_LDADD =		\
 	$(top_builddir)/src/gtest/libgtest.la	\
 	$(top_builddir)/src/glsl/libglsl.la	\
 	$(top_builddir)/src/mesa/libmesa.la	\
-	-lpthread
+	$(PTHREAD_LIBS)
 
 ralloc_test_SOURCES = ralloc_test.cpp $(top_builddir)/src/glsl/ralloc.c
-ralloc_test_LDADD = $(top_builddir)/src/gtest/libgtest.la -lpthread
+ralloc_test_CFLAGS = $(PTHREAD_CFLAGS)
+ralloc_test_LDADD = $(top_builddir)/src/gtest/libgtest.la $(PTHREAD_LIBS)
diff --git a/src/glx/tests/Makefile.am b/src/glx/tests/Makefile.am
index a7a23fa..83626fd 100644
--- a/src/glx/tests/Makefile.am
+++ b/src/glx/tests/Makefile.am
@@ -1,4 +1,5 @@
 if HAVE_SHARED_GLAPI
+AM_CFLAGS = $(PTHREAD_CFLAGS)
 AM_CPPFLAGS = \
 	-I$(top_builddir)/src/gtest/include \
 	-I$(top_builddir)/src/mapi \
@@ -21,5 +22,5 @@ glx_test_LDADD = \
 	$(top_builddir)/src/glx/libglx.la \
 	$(top_builddir)/src/gtest/libgtest.la \
 	$(top_builddir)/src/mapi/shared-glapi/libglapi.la \
-	-lpthread
+	$(PTHREAD_LIBS)
 endif
diff --git a/src/mapi/glapi/tests/Makefile.am b/src/mapi/glapi/tests/Makefile.am
index d1d2f03..a23eef2 100644
--- a/src/mapi/glapi/tests/Makefile.am
+++ b/src/mapi/glapi/tests/Makefile.am
@@ -1,4 +1,5 @@
 if !HAVE_SHARED_GLAPI
+AM_CFLAGS = $(PTHREAD_CFLAGS)
 AM_CPPFLAGS = \
 	-I$(top_builddir)/src/gtest/include \
 	-I$(top_builddir)/src/mapi \
@@ -13,5 +14,5 @@ glapi_test_SOURCES =			\
 glapi_test_LDADD = \
 	$(top_builddir)/src/mapi/glapi/libglapi.la \
 	$(top_builddir)/src/gtest/libgtest.la \
-	-lpthread
+	$(PTHREAD_LIBS)
 endif
diff --git a/src/mapi/shared-glapi/tests/Makefile.am b/src/mapi/shared-glapi/tests/Makefile.am
index 49b86af..23d0208 100644
--- a/src/mapi/shared-glapi/tests/Makefile.am
+++ b/src/mapi/shared-glapi/tests/Makefile.am
@@ -1,4 +1,5 @@
 if HAVE_SHARED_GLAPI
+AM_CFLAGS = $(PTHREAD_CFLAGS)
 AM_CPPFLAGS = \
 	-I$(top_builddir)/src/gtest/include \
 	-I$(top_builddir)/src/mapi \
@@ -13,5 +14,5 @@ shared_glapi_test_SOURCES =			\
 shared_glapi_test_LDADD = \
 	$(top_builddir)/src/mapi/shared-glapi/libglapi.la \
 	$(top_builddir)/src/gtest/libgtest.la \
-	-lpthread
+	$(PTHREAD_LIBS)
 endif
diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am
index 74e02a8..ef70c75 100644
--- a/src/mesa/main/tests/Makefile.am
+++ b/src/mesa/main/tests/Makefile.am
@@ -1,3 +1,6 @@
+AM_CFLAGS = \
+	$(X11_CFLAGS) \


Reply to: