From 92bd92f8514ee69f464e965ec465adb86ff882b9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 11 Mar 2009 12:02:00 +0100 Subject: Use GCC visibility for exporting symbols --- audio/Makefile.am | 14 ++++++++------ audio/gstbluetooth.c | 2 ++ input/Makefile.am | 10 +++++----- network/Makefile.am | 10 +++++----- plugins/Makefile.am | 7 +++---- serial/Makefile.am | 10 +++++----- src/plugin.h | 2 ++ 7 files changed, 30 insertions(+), 25 deletions(-) diff --git a/audio/Makefile.am b/audio/Makefile.am index 43030b8f..f5ca4ee2 100644 --- a/audio/Makefile.am +++ b/audio/Makefile.am @@ -13,8 +13,7 @@ audio_la_SOURCES = main.c \ nodist_audio_la_SOURCES = $(BUILT_SOURCES) -audio_la_LDFLAGS = -module -avoid-version -no-undefined \ - -export-symbols-regex bluetooth_plugin_desc +audio_la_LDFLAGS = -module -avoid-version -no-undefined LDADD = $(top_builddir)/common/libhelper.a \ @GDBUS_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@ @@ -49,13 +48,16 @@ libgstbluetooth_la_SOURCES = gstbluetooth.c \ gstsbcutil.h gstsbcutil.c \ gstrtpsbcpay.h gstrtpsbcpay.c \ rtp.h ipc.h ipc.c -libgstbluetooth_la_LDFLAGS = -module -avoid-version -export-symbols-regex gst_plugin_desc -libgstbluetooth_la_LIBADD = @SBC_LIBS@ @BLUEZ_LIBS@ @GSTREAMER_LIBS@ -lgstaudio-0.10 -lgstrtp-0.10 -libgstbluetooth_la_CFLAGS = @GSTREAMER_CFLAGS@ @BLUEZ_CFLAGS@ @SBC_CFLAGS@ +libgstbluetooth_la_LDFLAGS = -module -avoid-version +libgstbluetooth_la_LIBADD = @SBC_LIBS@ @BLUEZ_LIBS@ @GSTREAMER_LIBS@ \ + -lgstaudio-0.10 -lgstrtp-0.10 +libgstbluetooth_la_CFLAGS = -fvisibility=hidden \ + @GSTREAMER_CFLAGS@ @BLUEZ_CFLAGS@ @SBC_CFLAGS@ endif endif -AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ +AM_CFLAGS = -fvisibility=hidden \ + @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ CLEANFILES = $(BUILT_SOURCES) diff --git a/audio/gstbluetooth.c b/audio/gstbluetooth.c index 072b12ee..7775b48d 100644 --- a/audio/gstbluetooth.c +++ b/audio/gstbluetooth.c @@ -99,6 +99,8 @@ static gboolean plugin_init(GstPlugin *plugin) return TRUE; } +extern GstPluginDesc gst_plugin_desc __attribute__ ((visibility("default"))); + GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR, "bluetooth", "Bluetooth plugin library", plugin_init, VERSION, "LGPL", "BlueZ", "http://www.bluez.org/") diff --git a/input/Makefile.am b/input/Makefile.am index bf8a4c0a..98ce9287 100644 --- a/input/Makefile.am +++ b/input/Makefile.am @@ -5,17 +5,17 @@ plugindir = $(libdir)/bluetooth/plugins plugin_LTLIBRARIES = input.la input_la_SOURCES = main.c manager.h manager.c \ - server.h server.c device.h device.c \ - fakehid.c fakehid.h + server.h server.c device.h device.c \ + fakehid.c fakehid.h LDADD = $(top_builddir)/common/libhelper.a \ @GDBUS_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@ endif -AM_LDFLAGS = -module -avoid-version -no-undefined \ - -export-symbols-regex bluetooth_plugin_desc +AM_LDFLAGS = -module -avoid-version -no-undefined -AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ +AM_CFLAGS = -fvisibility=hidden \ + @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/src diff --git a/network/Makefile.am b/network/Makefile.am index 5966a619..f5cb3205 100644 --- a/network/Makefile.am +++ b/network/Makefile.am @@ -5,17 +5,17 @@ plugindir = $(libdir)/bluetooth/plugins plugin_LTLIBRARIES = network.la network_la_SOURCES = main.c manager.h manager.c \ - server.h server.c bridge.h bridge.c \ - connection.h connection.c common.h common.c + server.h server.c bridge.h bridge.c \ + connection.h connection.c common.h common.c LDADD = $(top_builddir)/common/libhelper.a \ @GDBUS_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@ endif -AM_LDFLAGS = -module -avoid-version -no-undefined \ - -export-symbols-regex bluetooth_plugin_desc +AM_LDFLAGS = -module -avoid-version -no-undefined -AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ +AM_CFLAGS = -fvisibility=hidden \ + @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/src diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 3b258a36..a1e933f9 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -31,11 +31,10 @@ if SERVICEPLUGIN service_la_SOURCES = service.c endif -AM_LDFLAGS = -module -avoid-version -no-undefined \ - -export-symbols-regex bluetooth_plugin_desc +AM_LDFLAGS = -module -avoid-version -no-undefined -AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ \ - @GDBUS_CFLAGS@ @NETLINK_CFLAGS@ +AM_CFLAGS = -fvisibility=hidden @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ \ + @GLIB_CFLAGS@ @GDBUS_CFLAGS@ @NETLINK_CFLAGS@ INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/src diff --git a/serial/Makefile.am b/serial/Makefile.am index a3bd6d1f..4fa455f5 100644 --- a/serial/Makefile.am +++ b/serial/Makefile.am @@ -5,17 +5,17 @@ plugindir = $(libdir)/bluetooth/plugins plugin_LTLIBRARIES = serial.la serial_la_SOURCES = main.c \ - manager.h manager.c port.h port.c \ - storage.h storage.c proxy.h proxy.c + manager.h manager.c port.h port.c \ + storage.h storage.c proxy.h proxy.c LDADD = $(top_builddir)/common/libhelper.a \ @GDBUS_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ @BLUEZ_LIBS@ endif -AM_LDFLAGS = -module -avoid-version -no-undefined \ - -export-symbols-regex bluetooth_plugin_desc +AM_LDFLAGS = -module -avoid-version -no-undefined -AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ +AM_CFLAGS = -fvisibility=hidden \ + @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ INCLUDES = -I$(top_srcdir)/common -I$(top_srcdir)/src diff --git a/src/plugin.h b/src/plugin.h index c735e5de..31bcce87 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -28,6 +28,8 @@ struct bluetooth_plugin_desc { }; #define BLUETOOTH_PLUGIN_DEFINE(name,init,exit) \ + extern struct bluetooth_plugin_desc bluetooth_plugin_desc \ + __attribute__ ((visibility("default"))); \ struct bluetooth_plugin_desc bluetooth_plugin_desc = { \ name, init, exit \ }; -- cgit