Author: kelnos
Date: 2008-04-05 01:46:31 +0000 (Sat, 05 Apr 2008)
New Revision: 26781

Modified:
   xfconf/trunk/configure.ac.in
   xfconf/trunk/gtk-doc.make
   xfconf/trunk/xfsettingsd/Makefile.am
   xfconf/trunk/xfsettingsd/main.c
   xfconf/trunk/xfsettingsd/registry.c
Log:
make xfsettingsd build optional, clean up all warnings, xfce-ise it


Modified: xfconf/trunk/configure.ac.in
===================================================================
--- xfconf/trunk/configure.ac.in        2008-04-03 07:52:52 UTC (rev 26780)
+++ xfconf/trunk/configure.ac.in        2008-04-05 01:46:31 UTC (rev 26781)
@@ -64,12 +64,22 @@
 
 dnl required
 XDT_CHECK_PACKAGE([GLIB], [gobject-2.0], [2.8.0])
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
 dnl XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
 XDT_CHECK_PACKAGE([DBUS], [dbus-1], [1.0.0])
 XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.72])
 
+dnl make xsettings daemon optional (so gtk dep is optional)
+AC_ARG_ENABLE([xsettings-daemon],
+              [AC_HELP_STRING([--disable-xsettings-daemon],
+                              [Don't build the XSETTINGS daemon])],
+              [build_xfsettingsd=$enableval],
+              [build_xfsettingsd=yes])
+if test "x$build_xfsettingsd" = "xyes"; then
+    XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
+fi
+AM_CONDITIONAL([BUILD_XFSETTINGSD], [test "x$build_xfsettingsd" = "xyes"])
+
 dnl check alignment for struct returns
 AC_DEFUN([BT_GLIB_CHECK_ALIGNOF],
 [

Modified: xfconf/trunk/gtk-doc.make
===================================================================
--- xfconf/trunk/gtk-doc.make   2008-04-03 07:52:52 UTC (rev 26780)
+++ xfconf/trunk/gtk-doc.make   2008-04-05 01:46:31 UTC (rev 26781)
@@ -5,11 +5,11 @@
 ####################################
 
 if GTK_DOC_USE_LIBTOOL
-GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) 
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS)
 else
-GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
 endif
 
 # We set GPATH here; this gives us semantics for GNU make
@@ -38,8 +38,13 @@
        $(DOC_MODULE).prerequisites \
        $(DOC_MODULE).signals
 
-CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
+REPORT_FILES = \
+       $(DOC_MODULE)-undocumented.txt \
+       $(DOC_MODULE)-undeclared.txt \
+       $(DOC_MODULE)-unused.txt
 
+CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
+
 if ENABLE_GTK_DOC
 all-local: html-build.stamp
 else
@@ -79,6 +84,10 @@
 tmpl.stamp: tmpl-build.stamp
        @true
 
+tmpl/*.sgml:
+       @true
+
+
 #### xml ####
 
 sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) 
$(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
@@ -96,11 +105,11 @@
 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
        @echo 'gtk-doc: Building HTML'
        @-chmod -R u+w $(srcdir)
-       rm -rf $(srcdir)/html 
+       rm -rf $(srcdir)/html
        mkdir $(srcdir)/html
        cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) 
../$(DOC_MAIN_SGML_FILE)
        test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) 
html )
-       @echo 'gtk-doc: Fixing cross-references' 
+       @echo 'gtk-doc: Fixing cross-references'
        cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) 
$(FIXXREF_OPTIONS)
        touch html-build.stamp
 
@@ -110,11 +119,16 @@
        rm -f *~ *.bak
        rm -rf .libs
 
+distclean-local:
+       cd $(srcdir) && \
+         rm -rf xml $(REPORT_FILES) \
+                $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+
 maintainer-clean-local: clean
-       cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt 
$(DOC_MODULE)-decl.txt
+       cd $(srcdir) && rm -rf xml html
 
 install-data-local:
-       installfiles=`echo $(srcdir)/html/*`; \
+       -installfiles=`echo $(srcdir)/html/*`; \
        if test "$$installfiles" = '$(srcdir)/html/*'; \
        then echo '-- Nothing to install' ; \
        else \
@@ -125,7 +139,10 @@
          done; \
          echo '-- Installing $(srcdir)/html/index.sgml' ; \
          $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || 
:; \
+         which gtkdoc-rebase >/dev/null && \
+           gtkdoc-rebase --relative --dest-dir=$(DESTDIR) 
--html-dir=$(DESTDIR)$(TARGET_DIR) ; \
        fi
+       
 
 uninstall-local:
        rm -f $(DESTDIR)$(TARGET_DIR)/*
@@ -148,8 +165,9 @@
        -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
        -cp $(srcdir)/xml/*.xml $(distdir)/xml
        cp $(srcdir)/html/* $(distdir)/html
-       if test -f $(srcdir)/$(DOC_MODULE).types; then \
-         cp $(srcdir)/$(DOC_MODULE).types $(distdir)/$(DOC_MODULE).types; \
-       fi
+       -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
+       -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
+       cd $(distdir) && rm -f $(DISTCLEANFILES)
+       -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
 
 .PHONY : dist-hook-local docs

Modified: xfconf/trunk/xfsettingsd/Makefile.am
===================================================================
--- xfconf/trunk/xfsettingsd/Makefile.am        2008-04-03 07:52:52 UTC (rev 
26780)
+++ xfconf/trunk/xfsettingsd/Makefile.am        2008-04-05 01:46:31 UTC (rev 
26781)
@@ -1,3 +1,5 @@
+if BUILD_XFSETTINGSD
+
 bin_PROGRAMS = xfsettingsd
 
 xfsettingsd_SOURCES = \
@@ -8,6 +10,7 @@
        $(GTK_CFLAGS) \
        $(GLIB_CFLAGS) \
        $(DBUS_GLIB_CFLAGS) \
+       $(LIBXFCE4UTIL_CFLAGS) \
        -DDATADIR=\"$(datadir)\" \
        -DSRCDIR=\"$(top_srcdir)\" \
        -DLOCALEDIR=\"$(localedir)\"
@@ -16,7 +19,10 @@
        $(top_builddir)/xfconf/libxfconf-0.la \
        $(GTK_LIBS) \
        $(GLIB_LIBS) \
-       $(DBUS_GLIB_LIBS)
+       $(DBUS_GLIB_LIBS) \
+       $(LIBXFCE4UTIL_LIBS)
 
 INCLUDES = \
-       -I${top_srcdir}
+       -I$(top_srcdir)
+
+endif

Modified: xfconf/trunk/xfsettingsd/main.c
===================================================================
--- xfconf/trunk/xfsettingsd/main.c     2008-04-03 07:52:52 UTC (rev 26780)
+++ xfconf/trunk/xfsettingsd/main.c     2008-04-05 01:46:31 UTC (rev 26781)
@@ -16,20 +16,22 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 #include <X11/Xlib.h>
 
 #include <glib.h>
 
-#if defined(GETTEXT_PACKAGE)
-#include <glib/gi18n-lib.h>
-#else
-#include <glib/gi18n.h>
-#endif
-
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 
+#include <libxfce4util/libxfce4util.h>
 #include <xfconf/xfconf.h>
 
 #include "registry.h"
@@ -92,7 +94,7 @@
     Atom atom;
     gchar buffer[256];
 
-    g_sprintf(buffer, "_XSETTINGS_S%d", screen);
+    g_snprintf(buffer, sizeof(buffer), "_XSETTINGS_S%d", screen);
     atom = XInternAtom((Display *)display, buffer, False);
 
     if (XGetSelectionOwner((Display *)display, atom))
@@ -106,17 +108,9 @@
 int
 main(int argc, char **argv)
 {
-    Atom selection_atom;
-    Atom xsettings_atom;
-    Atom manager_atom;
-
     GError *cli_error = NULL;
 
-    #ifdef ENABLE_NLS
-    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
-    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-    textdomain (GETTEXT_PACKAGE);
-    #endif
+    xfce_textdomain(GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
 
     if(!gtk_init_with_args(&argc, &argv, _(""), entries, PACKAGE, &cli_error))
     {
@@ -188,4 +182,6 @@
         XDestroyWindow (gdk_display, window);
         xfconf_shutdown();
     }
+
+    return 0;
 }

Modified: xfconf/trunk/xfsettingsd/registry.c
===================================================================
--- xfconf/trunk/xfsettingsd/registry.c 2008-04-03 07:52:52 UTC (rev 26780)
+++ xfconf/trunk/xfsettingsd/registry.c 2008-04-05 01:46:31 UTC (rev 26781)
@@ -264,7 +264,7 @@
         entry = registry->priv->properties[i];
 
         gint name_len = XSETTINGS_PAD(strlen(entry->name), 4);
-        gint value_len;
+        gint value_len = 0;
 
         switch (G_VALUE_TYPE(entry->value))
         {
@@ -426,10 +426,9 @@
     gchar buffer[256];
     unsigned char c = 'a';
     TimeStampInfo info;
-    Atom timestamp_atom;
     XEvent xevent;
 
-    g_sprintf(buffer, "_XSETTINGS_S%d", screen);
+    g_snprintf(buffer, sizeof(buffer), "_XSETTINGS_S%d", screen);
     Atom selection_atom = XInternAtom(dpy, buffer, True);
     Atom manager_atom = XInternAtom(dpy, "MANAGER", True);
 
@@ -597,4 +596,6 @@
         g_free(name);
 
     }
+
+    return TRUE;
 }

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to