[gnome-settings-daemon] Make lcms2 a hard dependency



commit 2ec5d7eac2bf03ef2798de61abfacf35047dd482
Author: Richard Hughes <richard hughsie com>
Date:   Sat Aug 13 18:07:52 2011 +0200

    Make lcms2 a hard dependency
    
    lcms2 is already in our stack; colord already has a hard dep on this library.
    Maintaining nested ifdefs for the different features of lcms2 was just insane.
    
    It also means we can rely on client-side checksum pre-generation, which is much
    more efficient than rechecksumming the file in the daemon.

 configure.ac                      |    8 +-------
 plugins/color/gsd-color-manager.c |   12 +-----------
 2 files changed, 2 insertions(+), 18 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9f145bb..29492b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,15 +122,10 @@ dnl - Check for LCMS2
 dnl ---------------------------------------------------------------------------
 PKG_CHECK_MODULES(LCMS, lcms2 >= 2.2, have_new_lcms=yes, have_new_lcms=no)
 if test x$have_new_lcms = xyes; then
-        have_lcms="yes"
         AC_DEFINE(HAVE_NEW_LCMS,1,[Got new lcms2])
 else
-        PKG_CHECK_MODULES(LCMS, lcms2, have_lcms="yes", have_lcms="no")
+        PKG_CHECK_MODULES(LCMS, lcms2)
 fi
-if test "x$have_lcms" = "xyes"; then
-        AC_DEFINE(HAVE_LCMS, 1, [define if LCMS is available])
-fi
-
 
 dnl ---------------------------------------------------------------------------
 dnl - Check for libnotify
@@ -640,7 +635,6 @@ echo "
 
         dbus-1 system.d dir:      ${DBUS_SYS_DIR}
         PolicyKit support:        ${HAVE_POLKIT}
-        LCMS support:             ${have_lcms}
         LCMS DICT support:        ${have_new_lcms}
 
         Libnotify support:        ${have_libnotify}
diff --git a/plugins/color/gsd-color-manager.c b/plugins/color/gsd-color-manager.c
index 326262a..67bb436 100644
--- a/plugins/color/gsd-color-manager.c
+++ b/plugins/color/gsd-color-manager.c
@@ -26,15 +26,12 @@
 #include <libnotify/notify.h>
 #include <gdk/gdk.h>
 #include <stdlib.h>
+#include <lcms2.h>
 
 #ifdef HAVE_LIBCANBERRA
 #include <canberra-gtk.h>
 #endif
 
-#ifdef HAVE_LCMS
-  #include <lcms2.h>
-#endif
-
 #define GNOME_DESKTOP_USE_UNSTABLE_API
 #include <libgnome-desktop/gnome-rr.h>
 
@@ -1735,7 +1732,6 @@ gcm_session_device_added_notify_cb (CdClient *client,
                            manager);
 }
 
-#ifdef HAVE_LCMS
 static gchar *
 gcm_session_get_precooked_md5 (cmsHPROFILE lcms_profile)
 {
@@ -1762,7 +1758,6 @@ gcm_session_get_precooked_md5 (cmsHPROFILE lcms_profile)
 out:
         return md5;
 }
-#endif
 
 static gchar *
 gcm_session_get_md5_for_filename (const gchar *filename,
@@ -1772,8 +1767,6 @@ gcm_session_get_md5_for_filename (const gchar *filename,
         gchar *checksum = NULL;
         gchar *data = NULL;
         gsize length;
-
-#ifdef HAVE_LCMS
         cmsHPROFILE lcms_profile = NULL;
 
         /* get the internal profile id, if it exists */
@@ -1788,7 +1781,6 @@ gcm_session_get_md5_for_filename (const gchar *filename,
         checksum = gcm_session_get_precooked_md5 (lcms_profile);
         if (checksum != NULL)
                 goto out;
-#endif
 
         /* generate checksum */
         ret = g_file_get_contents (filename, &data, &length, error);
@@ -1799,10 +1791,8 @@ gcm_session_get_md5_for_filename (const gchar *filename,
                                                 length);
 out:
         g_free (data);
-#ifdef HAVE_LCMS
         if (lcms_profile != NULL)
                 cmsCloseProfile (lcms_profile);
-#endif
         return checksum;
 }
 



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