Simplify linker script
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Tue, 21 Sep 2010 12:47:35 +0000 (09:47 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 21 Sep 2010 14:23:23 +0000 (23:23 +0900)
Version linker scripts support function names and globs, so there's no
need to rely on nm tool to gather the exported symbols.

.gitignore
Makefile.am
configure.ac
src/connman.ver [new file with mode: 0644]

index fb4f50b..5a173f7 100644 (file)
@@ -29,8 +29,6 @@ include/connman
 include/version.h
 src/builtin.h
 src/connmand
-src/connman.exp
-src/connman.ver
 src/connman.conf
 src/connman.service
 src/*-connman.rules
index 97d41d0..6627e2f 100644 (file)
@@ -86,8 +86,7 @@ src_connmand_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=src/connman.ver
 
 src_connmand_DEPENDENCIES = src/connman.ver
 
-CLEANFILES = src/connman.ver src/connman.exp src/connman.conf \
-                                               src/builtin.h $(local_headers)
+CLEANFILES = src/connman.conf src/builtin.h $(local_headers)
 
 statedir = $(localstatedir)/run/connman
 
@@ -241,15 +240,6 @@ src/plugin.$(OBJEXT): src/builtin.h
 src/builtin.h: src/genbuiltin $(builtin_sources)
        $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
 
-src/connman.exp: $(src_connmand_OBJECTS)
-       $(AM_V_GEN)$(NM) $^ | $(AWK) '{ print $$3 }' | sort -u | \
-               $(EGREP) -e '^connman_' -e '^g_dbus_' -e '^g_dhcp_' > $@
-
-src/connman.ver: src/connman.exp
-       $(AM_V_at)echo "{ global:" > $@
-       $(AM_V_GEN)$(SED) -e "s/\(.*\)/\1;/" $< >> $@
-       $(AM_V_at)echo "local: *; };" >> $@
-
 src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
 if POLKIT
        $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
index 6d96066..24c61ff 100644 (file)
@@ -23,8 +23,6 @@ AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CC_PIE
 AC_PROG_INSTALL
-AC_PROG_SED
-AC_PROG_AWK
 AM_PROG_MKDIR_P
 
 m4_define([_LT_AC_TAGCONFIG], [])
@@ -32,7 +30,6 @@ m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
 
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
-AC_PROG_NM
 
 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
                        [disable code optimization through compiler]), [
diff --git a/src/connman.ver b/src/connman.ver
new file mode 100644 (file)
index 0000000..9a178a2
--- /dev/null
@@ -0,0 +1,8 @@
+{
+       global:
+               connman_*;
+               g_dbus_*;
+               g_dhcp_*;
+       local:
+               *;
+};