diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-09-09 20:05:33 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-09-09 20:05:33 +0000 |
commit | b5f420650add6f06c58d981685468761d74022cf (patch) | |
tree | 34d8e9af4c7a0abcd29cc98f69a770c439164840 | |
parent | 40cfcab19c02578df219e8ef2dd8a3c6d04b8799 (diff) |
Added PJ_HAS_SOCKLEN_T test in configure script (some MacOS X have it, some dont)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@697 74dad513-b988-da41-8d7b-12977e46ad98
-rwxr-xr-x | aconfigure | 55 | ||||
-rw-r--r-- | aconfigure.ac | 8 | ||||
-rw-r--r-- | pjlib/include/pj/compat/os_auto.h.in | 14 |
3 files changed, 77 insertions, 0 deletions
@@ -7427,6 +7427,61 @@ echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Determine if socklen_t is available +echo "$as_me:$LINENO: checking if socklen_t is available" >&5 +echo $ECHO_N "checking if socklen_t is available... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <unistd.h> +int +main () +{ +socklen_t xxx = 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >>confdefs.h <<\_ACEOF +#define PJ_HAS_SOCKLEN_T 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + # Determine if SO_ERROR is available echo "$as_me:$LINENO: checking if SO_ERROR is available" >&5 echo $ECHO_N "checking if SO_ERROR is available... $ECHO_C" >&6 diff --git a/aconfigure.ac b/aconfigure.ac index a01e4d22..4efbf91f 100644 --- a/aconfigure.ac +++ b/aconfigure.ac @@ -110,6 +110,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h> AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) +# Determine if socklen_t is available +AC_MSG_CHECKING([if socklen_t is available]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], + [socklen_t xxx = 0;])], + [AC_DEFINE(PJ_HAS_SOCKLEN_T,1) + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no)) + # Determine if SO_ERROR is available AC_MSG_CHECKING([if SO_ERROR is available]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h> diff --git a/pjlib/include/pj/compat/os_auto.h.in b/pjlib/include/pj/compat/os_auto.h.in index e9e20068..403d8919 100644 --- a/pjlib/include/pj/compat/os_auto.h.in +++ b/pjlib/include/pj/compat/os_auto.h.in @@ -63,6 +63,13 @@ */ #undef PJ_SOCKADDR_HAS_LEN +/* Does the OS have socklen_t? */ +#undef PJ_HAS_SOCKLEN_T + +#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0 + typedef int socklen_t; +#endif + /** * If this macro is set, it tells select I/O Queue that select() needs to * be given correct value of nfds (i.e. largest fd + 1). This requires @@ -99,13 +106,20 @@ # define PJ_HAS_THREADS (1) #endif +/* Do we need high resolution timer? */ #undef PJ_HAS_HIGH_RES_TIMER + +/* Is malloc() available? */ #undef PJ_HAS_MALLOC + #ifndef PJ_OS_HAS_CHECK_STACK # define PJ_OS_HAS_CHECK_STACK 0 #endif + +/* Unicode? */ #undef PJ_NATIVE_STRING_IS_UNICODE +/* The type of atomic variable value: */ #undef PJ_ATOMIC_VALUE_TYPE /* If 1, use Read/Write mutex emulation for platforms that don't support it */ |