[clutter] build: Use libtool macros to find libm



commit df15f04fc0474be09e6839618c598d43aee920e5
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Mar 3 17:23:37 2015 +0000

    build: Use libtool macros to find libm
    
    Instead of using `-lm` everywhere, use LT_LIB_M inside configure.ac, and
    $(LIBM) inside Makefile.am.

 clutter/Makefile.am               |   19 ++++---------------
 configure.ac                      |    1 +
 doc/cookbook/examples/Makefile.am |    2 +-
 examples/Makefile.am              |    8 +-------
 tests/conform/Makefile.am         |    2 +-
 tests/interactive/Makefile.am     |    2 +-
 tests/micro-bench/Makefile.am     |    2 +-
 tests/performance/Makefile.am     |    2 +-
 8 files changed, 11 insertions(+), 27 deletions(-)
---
diff --git a/clutter/Makefile.am b/clutter/Makefile.am
index cbd76fd..7b5cf81 100644
--- a/clutter/Makefile.am
+++ b/clutter/Makefile.am
@@ -837,26 +837,15 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = $(pc_files)
 DISTCLEANFILES += $(pc_files)
 
-clutter_include_HEADERS = \
-       $(source_h) \
-       clutter.h \
-       clutter-version.h
-
-nodist_clutter_include_HEADERS = \
-       clutter-config.h \
-       $(built_source_h)
+clutter_include_HEADERS = $(source_h) clutter.h clutter-version.h
+nodist_clutter_include_HEADERS = clutter-config.h $(built_source_h)
 
 clutter_deprecated_HEADERS = $(deprecated_h)
 
 lib_LTLIBRARIES += libclutter- CLUTTER_API_VERSION@.la
 
-libclutter_ CLUTTER_API_VERSION@_la_LIBADD = \
-       -lm \
-       $(CLUTTER_LIBS) \
-       $(CLUTTER_PROFILE_LIBS)
-
-libclutter_ CLUTTER_API_VERSION@_la_DEPENDENCIES = \
-       $(win32_resources)
+libclutter_ CLUTTER_API_VERSION@_la_LIBADD = $(LIBM) $(CLUTTER_LIBS) $(CLUTTER_PROFILE_LIBS)
+libclutter_ CLUTTER_API_VERSION@_la_DEPENDENCIES = $(win32_resources)
 
 libclutter_ CLUTTER_API_VERSION@_la_SOURCES = \
        $(backend_source_c) \
diff --git a/configure.ac b/configure.ac
index bbe7714..a857cd0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,6 +130,7 @@ AM_PROG_CC_C_O
 # require libtool >= 2.2
 LT_PREREQ([2.2.6])
 LT_INIT([disable-static])
+LT_LIB_M
 
 # Checks for header files.
 AC_HEADER_STDC
diff --git a/doc/cookbook/examples/Makefile.am b/doc/cookbook/examples/Makefile.am
index 236edf2..0d97ce6 100644
--- a/doc/cookbook/examples/Makefile.am
+++ b/doc/cookbook/examples/Makefile.am
@@ -56,7 +56,7 @@ all_examples = \
        events-buttons-lasso                    \
        $(NULL)
 
-LDADD = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la -lm
+LDADD = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la $(LIBM)
 
 AM_CFLAGS = $(CLUTTER_CFLAGS)
 
diff --git a/examples/Makefile.am b/examples/Makefile.am
index cb80c9f..80602a2 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -22,14 +22,8 @@ all_examples += \
        image-content
 endif
 
-LDADD = \
-       $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la \
-       $(CLUTTER_LIBS) \
-       $(GDK_PIXBUF_LIBS) \
-       -lm
-
+LDADD = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) 
$(LIBM)
 AM_CFLAGS = $(CLUTTER_CFLAGS) $(GDK_PIXBUF_CFLAGS) $(MAINTAINER_CFLAGS)
-
 AM_CPPFLAGS = \
        -DG_DISABLE_SINGLE_INCLUDES \
        -DGLIB_DISABLE_DEPRECATION_WARNINGS \
diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am
index 4568d17..d0c08b6 100644
--- a/tests/conform/Makefile.am
+++ b/tests/conform/Makefile.am
@@ -1,7 +1,7 @@
 include $(top_srcdir)/build/autotools/glib-tap.mk
 
 AM_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
-LDADD = $(top_builddir)/clutter/libclutter-1.0.la $(CLUTTER_LIBS) -lm
+LDADD = $(top_builddir)/clutter/libclutter-1.0.la $(CLUTTER_LIBS) $(LIBM)
 AM_LDFLAGS = -export-dynamic
 AM_CPPFLAGS = \
        -DG_LOG_DOMAIN=\"Clutter-Conform\"      \
diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am
index 660107f..bb935cc 100644
--- a/tests/interactive/Makefile.am
+++ b/tests/interactive/Makefile.am
@@ -157,7 +157,7 @@ test_interactive_CPPFLAGS = \
        -I$(top_srcdir)/clutter \
        -I$(top_builddir)/clutter
 test_interactive_LDFLAGS = -export-dynamic
-test_interactive_LDADD = $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) $(common_ldadd) -lm
+test_interactive_LDADD = $(CLUTTER_LIBS) $(GDK_PIXBUF_LIBS) $(common_ldadd) $(LIBM)
 
 EXTRA_DIST = \
        wrapper.sh.in \
diff --git a/tests/micro-bench/Makefile.am b/tests/micro-bench/Makefile.am
index e4cb8f1..93278ab 100644
--- a/tests/micro-bench/Makefile.am
+++ b/tests/micro-bench/Makefile.am
@@ -22,7 +22,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/clutter \
        -I$(top_builddir)/clutter
 
-LDADD = $(common_ldadd) $(CLUTTER_LIBS) -lm
+LDADD = $(common_ldadd) $(CLUTTER_LIBS) $(LIBM)
 
 test_text_SOURCES = test-text.c
 test_picking_SOURCES = test-picking.c
diff --git a/tests/performance/Makefile.am b/tests/performance/Makefile.am
index ef7745c..08fa74e 100644
--- a/tests/performance/Makefile.am
+++ b/tests/performance/Makefile.am
@@ -11,7 +11,7 @@ check_PROGRAMS = \
 
 common_ldadd = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la
 
-LDADD = $(common_ldadd) $(CLUTTER_LIBS) -lm
+LDADD = $(common_ldadd) $(CLUTTER_LIBS) $(LIBM)
 
 AM_CFLAGS = $(CLUTTER_CFLAGS)
 


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