summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2005-11-07 21:58:51 +0000
committerBenny Prijono <bennylp@teluu.com>2005-11-07 21:58:51 +0000
commit5b11ba6ce80a7fed9cab4320fcaf02d70fc9b712 (patch)
tree2bd4fab06b978c4eb2b03d9f1e5452471904dce9
parent631d9d16cd10c61c06e36686257aad367006b5da (diff)
Modif in configure
git-svn-id: http://svn.pjsip.org/repos/pjproject/main@28 74dad513-b988-da41-8d7b-12977e46ad98
-rwxr-xr-xconfigure24
-rw-r--r--pjlib/build/os-linux.mak5
-rw-r--r--pjlib/src/pj/ioqueue_common_abs.c14
-rw-r--r--pjlib/src/pjlib-test/exception.c4
-rw-r--r--pjlib/src/pjlib-test/test.h12
5 files changed, 41 insertions, 18 deletions
diff --git a/configure b/configure
index 606c6963..2b077fff 100755
--- a/configure
+++ b/configure
@@ -27,6 +27,17 @@ if echo $SYSTEM | grep -i sunos > /dev/null; then
elif echo $SYSTEM | grep -i linux > /dev/null; then
OS_NAME=linux
HOST_NAME=unix
+ # More on linux version
+ KERNEL_VER=`uname -r`
+ if echo $KERNEL_VER | grep '^2\.4' > /dev/null; then
+ LINUX_POLL=select
+ elif echo $KERNEL_VER | grep '^2\.2' > /dev/null; then
+ LINUX_POLL=select
+ elif echo $KERNEL_VER | grep '^2\.0' > /dev/null; then
+ LINUX_EPOLL=select
+ else
+ LINUX_POLL=epoll
+ fi
elif echo $SYSTEM | grep -i mingw > /dev/null; then
OS_NAME=win32
HOST_NAME=mingw
@@ -54,15 +65,20 @@ if test -f build.mak; then
fi
echo 'Writing build.mak as follows:'
-echo " MACHINE_NAME=$MACHINE_NAME"
-echo " OS_NAME=$OS_NAME"
-echo " HOST_NAME=$HOST_NAME"
-echo " CC_NAME=$CC_NAME"
+echo " MACHINE_NAME = $MACHINE_NAME"
+echo " OS_NAME = $OS_NAME"
+echo " HOST_NAME = $HOST_NAME"
+echo " CC_NAME = $CC_NAME"
+echo " LINUX_POLL = $LINUX_POLL"
echo "# Auto-generated build.mak" > build.mak
echo "export MACHINE_NAME := $MACHINE_NAME" >> build.mak
echo "export OS_NAME := $OS_NAME" >> build.mak
echo "export HOST_NAME := $HOST_NAME" >> build.mak
echo "export CC_NAME := $CC_NAME" >> build.mak
+echo "export LINUX_POLL := $LINUX_POLL" >> build.mak
+
+echo
+echo "You may review build.mak if you wish"
echo "Done."
diff --git a/pjlib/build/os-linux.mak b/pjlib/build/os-linux.mak
index a705d4cd..80801edf 100644
--- a/pjlib/build/os-linux.mak
+++ b/pjlib/build/os-linux.mak
@@ -14,8 +14,11 @@ export PJLIB_OBJS += addr_resolv_sock.o guid_simple.o \
os_time_ansi.o \
pool_policy_malloc.o sock_bsd.o sock_select.o
-#export PJLIB_OBJS += ioqueue_select.o
+ifeq (epoll,$(LINUX_POLL))
export PJLIB_OBJS += ioqueue_epoll.o
+else
+export PJLIB_OBJS += ioqueue_select.o
+endif
export PJLIB_OBJS += file_access_unistd.o file_io_ansi.o
diff --git a/pjlib/src/pj/ioqueue_common_abs.c b/pjlib/src/pj/ioqueue_common_abs.c
index d5f8d657..35f86a06 100644
--- a/pjlib/src/pj/ioqueue_common_abs.c
+++ b/pjlib/src/pj/ioqueue_common_abs.c
@@ -168,20 +168,22 @@ void ioqueue_dispatch_write_event(pj_ioqueue_t *ioqueue, pj_ioqueue_key_t *h)
* level SOL_SOCKET to determine whether connect() completed
* successfully (if SO_ERROR is zero).
*/
- int value;
- socklen_t vallen = sizeof(value);
- int gs_rc = getsockopt(h->fd, SOL_SOCKET, SO_ERROR,
+ {
+ int value;
+ socklen_t vallen = sizeof(value);
+ int gs_rc = getsockopt(h->fd, SOL_SOCKET, SO_ERROR,
&value, &vallen);
- if (gs_rc != 0) {
+ if (gs_rc != 0) {
/* Argh!! What to do now???
* Just indicate that the socket is connected. The
* application will get error as soon as it tries to use
* the socket to send/receive.
*/
bytes_transfered = 0;
- } else {
+ } else {
bytes_transfered = value;
- }
+ }
+ }
#elif defined(PJ_WIN32) && PJ_WIN32!=0
bytes_transfered = 0; /* success */
#else
diff --git a/pjlib/src/pjlib-test/exception.c b/pjlib/src/pjlib-test/exception.c
index 44ed23ec..fcbe098c 100644
--- a/pjlib/src/pjlib-test/exception.c
+++ b/pjlib/src/pjlib-test/exception.c
@@ -140,8 +140,10 @@ int exception_test(void)
enum { LOOP = 10 };
for (i=0; i<LOOP; ++i) {
- if ((rc=test()) != 0)
+ if ((rc=test()) != 0) {
+ PJ_LOG(3,("", "...failed at i=%d (rc=%d)", i, rc));
return rc;
+ }
}
return 0;
}
diff --git a/pjlib/src/pjlib-test/test.h b/pjlib/src/pjlib-test/test.h
index 1af0a680..cf78f4f4 100644
--- a/pjlib/src/pjlib-test/test.h
+++ b/pjlib/src/pjlib-test/test.h
@@ -5,11 +5,11 @@
#include <pj/types.h>
-#define GROUP_LIBC 0
-#define GROUP_OS 0
-#define GROUP_DATA_STRUCTURE 0
-#define GROUP_NETWORK 0
-#define GROUP_FILE 0
+#define GROUP_LIBC 1
+#define GROUP_OS 1
+#define GROUP_DATA_STRUCTURE 1
+#define GROUP_NETWORK 1
+#define GROUP_FILE 1
#define GROUP_EXTRA 0
#define INCLUDE_ERRNO_TEST GROUP_LIBC
@@ -37,7 +37,7 @@
#define INCLUDE_XML_TEST GROUP_EXTRA
#define INCLUDE_ECHO_SERVER 0
-#define INCLUDE_ECHO_CLIENT 1
+#define INCLUDE_ECHO_CLIENT 0
#define ECHO_SERVER_MAX_THREADS 2