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.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
[Emil Velikov: rebase on top of previous commit]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
main
Tomasz Figa 2017-01-27 16:21:19 +09:00 committed by Emil Velikov
parent 58459a57fa
commit 8ef7e5b702
3 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,5 @@
AM_CFLAGS = \
-pthread \
$(WARN_CFLAGS)\
-I $(top_srcdir)/include/drm \
-I $(top_srcdir)/libkms/ \
@ -34,8 +35,7 @@ exynos_fimg2d_perf_LDADD = \
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 \

View File

@ -3,6 +3,7 @@ include Makefile.sources
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_SOURCES = $(MODETEST_FILES)
modetest_LDADD = \
$(top_builddir)/libdrm.la \
$(top_builddir)/tests/util/libutil.la \
$(CAIRO_LIBS) \
-lpthread
$(CAIRO_LIBS)

View File

@ -1,4 +1,5 @@
AM_CFLAGS = \
-pthread \
$(WARN_CFLAGS) \
-I$(top_srcdir)/include/drm \
-I$(top_srcdir)/nouveau \
@ -7,7 +8,7 @@ AM_CFLAGS = \
LDADD = \
../../nouveau/libdrm_nouveau.la \
../../libdrm.la \
-ldl -lpthread
-ldl
TESTS = threaded