summaryrefslogtreecommitdiff
path: root/pjsip-apps
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-07-14 15:20:00 +0000
committerBenny Prijono <bennylp@teluu.com>2006-07-14 15:20:00 +0000
commit08d0de3ade0e6866aa3c09ffcc028d25233fe179 (patch)
tree92cf24c5c1d1a97bc749dd3b6e345ab4e4e43c1e /pjsip-apps
parent8fe835ee6304768e39a285c878e9d3c0fe3b8957 (diff)
Attempt to get some applications linked for RTEMS target, just to get the footprint calculation working
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@604 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r--pjsip-apps/build/Footprint.mak6
-rw-r--r--pjsip-apps/build/get-footprint.py37
-rw-r--r--pjsip-apps/src/pjsua/main_rtems.c12
-rw-r--r--pjsip-apps/src/samples/footprint.c11
-rw-r--r--pjsip-apps/src/samples/main_rtems.c12
5 files changed, 63 insertions, 15 deletions
diff --git a/pjsip-apps/build/Footprint.mak b/pjsip-apps/build/Footprint.mak
index 735aef25..26055cf0 100644
--- a/pjsip-apps/build/Footprint.mak
+++ b/pjsip-apps/build/Footprint.mak
@@ -44,10 +44,12 @@ export _LDFLAGS := $(LIBS) \
EXE := footprint.exe
all:
- $(CC_NAME) -o $(EXE) ../src/samples/footprint.c $(FCFLAGS) $(_CFLAGS) $(_LDFLAGS)
+ $(CROSS_COMPILE)$(CC_NAME) -o $(EXE) ../src/samples/footprint.c $(FCFLAGS) $(_CFLAGS) $(_LDFLAGS)
+ $(CROSS_COMPILE)strip --strip-all $(EXE)
clean:
rm -f $(EXE)
print_name:
- @echo $(MACHINE_NAME) $(OS_NAME) $(CC_NAME) `$(CC_NAME) -dumpversion`
+ @echo $(MACHINE_NAME) $(OS_NAME) $(CROSS_COMPILE)$(CC_NAME) `$(CROSS_COMPILE)$(CC_NAME) -dumpversion`
+
diff --git a/pjsip-apps/build/get-footprint.py b/pjsip-apps/build/get-footprint.py
index 3576b12a..bef4aa38 100644
--- a/pjsip-apps/build/get-footprint.py
+++ b/pjsip-apps/build/get-footprint.py
@@ -32,8 +32,10 @@ compile_flags = [
['BASE', 'Empty application size'],
['', 'Subtotal: empty application size on this platform'],
- ['HAS_PJLIB', 'PJLIB (pool, data structures, hash tables, ioqueue, socket, timer heap, etc.)'],
- ['', 'Subtotal: Minimal PJLIB application size'],
+ ['HAS_PJLIB', 'PJLIB (pool, data structures, hash tables, ioqueue, socket, timer heap, etc.). ' +
+ 'For targets that statically link application with LIBC, the size includes ' +
+ 'various LIBC functions that are used by PJLIB.'],
+ ['', 'Subtotal: Application linked with PJLIB'],
# PJLIB-UTIL
['HAS_PJLIB_STUN', 'PJLIB-UTIL STUN client'],
@@ -46,7 +48,7 @@ compile_flags = [
['HAS_PJSIP_CORE', 'PJSIP Core - Endpoint (transport management, module management, event distribution, etc.)'],
['HAS_PJSIP_CORE_MSG_UTIL', 'PJSIP Core - Stateless operations, server resolution and fail-over'],
['HAS_PJSIP_UDP_TRANSPORT', 'PJSIP UDP transport'],
- ['', 'Subtotal: A very minimum SIP application (parsing, UDP transport+STUN, no transaction)'],
+ ['', 'Subtotal: A minimalistic SIP application (parsing, UDP transport+STUN, no transaction)'],
['HAS_PJSIP_TCP_TRANSPORT', 'PJSIP TCP transport'],
['HAS_PJSIP_INFO', 'PJSIP INFO support (RFC 2976) (no special treatment, thus the zero size)'],
@@ -157,8 +159,7 @@ def print_text_report(filename):
#
# Write the report to HTML file
#
-def print_html_report(filename):
- output = open(filename, 'w')
+def print_html_report():
# Get Revision info.
f = os.popen('svn info | grep Revision')
@@ -171,16 +172,21 @@ def print_html_report(filename):
o = names[1]
cc = names[2]
cc_ver = names[3]
-
+
+ # Open HTML file
+ filename = 'footprint-' + m + '-' + o + '.htm'
+ output = open(filename, 'w')
+
+ title = 'PJSIP and PJMEDIA footprint report for ' + m + '-' + o + ' target'
output.write('<HTML><HEAD>\n');
- output.write(' <TITLE>PJSIP and PJMEDIA footprint report for ' + o + '/' + m + ' (r' + revision + ')</TITLE>\n')
+ output.write(' <TITLE>' + title + '</TITLE>\n')
output.write(' <LINK href="/style/style.css" type="text/css" rel="stylesheet">\n')
output.write('</HEAD>\n');
output.write('<BODY bgcolor="white">\n');
output.write('<!--#include virtual="/header.html" -->')
- output.write(' <H1>PJSIP and PJMEDIA footprint report (r' + revision + ')</H1>\n')
- output.write('Auto-generated by pjsip-apps/build/get-footprint.py\n')
+ output.write(' <H1>' + title + '</H1>\n')
+ output.write('Auto-generated by pjsip-apps/build/get-footprint.py script\n')
output.write('<p>Date: ' + time.asctime() + '<BR>\n')
output.write('Revision: r' + revision + '</p>\n\n')
output.write('<HR>\n')
@@ -242,11 +248,18 @@ def print_html_report(filename):
output.write( ' <TD align="right">' + `string.atoi(e[4]) - string.atoi(prev[4])` + '</TD>\n' )
output.write( ' <TD>' + e[5] + '</TD>\n')
else:
+ empty_size = exe_size[1]
output.write('<TR bgcolor="#e8e8ff">\n')
output.write( ' <TD align="right">&nbsp;</TD>\n')
output.write( ' <TD align="right">&nbsp;</TD>\n')
output.write( ' <TD align="right">&nbsp;</TD>\n')
- output.write( ' <TD><strong>' + e[5] + ': .text=' + e[2]+ ', .data=' + e[3] + ', .bss=' + e[4] + '</strong></TD>\n')
+ output.write( ' <TD><strong>' + e[5] + ': .text=' + e[2]+ ', .data=' + e[3] + ', .bss=' + e[4] )
+ output.write( '\n </strong> <BR>(Size minus empty application size: ' + \
+ '.text=' + `string.atoi(e[2]) - string.atoi(empty_size[2])` + \
+ ', .data=' + `string.atoi(e[3]) - string.atoi(empty_size[3])` + \
+ ', .data=' + `string.atoi(e[4]) - string.atoi(empty_size[4])` + \
+ ')\n' )
+ output.write( ' </TD>\n')
output.write('</TR>\n')
@@ -306,6 +319,6 @@ for elem in compile_flags:
exe_size.append(n)
-print_text_report('footprint.txt')
-print_html_report('footprint.htm')
+#print_text_report('footprint.txt')
+print_html_report()
diff --git a/pjsip-apps/src/pjsua/main_rtems.c b/pjsip-apps/src/pjsua/main_rtems.c
new file mode 100644
index 00000000..d26605ac
--- /dev/null
+++ b/pjsip-apps/src/pjsua/main_rtems.c
@@ -0,0 +1,12 @@
+
+/*
+ * !! OIY OIY !!
+ *
+ * The purpose of this file is only to get the executable linked. I haven't
+ * actually tried to run this on RTEMS!!
+ *
+ */
+
+#include "../../pjlib/src/pjlib-test/main_rtems.c"
+
+
diff --git a/pjsip-apps/src/samples/footprint.c b/pjsip-apps/src/samples/footprint.c
index 06142f67..7f631a79 100644
--- a/pjsip-apps/src/samples/footprint.c
+++ b/pjsip-apps/src/samples/footprint.c
@@ -529,8 +529,17 @@ int dummy_function()
}
-int main()
+int test_main()
{
return dummy_function();
}
+#if defined(PJ_RTEMS) && PJ_RTEMS!=0
+# include "../../pjlib/src/pjlib-test/main_rtems.c"
+#else
+int main()
+{
+ return test_main();
+}
+#endif
+
diff --git a/pjsip-apps/src/samples/main_rtems.c b/pjsip-apps/src/samples/main_rtems.c
new file mode 100644
index 00000000..d26605ac
--- /dev/null
+++ b/pjsip-apps/src/samples/main_rtems.c
@@ -0,0 +1,12 @@
+
+/*
+ * !! OIY OIY !!
+ *
+ * The purpose of this file is only to get the executable linked. I haven't
+ * actually tried to run this on RTEMS!!
+ *
+ */
+
+#include "../../pjlib/src/pjlib-test/main_rtems.c"
+
+