[Mesa-dev] [PATCH 1/2] gallium: correctly manage libsensors link flags

Emil Velikov emil.l.velikov at gmail.com
Thu Dec 8 17:58:21 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

We should be using LIBS rather than the LDFLAGS variable. Furthermore
try to keep the linking to the final stage, rather than intermetent
static library.

Cc: Steven Toth <stoth at kernellabs.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
Steven please double-check things on your end.
---
 configure.ac                      | 6 +++---
 src/gallium/Automake.inc          | 1 +
 src/gallium/auxiliary/Makefile.am | 2 --
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 802cd02..2007098 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1117,11 +1117,11 @@ AC_ARG_ENABLE([lmsensors],
 AM_CONDITIONAL(HAVE_LIBSENSORS, test "x$enable_lmsensors" = xyes)
 if test "x$enable_lmsensors" = xyes ; then
     DEFINES="${DEFINES} -DHAVE_LIBSENSORS=1"
-    LIBSENSORS_LDFLAGS="-lsensors"
+    LIBSENSORS_LIBS="-lsensors"
 else
-    LIBSENSORS_LDFLAGS=""
+    LIBSENSORS_LIBS=""
 fi
-AC_SUBST(LIBSENSORS_LDFLAGS)
+AC_SUBST(LIBSENSORS_LIBS)
 
 case "$host_os" in
 linux*)
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 6fe2e22..d792475 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -46,6 +46,7 @@ GALLIUM_TARGET_CFLAGS = \
 
 GALLIUM_COMMON_LIB_DEPS = \
 	-lm \
+	$(LIBSENSORS_LIBS) \
 	$(CLOCK_LIB) \
 	$(PTHREAD_LIBS) \
 	$(DLOPEN_LIBS)
diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
index 1b40515..e9f8c12 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -34,8 +34,6 @@ libgallium_la_SOURCES += \
 
 endif
 
-libgallium_la_LDFLAGS = $(LIBSENSORS_LDFLAGS)
-
 MKDIR_GEN = $(AM_V_at)$(MKDIR_P) $(@D)
 PYTHON_GEN =  $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
 
-- 
2.10.2



More information about the mesa-dev mailing list