[asterisk-commits] kpfleming: branch 1.4 r43450 - in /branches/1.4: build_tools/ main/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Sep 21 14:21:29 MST 2006


Author: kpfleming
Date: Thu Sep 21 16:21:29 2006
New Revision: 43450

URL: http://svn.digium.com/view/asterisk?rev=43450&view=rev
Log:
add another attempt to strip non-API symbols from the final binary... script will need to be extended to work on non-Linux systems

Added:
    branches/1.4/build_tools/strip_nonapi   (with props)
Modified:
    branches/1.4/main/Makefile

Added: branches/1.4/build_tools/strip_nonapi
URL: http://svn.digium.com/view/asterisk/branches/1.4/build_tools/strip_nonapi?rev=43450&view=auto
==============================================================================
--- branches/1.4/build_tools/strip_nonapi (added)
+++ branches/1.4/build_tools/strip_nonapi Thu Sep 21 16:21:29 2006
@@ -1,0 +1,28 @@
+#!/bin/sh -e
+
+# This script is designed to remove all non-API global symbols from an object
+# file. The only global symbols that should be retained are those that belong
+# to the official namespace. Unfortunately doing this is platform-specific, as
+# the object file manipulation tools are not consistent across platforms.
+#
+# On platforms where this script does not know what to do, the object file
+# will retain non-API global symbols, and this may have unpleasant side effects.
+#
+# Prefixes that belong to the official namespace are:
+#	ast_
+#	_ast_
+#	__ast_
+#	astman_
+#	pbx_
+
+FILTER="grep -v -e ^ast_ -e ^_ast_ -e ^__ast_ -e ^astman_ -e ^pbx_"
+
+case "${OSARCH}" in
+    linux-gnu)
+	nm ${1} | grep -e " T " | cut -d" " -f3 | ${FILTER} > striplist
+	sed -e "s/^/-N /" striplist | xargs strip ${1}
+	rm -f striplist
+	;;
+    *)
+	;;
+esac

Propchange: branches/1.4/build_tools/strip_nonapi
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/1.4/build_tools/strip_nonapi
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/1.4/build_tools/strip_nonapi
------------------------------------------------------------------------------
    svn:keywords = Author Id Date Revision

Propchange: branches/1.4/build_tools/strip_nonapi
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: branches/1.4/main/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/Makefile?rev=43450&r1=43449&r2=43450&view=diff
==============================================================================
--- branches/1.4/main/Makefile (original)
+++ branches/1.4/main/Makefile Thu Sep 21 16:21:29 2006
@@ -130,7 +130,8 @@
 	@rm -f $(ASTTOPDIR)/include/asterisk/build.h.tmp
 	@$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
 	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o asterisk $(ASTLINK) $(AST_EMBED_LDFLAGS) $(LDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
+	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(LDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
+	@$(ASTTOPDIR)/build_tools/strip_nonapi $@
 
 clean::
 	rm -f asterisk



More information about the asterisk-commits mailing list