FROMLIST: tests: Use -pthread in CFLAGS instead of -lpthread
-lpthread is not always a valid flag to pull pthread support, especially
on Android it will fail to link due to a missing libpthread.so. The more
generic way to build-in pthread support is to use the -pthread CFLAG, so
let's use it instead.
(am from https://patchwork.freedesktop.org/patch/135650/)
BUG=b:26864637
TEST=emerge-samus arc-libdrm
Change-Id: Iec375f66a666a056e1cba79272e7b621d96637cd
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/422809
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/tests/exynos/Makefile.am b/tests/exynos/Makefile.am
index 357d6b8..b636172 100644
--- a/tests/exynos/Makefile.am
+++ b/tests/exynos/Makefile.am
@@ -1,4 +1,5 @@
AM_CFLAGS = \
+ -pthread \
$(WARN_CFLAGS)\
-I $(top_srcdir)/include/drm \
-I $(top_srcdir)/libkms/ \
@@ -34,8 +35,7 @@
exynos_fimg2d_event_LDADD = \
$(top_builddir)/libdrm.la \
- $(top_builddir)/exynos/libdrm_exynos.la \
- -lpthread
+ $(top_builddir)/exynos/libdrm_exynos.la
exynos_fimg2d_test_LDADD = \
$(top_builddir)/libdrm.la \
diff --git a/tests/modetest/Makefile.am b/tests/modetest/Makefile.am
index 9686ccb..4b296c8 100644
--- a/tests/modetest/Makefile.am
+++ b/tests/modetest/Makefile.am
@@ -3,6 +3,7 @@
AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS))
AM_CFLAGS += \
+ -pthread \
-I$(top_srcdir)/include/drm \
-I$(top_srcdir)/tests \
-I$(top_srcdir)
@@ -20,5 +21,4 @@
modetest_LDADD = \
$(top_builddir)/libdrm.la \
$(top_builddir)/tests/util/libutil.la \
- $(CAIRO_LIBS) \
- -lpthread
+ $(CAIRO_LIBS)
diff --git a/tests/nouveau/Makefile.am b/tests/nouveau/Makefile.am
index c4f6e29..593acef 100644
--- a/tests/nouveau/Makefile.am
+++ b/tests/nouveau/Makefile.am
@@ -1,4 +1,5 @@
AM_CPPFLAGS = \
+ -pthread \
-I$(top_srcdir)/include/drm \
-I$(top_srcdir)/nouveau \
-I$(top_srcdir)
@@ -8,7 +9,7 @@
LDADD = \
../../nouveau/libdrm_nouveau.la \
../../libdrm.la \
- -ldl -lpthread
+ -ldl
TESTS = threaded