[gnome-control-center] build: Better libm checks



commit 3f0510cac87f3546ada4581c1174d60621c9aa7d
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 8 19:21:53 2017 +0100

    build: Better libm checks
    
    Use AC_CHECK_LIBM instead of AC_CHECK_LIB(m,...
    and use $(LIBM) instead of hardcoding "-lm" in Makefiles.

 configure.ac                        |    3 ++-
 panels/color/Makefile.am            |    2 +-
 panels/datetime/Makefile.am         |    4 ++--
 panels/display/Makefile.am          |    2 +-
 panels/mouse/Makefile.am            |    4 ++--
 panels/printers/Makefile.am         |    2 +-
 panels/sound/Makefile.am            |    2 +-
 panels/universal-access/Makefile.am |    2 +-
 panels/user-accounts/Makefile.am    |    2 +-
 panels/wacom/calibrator/Makefile.am |    5 ++---
 10 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b1c5e04..6e35c00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,7 +63,8 @@ AC_SUBST(XF86MISC_LIBS)
 AC_CHECK_HEADERS(X11/extensions/XKB.h)
 CPPFLAGS=$savecppflags
 
-AC_CHECK_LIB(m, floor)
+AC_CHECK_LIBM
+AC_SUBST(LIBM)
 
 # IBus support
 IBUS_REQUIRED_VERSION=1.5.2
diff --git a/panels/color/Makefile.am b/panels/color/Makefile.am
index ce0582f..a003f8a 100644
--- a/panels/color/Makefile.am
+++ b/panels/color/Makefile.am
@@ -30,7 +30,7 @@ libcolor_la_SOURCES =         \
        cc-color-panel.c        \
        cc-color-panel.h
 
-libcolor_la_LIBADD = $(PANEL_LIBS) $(COLOR_PANEL_LIBS)
+libcolor_la_LIBADD = $(PANEL_LIBS) $(COLOR_PANEL_LIBS) $(LIBM)
 
 resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/color.gresource.xml)
 cc-color-resources.c: color.gresource.xml $(resource_files)
diff --git a/panels/datetime/Makefile.am b/panels/datetime/Makefile.am
index 43523a6..a003f0b 100644
--- a/panels/datetime/Makefile.am
+++ b/panels/datetime/Makefile.am
@@ -30,11 +30,11 @@ noinst_PROGRAMS = $(TEST_PROGS) test-timezone
 TEST_PROGS += test-timezone-gfx test-endianess
 
 test_timezone_SOURCES = test-timezone.c cc-timezone-map.h cc-timezone-map.c tz.c tz.h 
cc-datetime-resources.c cc-datetime-resources.h
-test_timezone_LDADD = $(DATETIME_PANEL_LIBS) -lm
+test_timezone_LDADD = $(DATETIME_PANEL_LIBS) $(LIBM)
 test_timezone_CFLAGS = $(DATETIME_PANEL_CFLAGS)
 
 test_timezone_gfx_SOURCES = test-timezone-gfx.c tz.c tz.h cc-datetime-resources.c cc-datetime-resources.h
-test_timezone_gfx_LDADD = $(DATETIME_PANEL_LIBS) -lm
+test_timezone_gfx_LDADD = $(DATETIME_PANEL_LIBS) $(LIBM)
 test_timezone_gfx_CFLAGS = $(DATETIME_PANEL_CFLAGS) -DSRCDIR="\"$(srcdir)\""
 
 test_endianess_SOURCES = test-endianess.c date-endian.c date-endian.h
diff --git a/panels/display/Makefile.am b/panels/display/Makefile.am
index 9402044..c03696f 100644
--- a/panels/display/Makefile.am
+++ b/panels/display/Makefile.am
@@ -9,7 +9,7 @@ libdisplay_la_SOURCES =         \
        scrollarea.c            \
        scrollarea.h
 
-libdisplay_la_LIBADD = $(PANEL_LIBS) $(DISPLAY_PANEL_LIBS)
+libdisplay_la_LIBADD = $(PANEL_LIBS) $(DISPLAY_PANEL_LIBS) $(LIBM)
 
 # You will need a recent intltool or the patch from this bug
 # http://bugzilla.gnome.org/show_bug.cgi?id=462312
diff --git a/panels/mouse/Makefile.am b/panels/mouse/Makefile.am
index 9e113d5..aa86e0a 100644
--- a/panels/mouse/Makefile.am
+++ b/panels/mouse/Makefile.am
@@ -25,7 +25,7 @@ libmouse_properties_la_SOURCES =      \
        gnome-mouse-test.c              \
        gnome-mouse-test.h
 
-libmouse_properties_la_LIBADD = $(PANEL_LIBS) $(MOUSE_PANEL_LIBS) $(top_builddir)/panels/common/libdevice.la
+libmouse_properties_la_LIBADD = $(PANEL_LIBS) $(MOUSE_PANEL_LIBS) $(LIBM) 
$(top_builddir)/panels/common/libdevice.la
 
 test_gnome_mouse_test_SOURCES =                \
        $(BUILT_SOURCES)                \
@@ -36,7 +36,7 @@ test_gnome_mouse_test_SOURCES =               \
 noinst_PROGRAMS = test-gnome-mouse-test
 
 test_gnome_mouse_test_CPPFLAGS = $(AM_CPPFLAGS)
-test_gnome_mouse_test_LDADD = $(PANEL_LIBS) $(MOUSE_PANEL_LIBS)
+test_gnome_mouse_test_LDADD = $(PANEL_LIBS) $(MOUSE_PANEL_LIBS) $(LIBM)
 
 resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/mouse.gresource.xml)
 cc-mouse-resources.c: mouse.gresource.xml $(resource_files)
diff --git a/panels/printers/Makefile.am b/panels/printers/Makefile.am
index ef23deb..fad9d09 100644
--- a/panels/printers/Makefile.am
+++ b/panels/printers/Makefile.am
@@ -54,7 +54,7 @@ libprinters_la_SOURCES =              \
        cc-printers-panel.h
 
 libprinters_la_CPPFLAGS = $(AM_CPPFLAGS)
-libprinters_la_LIBADD = $(PRINTERS_PANEL_LIBS) $(PANEL_LIBS) $(CUPS_LIBS) $(SMBCLIENT_LIBS)
+libprinters_la_LIBADD = $(PRINTERS_PANEL_LIBS) $(PANEL_LIBS) $(CUPS_LIBS) $(SMBCLIENT_LIBS) $(LIBM)
 
 resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/printers.gresource.xml)
 cc-printers-resources.c: printers.gresource.xml $(resource_files)
diff --git a/panels/sound/Makefile.am b/panels/sound/Makefile.am
index 1f152b6..709007f 100644
--- a/panels/sound/Makefile.am
+++ b/panels/sound/Makefile.am
@@ -27,11 +27,11 @@ libgvcgtk_la_SOURCES =                              \
        $(NULL)
 
 libsound_la_LIBADD =                           \
-       -lm                                     \
        gvc/libgvc.la                           \
        libgvcgtk.la                            \
        $(PANEL_LIBS)                           \
        $(SOUND_PANEL_LIBS)                     \
+       $(LIBM)                                 \
        $(NULL)
 
 libsound_la_LDFLAGS =                          \
diff --git a/panels/universal-access/Makefile.am b/panels/universal-access/Makefile.am
index 5fcc983..b0efc5e 100644
--- a/panels/universal-access/Makefile.am
+++ b/panels/universal-access/Makefile.am
@@ -20,7 +20,7 @@ libuniversal_access_la_SOURCES =              \
        zoom-options.c                          \
        zoom-options.h
 
-libuniversal_access_la_LIBADD = $(PANEL_LIBS) $(UNIVERSAL_ACCESS_PANEL_LIBS)
+libuniversal_access_la_LIBADD = $(PANEL_LIBS) $(UNIVERSAL_ACCESS_PANEL_LIBS) $(LIBM)
 
 resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies 
$(srcdir)/universal-access.gresource.xml)
 cc-ua-resources.c: universal-access.gresource.xml $(resource_files)
diff --git a/panels/user-accounts/Makefile.am b/panels/user-accounts/Makefile.am
index eff4d67..65d422f 100644
--- a/panels/user-accounts/Makefile.am
+++ b/panels/user-accounts/Makefile.am
@@ -64,7 +64,7 @@ libuser_accounts_la_LIBADD =          \
        $(builddir)/../common/liblanguage.la    \
        -lpwquality                     \
        -lcrypt                         \
-       -lm                             \
+       $(LIBM)                         \
        $(top_builddir)/libgd/libgd.la
 
 if BUILD_CHEESE
diff --git a/panels/wacom/calibrator/Makefile.am b/panels/wacom/calibrator/Makefile.am
index 4559aef..38e9e82 100644
--- a/panels/wacom/calibrator/Makefile.am
+++ b/panels/wacom/calibrator/Makefile.am
@@ -7,7 +7,6 @@ AM_CPPFLAGS =                                           \
        -DGNOMELOCALEDIR="\"$(datadir)/locale\""        \
        $(NULL)
 
-
 noinst_LTLIBRARIES = libwacom-calibrator.la libwacom-calibrator-test.la
 
 libwacom_calibrator_la_SOURCES =       \
@@ -20,7 +19,7 @@ libwacom_calibrator_la_SOURCES =      \
        cc-target-actor.c               \
        cc-target-actor.h
 
-libwacom_calibrator_la_LIBADD = $(PANEL_LIBS) $(WACOM_PANEL_LIBS)
+libwacom_calibrator_la_LIBADD = $(PANEL_LIBS) $(WACOM_PANEL_LIBS) $(LIBM)
 libwacom_calibrator_la_LDFLAGS = $(PANEL_LDFLAGS)
 
 libwacom_calibrator_test_la_SOURCES = $(libwacom_calibrator_la_SOURCES)
@@ -43,6 +42,6 @@ test_calibrator_SOURCES =             \
        cc-target-actor.h
 
 test_calibrator_CPPFLAGS = $(AM_CPPFLAGS)
-test_calibrator_LDADD = $(PANEL_LIBS) $(WACOM_PANEL_LIBS)
+test_calibrator_LDADD = $(PANEL_LIBS) $(WACOM_PANEL_LIBS) $(LIBM)
 
 -include $(top_srcdir)/git.mk


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