--- Configure.orig	Sat Nov 15 17:19:06 2003
+++ Configure	Tue Dec 23 03:24:03 2003
@@ -64,7 +64,7 @@
 		    shift
 		    ;;
 		-P*)
-		    prefix="`expr \"$1\" : '-P\(.*\)'`"
+		    prefix="`expr \"X$1\" : 'X-P\(.*\)'`"
 		    shift
 		    case "$prefix" in
 			"")
@@ -75,7 +75,7 @@
        		    echo "Prefix: $prefix"
 		;;
 		-s*)
-		    libsuffix="`expr \"$1\" : '-s\(.*\)'`"
+		    libsuffix="`expr \"X$1\" : 'X-s\(.*\)'`"
 		    shift
 		    case "$libsuffix" in
 			"")
@@ -86,7 +86,7 @@
        		    echo "Extra library suffix: $libsuffix"
 		;;
 		-c*)
-		    config="`expr \"$1\" : '-c\(.*\)'`"
+		    config="`expr \"X$1\" : 'X-c\(.*\)'`"
 		    shift
 		    case "$config" in
 			"")
@@ -2589,7 +2589,10 @@
 
 : see if crypt exists
 echo " "
-if $contains '^crypt$' libc.list >/dev/null 2>&1; then
+if $test "$cryptlib" = -lcrypt; then
+    echo 'crypt() found.'
+    d_crypt="$define"
+elif $contains '^crypt$' libc.list >/dev/null 2>&1; then
     echo 'crypt() found.'
     d_crypt="$define"
     cryptlib=''
@@ -3093,6 +3096,7 @@
 
     $echo $n "Testing if inet_aton can be used ... $c"
     $cat > try.c <<'EOF'
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
