Index: pjproject/trunk/build.symbian/00.bat
===================================================================
--- pjproject/trunk/build.symbian/00.bat	(revision 1269)
+++ pjproject/trunk/build.symbian/00.bat	(revision 1405)
@@ -1,5 +1,6 @@
-rem set MWSym2Libraries=1
-rem set EPOCROOT=\Symbian\9.1\S60_3rd\
-rem set EPOCROOT=\Symbian\9.1\S60_3rd_MR_2\
-rem set EPOCROOT=\Symbian\UIQ3SDK\
+@rem set MWSym2Libraries=1
+@rem set EPOCROOT=\Symbian\9.1\S60_3rd\
+@rem set EPOCROOT=\Symbian\9.1\S60_3rd_MR_2\
+@rem set EPOCROOT=\Symbian\UIQ3SDK\
+@rem set EPOCROOT=\symbian\UIQ3.1\
 bldmake bldfiles
Index: pjproject/trunk/build.symbian/01.bat
===================================================================
--- pjproject/trunk/build.symbian/01.bat	(revision 1269)
+++ pjproject/trunk/build.symbian/01.bat	(revision 1405)
@@ -1,6 +1,7 @@
-rem set MWSym2Libraries=1
-rem set MWSym2Libraries=\Symbian\9.1\S60_3rd\Epoc32\release\winscw\udeb
+@rem call abld build -v vs6 udeb
+@rem call abld build -v gcce urel
+@rem call abld build winscw udeb
+call abld build %1 %2 %3 %4
 
-rem set EPOCROOT=\Symbian\9.1\S60_3rd\
-rem set EPOCROOT=\Symbian\9.1\S60_3rd_MR_2\
-call abld build -v vs6 udeb
+
+
Index: pjproject/trunk/build.symbian/bld.inf
===================================================================
--- pjproject/trunk/build.symbian/bld.inf	(revision 1269)
+++ pjproject/trunk/build.symbian/bld.inf	(revision 1405)
@@ -1,9 +1,10 @@
 prj_platforms
 winscw
-armv5
+//armv5
 gcce
 
 prj_mmpfiles
 pjlib.mmp
+pjlib_test.mmp
 pjlib_util.mmp
 pjnath.mmp
@@ -13,6 +14,6 @@
 pjsip_simple.mmp
 pjsip_ua.mmp
-//pjlib_test.mmp
-//sipstateless.mmp
+pjlib_test.mmp
+sipstateless.mmp
 pjsua_lib.mmp
 null_audio.mmp
Index: pjproject/trunk/build.symbian/makedef.sh
===================================================================
--- pjproject/trunk/build.symbian/makedef.sh	(revision 1405)
+++ pjproject/trunk/build.symbian/makedef.sh	(revision 1405)
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+MMP=$1
+if test "$MMP" == ""; then
+	echo Usage: makedef.sh FILE.MMP
+	exit 1
+fi
+
+if test -f $MMP; then
+	true
+else
+	echo "Unable to open $MMP"
+	exit 1
+fi
+
+TARGET=`grep -w TARGET $MMP | awk '{print $2}' | awk -F '.' '{print $1}' | head -1`
+DEFFILE="${TARGET}U.def"
+SOURCES=`grep -w SOURCE $MMP | awk '{print $2}' | tr '\\\\' '/'`
+SOURCEPATH=`grep -w SOURCEPATH $MMP | tr '\\\\' '/' | awk '{print $2}'`
+INCPATH=`grep INCLUDE $MMP | awk '{print $2}' | grep pj | tr '\\\\' '/'`
+INCLUDE=""
+for INC in $INCPATH; do
+	INCLUDE=`echo $INCLUDE -I$INC`
+done
+
+echo > tmpnames.def
+
+
+for file in $SOURCES; do
+	#SYMBOLS=`grep PJ_DEF ${SOURCEPATH}/$file | awk -F ')' '{print $2}' | awk -F '(' '{print $1}' | awk -F '=' '{print $1}' | tr -d '[:blank:]' | sort | uniq`
+	SYMBOLS=`
+		cpp -DPJ_SYMBIAN=1 -DPJ_DLL -DPJ_EXPORTING=1 $INCLUDE ${SOURCEPATH}/$file 2>&1 |
+       		grep EXPORT_C | 
+		sed 's/(/;/' | 
+		sed 's/=/;/' | 
+		awk -F ';' '{print $1}' | 
+		awk '{print $NF}'`
+	echo Processing ${SOURCEPATH}/$file..
+	for SYM in $SYMBOLS; do
+		echo $SYM >> tmpnames.def
+	done
+done
+
+echo "Writing $DEFFILE"
+echo EXPORTS > $DEFFILE
+i=0
+for SYM in `cat tmpnames.def | sort | uniq`; do
+	echo "             $SYM"
+	i=`expr $i + 1`
+	printf "\\t%-40s @ $i NONAME\\n" $SYM >> $DEFFILE
+done
+
+
+echo
+echo "Done. Total $i symbols exported."
+
Index: pjproject/trunk/build.symbian/pjlib.mmp
===================================================================
--- pjproject/trunk/build.symbian/pjlib.mmp	(revision 1269)
+++ pjproject/trunk/build.symbian/pjlib.mmp	(revision 1405)
@@ -1,6 +1,21 @@
+#if defined(EKA2)
+// ARM ABIv2 doesn't support static libraries anymore
+TARGET		pjlib.dll
+TARGETTYPE	dll
+UID		0x1000008d 0xA0004299
+CAPABILITY	NONE
+LIBRARY		esock.lib insock.lib charconv.lib euser.lib estlib.lib
+MACRO		PJ_DLL
+MACRO		PJ_EXPORTING
+
+DEFFILE		.\pjlib.def
+
+#else
+
 TARGET 		pjlib.lib
 TARGETTYPE 	lib
 UID		0x100039CE 0x10004299
-VENDORID	0x70000001
+//VENDORID	0x70000001
+#endif
 
 SOURCEPATH	..\pjlib\src\pj
@@ -33,4 +48,5 @@
 SOURCE		rand.c
 SOURCE		rbtree.c
+SOURCE		sock_common.c
 SOURCE		types.c
 
@@ -92,6 +108,6 @@
 
 SYSTEMINCLUDE	..\pjlib\include
-
 SYSTEMINCLUDE	\epoc32\include
 SYSTEMINCLUDE	\epoc32\include\libc
 
+
Index: pjproject/trunk/build.symbian/pjlibU.def
===================================================================
--- pjproject/trunk/build.symbian/pjlibU.def	(revision 1405)
+++ pjproject/trunk/build.symbian/pjlibU.def	(revision 1405)
@@ -0,0 +1,290 @@
+EXPORTS
+	PJ_FD_CLR                                @ 1 NONAME
+	PJ_FD_COUNT                              @ 2 NONAME
+	PJ_FD_ISSET                              @ 3 NONAME
+	PJ_FD_SET                                @ 4 NONAME
+	PJ_FD_ZERO                               @ 5 NONAME
+	pj_AF_INET                               @ 6 NONAME
+	pj_AF_INET6                              @ 7 NONAME
+	pj_AF_IRDA                               @ 8 NONAME
+	pj_AF_PACKET                             @ 9 NONAME
+	pj_AF_UNIX                               @ 10 NONAME
+	pj_IPTOS_LOWDELAY                        @ 11 NONAME
+	pj_IPTOS_MINCOST                         @ 12 NONAME
+	pj_IPTOS_RELIABILITY                     @ 13 NONAME
+	pj_IPTOS_THROUGHPUT                      @ 14 NONAME
+	pj_IP_TOS                                @ 15 NONAME
+	pj_MSG_DONTROUTE                         @ 16 NONAME
+	pj_MSG_OOB                               @ 17 NONAME
+	pj_MSG_PEEK                              @ 18 NONAME
+	pj_SOCK_DGRAM                            @ 19 NONAME
+	pj_SOCK_RAW                              @ 20 NONAME
+	pj_SOCK_RDM                              @ 21 NONAME
+	pj_SOCK_STREAM                           @ 22 NONAME
+	pj_SOL_IP                                @ 23 NONAME
+	pj_SOL_IPV6                              @ 24 NONAME
+	pj_SOL_SOCKET                            @ 25 NONAME
+	pj_SOL_TCP                               @ 26 NONAME
+	pj_SOL_UDP                               @ 27 NONAME
+	pj_SO_RCVBUF                             @ 28 NONAME
+	pj_SO_SNDBUF                             @ 29 NONAME
+	pj_SO_TYPE                               @ 30 NONAME
+	pj_ansi_to_unicode                       @ 31 NONAME
+	pj_array_erase                           @ 32 NONAME
+	pj_array_find                            @ 33 NONAME
+	pj_array_insert                          @ 34 NONAME
+	pj_atexit                                @ 35 NONAME
+	pj_atomic_add                            @ 36 NONAME
+	pj_atomic_add_and_get                    @ 37 NONAME
+	pj_atomic_create                         @ 38 NONAME
+	pj_atomic_dec                            @ 39 NONAME
+	pj_atomic_dec_and_get                    @ 40 NONAME
+	pj_atomic_destroy                        @ 41 NONAME
+	pj_atomic_get                            @ 42 NONAME
+	pj_atomic_inc                            @ 43 NONAME
+	pj_atomic_inc_and_get                    @ 44 NONAME
+	pj_atomic_set                            @ 45 NONAME
+	pj_caching_pool_destroy                  @ 46 NONAME
+	pj_caching_pool_init                     @ 47 NONAME
+	pj_create_random_string                  @ 48 NONAME
+	pj_create_unique_string                  @ 49 NONAME
+	pj_dump_config                           @ 50 NONAME
+	pj_elapsed_cycle                         @ 51 NONAME
+	pj_elapsed_msec                          @ 52 NONAME
+	pj_elapsed_nanosec                       @ 53 NONAME
+	pj_elapsed_time                          @ 54 NONAME
+	pj_elapsed_usec                          @ 55 NONAME
+	pj_enter_critical_section                @ 56 NONAME
+	pj_enum_ip_interface                     @ 57 NONAME
+	pj_enum_ip_route                         @ 58 NONAME
+	pj_exception_id_alloc                    @ 59 NONAME
+	pj_exception_id_free                     @ 60 NONAME
+	pj_exception_id_name                     @ 61 NONAME
+	pj_fifobuf_alloc                         @ 62 NONAME
+	pj_fifobuf_free                          @ 63 NONAME
+	pj_fifobuf_init                          @ 64 NONAME
+	pj_fifobuf_max_size                      @ 65 NONAME
+	pj_fifobuf_unalloc                       @ 66 NONAME
+	pj_file_close                            @ 67 NONAME
+	pj_file_delete                           @ 68 NONAME
+	pj_file_exists                           @ 69 NONAME
+	pj_file_flush                            @ 70 NONAME
+	pj_file_getpos                           @ 71 NONAME
+	pj_file_getstat                          @ 72 NONAME
+	pj_file_move                             @ 73 NONAME
+	pj_file_open                             @ 74 NONAME
+	pj_file_read                             @ 75 NONAME
+	pj_file_setpos                           @ 76 NONAME
+	pj_file_size                             @ 77 NONAME
+	pj_file_write                            @ 78 NONAME
+	pj_generate_unique_string                @ 79 NONAME
+	pj_get_netos_error                       @ 80 NONAME
+	pj_get_os_error                          @ 81 NONAME
+	pj_get_timestamp                         @ 82 NONAME
+	pj_get_timestamp_freq                    @ 83 NONAME
+	pj_gethostaddr                           @ 84 NONAME
+	pj_gethostbyname                         @ 85 NONAME
+	pj_gethostip                             @ 86 NONAME
+	pj_gethostname                           @ 87 NONAME
+	pj_getpid                                @ 88 NONAME
+	pj_gettimeofday                          @ 89 NONAME
+	pj_hash_calc                             @ 90 NONAME
+	pj_hash_calc_tolower                     @ 91 NONAME
+	pj_hash_count                            @ 92 NONAME
+	pj_hash_create                           @ 93 NONAME
+	pj_hash_first                            @ 94 NONAME
+	pj_hash_get                              @ 95 NONAME
+	pj_hash_next                             @ 96 NONAME
+	pj_hash_set                              @ 97 NONAME
+	pj_hash_set_np                           @ 98 NONAME
+	pj_hash_this                             @ 99 NONAME
+	pj_htonl                                 @ 100 NONAME
+	pj_htons                                 @ 101 NONAME
+	pj_inet_addr                             @ 102 NONAME
+	pj_inet_addr2                            @ 103 NONAME
+	pj_inet_aton                             @ 104 NONAME
+	pj_inet_ntoa                             @ 105 NONAME
+	pj_init                                  @ 106 NONAME
+	pj_ioqueue_accept                        @ 107 NONAME
+	pj_ioqueue_connect                       @ 108 NONAME
+	pj_ioqueue_create                        @ 109 NONAME
+	pj_ioqueue_destroy                       @ 110 NONAME
+	pj_ioqueue_get_user_data                 @ 111 NONAME
+	pj_ioqueue_is_pending                    @ 112 NONAME
+	pj_ioqueue_name                          @ 113 NONAME
+	pj_ioqueue_op_key_init                   @ 114 NONAME
+	pj_ioqueue_poll                          @ 115 NONAME
+	pj_ioqueue_post_completion               @ 116 NONAME
+	pj_ioqueue_recv                          @ 117 NONAME
+	pj_ioqueue_recvfrom                      @ 118 NONAME
+	pj_ioqueue_register_sock                 @ 119 NONAME
+	pj_ioqueue_send                          @ 120 NONAME
+	pj_ioqueue_sendto                        @ 121 NONAME
+	pj_ioqueue_set_lock                      @ 122 NONAME
+	pj_ioqueue_set_user_data                 @ 123 NONAME
+	pj_ioqueue_unregister                    @ 124 NONAME
+	pj_leave_critical_section                @ 125 NONAME
+	pj_list_erase                            @ 126 NONAME
+	pj_list_find_node                        @ 127 NONAME
+	pj_list_insert_after                     @ 128 NONAME
+	pj_list_insert_before                    @ 129 NONAME
+	pj_list_insert_nodes_after               @ 130 NONAME
+	pj_list_insert_nodes_before              @ 131 NONAME
+	pj_list_merge_first                      @ 132 NONAME
+	pj_list_merge_last                       @ 133 NONAME
+	pj_list_search                           @ 134 NONAME
+	pj_list_size                             @ 135 NONAME
+	pj_lock_acquire                          @ 136 NONAME
+	pj_lock_create_null_mutex                @ 137 NONAME
+	pj_lock_create_recursive_mutex           @ 138 NONAME
+	pj_lock_create_semaphore                 @ 139 NONAME
+	pj_lock_create_simple_mutex              @ 140 NONAME
+	pj_lock_destroy                          @ 141 NONAME
+	pj_lock_release                          @ 142 NONAME
+	pj_lock_tryacquire                       @ 143 NONAME
+	pj_log                                   @ 144 NONAME
+	pj_log_1                                 @ 145 NONAME
+	pj_log_2                                 @ 146 NONAME
+	pj_log_3                                 @ 147 NONAME
+	pj_log_4                                 @ 148 NONAME
+	pj_log_5                                 @ 149 NONAME
+	pj_log_get_decor                         @ 150 NONAME
+	pj_log_get_level                         @ 151 NONAME
+	pj_log_get_log_func                      @ 152 NONAME
+	pj_log_set_decor                         @ 153 NONAME
+	pj_log_set_level                         @ 154 NONAME
+	pj_log_set_log_func                      @ 155 NONAME
+	pj_log_write                             @ 156 NONAME
+	pj_mutex_create                          @ 157 NONAME
+	pj_mutex_create_recursive                @ 158 NONAME
+	pj_mutex_create_simple                   @ 159 NONAME
+	pj_mutex_destroy                         @ 160 NONAME
+	pj_mutex_lock                            @ 161 NONAME
+	pj_mutex_trylock                         @ 162 NONAME
+	pj_mutex_unlock                          @ 163 NONAME
+	pj_ntohl                                 @ 164 NONAME
+	pj_ntohs                                 @ 165 NONAME
+	pj_pool_alloc                            @ 166 NONAME
+	pj_pool_alloc_from_block                 @ 167 NONAME
+	pj_pool_allocate_find                    @ 168 NONAME
+	pj_pool_calloc                           @ 169 NONAME
+	pj_pool_create                           @ 170 NONAME
+	pj_pool_create_int                       @ 171 NONAME
+	pj_pool_create_on_buf                    @ 172 NONAME
+	pj_pool_destroy_int                      @ 173 NONAME
+	pj_pool_factory_default_policy           @ 174 NONAME
+	pj_pool_factory_get_default_policy       @ 175 NONAME
+	pj_pool_get_capacity                     @ 176 NONAME
+	pj_pool_get_used_size                    @ 177 NONAME
+	pj_pool_getobjname                       @ 178 NONAME
+	pj_pool_init_int                         @ 179 NONAME
+	pj_pool_release                          @ 180 NONAME
+	pj_pool_reset                            @ 181 NONAME
+	pj_rand                                  @ 182 NONAME
+	pj_rbtree_erase                          @ 183 NONAME
+	pj_rbtree_find                           @ 184 NONAME
+	pj_rbtree_first                          @ 185 NONAME
+	pj_rbtree_init                           @ 186 NONAME
+	pj_rbtree_insert                         @ 187 NONAME
+	pj_rbtree_last                           @ 188 NONAME
+	pj_rbtree_max_height                     @ 189 NONAME
+	pj_rbtree_min_height                     @ 190 NONAME
+	pj_rbtree_next                           @ 191 NONAME
+	pj_rbtree_prev                           @ 192 NONAME
+	pj_register_strerror                     @ 193 NONAME
+	pj_rwmutex_create                        @ 194 NONAME
+	pj_rwmutex_destroy                       @ 195 NONAME
+	pj_rwmutex_lock_read                     @ 196 NONAME
+	pj_rwmutex_lock_write                    @ 197 NONAME
+	pj_rwmutex_unlock_read                   @ 198 NONAME
+	pj_rwmutex_unlock_write                  @ 199 NONAME
+	pj_sem_create                            @ 200 NONAME
+	pj_sem_destroy                           @ 201 NONAME
+	pj_sem_post                              @ 202 NONAME
+	pj_sem_trywait                           @ 203 NONAME
+	pj_sem_wait                              @ 204 NONAME
+	pj_set_netos_error                       @ 205 NONAME
+	pj_set_os_error                          @ 206 NONAME
+	pj_shutdown                              @ 207 NONAME
+	pj_sock_accept                           @ 208 NONAME
+	pj_sock_bind                             @ 209 NONAME
+	pj_sock_bind_in                          @ 210 NONAME
+	pj_sock_close                            @ 211 NONAME
+	pj_sock_connect                          @ 212 NONAME
+	pj_sock_getpeername                      @ 213 NONAME
+	pj_sock_getsockname                      @ 214 NONAME
+	pj_sock_getsockopt                       @ 215 NONAME
+	pj_sock_listen                           @ 216 NONAME
+	pj_sock_recv                             @ 217 NONAME
+	pj_sock_recvfrom                         @ 218 NONAME
+	pj_sock_select                           @ 219 NONAME
+	pj_sock_send                             @ 220 NONAME
+	pj_sock_sendto                           @ 221 NONAME
+	pj_sock_setsockopt                       @ 222 NONAME
+	pj_sock_shutdown                         @ 223 NONAME
+	pj_sock_socket                           @ 224 NONAME
+	pj_sockaddr_in_init                      @ 225 NONAME
+	pj_sockaddr_in_set_str_addr              @ 226 NONAME
+	pj_srand                                 @ 227 NONAME
+	pj_str                                   @ 228 NONAME
+	pj_strassign                             @ 229 NONAME
+	pj_strcat                                @ 230 NONAME
+	pj_strcat2                               @ 231 NONAME
+	pj_strcmp                                @ 232 NONAME
+	pj_strcmp2                               @ 233 NONAME
+	pj_strcpy                                @ 234 NONAME
+	pj_strcpy2                               @ 235 NONAME
+	pj_strdup                                @ 236 NONAME
+	pj_strdup2                               @ 237 NONAME
+	pj_strdup2_with_null                     @ 238 NONAME
+	pj_strdup3                               @ 239 NONAME
+	pj_strdup_with_null                      @ 240 NONAME
+	pj_strerror                              @ 241 NONAME
+	pj_stricmp                               @ 242 NONAME
+	pj_stricmp2                              @ 243 NONAME
+	pj_strltrim                              @ 244 NONAME
+	pj_strncmp                               @ 245 NONAME
+	pj_strncmp2                              @ 246 NONAME
+	pj_strncpy                               @ 247 NONAME
+	pj_strncpy_with_null                     @ 248 NONAME
+	pj_strnicmp                              @ 249 NONAME
+	pj_strnicmp2                             @ 250 NONAME
+	pj_strrtrim                              @ 251 NONAME
+	pj_strtoul                               @ 252 NONAME
+	pj_strtoul2                              @ 253 NONAME
+	pj_strtrim                               @ 254 NONAME
+	pj_symbianos_poll                        @ 255 NONAME
+	pj_thread_create                         @ 256 NONAME
+	pj_thread_destroy                        @ 257 NONAME
+	pj_thread_get_name                       @ 258 NONAME
+	pj_thread_join                           @ 259 NONAME
+	pj_thread_local_alloc                    @ 260 NONAME
+	pj_thread_local_free                     @ 261 NONAME
+	pj_thread_local_get                      @ 262 NONAME
+	pj_thread_local_set                      @ 263 NONAME
+	pj_thread_register                       @ 264 NONAME
+	pj_thread_resume                         @ 265 NONAME
+	pj_thread_sleep                          @ 266 NONAME
+	pj_thread_this                           @ 267 NONAME
+	pj_time_decode                           @ 268 NONAME
+	pj_time_encode                           @ 269 NONAME
+	pj_time_gmt_to_local                     @ 270 NONAME
+	pj_time_local_to_gmt                     @ 271 NONAME
+	pj_time_val_normalize                    @ 272 NONAME
+	pj_timer_entry_init                      @ 273 NONAME
+	pj_timer_heap_cancel                     @ 274 NONAME
+	pj_timer_heap_count                      @ 275 NONAME
+	pj_timer_heap_create                     @ 276 NONAME
+	pj_timer_heap_destroy                    @ 277 NONAME
+	pj_timer_heap_earliest_time              @ 278 NONAME
+	pj_timer_heap_mem_size                   @ 279 NONAME
+	pj_timer_heap_poll                       @ 280 NONAME
+	pj_timer_heap_schedule                   @ 281 NONAME
+	pj_timer_heap_set_lock                   @ 282 NONAME
+	pj_timer_heap_set_max_timed_out_per_poll @ 283 NONAME
+	pj_unicode_to_ansi                       @ 284 NONAME
+	pj_utoa                                  @ 285 NONAME
+	pj_utoa_pad                              @ 286 NONAME
+	platform_strerror                        @ 287 NONAME
+	snprintf                                 @ 288 NONAME
+	vsnprintf                                @ 289 NONAME
Index: pjproject/trunk/build.symbian/pjlib_test.mmp
===================================================================
--- pjproject/trunk/build.symbian/pjlib_test.mmp	(revision 1269)
+++ pjproject/trunk/build.symbian/pjlib_test.mmp	(revision 1405)
@@ -8,4 +8,8 @@
 MACRO		PJ_M_I386=1
 MACRO		PJ_SYMBIAN=1
+
+#if defined(EKA2)
+MACRO		PJ_DLL
+#endif
 
 OPTION		CW -lang c++
