From xemacs-m  Tue Apr  8 22:34:07 1997
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
	by xemacs.org (8.8.5/8.8.5) with SMTP id WAA08645
	for <xemacs-beta@xemacs.org>; Tue, 8 Apr 1997 22:34:06 -0500 (CDT)
Received: from Eng.Sun.COM ([129.146.1.25]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with SMTP id UAA21110; Tue, 8 Apr 1997 20:32:56 -0700
Received: from kindra.eng.sun.com by Eng.Sun.COM (SMI-8.6/SMI-5.3)
	id UAA20868; Tue, 8 Apr 1997 20:32:53 -0700
Received: from xemacs.eng.sun.com by kindra.eng.sun.com (SMI-8.6/SMI-SVR4)
	id UAA17138; Tue, 8 Apr 1997 20:32:52 -0700
Received: by xemacs.eng.sun.com (SMI-8.6/SMI-SVR4)
	id UAA20670; Tue, 8 Apr 1997 20:32:50 -0700
Date: Tue, 8 Apr 1997 20:32:50 -0700
Message-Id: <199704090332.UAA20670@xemacs.eng.sun.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Martin Buchholz <mrb@Eng.Sun.COM>
To: Steven L Baur <steve@miranova.com>, Bill Perry <wmperry@aventail.com>,
        XEmacs Beta Test <xemacs-beta@xemacs.org>
Subject: configure.in changes, esp. -with-database
Reply-To: Martin Buchholz <mrb@Eng.Sun.COM>

If you do

configure --with-database=dbm

XEmacs will still go ahead and autodetect berkdb, even though you
specificallly asked not to.  The patch below fixes that. 

Also, there is random cleanup of various things, and making error
messages more consistent.

While I was doing this I thought about how, when you make a usage
error invoking configure, XEmacs will first spit out an error message,
then follow that with the entire help text.  As a result, the error
message will never be visible on the screen when the user goes to look
for it.  Losers who don't run configure in a shell buffer might not be
able to discern the error message, in a most frustrating way.

Here's what FSF Emacs does:

(mrb@xemacs) ~/x/34 $ ./configure -foo
configure: error: -foo: invalid option; use --help to show usage

and now XEmacs:

(mrb@xemacs) ~/x/tm/editor $ ./configure -foo 2>&1 | head -10
./configure: Error: unrecognized option: -foo

Usage: ./configure CONFIGURATION [-OPTION[=VALUE] ...]

and 190 lines more........

FSF Emacs' help is superior.  I'd be willing to make this change.

Steve: If you agree, don't apply this patch, I'll send you an updated
one later.

Martin

--- editor/configure.in.old
+++ editor/configure.in
@@ -443,7 +443,8 @@
 	with_kerberos	| \
 	with_hesiod	| \
 	external_widget | \
-	extra_verbose   | \
+	verbose		| \
+	extra_verbose	| \
 	const_is_losing | \
 	usage_tracking  | \
 	use_union_type  | \
@@ -458,7 +459,7 @@
 	    * )
 	      (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
 Set it to either \`yes' or \`no'."
-	       echo "${short_usage}") >&2
+	       echo ""; echo "${short_usage}") >&2
 	      exit 1 ;;
 	  esac
           eval "${opt}=\"${val}\"" ;;
@@ -468,13 +469,13 @@
 	srcdir		| \
 	compiler	| \
 	puresize	| \
-	native_sound_lib	| \
+	native_sound_lib | \
 	x_includes	| \
 	x_libraries	| \
         wnn_includes    | \
         wnn_libraries   | \
-        canna_includes    | \
-        canna_libraries   | \
+        canna_includes  | \
+        canna_libraries | \
 	site_includes	| \
 	site_libraries	| \
 	site_runtime_libraries  )
@@ -484,7 +485,7 @@
             if test $# = 0 ; then
 	      (echo "${progname}: You must give a value for the \`--${optname}' option, as in
     \`--${optname}=FOO'."
-	       echo "${short_usage}") >&2
+	       echo ""; echo "${short_usage}") >&2
 	      exit 1
 	    fi
 	    val="$1"; shift
@@ -503,7 +504,7 @@
 	    * )
 	      (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value or \`default'.
 Set it to either \`yes', \`no', or \`default'."
-	       echo "${short_usage}") >&2
+	       echo ""; echo "${short_usage}") >&2
 	      exit 1
 	    ;;
 	  esac
@@ -512,30 +513,30 @@
 
         ## Has the user requested database support?
         "with_database" )
-	  if test "${val}" = "no"  ; then
-	    with_database_berkdb=no
-	    with_database_dbm=no
-	    with_database_gnudbm=no
-	  else
-            ## Make sure the value given was berkdb, dbm, gnudbm, or a list
-	    for x in `echo "${val}" | sed 's/,/ /'` ; do
-	      case "${x}" in
-                b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
-                d | db | dbm )				with_database_dbm=yes ;;
+	  with_database_berkdb=no
+	  with_database_dbm=no
+	  with_database_gnudbm=no
+          ## Make sure the value given was `no' or a list of berkdb, dbm, gnudbm
+	  for x in `echo "${val}" | sed 's/,/ /'` ; do
+	    case "${x}" in
+		no ) : ;;
+		b | be | ber | berk | berkd | berkdb )  with_database_berkdb=yes ;;
+		d | db | dbm )				with_database_dbm=yes    ;;
 		g | gn | gnu | gnud | gnudb | gnudbm )  with_database_gnudbm=yes ;;
 		* )
-                  (echo "${progname}: the \`--${optname}' option is supposed to be either \`no'
-  or a comma-separated list of one or more of \`berkdb', \`dbm', or \`gnudbm'."
-                   echo "${short_usage}") >&2
-                  exit 1
-                ;;
-              esac
-	    done
-	    if test "${with_database_dbm}" = "yes" -a "${with_database_gnudbm}" = "yes"
-	    then
-	      (echo "${progname}: only one of \`dbm' and \`gnudbm' should be specified.") >&2
-	      exit 1
-	    fi
+		  (echo "${progname}: the \`--${optname}' option value"
+		   echo "  should be either \`no' or a comma-separated list"
+		   echo "  of one or more of \`berkdb', \`dbm', or \`gnudbm'."
+		   echo ""; echo "${short_usage}") >&2
+                   exit 1 ;;
+            esac
+	  done
+	  if test "${with_database_dbm}" = "yes" -a "${with_database_gnudbm}" = "yes"
+	  then
+	    (echo "${progname}: only one of \`dbm' and \`gnudbm' should be specified"
+	     echo "  with the \`--${optname}' option"
+	     echo ""; echo "${short_usage}") >&2
+	    exit 1
 	  fi
         ;;
 
@@ -552,10 +553,8 @@
 	    * )
 	      (echo "${progname}: the \`--${optname}' option should have one of the values:"
 		echo "\`native', \`nas', \`both', or \`none'."
-		echo ""
-		echo "${short_usage}") >&2
-	      exit 1
-	    ;;
+		echo ""; echo "${short_usage}") >&2
+	      exit 1 ;;
 	  esac
           eval "${opt}=\"${val}\""
         ;;
@@ -563,7 +562,6 @@
         ## Has the user requested XIM support?
 	"with_xim" )
 	  ## value can be xlib or motif
-	  ## as a backwards compatible synonym for native
 	  case "${val}" in
 	    y | ye | yes )			val=yes   ;;
 	    n | no | non | none )		val=no    ;;
@@ -572,10 +570,8 @@
 	    * )
 	      (echo "${progname}: the \`--${optname}' option should have one of the values:"
 		echo "\`motif', \`xlib', \`yes', or \`no'."
-		echo ""
-		echo "${short_usage}") >&2
-	      exit 1
-	    ;;
+		echo ""; echo "${short_usage}") >&2
+	      exit 1 ;;
 	  esac
           eval "${opt}=\"${val}\""
         ;;
@@ -590,9 +586,8 @@
 	    * )
 	      (echo "${progname}: the \`--${optname}' option is supposed to
   be either \`yes', \`no', or \`gnuz'."
-	       echo "${short_usage}") >&2
-	      exit 1
-	    ;;
+	       echo ""; echo "${short_usage}") >&2
+	      exit 1 ;;
 	  esac
           eval "${opt}=\"${val}\""
         ;;
@@ -634,7 +629,7 @@
 		else
 		  echo "\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', and \`malloc'."
 		fi
-		echo "${short_usage}" ) >&2
+		echo ""; echo "${short_usage}" ) >&2
 		exit 1
 	    elif test "$new_default" ; then
 		error_check_extents=$new_default
@@ -664,7 +659,7 @@
 "$progname: You must give a value for the \`--${optname}' option,";
 		  echo \
 "as in \`--${optname}=`eval echo '$'$optname`.'"
-		  echo "$short_usage") >&2
+		  echo ""; echo "$short_usage") >&2
 		 exit 1
 	      fi
 	      val="$1"; shift
@@ -698,7 +693,7 @@
 "$progname: You must give a value for the \`--${optname}' option,";
 		  echo \
 "as in \`--${optname}=`eval echo '$'$optname`-g -O'"
-		  echo "$short_usage") >&2
+		  echo ""; echo "$short_usage") >&2
 		 exit 1
 	      fi
 	      val="$1"; shift
@@ -707,22 +702,14 @@
 	   eval "${opt}_specified=1"
 	;;
 
-	## Verbose flag, tested by autoconf macros.
-	"verbose" )
-	  verbose=yes
-	;;
-
 	## --no-create added by autoconf for use by config.status
 	"no_create" )
 	;;
 
 	## Has the user asked for some help?
 	"usage" | "help" )
-	  if test -z "$PAGER"
-	  then echo "${short_usage}" | more
-	  else echo "${short_usage}" | $PAGER
-	  fi
-	  exit
+	  echo "${short_usage}" | ${PAGER:-more}
+	  exit 0
 	;;
 
 	## Has the user specified what toolkit to use for the menubars,
@@ -738,8 +725,7 @@
 	    * )
 	      (echo "${progname}: the \`--${optname}' option should have one of the values:"
 		echo "\`lucid', \`motif', \`athena', or \`no'."
-		echo ""
-		echo "${short_usage}") >&2
+		echo ""; echo "${short_usage}") >&2
 	      exit 1
 	    ;;
 	  esac
@@ -749,8 +735,7 @@
         ## Fail on unrecognized arguments.
 	* )
 	  (echo "${progname}: Error: unrecognized option: ${arg}"
-	   echo ""
-           echo "${short_usage}") >& 2
+	   echo ""; echo "${short_usage}") >& 2
 	  exit 1
 	;;
 
@@ -799,7 +784,7 @@
 ### Can't specify 2 compilers
 if test "${with_gcc}" = "yes" -a "${with_lcc}" = "yes"; then
   (echo "${progname}: only one of --with-gcc and --with-lcc may be specified."
-   echo "${short_usage}") >&2
+   echo ""; echo "${short_usage}") >&2
   exit 1
 fi
 
@@ -817,7 +802,7 @@
     echo "- Looks like this is a ${configuration}" 1>&2
   else
     echo '- Failed to guess the system type.  You need to tell me.' 1>&2
-    echo "${short_usage}" >&2
+    echo ""; echo "${short_usage}" >&2
     exit 1
   fi
 fi
@@ -854,7 +839,7 @@
 either run the \`${progname}' script at the top of the XEmacs source
 tree, or use the \`--srcdir' option to specify where the XEmacs sources
 are."
-       echo "${short_usage}") >&2
+       echo ""; echo "${short_usage}") >&2
       exit 1
     fi
   ;;
@@ -1305,9 +1290,7 @@
   ## Iris 4D
   mips-sgi-irix3.*      ) machine=iris4d opsys=irix3-3 ;;
   mips-sgi-irix4.*      ) machine=iris4d opsys=irix4-0 ;;
-  mips-sgi-irix6*       ) machine=iris4d
-			opsys=irix6-0
-			NON_GNU_CC="cc -Olimit 2000" ;;
+  mips-sgi-irix6*       ) machine=iris4d opsys=irix6-0 NON_GNU_CC="cc -Olimit 2000" ;;
   mips-sgi-irix5.[3-9]* ) machine=iris4d opsys=irix5-3 ;;
   mips-sgi-irix5.2*     ) machine=iris4d opsys=irix5-2 ;;
   mips-sgi-irix5.1*     ) machine=iris4d opsys=irix5-1 ;;

