From e5214a661c18b16040393d5900962f1ac6e76d2e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Jul 2008 03:14:33 +0200 Subject: [PATCH] Only export external functions when building daemon --- plugins/Makefile.am | 3 ++- src/Makefile.am | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 68ea95a..37ee862 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -20,7 +20,8 @@ dhclient_la_CFLAGS = @GDBUS_CFLAGS@ -DDHCLIENT=\"@DHCLIENT@\" \ ipv4_la_SOURCES = ipv4.c -AM_LDFLAGS = -module -avoid-version -export-symbols-regex connman_plugin_desc +AM_LDFLAGS = -no-undefined -module -avoid-version \ + -export-symbols-regex connman_plugin_desc statedir = $(localstatedir)/run/connman diff --git a/src/Makefile.am b/src/Makefile.am index af26d42..a1a7dac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,7 +15,13 @@ connmand_SOURCES = main.c connman.h log.c plugin.c element.c \ storage.c manager.c agent.c connmand_LDADD = @SQLITE_LIBS@ @GDBUS_LIBS@ @GMODULE_LIBS@ @GTHREAD_LIBS@ - + +connmand_LDFLAGS = -Wl,--version-script=connman.ver + +connmand_DEPENDENCIES = connman.ver + +CLEANFILES = connman.ver connman.exp + statedir = $(localstatedir)/run/connman storagedir = $(localstatedir)/lib/connman @@ -36,3 +42,11 @@ INCLUDES = -I$(top_builddir)/include EXTRA_DIST = $(dbus_DATA) MAINTAINERCLEANFILES = Makefile.in + +connman.exp: + nm -B *.o | awk '{ print $$3 }' | sort -u | grep -E -e '^connman_' > $@ + +connman.ver: connman.exp + echo "{ global:" > $@ + cat $< | sed -e "s/\(.*\)/\1;/" >> $@ + echo "local: *; };" >> $@ -- 2.7.4