diff options
-rw-r--r-- | common/Makefile.am | 30 | ||||
-rw-r--r-- | common/make-exo-alias.pl | 155 | ||||
-rw-r--r-- | common/xfconf-errors.c | 6 | ||||
-rw-r--r-- | common/xfconf-types.c | 6 | ||||
-rw-r--r-- | common/xfconf-util.h | 4 | ||||
-rw-r--r-- | configure.ac.in | 43 | ||||
-rw-r--r-- | docs/reference/tmpl/xfconf-types.sgml | 2 | ||||
-rw-r--r-- | po/xfconf.pot | 55 | ||||
-rw-r--r-- | xfconf/Makefile.am | 10 | ||||
-rwxr-xr-x | xfconf/abicheck.sh | 24 | ||||
-rw-r--r-- | xfconf/xfconf-channel.c | 6 | ||||
-rw-r--r-- | xfconf/xfconf.c | 6 | ||||
-rw-r--r-- | xfconf/xfconf.symbols | 91 | ||||
-rw-r--r-- | xfconfd/Makefile.am | 1 |
14 files changed, 418 insertions, 21 deletions
diff --git a/common/Makefile.am b/common/Makefile.am index 60078dd..04ebcc4 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -14,6 +14,11 @@ libxfconf_common_la_CFLAGS = \ -I$(top_srcdir) \ $(GLIB_CFLAGS) +libxfconf_built_sources = \ + xfconf-alias.h \ + xfconf-aliasdef.c + + if MAINTAINER_MODE BUILT_SOURCES = \ @@ -23,15 +28,36 @@ BUILT_SOURCES = \ xfconf-marshal.h: stamp-xfconf-marshal.h @true stamp-xfconf-marshal.h: xfconf-marshal.list Makefile - glib-genmarshal --prefix=xfconf_marshal xfconf-marshal.list --header > xfconf-marshal.h + glib-genmarshal --prefix=xfconf_marshal --internal xfconf-marshal.list --header > xfconf-marshal.h echo timestamp > $(@F) xfconf-marshal.c: xfconf-marshal.list Makefile echo '#include "xfconf-marshal.h"' > xfconf-marshal.c - glib-genmarshal --prefix=xfconf_marshal xfconf-marshal.list --body >> xfconf-marshal.c + glib-genmarshal --prefix=xfconf_marshal --internal xfconf-marshal.list --body >> xfconf-marshal.c + + + +CLEANFILES = \ + actual-abi \ + expected-abi + +DISTCLEANFILES = \ + $(libxfconf_built_sources) + +BUILT_SOURCES += \ + $(libxfconf_built_sources) + +xfconf-alias.h: make-exo-alias.pl $(top_srcdir)/xfconf/xfconf.symbols + $(PERL) $(srcdir)/make-exo-alias.pl <$(top_srcdir)/xfconf/xfconf.symbols >xfconf-alias.h + +xfconf-aliasdef.c: make-exo-alias.pl $(top_srcdir)/xfconf/xfconf.symbols + $(PERL) $(srcdir)/make-exo-alias.pl -def <$(top_srcdir)/xfconf/xfconf.symbols >xfconf-aliasdef.c endif EXTRA_DIST = \ + make-exo-alias.pl \ + xfconf-alias.h \ + xfconf-aliasdef.c \ xfconf-dbus.xml \ xfconf-marshal.list diff --git a/common/make-exo-alias.pl b/common/make-exo-alias.pl new file mode 100644 index 0000000..f17ff01 --- /dev/null +++ b/common/make-exo-alias.pl @@ -0,0 +1,155 @@ +#!/usr/bin/env perl -w +# +# Copyright (c) 2004 The GLib Development Team. +# Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +my $option_def = 0; + +if (($#ARGV >= 0) && ($ARGV[0] eq "-def")) + { + shift; + $option_def = 1; + } + +print <<EOF; +/* Generated by make-exo-alias.pl. Do not edit this file. */ + +#ifdef HAVE_GNUC_VISIBILITY + +#include <glib.h> + +EOF + +if ($option_def) + { + print <<EOF +#undef IN_HEADER +#define IN_HEADER(x) 1 + +#undef IN_SOURCE +#define IN_SOURCE defined + +EOF + } +else + { + print <<EOF +#define IN_HEADER defined +#define IN_SOURCE(x) 1 + +EOF + } + +my $in_comment = 0; +my $in_skipped_section = 0; + +while (<>) + { + # ignore empty lines + next if /^\s*$/; + + # skip comments + if ($_ =~ /^\s*\/\*/) + { + $in_comment = 1; + } + + if ($in_comment) + { + if ($_ =~ /\*\/\s$/) + { + $in_comment = 0; + } + next; + } + + # handle ifdefs + if ($_ =~ /^\#endif/) + { + if (!$in_skipped_section) + { + print $_; + } + + $in_skipped_section = 0; + next; + } + + if ($_ =~ /^\#ifdef\s+(INCLUDE_VARIABLES|INCLUDE_INTERNAL_SYMBOLS|ALL_FILES)/) + { + $in_skipped_section = 1; + } + + if ($in_skipped_section) + { + next; + } + + if ($_ =~ /^\#ifn?def\s+G/) + { + print $_; + next; + } + + if ($_ =~ /^\#if.*(IN_SOURCE|IN_HEADER)/) + { + print $_; + next; + } + + chop; + my $line = $_; + my @words; + my $attributes = ""; + + @words = split (/ /, $line); + my $symbol = shift (@words); + chomp ($symbol); + my $alias = "IA__".$symbol; + + # Drop any Win32 specific .def file syntax, but keep attributes + foreach $word (@words) + { + $attributes = "$attributes $word" unless $word eq "PRIVATE"; + } + + if (!$option_def) + { + print <<EOF +extern __typeof ($symbol) $alias __attribute((visibility("hidden")))$attributes; +\#define $symbol $alias + +EOF + } + else + { + print <<EOF +\#undef $symbol +extern __typeof ($symbol) $symbol __attribute((alias("$alias"), visibility("default"))); + +EOF + } + } + +print <<EOF; + +#endif /* HAVE_GNUC_VISIBILITY */ +EOF + + diff --git a/common/xfconf-errors.c b/common/xfconf-errors.c index 9f0ff9d..106ba50 100644 --- a/common/xfconf-errors.c +++ b/common/xfconf-errors.c @@ -22,6 +22,7 @@ #endif #include "xfconf/xfconf-errors.h" +#include "xfconf-alias.h" static GQuark xfconf_error_quark = 0; @@ -74,3 +75,8 @@ xfconf_error_get_type() return type; } + + + +#define __XFCONF_ERRORS_C__ +#include "xfconf-aliasdef.c" diff --git a/common/xfconf-types.c b/common/xfconf-types.c index 43b3711..d885f92 100644 --- a/common/xfconf-types.c +++ b/common/xfconf-types.c @@ -22,6 +22,7 @@ #endif #include "xfconf/xfconf-types.h" +#include "xfconf-alias.h" #include <gobject/gvaluecollector.h> @@ -181,3 +182,8 @@ xfconf_g_value_set_int16(GValue *value, g_return_if_fail(G_VALUE_HOLDS(value, XFCONF_TYPE_INT16)); value->data[0].v_int = v_int16; } + + + +#define __XFCONF_TYPES_C__ +#include "xfconf-aliasdef.c" diff --git a/common/xfconf-util.h b/common/xfconf-util.h index 65fb2c8..1ee64f7 100644 --- a/common/xfconf-util.h +++ b/common/xfconf-util.h @@ -26,9 +26,9 @@ G_BEGIN_DECLS #define XFCONF_DBUS_TYPE_G_DOUBLE_ARRAY (dbus_g_type_get_collection("GArray", G_TYPE_DOUBLE)) -void xfconf_g_value_free(GValue *value); +void xfconf_g_value_free(GValue *value) G_GNUC_INTERNAL; -gboolean xfconf_user_is_in_list(const gchar *list); +gboolean xfconf_user_is_in_list(const gchar *list) G_GNUC_INTERNAL; G_END_DECLS diff --git a/configure.ac.in b/configure.ac.in index 1678704..18b0baa 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -38,6 +38,7 @@ AC_PROG_INSTALL AC_PROG_LIBTOOL dnl AC_PROG_INTLTOOL([0.31], [no-xml]) dnl AC_PROG_MAKE_SET +AC_CHECK_PROGS([PERL], [perl5 perl]) dnl check for standard header files AC_HEADER_STDC @@ -47,18 +48,6 @@ AC_CHECK_HEADERS([errno.h fcntl.h grp.h \ unistd.h]) dnl AC_CHECK_FUNCS([fdwalk getdtablesize setsid sysconf]) -dnl get svn revision -SVN=`which svn` -if test "$SVN" -a -x "$SVN"; then - dir="`dirname $0`" - SVN_REVISION=`LC_ALL=C svn info "$dir" | awk '/^Revision: / {printf "%05d\n", $2}'` -fi -if test -z "$SVN_REVISION"; then - SVN_REVISION="@REVISION@" -fi -AC_DEFINE_UNQUOTED([SVN_REVISION], "$REVISION", [subversion revision number]) -AC_SUBST([SVN_REVISION]) - dnl version information XFCONF_VERSION=xfconf_version LIBXFCONF_VERSION_API=libxfconf_version_api @@ -136,6 +125,36 @@ if test "x$enable_checks" = "xyes"; then [Define if runtime checks should be performed]) fi +dnl check whether the compiler supports the visibility attribute +AC_ARG_ENABLE([visibility], + AC_HELP_STRING([--disable-visibility], + [Don't use ELF visibility attributes]), + [], [enable_visibility=yes]) +have_gnuc_visibility=no +if test "x$enable_visibility" != "xno"; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Wall -Werror" + AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute]) + AC_COMPILE_IFELSE(AC_LANG_SOURCE( + [ + void __attribute__ ((visibility("default"))) test_default (void) {} + void __attribute__ ((visibility("hidden"))) test_hidden (void) {} + int main (int argc, char **argv) { test_default (); test_hidden (); return 0; } + ]), + [ + have_gnuc_visibility=yes + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + ]) + CFLAGS="$save_CFLAGS" +fi +if test "x$have_gnuc_visibility" = "xyes"; then + CPPFLAGS="$CPPFLAGS -DHAVE_GNUC_VISIBILITY" +fi +AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test "x$have_gnuc_visibility" = "xyes"]) + AC_OUTPUT([ Makefile common/Makefile diff --git a/docs/reference/tmpl/xfconf-types.sgml b/docs/reference/tmpl/xfconf-types.sgml index ff88f27..e52c0d9 100644 --- a/docs/reference/tmpl/xfconf-types.sgml +++ b/docs/reference/tmpl/xfconf-types.sgml @@ -9,13 +9,11 @@ GObject types used by the Xfconf daemon and library </para> - <!-- ##### SECTION See_Also ##### --> <para> </para> - <!-- ##### SECTION Stability_Level ##### --> diff --git a/po/xfconf.pot b/po/xfconf.pot index 77c7a49..6cbb544 100644 --- a/po/xfconf.pot +++ b/po/xfconf.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-09-04 04:44-0700\n" +"POT-Creation-Date: 2007-10-27 12:22-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -21,12 +21,61 @@ msgstr "" msgid "Unable to find Xfconf backend of type \"%s\"" msgstr "" -#: xfconfd/xfconf-backend-perchannel-xml.c:110 +#: xfconfd/xfconf-backend-perchannel-xml.c:272 #, c-format msgid "Unable to create configuration directory" msgstr "" -#: xfconfd/xfconf-daemon.c:181 +#: xfconfd/xfconf-backend-perchannel-xml.c:319 +#, c-format +msgid "You don't have permission to modify property \"%s\" on channel \"%s\"" +msgstr "" + +#: xfconfd/xfconf-backend-perchannel-xml.c:362 +#: xfconfd/xfconf-backend-perchannel-xml.c:496 +#, c-format +msgid "Property \"%s\" does not exist on channel \"%s\"" +msgstr "" + +#: xfconfd/xfconf-backend-perchannel-xml.c:533 +#, c-format +msgid "Unable to remove channel \"%s\": %s" +msgstr "" + +#: xfconfd/xfconf-backend-perchannel-xml.c:1136 +#: xfconfd/xfconf-backend-perchannel-xml.c:1203 +#, c-format +msgid "Invalid type for <%s>: \"%s\"" +msgstr "" + +#: xfconfd/xfconf-backend-perchannel-xml.c:1147 +#: xfconfd/xfconf-backend-perchannel-xml.c:1214 +#, c-format +msgid "Unable to parse value from \"%s\"" +msgstr "" + +#: xfconfd/xfconf-backend-perchannel-xml.c:1194 +#, c-format +msgid "The type attribute of <value> cannot be an array" +msgstr "" + +#: xfconfd/xfconf-backend-perchannel-xml.c:1461 +#: xfconfd/xfconf-backend-perchannel-xml.c:1692 +#, c-format +msgid "Channel \"%s\" does not exist" +msgstr "" + +#: xfconfd/xfconf-backend-perchannel-xml.c:1737 +#, c-format +msgid "Unable to write channel \"%s\": %s" +msgstr "" + +#: xfconfd/xfconf-daemon.c:362 #, c-format msgid "Another Xfconf daemon is already running" msgstr "" + +#: xfconfd/xfconf-daemon.c:394 +#, c-format +msgid "No backends could be started" +msgstr "" diff --git a/xfconf/Makefile.am b/xfconf/Makefile.am index 6f02a4b..ff5e239 100644 --- a/xfconf/Makefile.am +++ b/xfconf/Makefile.am @@ -16,6 +16,7 @@ libxfconf_0_la_SOURCES = \ xfconf.c libxfconf_0_la_CFLAGS = \ + -I$(top_srcdir) \ -I$(top_srcdir)/common \ -DLIBXFCONF_COMPILATION \ -DG_LOG_DOMAIN=\"xfconf\" \ @@ -38,6 +39,7 @@ libxfconf_0_la_LIBADD = \ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libxfconf-0.pc + if MAINTAINER_MODE BUILT_SOURCES = \ @@ -48,5 +50,13 @@ xfconf-dbus-bindings.h: $(top_srcdir)/common/xfconf-dbus.xml Makefile | sed -e 's/org_xfce_Xfconf_/xfconf_client_/g;' \ -e 's/_GUI_/_gui_/g;' > $@ +if HAVE_GNUC_VISIBILITY +TESTS = abicheck.sh +endif + endif + +EXTRA_DIST = \ + abicheck.sh \ + xfconf.symbols diff --git a/xfconf/abicheck.sh b/xfconf/abicheck.sh new file mode 100755 index 0000000..afb8318 --- /dev/null +++ b/xfconf/abicheck.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Copyright (c) 2004 The GLib Development Team. +# Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +cpp -P -DINCLUDE_INTERNAL_SYMBOLS -DINCLUDE_VARIABLES -DALL_FILES ${srcdir:-.}/xfconf.symbols | sed -e '/^$/d' -e 's/ XFCONF_GNUC.*$//' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' | sort > expected-abi +nm -D .libs/libxfconf-0.so | grep " T\|R " | cut -d ' ' -f 3 | grep -v '^_.*' | sort > actual-abi +diff -u expected-abi actual-abi && rm expected-abi actual-abi diff --git a/xfconf/xfconf-channel.c b/xfconf/xfconf-channel.c index 71020b6..02114bf 100644 --- a/xfconf/xfconf-channel.c +++ b/xfconf/xfconf-channel.c @@ -30,6 +30,7 @@ #include "xfconf-private.h" #include "xfconf-marshal.h" #include "xfconf-types.h" +#include "common/xfconf-alias.h" #define ALIGN_VAL(val, align) ( ((val) + ((align) -1)) & ~((align) - 1) ) @@ -1684,3 +1685,8 @@ out: return ret; } + + + +#define __XFCONF_CHANNEL_C__ +#include "common/xfconf-aliasdef.c" diff --git a/xfconf/xfconf.c b/xfconf/xfconf.c index 578bf30..579f975 100644 --- a/xfconf/xfconf.c +++ b/xfconf/xfconf.c @@ -32,6 +32,7 @@ #include "xfconf.h" #include "xfconf-marshal.h" #include "xfconf-private.h" +#include "common/xfconf-alias.h" static guint xfconf_refcnt = 0; static DBusGConnection *dbus_conn = NULL; @@ -198,3 +199,8 @@ xfconf_named_struct_register(const gchar *struct_name, g_hash_table_insert(named_structs, g_strdup(struct_name), ns); } + + + +#define __XFCONF_C__ +#include "common/xfconf-aliasdef.c" diff --git a/xfconf/xfconf.symbols b/xfconf/xfconf.symbols new file mode 100644 index 0000000..9daaffd --- /dev/null +++ b/xfconf/xfconf.symbols @@ -0,0 +1,91 @@ +/* + * xfconf + * + * Copyright (c) 2007 Brian Tarricone <bjt23@cornell.edu> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License ONLY. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef ALL_FILES +#define IN_HEADER(x) 1 +#define IN_SOURCE(x) 1 +#endif + +/* xfconf.c */ +#if IN_HEADER(__XFCONF_H__) +#if IN_SOURCE(__XFCONF_C__) +xfconf_init +xfconf_shutdown +xfconf_named_struct_register +#endif +#endif + +/* xfconf-errors.h */ +#if IN_HEADER(__XFCONF_ERRORS_H__) +#if IN_SOURCE(__XFCONF_ERRORS_C__) +xfconf_error_get_type G_GNUC_CONST +xfconf_get_error_quark +#endif +#endif + +/* xfconf-types.h */ +#if IN_HEADER(__XFCONF_TYPES_H__) +#if IN_SOURCE(__XFCONF_TYPES_C__) +xfconf_uint16_get_type G_GNUC_CONST +xfconf_g_value_get_uint16 +xfconf_g_value_set_uint16 +xfconf_int16_get_type G_GNUC_CONST +xfconf_g_value_get_int16 +xfconf_g_value_set_int16 +#endif +#endif + +/* xfconf-channel.h */ +#if IN_HEADER(__XFCONF_CHANNEL_H__) +#if IN_SOURCE(__XFCONF_CHANNEL_C__) +xfconf_channel_get_type G_GNUC_CONST +xfconf_channel_new +xfconf_channel_has_property +xfconf_channel_remove_property +xfconf_channel_get_all +xfconf_channel_get_string +xfconf_channel_set_string +xfconf_channel_get_int +xfconf_channel_set_int +xfconf_channel_get_uint64 +xfconf_channel_set_uint64 +xfconf_channel_get_double +xfconf_channel_set_double +xfconf_channel_get_bool +xfconf_channel_set_bool +xfconf_channel_get_string_list +xfconf_channel_set_string_list +xfconf_channel_get_property +xfconf_channel_set_property +xfconf_channel_get_array +xfconf_channel_get_array_valist +xfconf_channel_get_arrayv +xfconf_channel_set_array +xfconf_channel_set_array_valist +xfconf_channel_set_arrayv +xfconf_channel_get_named_struct +xfconf_channel_set_named_struct +xfconf_channel_get_struct +xfconf_channel_get_struct_valist +xfconf_channel_get_structv +xfconf_channel_set_struct +xfconf_channel_set_struct_valist +xfconf_channel_set_structv +#endif +#endif diff --git a/xfconfd/Makefile.am b/xfconfd/Makefile.am index 62174dc..ef64b88 100644 --- a/xfconfd/Makefile.am +++ b/xfconfd/Makefile.am @@ -24,6 +24,7 @@ xfconfd_CFLAGS = \ -DLIBXFCONF_COMPILATION \ -DBINDIR=\"$(bindir)\" \ -DLOCALEDIR=\"$(localedir)\" \ + -I$(top_srcdir) \ -I$(top_srcdir)/common \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ |