Use GCC visibility for exporting symbols
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 9 Mar 2009 13:01:14 +0000 (14:01 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 9 Mar 2009 13:01:14 +0000 (14:01 +0100)
include/plugin.h
plugins/Makefile.am

index 059c50a..086786c 100644 (file)
@@ -79,6 +79,8 @@ struct connman_plugin_desc {
  * ]|
  */
 #define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init, exit) \
+               extern struct connman_plugin_desc connman_plugin_desc \
+                               __attribute__ ((visibility("default"))); \
                struct connman_plugin_desc connman_plugin_desc = { \
                        #name, description, version, priority, init, exit \
                };
index 4c43ea5..fec81d5 100644 (file)
@@ -57,7 +57,7 @@ if UDHCP
 plugin_LTLIBRARIES += udhcp.la
 
 udhcp_la_SOURCES = udhcp.c inet.h inet.c task.h task.c
-udhcp_la_CFLAGS = @GLIB_CFLAGS@ @GDBUS_CFLAGS@ -DUDHCPC=\"@UDHCPC@\" \
+udhcp_la_CFLAGS = $(AM_CFLAGS) -DUDHCPC=\"@UDHCPC@\" \
                -DSTATEDIR=\""$(statedir)"\" -DSCRIPTDIR=\""$(scriptdir)"\"
 endif
 
@@ -65,7 +65,7 @@ if DHCLIENT
 plugin_LTLIBRARIES += dhclient.la
 
 dhclient_la_SOURCES = dhclient.c inet.h inet.c
-dhclient_la_CFLAGS = @GLIB_CFLAGS@ @GDBUS_CFLAGS@ -DDHCLIENT=\"@DHCLIENT@\" \
+dhclient_la_CFLAGS = $(AM_CFLAGS) -DDHCLIENT=\"@DHCLIENT@\" \
                -DSTATEDIR=\""$(statedir)"\" -DSCRIPTDIR=\""$(scriptdir)"\"
 endif
 
@@ -73,14 +73,14 @@ if PPPD
 plugin_LTLIBRARIES += pppd.la
 
 pppd_la_SOURCES = pppd.c
-pppd_la_CFLAGS = @GLIB_CFLAGS@ -DPPPD=\"@PPPD@\"
+pppd_la_CFLAGS = $(AM_CFLAGS) -DPPPD=\"@PPPD@\"
 endif
 
 if RESOLVCONF
 plugin_LTLIBRARIES += resolvconf.la
 
 resolvconf_la_SOURCES = resolvconf.c
-resolvconf_la_CFLAGS = @GLIB_CFLAGS@ -DRESOLVCONF=\"@RESOLVCONF@\"
+resolvconf_la_CFLAGS = $(AM_CFLAGS) -DRESOLVCONF=\"@RESOLVCONF@\"
 endif
 
 if DNSPROXY
@@ -94,7 +94,7 @@ plugin_LTLIBRARIES += polkit.la
 
 polkit_la_SOURCES = polkit.c
 polkit_la_LIBADD = @POLKIT_LIBS@ @GLIB_LIBS@
-polkit_la_CFLAGS = @GLIB_CFLAGS@ @POLKIT_CFLAGS@
+polkit_la_CFLAGS = $(AM_CFLAGS) @POLKIT_CFLAGS@
 
 if DATAFILES
 policydir = @POLKIT_DATADIR@
@@ -107,7 +107,7 @@ if OSPM
 plugin_LTLIBRARIES += ospm.la
 
 polkit_la_SOURCES = ospm.c
-polkit_la_CFLAGS = @GDBUS_CFLAGS@
+polkit_la_CFLAGS = $(AM_CFLAGS)
 endif
 
 if FAKE
@@ -116,8 +116,7 @@ plugin_LTLIBRARIES += fake.la
 fake_la_SOURCES = fake.c
 endif
 
-AM_LDFLAGS = -no-undefined -module -avoid-version \
-                               -export-symbols-regex connman_plugin_desc
+AM_LDFLAGS = -no-undefined -module -avoid-version
 
 statedir = $(localstatedir)/run/connman
 
@@ -127,7 +126,7 @@ else
 scriptdir = $(libdir)/connman/scripts
 endif
 
-AM_CFLAGS = @GLIB_CFLAGS@ @GDBUS_CFLAGS@
+AM_CFLAGS = -fvisibility=hidden @GLIB_CFLAGS@ @GDBUS_CFLAGS@
 
 INCLUDES = -I$(top_builddir)/include