diff --git a/build/m-arm.mak b/build/m-arm.mak new file mode 100644 index 000000000..43a1ef2b3 --- /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 685318b9c..4c2bcd83c 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 000000000..600d46771 --- /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 000000000..4b7b58d27 --- /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 577956d91..15fd44b16 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 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 208544094..bbcfad4e2 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 735aef250..26055cf06 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 3576b12a8..bef4aa383 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('\n'); - output.write(' PJSIP and PJMEDIA footprint report for ' + o + '/' + m + ' (r' + revision + ')\n') + output.write(' ' + title + '\n') output.write(' \n') output.write('\n'); output.write('\n'); output.write('') - output.write('

PJSIP and PJMEDIA footprint report (r' + revision + ')

\n') - output.write('Auto-generated by pjsip-apps/build/get-footprint.py\n') + output.write('

' + title + '

\n') + output.write('Auto-generated by pjsip-apps/build/get-footprint.py script\n') output.write('

Date: ' + time.asctime() + '
\n') output.write('Revision: r' + revision + '

\n\n') output.write('
\n') @@ -242,11 +248,18 @@ def print_html_report(filename): output.write( ' ' + `string.atoi(e[4]) - string.atoi(prev[4])` + '\n' ) output.write( ' ' + e[5] + '\n') else: + empty_size = exe_size[1] output.write('\n') output.write( '  \n') output.write( '  \n') output.write( '  \n') - output.write( ' ' + e[5] + ': .text=' + e[2]+ ', .data=' + e[3] + ', .bss=' + e[4] + '\n') + output.write( ' ' + e[5] + ': .text=' + e[2]+ ', .data=' + e[3] + ', .bss=' + e[4] ) + output.write( '\n
(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( ' \n') output.write('\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 000000000..d26605ac3 --- /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 06142f673..7f631a790 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 000000000..d26605ac3 --- /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 15ed0fb90..247555533 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 000000000..69118b41a --- /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 000000000..a4d14e5a0 --- /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" + +