summaryrefslogtreecommitdiff
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
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
-rw-r--r--build/m-arm.mak4
-rw-r--r--pjlib-util/build/Makefile6
-rw-r--r--pjlib-util/build/os-rtems.mak2
-rw-r--r--pjlib-util/src/pjlib-util-test/main_rtems.c11
-rw-r--r--pjlib/include/pj/compat/setjmp.h8
-rw-r--r--pjmedia/build/os-rtems.mak1
-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
-rw-r--r--pjsip/build/Makefile6
-rw-r--r--pjsip/build/os-rtems.mak2
-rw-r--r--pjsip/src/test-pjsip/main_rtems.c12
14 files changed, 111 insertions, 19 deletions
diff --git a/build/m-arm.mak b/build/m-arm.mak
new file mode 100644
index 00000000..43a1ef2b
--- /dev/null
+++ b/build/m-arm.mak
@@ -0,0 +1,4 @@
+export M_CFLAGS := $(CC_DEF)PJ_M_ARMV4=1
+export M_CXXFLAGS :=
+export M_LDFLAGS :=
+export M_SOURCES :=
diff --git a/pjlib-util/build/Makefile b/pjlib-util/build/Makefile
index 685318b9..4c2bcd83 100644
--- a/pjlib-util/build/Makefile
+++ b/pjlib-util/build/Makefile
@@ -1,3 +1,7 @@
+# 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
RULES_MAK := ../../build/rules.mak
@@ -30,7 +34,7 @@ export PJLIB_UTIL_CFLAGS += $(_CFLAGS)
# Defines for building test application
#
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)
export UTIL_TEST_EXE:=../bin/pjlib-util-test-$(TARGET_NAME)$(HOST_EXE)
diff --git a/pjlib-util/build/os-rtems.mak b/pjlib-util/build/os-rtems.mak
new file mode 100644
index 00000000..600d4677
--- /dev/null
+++ b/pjlib-util/build/os-rtems.mak
@@ -0,0 +1,2 @@
+export UTIL_TEST_OBJS = main_rtems.o
+
diff --git a/pjlib-util/src/pjlib-util-test/main_rtems.c b/pjlib-util/src/pjlib-util-test/main_rtems.c
new file mode 100644
index 00000000..4b7b58d2
--- /dev/null
+++ b/pjlib-util/src/pjlib-util-test/main_rtems.c
@@ -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"
diff --git a/pjlib/include/pj/compat/setjmp.h b/pjlib/include/pj/compat/setjmp.h
index 577956d9..15fd44b1 100644
--- a/pjlib/include/pj/compat/setjmp.h
+++ b/pjlib/include/pj/compat/setjmp.h
@@ -27,8 +27,12 @@
#if defined(PJ_HAS_SETJMP_H) && PJ_HAS_SETJMP_H != 0
# 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 && \
defined(PJ_M_I386) && PJ_M_I386 != 0
diff --git a/pjmedia/build/os-rtems.mak b/pjmedia/build/os-rtems.mak
index 20854409..bbcfad4e 100644
--- a/pjmedia/build/os-rtems.mak
+++ b/pjmedia/build/os-rtems.mak
@@ -2,6 +2,7 @@
# PJMEDIA OS specific configuration for RTEMS OS target.
#
+export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_NULL_SOUND
export PJMEDIA_OBJS += nullsound.o
export SOUND_OBJS = $(NULLSOUND_OBJS)
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"
+
+
diff --git a/pjsip/build/Makefile b/pjsip/build/Makefile
index 15ed0fb9..24755553 100644
--- a/pjsip/build/Makefile
+++ b/pjsip/build/Makefile
@@ -1,3 +1,8 @@
+# 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
RULES_MAK := ../../build/rules.mak
@@ -87,7 +92,6 @@ export TEST_OBJS += dlg_core_test.o msg_err_test.o msg_logger.o msg_test.o \
transport_test.o transport_udp_test.o \
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)
export TEST_EXE := ../bin/pjsip-test-$(TARGET_NAME)$(HOST_EXE)
diff --git a/pjsip/build/os-rtems.mak b/pjsip/build/os-rtems.mak
new file mode 100644
index 00000000..69118b41
--- /dev/null
+++ b/pjsip/build/os-rtems.mak
@@ -0,0 +1,2 @@
+export TEST_OBJS = main_rtems.o
+
diff --git a/pjsip/src/test-pjsip/main_rtems.c b/pjsip/src/test-pjsip/main_rtems.c
new file mode 100644
index 00000000..a4d14e5a
--- /dev/null
+++ b/pjsip/src/test-pjsip/main_rtems.c
@@ -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"
+
+