$NetBSD: patch-al,v 1.6 2002/04/04 07:48:30 jlam Exp $

--- configure.orig	Sun Feb  3 16:04:11 2002
+++ configure
@@ -19,6 +19,10 @@
 ac_help="$ac_help
   --with-libs=DIRS        alternative spelling of --with-libraries"
 ac_help="$ac_help
+  --with-htmldir=DIR      HTML documentation in DIR"
+ac_help="$ac_help
+  --disable-readline      disable readline support"
+ac_help="$ac_help
   --enable-locale         enable locale support"
 ac_help="$ac_help
   --enable-recode         enable character set recode support"
@@ -53,6 +57,8 @@
 ac_help="$ac_help
   --with-python           build Python interface module"
 ac_help="$ac_help
+  --with-python-compile   byte-compile modules if Python is enabled"
+ac_help="$ac_help
   --with-java             build JDBC interface and Java tools"
 ac_help="$ac_help
   --with-krb4[=DIR]       build with Kerberos 4 support [/usr/athena]"
@@ -817,6 +823,54 @@
 
 
 #
+# Location for HTML documentation
+#
+htmldir='${docdir}/html'
+# Check whether --with-htmldir was given
+if test x"${with_htmldir+set}" = xset; then
+  case $with_htmldir in
+    yes)
+      { echo "configure: error: argument required for --with-htmldir option" 1>&2; exit 1; }
+      ;;
+    no)
+      { echo "configure: error: argument required for --with-htmldir option" 1>&2; exit 1; }
+      ;;
+    *)
+      withval=$with_htmldir
+      htmldir=$withval
+      ;;
+  esac # $with_htmldir
+fi
+
+
+
+#
+# Readline support
+#
+echo $ac_n "checking whether to build with readline support""... $ac_c" 1>&6
+echo "configure:852: checking whether to build with readline support" >&5
+# Check whether --enable-readline was given
+if test x"${enable_readline+set}" = xset; then
+  case $enable_readline in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      enableval=$enable_readline
+      { echo "configure: error: no argument expected for --enable-readline option" 1>&2; exit 1; }
+      ;;
+  esac # $enable_readline
+else
+  enable_readline=yes
+
+fi
+echo "$ac_t""$enable_readline" 1>&6
+
+
+#
 # Locale (--enable-locale)
 #
 echo $ac_n "checking whether to build with locale support""... $ac_c" 1>&6
@@ -1859,6 +1913,35 @@
 echo "$ac_t""$with_python" 1>&6
 
 
+# If python is enabled (above), then optionally byte-compile the modules.
+echo $ac_n "checking whether to byte-compile Python modules""... $ac_c" 1>&6
+echo "configure:1919: checking whether to byte-compile Python modules" >&5
+if test "$with_python" = yes; then
+  # Check whether --with-python_compile was given
+if test x"${with_python_compile+set}" = xset; then
+  case $with_python_compile in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      withval=$with_python_compile
+      { echo "configure: error: no argument expected for --with-python_compile option" 1>&2; exit 1; }
+      ;;
+  esac # $with_python_compile
+else
+  with_python_compile=no
+
+fi
+else
+  with_python_compile=no
+fi
+echo "$ac_t""$with_python_compile" 1>&6
+
+
+
 #
 # Optionally build the Java/JDBC tools
 #
@@ -3282,9 +3365,18 @@
 ## Libraries
 ##
 
+if test "$enable_readline" = yes; then
 
 echo $ac_n "checking for readline""... $ac_c" 1>&6
-echo "configure:3288: checking for readline" >&5
+echo "configure:3372: checking for readline" >&5
+
+case $host_os in netbsd* | openbsd* )
+  if echo __ELF__ | $CPP - 2>/dev/null | grep __ELF__ >/dev/null; then
+    objformat=a.out
+  else
+    objformat=ELF
+  fi
+esac
 
 if eval "test \"`echo '$''{'pgac_cv_check_readline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3306,15 +3398,17 @@
 readline()
 ; return 0; }
 EOF
-if { (eval echo configure:3310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
-      # NetBSD and OpenBSD have a broken linker that does not
+      # NetBSD and OpenBSD have a broken a.out linker that does not
       # recognize dependent libraries
       case $host_os in netbsd* | openbsd* )
-        case $pgac_lib in
-          *curses*) ;;
-          *) pgac_lib=" -lcurses" ;;
+        case $objformat in a.out )
+          case $pgac_lib in
+            *termcap*) ;;
+            *) pgac_lib=" -ltermcap" ;;
+          esac
         esac
       esac
 
@@ -3408,6 +3502,7 @@
 else :
   
 fi
+fi
 
 if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
 then
@@ -8991,6 +9086,7 @@
 s%@host_os@%$host_os%g
 s%@PORTNAME@%$PORTNAME%g
 s%@TAS@%$TAS%g
+s%@htmldir@%$htmldir%g
 s%@MULTIBYTE@%$MULTIBYTE%g
 s%@enable_nls@%$enable_nls%g
 s%@WANTED_LANGUAGES@%$WANTED_LANGUAGES%g
@@ -9007,6 +9103,7 @@
 s%@with_tk@%$with_tk%g
 s%@with_perl@%$with_perl%g
 s%@with_python@%$with_python%g
+s%@with_python_compile@%$with_python_compile%g
 s%@ANT@%$ANT%g
 s%@with_java@%$with_java%g
 s%@with_krb4@%$with_krb4%g
