[weston V2 1/2] Check for math (m) and real time (rt) libraries

Javier Jardón jjardon at gnome.org
Thu Oct 30 07:23:50 PDT 2014


---
 Makefile.am  | 19 +++++++++----------
 configure.ac |  6 ++++++
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1e7cc81..1557953 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,7 +44,7 @@ weston_LDFLAGS = -export-dynamic
 weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
 weston_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
 weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
-	$(DLOPEN_LIBS) -lm libshared.la
+	$(DLOPEN_LIBS) libshared.la
 
 weston_SOURCES =					\
 	src/git-version.h				\
@@ -211,7 +211,7 @@ drm_backend_la_LIBADD =				\
 	$(COMPOSITOR_LIBS)			\
 	$(DRM_COMPOSITOR_LIBS)			\
 	$(INPUT_BACKEND_LIBS)			\
-	libshared.la -lrt			\
+	libshared.la				\
 	libsession-helper.la
 drm_backend_la_CFLAGS =				\
 	$(COMPOSITOR_CFLAGS)			\
@@ -348,7 +348,7 @@ endif
 
 noinst_PROGRAMS += spring-tool
 spring_tool_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
-spring_tool_LDADD = $(COMPOSITOR_LIBS) -lm
+spring_tool_LDADD = $(COMPOSITOR_LIBS)
 spring_tool_SOURCES =				\
 	src/spring-tool.c			\
 	src/animation.c				\
@@ -429,7 +429,7 @@ weston_presentation_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la -lm
 
 weston_multi_resource_SOURCES = clients/multi-resource.c
 weston_multi_resource_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
-weston_multi_resource_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la -lm
+weston_multi_resource_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
 endif
 
 if BUILD_SIMPLE_EGL_CLIENTS
@@ -439,7 +439,7 @@ nodist_weston_simple_egl_SOURCES =		\
 	protocol/xdg-shell-protocol.c		\
 	protocol/xdg-shell-client-protocol.h
 weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
-weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
+weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS)
 endif
 
 noinst_LTLIBRARIES += libtoytoolkit.la
@@ -466,7 +466,7 @@ BUILT_SOURCES += $(nodist_libtoytoolkit_la_SOURCES)
 libtoytoolkit_la_LIBADD =			\
 	$(CLIENT_LIBS)				\
 	$(CAIRO_EGL_LIBS)			\
-	libshared-cairo.la -lrt -lm
+	libshared-cairo.la
 libtoytoolkit_la_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(CAIRO_EGL_CFLAGS)
 
 weston_flower_SOURCES = clients/flower.c
@@ -520,7 +520,7 @@ weston_nested_LDADD = libtoytoolkit.la $(SERVER_LIBS)
 weston_nested_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
 
 weston_nested_client_SOURCES = clients/nested-client.c
-weston_nested_client_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
+weston_nested_client_LDADD = $(SIMPLE_EGL_CLIENT_LIBS)
 weston_nested_client_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
 endif
 
@@ -560,7 +560,7 @@ weston_subsurfaces_CFLAGS =			\
 	$(AM_CFLAGS)				\
 	$(SIMPLE_EGL_CLIENT_CFLAGS)		\
 	$(CLIENT_CFLAGS)
-weston_subsurfaces_LDADD = libtoytoolkit.la $(SIMPLE_EGL_CLIENT_LIBS) -lm
+weston_subsurfaces_LDADD = libtoytoolkit.la $(SIMPLE_EGL_CLIENT_LIBS)
 endif
 
 if HAVE_PANGO
@@ -916,7 +916,7 @@ vertex_clip_test_SOURCES =			\
 	tests/vertex-clip-test.c		\
 	src/vertex-clipping.c			\
 	src/vertex-clipping.h
-vertex_clip_test_LDADD = libtest-runner.la -lm -lrt
+vertex_clip_test_LDADD = libtest-runner.la
 
 libtest_client_la_SOURCES =			\
 	tests/weston-test-client-helper.c	\
@@ -984,7 +984,6 @@ matrix_test_SOURCES =				\
 	shared/matrix.c				\
 	shared/matrix.h
 matrix_test_CPPFLAGS = -DUNIT_TEST
-matrix_test_LDADD = -lm -lrt
 
 if BUILD_SETBACKLIGHT
 noinst_PROGRAMS += setbacklight
diff --git a/configure.ac b/configure.ac
index 9377774..e78f6c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,12 @@ AC_CHECK_FUNC([dlopen], [],
               AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
 AC_SUBST(DLOPEN_LIBS)
 
+AC_SEARCH_LIBS([sqrt], [m], [],
+               [AC_MSG_FAILURE([Math library missing])])
+
+AC_SEARCH_LIBS([clock_gettime], [rt], [],
+               [AC_MSG_FAILURE([Real time library missing])])
+
 AC_CHECK_DECL(SFD_CLOEXEC,[],
 	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
 	      [[#include <sys/signalfd.h>]])
-- 
2.1.2



More information about the wayland-devel mailing list