Commit 4553fba6 authored by Jannis Pohlmann's avatar Jannis Pohlmann

Use -export-symbols-regex instead of XDT_FEATURE_VISIBILITY.

XDT_FEATURE_VISIBILITY() breaks plugins as it strips thunar_extension*
functions from the final shared library files. An alternative way to
XDT_FEATURE_VISIBILITY() and the old visibility configure code used in
Thunar is to define -export-symbols-regex (e.g. by setting it to
"^thunar_extension.*") in Makefile.am of each plugin.

This also removes the alias stuff in Thunarx, as we no longer need to
define which symbols to export or not via the alias header. All symbols
starting with _ are now automatically marked as private and are not
exported. Additionally, G_GNUC_INTERNAL can be used to hide symbols.

thunarx.symbols is preserved for ABI checks and still has to be updated
when new symbols are added.

Hope all this is ok. Double-checkers to the rescue!
parent af1ad121
......@@ -210,10 +210,10 @@ dnl *** Check for linker optimizations ***
dnl **************************************
XDT_FEATURE_LINKER_OPTS()
dnl ****************************************
dnl *** Check for ELF visibility support ***
dnl ****************************************
XDT_FEATURE_VISIBILITY()
dnl dnl ****************************************
dnl dnl *** Check for ELF visibility support ***
dnl dnl ****************************************
dnl XDT_FEATURE_VISIBILITY()
dnl *********************************
dnl *** Substitute platform flags ***
......
......@@ -34,6 +34,7 @@ thunar_apr_la_CFLAGS = \
thunar_apr_la_LDFLAGS = \
-avoid-version \
-export-dynamic \
-export-symbols-regex="^thunar_extension_(shutdown|initialize|list_types)" \
-module \
$(PLATFORM_LDFLAGS)
......
......@@ -40,6 +40,7 @@ thunar_sbr_la_CFLAGS = \
thunar_sbr_la_LDFLAGS = \
-avoid-version \
-export-dynamic \
-export-symbols-regex="^thunar_extension_(shutdown|initialize|list_types)" \
-module \
$(PLATFORM_LDFLAGS)
......
......@@ -38,6 +38,7 @@ thunar_uca_la_CFLAGS = \
thunar_uca_la_LDFLAGS = \
-avoid-version \
-export-dynamic \
-export-symbols-regex="^thunar_extension_(shutdown|initialize|list_types)" \
-module \
$(PLATFORM_LDFLAGS)
......
INCLUDES = \
-I$(top_builddir) \
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"thunar-wallpaper-plugin\" \
INCLUDES = \
-I$(top_builddir) \
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"thunar-wallpaper-plugin\" \
-DEXO_API_SUBJECT_TO_CHANGE \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
$(PLATFORM_CPPFLAGS)
extensionsdir = $(libdir)/thunarx-$(THUNARX_VERSION_API)
extensions_LTLIBRARIES = \
extensions_LTLIBRARIES = \
thunar-wallpaper-plugin.la
thunar_wallpaper_plugin_la_SOURCES = \
thunar_wallpaper_plugin_la_SOURCES = \
twp-provider.h \
twp-provider.c \
thunar-wallpaper-plugin.c
thunar_wallpaper_plugin_la_CFLAGS = \
thunar_wallpaper_plugin_la_CFLAGS = \
$(PLATFORM_CFLAGS) \
$(THUNARX_CFLAGS) \
$(EXO_CFLAGS)
thunar_wallpaper_plugin_la_LDFLAGS = \
thunar_wallpaper_plugin_la_LDFLAGS = \
-avoid-version \
-export-dynamic \
-module \
-export-symbols-regex="^thunar_extension_(shutdown|initialize|list_types)" \
-module \
$(PLATFORM_LDFLAGS) \
$(THUNARX_LDFLAGS)
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
......@@ -7,10 +7,6 @@ INCLUDES = \
-DTHUNARX_DIRECTORY=\"$(libdir)/thunarx-$(THUNARX_VERSION_API)\" \
$(PLATFORM_CPPFLAGS)
libthunarx_built_sources = \
thunarx-alias.h \
thunarx-aliasdef.c
libthunarx_headers = \
thunarx.h \
thunarx-config.h \
......@@ -34,7 +30,6 @@ lib_LTLIBRARIES = \
libthunarx-2.la
libthunarx_2_la_SOURCES = \
$(libthunarx_built_sources) \
$(libthunarx_headers) \
thunarx-config.c \
thunarx-file-info.c \
......@@ -73,10 +68,7 @@ pkgconfig_DATA = thunarx-2.pc
EXTRA_DIST = \
abicheck.sh \
make-thunarx-alias.pl \
thunarx.symbols \
thunarx-alias.h \
thunarx-aliasdef.c
thunarx.symbols
##
## Rules to auto-generate built sources
......@@ -92,22 +84,9 @@ CLEANFILES = \
actual-abi \
expected-abi
DISTCLEANFILES = \
$(libthunarx_built_sources)
BUILT_SOURCES = \
$(libthunarx_built_sources)
if HAVE_GNUC_VISIBILITY
TESTS = \
abicheck.sh
endif
thunarx-alias.h: make-thunarx-alias.pl thunarx.symbols
$(PERL) $(srcdir)/make-thunarx-alias.pl < $(srcdir)/thunarx.symbols > thunarx-alias.h
thunarx-aliasdef.c: make-thunarx-alias.pl thunarx.symbols
$(PERL) $(srcdir)/make-thunarx-alias.pl -def < $(srcdir)/thunarx.symbols > thunarx-aliasdef.c
endif
# required for gtk-doc
......
#!/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-thunarx-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
......@@ -23,7 +23,6 @@
#endif
#include <thunarx/thunarx-config.h>
#include <thunarx/thunarx-alias.h>
......@@ -124,8 +123,3 @@ thunarx_check_version (guint required_major,
{
return NULL;
}
#define __THUNARX_CONFIG_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -25,7 +25,6 @@
#include <thunarx/thunarx-file-info.h>
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-alias.h>
......@@ -444,8 +443,3 @@ thunarx_file_info_list_free (GList *file_infos)
g_list_foreach (file_infos, (GFunc) g_object_unref, NULL);
g_list_free (file_infos);
}
#define __THUNARX_FILE_INFO_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -24,7 +24,6 @@
#include <thunarx/thunarx-menu-provider.h>
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-alias.h>
......@@ -229,8 +228,3 @@ thunarx_menu_provider_get_dnd_actions (ThunarxMenuProvider *provider,
return actions;
}
#define __THUNARX_MENU_PROVIDER_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -24,7 +24,6 @@
#include <thunarx/thunarx-preferences-provider.h>
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-alias.h>
......@@ -104,8 +103,3 @@ thunarx_preferences_provider_get_actions (ThunarxPreferencesProvider *provider,
return actions;
}
#define __THUNARX_PREFERENCES_PROVIDER_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -24,7 +24,6 @@
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-property-page-provider.h>
#include <thunarx/thunarx-alias.h>
......@@ -126,8 +125,3 @@ thunarx_property_page_provider_get_pages (ThunarxPropertyPageProvider *provider,
return pages;
}
#define __THUNARX_PROPERTY_PAGE_PROVIDER_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -26,7 +26,6 @@
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-property-page.h>
#include <thunarx/thunarx-alias.h>
......@@ -390,8 +389,3 @@ thunarx_property_page_set_label_widget (ThunarxPropertyPage *property_page,
g_object_notify (G_OBJECT (property_page), "label-widget");
g_object_thaw_notify (G_OBJECT (property_page));
}
#define __THUNARX_PROPERTY_PAGE_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -28,7 +28,6 @@
#include <thunarx/thunarx-provider-factory.h>
#include <thunarx/thunarx-provider-module.h>
#include <thunarx/thunarx-provider-plugin.h>
#include <thunarx/thunarx-alias.h>
......@@ -336,8 +335,3 @@ thunarx_provider_factory_list_providers (ThunarxProviderFactory *factory,
return providers;
}
#define __THUNARX_PROVIDER_FACTORY_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -27,7 +27,6 @@
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-provider-module.h>
#include <thunarx/thunarx-provider-plugin.h>
#include <thunarx/thunarx-alias.h>
......@@ -299,8 +298,3 @@ thunarx_provider_module_list_types (const ThunarxProviderModule *module,
(*module->list_types) (types, n_types);
}
#define __THUNARX_PROVIDER_MODULE_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -26,7 +26,6 @@
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-provider-plugin.h>
#include <thunarx/thunarx-alias.h>
......@@ -242,8 +241,3 @@ thunarx_provider_plugin_register_flags (ThunarxProviderPlugin *plugin,
return (*THUNARX_PROVIDER_PLUGIN_GET_IFACE (plugin)->register_flags) (plugin, name, const_static_values);
}
#define __THUNARX_PROVIDER_PLUGIN_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -24,7 +24,6 @@
#include <thunarx/thunarx-renamer-provider.h>
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-alias.h>
......@@ -107,8 +106,3 @@ thunarx_renamer_provider_get_renamers (ThunarxRenamerProvider *provider)
/* and return the list of renamers */
return renamers;
}
#define __THUNARX_RENAMER_PROVIDER_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -26,7 +26,6 @@
#include <thunarx/thunarx-renamer.h>
#include <thunarx/thunarx-private.h>
#include <thunarx/thunarx-alias.h>
......@@ -706,8 +705,3 @@ thunarx_renamer_changed (ThunarxRenamer *renamer)
g_return_if_fail (THUNARX_IS_RENAMER (renamer));
g_signal_emit (G_OBJECT (renamer), renamer_signals[CHANGED], 0);
}
#define __THUNARX_RENAMER_C__
#include <thunarx/thunarx-aliasdef.c>
......@@ -20,34 +20,15 @@
*/
/* This file lists all exported symbols. It is used to generate
* the thunarx.def file used to control exports on Windows and the
* thunarx-alias.h/thunarx-aliasdef.c files used to avoid PLT
* entries for * internal uses of exported functions (see
* make-thunarx-alias.pl).
*
* Every symbol must be included in the right
* #ifdef IN_HEADER(sym) #endif and
* #ifdef IN_SOURCE(sym) #endif sections.
*/
#ifdef ALL_FILES
#define IN_SOURCE(x) 1
#define IN_HEADER(x) 1
#endif
* for ABI compatibility checks. */
/* thunarx-config symbols */
#if IN_HEADER(__THUNARX_CONFIG_H__)
#if IN_SOURCE(__THUNARX_CONFIG_C__)
thunarx_major_version
thunarx_minor_version
thunarx_micro_version
thunarx_check_version
#endif
#endif
/* ThunarxFileInfo methods */
#if IN_HEADER(__THUNARX_FILE_INFO_H__)
#if IN_SOURCE(__THUNARX_FILE_INFO_C__)
thunarx_file_info_get_type G_GNUC_CONST
thunarx_file_info_get_name
thunarx_file_info_get_uri
......@@ -64,30 +45,18 @@ thunarx_file_info_renamed
thunarx_file_info_list_get_type
thunarx_file_info_list_copy
thunarx_file_info_list_free
#endif
#endif
/* ThunarxMenuProvider methods */
#if IN_HEADER(__THUNARX_MENU_PROVIDER_H__)
#if IN_SOURCE(__THUNARX_MENU_PROVIDER_C__)
thunarx_menu_provider_get_type G_GNUC_CONST
thunarx_menu_provider_get_file_actions G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
thunarx_menu_provider_get_folder_actions G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
thunarx_menu_provider_get_dnd_actions G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT
#endif
#endif
/* ThunarxPreferencesProvider methods */
#if IN_HEADER(__THUNARX_PREFERENCES_PROVIDER_H__)
#if IN_SOURCE(__THUNARX_PREFERENCES_PROVIDER_C__)
thunarx_preferences_provider_get_type G_GNUC_CONST
thunarx_preferences_provider_get_actions
#endif
#endif
/* ThunarxPropertyPage methods */
#if IN_HEADER(__THUNARX_PROPERTY_PAGE_H__)
#if IN_SOURCE(__THUNARX_PROPERTY_PAGE_C__)
thunarx_property_page_get_type G_GNUC_CONST
thunarx_property_page_new G_GNUC_MALLOC
thunarx_property_page_new_with_label_widget G_GNUC_MALLOC
......@@ -95,29 +64,17 @@ thunarx_property_page_get_label
thunarx_property_page_set_label
thunarx_property_page_get_label_widget
thunarx_property_page_set_label_widget
#endif
#endif
/* ThunarxPropertyPageProvider methods */
#if IN_HEADER(__THUNARX_PROPERTY_PAGE_PROVIDER_H__)
#if IN_SOURCE(__THUNARX_PROPERTY_PAGE_PROVIDER_C__)
thunarx_property_page_provider_get_type G_GNUC_CONST
thunarx_property_page_provider_get_pages
#endif
#endif
/* ThunarxProviderFactory methods */
#if IN_HEADER(__THUNARX_PROVIDER_FACTORY_H__)
#if IN_SOURCE(__THUNARX_PROVIDER_FACTORY_C__)
thunarx_provider_factory_get_type G_GNUC_CONST
thunarx_provider_factory_get_default
thunarx_provider_factory_list_providers G_GNUC_MALLOC
#endif
#endif
/* ThunarxProviderPlugin methods */
#if IN_HEADER(__THUNARX_PROVIDER_PLUGIN_H__)
#if IN_SOURCE(__THUNARX_PROVIDER_PLUGIN_C__)
thunarx_provider_plugin_get_type G_GNUC_CONST
thunarx_provider_plugin_get_resident
thunarx_provider_plugin_set_resident
......@@ -125,12 +82,8 @@ thunarx_provider_plugin_register_type
thunarx_provider_plugin_add_interface
thunarx_provider_plugin_register_enum
thunarx_provider_plugin_register_flags
#endif
#endif
/* ThunarxRenamer methods */
#if IN_HEADER(__THUNARX_RENAMER_H__)
#if IN_SOURCE(__THUNARX_RENAMER_C__)
thunarx_renamer_get_type G_GNUC_CONST
thunarx_renamer_get_help_url
thunarx_renamer_set_help_url
......@@ -141,14 +94,8 @@ thunarx_renamer_save
thunarx_renamer_load
thunarx_renamer_get_actions G_GNUC_MALLOC
thunarx_renamer_changed
#endif
#endif
/* ThunarxRenamerProvider methods */
#if IN_HEADER(__THUNARX_RENAMER_PROVIDER_H__)
#if IN_SOURCE(__THUNARX_RENAMER_PROVIDER_C__)
thunarx_renamer_provider_get_type G_GNUC_CONST
thunarx_renamer_provider_get_renamers G_GNUC_MALLOC
#endif
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment