Index: /pjproject/trunk/build/m-arm.mak
===================================================================
--- /pjproject/trunk/build/m-arm.mak	(revision 604)
+++ /pjproject/trunk/build/m-arm.mak	(revision 604)
@@ -0,0 +1,4 @@
+export M_CFLAGS := $(CC_DEF)PJ_M_ARMV4=1
+export M_CXXFLAGS :=
+export M_LDFLAGS :=
+export M_SOURCES :=
Index: /pjproject/trunk/pjlib-util/build/Makefile
===================================================================
--- /pjproject/trunk/pjlib-util/build/Makefile	(revision 603)
+++ /pjproject/trunk/pjlib-util/build/Makefile	(revision 604)
@@ -1,2 +1,6 @@
+# By default, the test application includes main.o.
+# OS make file may override this with os-specific files
+export UTIL_TEST_OBJS = main.o
+
 include ../../build/common.mak
 
@@ -31,5 +35,5 @@
 #
 export UTIL_TEST_SRCDIR = ../src/pjlib-util-test
-export UTIL_TEST_OBJS += xml.o test.o main.o
+export UTIL_TEST_OBJS += xml.o test.o 
 export UTIL_TEST_CFLAGS += $(_CFLAGS)
 export UTIL_TEST_LDFLAGS += $(_LDFLAGS)
Index: /pjproject/trunk/pjlib-util/build/os-rtems.mak
===================================================================
--- /pjproject/trunk/pjlib-util/build/os-rtems.mak	(revision 604)
+++ /pjproject/trunk/pjlib-util/build/os-rtems.mak	(revision 604)
@@ -0,0 +1,2 @@
+export UTIL_TEST_OBJS = main_rtems.o
+
Index: /pjproject/trunk/pjlib-util/src/pjlib-util-test/main_rtems.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util-test/main_rtems.c	(revision 604)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util-test/main_rtems.c	(revision 604)
@@ -0,0 +1,11 @@
+
+/* 
+ *  !! OIY OIY !!
+ *
+ *  The purpose of this file is only to get pjlib-util-test linked. I haven't
+ *  actually tried to run pjlib-util-test on RTEMS!!
+ *
+ */
+
+
+#include "../../pjlib/src/pjlib-test/main_rtems.c"
Index: /pjproject/trunk/pjlib/include/pj/compat/setjmp.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/compat/setjmp.h	(revision 603)
+++ /pjproject/trunk/pjlib/include/pj/compat/setjmp.h	(revision 604)
@@ -28,6 +28,10 @@
 #  include <setjmp.h>
    typedef jmp_buf pj_jmp_buf;
-#  define pj_setjmp(buf)	setjmp(buf)
-#  define pj_longjmp(buf,d)	longjmp(buf,d)
+#  ifndef pj_setjmp
+#    define pj_setjmp(buf)	setjmp(buf)
+#  endif
+#  ifndef pj_longjmp
+#    define pj_longjmp(buf,d)	longjmp(buf,d)
+#  endif
 
 #elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 && \
Index: /pjproject/trunk/pjmedia/build/os-rtems.mak
===================================================================
--- /pjproject/trunk/pjmedia/build/os-rtems.mak	(revision 603)
+++ /pjproject/trunk/pjmedia/build/os-rtems.mak	(revision 604)
@@ -3,4 +3,5 @@
 #
 
+export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_NULL_SOUND
 export PJMEDIA_OBJS += nullsound.o
 export SOUND_OBJS = $(NULLSOUND_OBJS)
Index: /pjproject/trunk/pjsip-apps/build/Footprint.mak
===================================================================
--- /pjproject/trunk/pjsip-apps/build/Footprint.mak	(revision 603)
+++ /pjproject/trunk/pjsip-apps/build/Footprint.mak	(revision 604)
@@ -45,5 +45,6 @@
 
 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:
@@ -51,3 +52,4 @@
 
 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`
+
Index: /pjproject/trunk/pjsip-apps/build/get-footprint.py
===================================================================
--- /pjproject/trunk/pjsip-apps/build/get-footprint.py	(revision 603)
+++ /pjproject/trunk/pjsip-apps/build/get-footprint.py	(revision 604)
@@ -33,6 +33,8 @@
     ['', 			'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
@@ -47,5 +49,5 @@
     ['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'],
@@ -158,6 +160,5 @@
 # Write the report to HTML file
 #
-def print_html_report(filename):
-    output = open(filename, 'w')
+def print_html_report():
 
     # Get Revision info.
@@ -172,7 +173,12 @@
     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');
@@ -180,6 +186,6 @@
     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')
@@ -243,9 +249,16 @@
 	    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')
@@ -307,5 +320,5 @@
 	
 
-print_text_report('footprint.txt')	
-print_html_report('footprint.htm')
-
+#print_text_report('footprint.txt')	
+print_html_report()
+
Index: /pjproject/trunk/pjsip-apps/src/pjsua/main_rtems.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/pjsua/main_rtems.c	(revision 604)
+++ /pjproject/trunk/pjsip-apps/src/pjsua/main_rtems.c	(revision 604)
@@ -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"
+
+
Index: /pjproject/trunk/pjsip-apps/src/samples/footprint.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/samples/footprint.c	(revision 603)
+++ /pjproject/trunk/pjsip-apps/src/samples/footprint.c	(revision 604)
@@ -530,7 +530,16 @@
 
 
-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
+
Index: /pjproject/trunk/pjsip-apps/src/samples/main_rtems.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/samples/main_rtems.c	(revision 604)
+++ /pjproject/trunk/pjsip-apps/src/samples/main_rtems.c	(revision 604)
@@ -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"
+
+
Index: /pjproject/trunk/pjsip/build/Makefile
===================================================================
--- /pjproject/trunk/pjsip/build/Makefile	(revision 603)
+++ /pjproject/trunk/pjsip/build/Makefile	(revision 604)
@@ -1,2 +1,7 @@
+# For common OSes, test's main() is defined in main.c.
+# OS specific configuration may want to put it in different file.
+# For example, see os-rtems.mak in current directory.
+export TEST_OBJS = main.o
+
 include ../../build/common.mak
 
@@ -88,5 +93,4 @@
 		    tsx_basic_test.o tsx_bench.o tsx_uac_test.o \
 		    tsx_uas_test.o txdata_test.o uri_test.o
-export TEST_OBJS += main.o
 export TEST_CFLAGS += $(_CFLAGS)
 export TEST_LDFLAGS += $(_LDFLAGS)
Index: /pjproject/trunk/pjsip/build/os-rtems.mak
===================================================================
--- /pjproject/trunk/pjsip/build/os-rtems.mak	(revision 604)
+++ /pjproject/trunk/pjsip/build/os-rtems.mak	(revision 604)
@@ -0,0 +1,2 @@
+export TEST_OBJS = main_rtems.o
+
Index: /pjproject/trunk/pjsip/src/test-pjsip/main_rtems.c
===================================================================
--- /pjproject/trunk/pjsip/src/test-pjsip/main_rtems.c	(revision 604)
+++ /pjproject/trunk/pjsip/src/test-pjsip/main_rtems.c	(revision 604)
@@ -0,0 +1,12 @@
+
+/* 
+ *  !! OIY OIY !!
+ *
+ *  The purpose of this file is only to get pjsip-test linked. I haven't
+ *  actually tried to run pjsip-test on RTEMS!!
+ *
+ */
+
+#include "../../pjlib/src/pjlib-test/main_rtems.c"
+
+
