$NetBSD: patch-af,v 1.1.1.1 2002/08/06 00:48:14 seb Exp $

--- configure.orig	Thu May 16 10:32:38 2002
+++ configure
@@ -3771,9 +3771,6 @@ export CC CFLAGS
 #                    All rights reserved
 #
 
-# So many systems seem to need this that it is better do it here automatically.
-LIBS="-L/usr/local/lib $LIBS"
-
 # Platform-specific stuff.
 case "$target" in
   alpha*-dec-osf*)
@@ -8224,8 +8221,49 @@ else
 fi
 
 fi
+echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6
+echo "configure:8226: checking for openpty in -lutil" >&5
+ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lutil  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 8234 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char openpty();
+
+int main() {
+openpty()
+; return 0; }
+EOF
+if { (eval echo configure:8245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -lutil"
+			    pty="openpty"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
 echo $ac_n "checking for login in -lutil""... $ac_c" 1>&6
-echo "configure:8229: checking for login in -lutil" >&5
+echo "configure:8267: checking for login in -lutil" >&5
 ac_lib_var=`echo util'_'login | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
