diff options
author | jenglish <jenglish@flightlab.com> | 2008-02-26 21:19:51 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2008-02-26 21:19:51 (GMT) |
commit | 2c695fbcd0bcccce2bb7bd362c5088789a96eb5a (patch) | |
tree | a882a14a15dfedc2bd7b6d24a57a424d8ffb64bb /unix | |
parent | 480791e56d8ff26684b9510b81edbf9bc8fe89c2 (diff) | |
download | tcl-2c695fbcd0bcccce2bb7bd362c5088789a96eb5a.zip tcl-2c695fbcd0bcccce2bb7bd362c5088789a96eb5a.tar.gz tcl-2c695fbcd0bcccce2bb7bd362c5088789a96eb5a.tar.bz2 |
Define socklen_t as "int" if missing, not "unsigned".
(accept(2) et. al. traditionally took "int *" before POSIX invented socklen_t)
Use AC_TRY_COMPILE instead of AC_EGREP_HEADER for socklen_t test.
Regenerated configure script.
Diffstat (limited to 'unix')
-rwxr-xr-x | unix/configure | 51 | ||||
-rw-r--r-- | unix/configure.in | 20 |
2 files changed, 47 insertions, 24 deletions
diff --git a/unix/configure b/unix/configure index aea9742..4a16083 100755 --- a/unix/configure +++ b/unix/configure @@ -15093,29 +15093,56 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #include <sys/types.h> - #include <sys/socket.h> - #if STDC_HEADERS - #include <stdlib.h> - #include <stddef.h> - #endif + #include <sys/types.h> + #include <sys/socket.h> + +int +main () +{ + socklen_t foo; + + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then +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 tcl_cv_type_socklen_t=yes else - tcl_cv_type_socklen_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +tcl_cv_type_socklen_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $tcl_cv_type_socklen_t" >&5 echo "${ECHO_T}$tcl_cv_type_socklen_t" >&6 if test $tcl_cv_type_socklen_t = no; then cat >>confdefs.h <<\_ACEOF -#define socklen_t unsigned +#define socklen_t int _ACEOF fi diff --git a/unix/configure.in b/unix/configure.in index 6c76fc0..50fb99a 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.176 2008/02/13 18:00:40 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.177 2008/02/26 21:19:51 jenglish Exp $ AC_INIT([tcl],[8.5]) AC_PREREQ(2.59) @@ -321,18 +321,14 @@ AC_TYPE_SIZE_T AC_TYPE_UID_T AC_CACHE_CHECK([for socklen_t], tcl_cv_type_socklen_t, [ - AC_EGREP_CPP(changequote(<<,>>)dnl -<<(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]>>dnl -changequote([,]),[ - #include <sys/types.h> - #include <sys/socket.h> - #if STDC_HEADERS - #include <stdlib.h> - #include <stddef.h> - #endif - ], tcl_cv_type_socklen_t=yes, tcl_cv_type_socklen_t=no)]) + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <sys/socket.h> + ],[ + socklen_t foo; + ],[tcl_cv_type_socklen_t=yes],[tcl_cv_type_socklen_t=no])]) if test $tcl_cv_type_socklen_t = no; then - AC_DEFINE(socklen_t, unsigned, [What is the type of socklen_t?]) + AC_DEFINE(socklen_t, int, [Define as int if socklen_t is not available]) fi AC_CHECK_TYPE([intptr_t], [ |