Attempt to get some applications linked for RTEMS target, just to get the footprint calculation working
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@604 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
49f682acab
commit
ceb12607c8
|
@ -0,0 +1,4 @@
|
|||
export M_CFLAGS := $(CC_DEF)PJ_M_ARMV4=1
|
||||
export M_CXXFLAGS :=
|
||||
export M_LDFLAGS :=
|
||||
export M_SOURCES :=
|
|
@ -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)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
export UTIL_TEST_OBJS = main_rtems.o
|
||||
|
|
@ -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"
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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`
|
||||
|
||||
|
|
|
@ -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"> </TD>\n')
|
||||
output.write( ' <TD align="right"> </TD>\n')
|
||||
output.write( ' <TD align="right"> </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()
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
export TEST_OBJS = main_rtems.o
|
||||
|
|
@ -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"
|
||||
|
||||
|
Loading…
Reference in New Issue