Configure nits; add socksizetype; add getfsstat for completeness;
[p5sagit/p5-mst-13.2.git] / Configure
index 126ff93..5de3295 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Fri Feb 25 07:45:17 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Sat Feb 26 00:48:15 EET 2000 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.com)
 
 cat >/tmp/c1$$ <<EOF
@@ -364,6 +364,7 @@ d_ftime=''
 d_gettimeod=''
 d_Gconvert=''
 d_getcwd=''
+d_getfsstat=''
 d_getgrent=''
 d_getgrps=''
 d_gethbyaddr=''
@@ -864,6 +865,7 @@ siteprefix=''
 siteprefixexp=''
 sizetype=''
 so=''
+socksizetype=''
 sharpbang=''
 shsharp=''
 spitshell=''
@@ -4276,7 +4278,7 @@ if eval $compile_ok; then
                echo "(I can't execute the test program--guessing $fpossize.)" >&4
                ;;
        *)      fpossize=$yyy
-               echo "Your $zzz is bytes long." >&4
+               echo "Your $zzz is $fpossize bytes long."
                ;;
        esac
 else
@@ -9008,6 +9010,11 @@ esac
 set getcwd d_getcwd
 eval $inlibc
 
+
+: see if getfsstat exists
+set getfsstat d_getfsstat
+eval $inlibc
+
 : see if getgrent exists
 set getgrent d_getgrent
 eval $inlibc
@@ -11044,37 +11051,6 @@ set d_sigsetjmp
 eval $setvar
 $rm -f try.c try
 
-: see what type is used for size_t
-rp="What is the type used for the length parameter for string functions?"
-set size_t sizetype 'unsigned int' stdio.h sys/types.h
-eval $typedef_ask
-
-: check for socklen_t
-echo " "
-echo "Checking to see if you have socklen_t..." >&4
-$cat >try.c <<EOCP
-#include <sys/types.h>
-#$d_socket HAS_SOCKET
-#ifdef HAS_SOCKET
-#include <sys/socket.h>
-#endif
-int main() { socklen_t x = 16; }
-EOCP
-set try
-if eval $compile; then
-       val="$define"
-       echo "You have socklen_t."
-else
-       val="$undef"
-       echo "You do not have socklen_t."
-       case "$sizetype" in
-       size_t) echo "(You do have size_t, that might work.)" ;;
-       esac
-fi
-$rm -f try try.*
-set d_socklen_t
-eval $setvar
-
 : see if sys/stat.h is available
 set sys/stat.h i_sysstat
 eval $inhdr
@@ -12849,6 +12825,11 @@ EOSH
 chmod +x protochk
 $eunicefix protochk
 
+: see what type is used for size_t
+rp="What is the type used for the length parameter for string functions?"
+set size_t sizetype 'unsigned int' stdio.h sys/types.h
+eval $typedef_ask
+
 : check for type of arguments to gethostbyaddr. 
 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
        case "$d_gethbyaddr" in
@@ -13500,6 +13481,69 @@ echo $sig_name | $awk \
 }'
 $rm -f signal signal.c signal.awk signal.lst signal_cmd 
 
+: check for socklen_t
+echo " "
+echo "Checking to see if you have socklen_t..." >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#$d_socket HAS_SOCKET
+#ifdef HAS_SOCKET
+#include <sys/socket.h>
+#endif
+int main() { socklen_t x = 16; }
+EOCP
+set try
+if eval $compile; then
+       val="$define"
+       echo "You have socklen_t."
+else
+       val="$undef"
+       echo "You do not have socklen_t."
+       case "$sizetype" in
+       size_t) echo "(You do have size_t, that might work.)" ;;
+       esac
+fi
+$rm -f try try.*
+set d_socklen_t
+eval $setvar
+
+: check for type of the size argument to socket calls
+case "$d_socket" in
+"$define")
+       $cat <<EOM
+
+Checking to see what type is the last argument of accept().
+EOM
+       hdrs="$define sys/types.h $d_socket sys/socket.h" 
+       yyy=''
+       case "$d_socklen_t" in
+       "$define") yyy="$yyy socklen_t"
+       esac
+       yyy="$yyy $sizetype int long"
+       for xxx in $yyy; do
+               case "$socksizetype" in
+               '')     try="extern int accept(int, struct sockaddr *, $xxx *);"
+                       if ./protochk "$try" $hdrs; then
+                               echo "Your system accepts '$xxx *' for the last argument of accept()."
+                               socksizetype="$xxx *"
+                       fi
+                       ;;
+               esac
+       done
+: In case none of those worked, prompt the user.
+       case "$socksizetype" in
+       '')     rp='What is the type for the last argument to accept()?'
+               dflt='int *'
+               . ./myread
+               socksizetype=$ans
+               ;;
+       esac
+       ;;
+*)     : no gethostbyaddr, so pick relatively harmless defaults
+       socksizetype='char *'
+       ;;
+esac
+
 : see what type is used for signed size_t
 set ssize_t ssizetype int stdio.h sys/types.h
 eval $typedef
@@ -14794,6 +14838,7 @@ d_fstatvfs='$d_fstatvfs'
 d_ftello='$d_ftello'
 d_ftime='$d_ftime'
 d_getcwd='$d_getcwd'
+d_getfsstat='$d_getfsstat'
 d_getgrent='$d_getgrent'
 d_getgrps='$d_getgrps'
 d_gethbyaddr='$d_gethbyaddr'
@@ -15316,6 +15361,7 @@ small='$small'
 so='$so'
 sockethdr='$sockethdr'
 socketlib='$socketlib'
+socksizetype='$socksizetype'
 sort='$sort'
 spackage='$spackage'
 spitshell='$spitshell'