OSDN Git Service

Use GCC visibility for exporting symbols
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 11 Mar 2009 11:02:00 +0000 (12:02 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 11 Mar 2009 11:02:00 +0000 (12:02 +0100)
audio/Makefile.am
audio/gstbluetooth.c
input/Makefile.am
network/Makefile.am
plugins/Makefile.am
serial/Makefile.am
src/plugin.h

index 43030b8..f5ca4ee 100644 (file)
@@ -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)
 
index 072b12e..7775b48 100644 (file)
@@ -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/")
index bf8a4c0..98ce928 100644 (file)
@@ -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
 
index 5966a61..f5cb320 100644 (file)
@@ -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
 
index 3b258a3..a1e933f 100644 (file)
@@ -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
 
index a3bd6d1..4fa455f 100644 (file)
@@ -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
 
index c735e5d..31bcce8 100644 (file)
@@ -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 \
                };