Index: /trunk/Makefile.in
===================================================================
--- /trunk/Makefile.in	(revision 582)
+++ /trunk/Makefile.in	(revision 583)
@@ -63,6 +63,6 @@
 INSTALL_DSYS = @INSTALL@ -m 755
 
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
+PACKAGE = @PACKAGE_NAME@
+VERSION = @PACKAGE_VERSION@
 BUILD_NUM = 1
 
@@ -91,5 +91,5 @@
 LIBS_TRY = @LIBS@
 LIBS_SOCK = @sh_libsocket@
-LIBS_KVM = @sh_libkvm@
+
 CFLAGS = @CFLAGS@
 CUTEST =
@@ -222,5 +222,5 @@
 stealth_template.jpg \
 config.guess config.h.in stamp-h.in config.sub configure \
-configure.ac acconfig.h aclocal.m4 install-sh missing mkinstalldirs \
+configure.ac aclocal.m4 acinclude.m4 compile install-sh missing mkinstalldirs \
 c_random.sh c_bits.sh depend.sum depend.dep stamp-hdep
 
@@ -261,6 +261,6 @@
 	touch config.h
 
-stamp-h: $(top_srcdir)/config.h.in config.status
-	./config.status
+#stamp-h: $(top_srcdir)/config.h.in config.status
+#	./config.status
 
 Makefile: $(top_srcdir)/Makefile.in config.status
Index: unk/acconfig.h
===================================================================
--- /trunk/acconfig.h	(revision 582)
+++ 	(revision )
@@ -1,436 +1,0 @@
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-
-@TOP@
-
-/* ---- compile options        ------------   */
-
-/* Define if you want database support        */
-#undef WITH_DATABASE
-
-/* Define if the database is unixODBC         */
-#undef WITH_ODBC
-
-/* Define if the database is oracle           */
-#undef WITH_ORACLE
-
-/* Define if the database is mysql            */
-#undef WITH_MYSQL
-
-/* Define if the database is postgresql       */
-#undef WITH_POSTGRES
-
-/* Define if the server may listen on 514/udp */
-#undef INET_SYSLOG
-
-/* Define if you want logfile in XML format   */
-#undef SH_USE_XML
-
-/* Define if you want external programs.      */
-#undef WITH_EXTERNAL
-
-/* Define if you want to reload the database  */
-/* on SIGHUP.                                 */
-#undef RELOAD_DATABASE
-
-/* Define if you want SysV message queue.     */
-#undef WITH_MESSAGE_QUEUE
-
-/* Define the mode of the message queue.      */
-#undef MESSAGE_QUEUE_MODE
-
-/* Define which users are always trusted.     */
-/* default = 0 ( = root)                      */
-#undef SL_ALWAYS_TRUSTED
-
-/* Define if you want network time.           */
-/* default = no                               */
-#undef HAVE_NTIME
-
-/* The time server host address.              */
-/* default = "NULL"                           */
-#undef DEFAULT_TIMESERVER
-#undef ALT_TIMESERVER
-
-/* Define if you want to use the mail code.   */
-/* default = yes                              */
-#undef  SH_WITH_MAIL
-
-/* Define if you want client/server encryption*/
-#undef  SH_ENCRYPT
-
-/* Define if you want version 2 encryption    */
-#undef  SH_ENCRYPT_2
-
-/* Define if you want to watch for login/-out.*/
-/* default = no                               */
-#undef  SH_USE_UTMP
-
-/* Define if you want to check mount options on filesystems */
-/* default = no                               */
-#undef SH_USE_MOUNTS
-
-/* Define if you want to keep an eye on       */
-/* sensitive files that your users own        */
-#undef SH_USE_USERFILES
-
-/* Define if you want to watch for suid/sgid  */
-/* files                                      */
-#undef  SH_USE_SUIDCHK
-
-/* Define if you want to check kernel syscall */
-/* table to detect LKM rootkits.              */
-/* default = no                               */
-#undef  SH_USE_KERN
-
-/* Define if you want to use the Kernel       */
-/* module to hide samhain.                    */
-#undef  SH_USE_LKM
-
-/* Define if you have a vanilla  Kernel       */
-/* (2.4 or 2.2)                               */
-#undef  SH_VANILLA_KERNEL
-
-/* Define to the name of the MAGIC_HIDE       */
-/* string if you use the Kernel module to     */
-/* hide samhain.                              */
-#undef  SH_MAGIC_HIDE
-
-/* Define if you want 'micro' stealth mode.   */
-/* default = no                               */
-#undef SH_STEALTH_MICRO
-
-/* Define if you want to use stealth mode.    */
-/* default = no                               */
-#undef SH_STEALTH
-
-/* Define if you want stealth w/o CL parsing. */
-/* default = no                               */
-#undef SH_STEALTH_NOCL
-
-/* The magic argv[1] to re-enable CL parsing. */
-/* default = "yes"                            */
-#undef NOCL_CODE
-
-/* XOR value to hide literal strings.         */
-/* default = 0                                */
-#undef XOR_CODE
-
-/* The port number for TCP/IP connection.     */
-/* default = 49777                            */
-#undef SH_DEFAULT_PORT
-
-/* The identity to assume when dropping root  */
-/* default = "nobody"                         */
-#undef DEFAULT_IDENT
-
-/* Directory for tmp files                    */
-#undef SH_TMPDIR
-
-/* The data root directory.                   */
-/* default="/var/lib/samhain"                 */
-#undef DEFAULT_DATAROOT
-
-/* The quarantine directory.                  */
-/* default="/var/lib/samhain/.quarantine      */
-#undef DEFAULT_QDIR
-
-/* The location of the log file.              */
-/* default="/var/log/samhain_log"             */
-#undef DEFAULT_ERRFILE
-
-/* The directory of the log file.             */
-/* default="/var/log"                         */
-#undef DEFAULT_LOGDIR
-
-/* The location of the pid file.              */
-/* default="/var/run/samhain.pid"             */
-#undef DEFAULT_ERRLOCK
-
-/* The location of the pid file directory.    */
-/* default="/var/run            "             */
-#undef DEFAULT_PIDDIR
-
-/* The location of the configuration file.    */ 
-/* default="/etc/samhainrc"                   */
-#undef DEFAULT_CONFIGFILE
-
-/* The location of the checksum data.         */
-/* default="/var/lib/samhain/samhain_file"    */
-#undef DEFAULT_DATA_FILE
-
-/* The location of the html report.           */
-/* default="/var/log/.samhain.html"           */
-#undef DEFAULT_HTML_FILE
-
-/* The install directory.                     */
-/* default="/usr/local/sbin"                  */
-#undef SH_INSTALL_DIR
-
-/* The install path.                          */
-/* default="/usr/local/sbin/samhain"          */
-#undef SH_INSTALL_PATH
-#undef SH_INSTALL_YULE_PATH
-
-/* The install name.                          */
-/* default="samhain"                          */
-#undef SH_INSTALL_NAME
-
-/* The sender name to use.                    */
-/* default = "daemon"                         */
-#undef  DEFAULT_SENDER 
-
-/* The address to send mail to.               */ 
-/* default = "NULL"                           */
-#undef  DEFAULT_MAILADDRESS 
-#undef  ALT_MAILADDRESS 
-
-/* The log server.                            */ 
-/* default = "NULL"                           */
-#undef  DEFAULT_LOGSERVER 
-#undef  ALT_LOGSERVER 
-
-/* The console.                               */ 
-/* default = "NULL"                           */
-#undef  DEFAULT_CONSOLE 
-#undef  ALT_CONSOLE 
-
-/* The default base for one-time pads.        */ 
-/* default = compile_time,compile_time        */
-#undef  DEFKEY
-
-/* Define if you want more debug options.     */
-/* default = no                               */
-#undef MEM_DEBUG
-
-/* Define if you want more debug output.      */
-/* default = no                               */
-#undef WITH_TPT
-
-/* Define if you want tracing.                */
-/* default = no                               */
-#undef WITH_TRACE
-
-/* Define if you want slib debug.             */
-/* default = no                               */
-#undef SL_DEBUG
-
-/* Define if you want slib to abort on errors.*/
-/* default = no                               */
-#undef SL_FAIL_ON_ERROR
-
-/* Define if you want to use SRP authenticaton*/
-#undef USE_SRP_PROTOCOL
-
-/* Define if you want to use GnuPG to         */
-/* verify database and configuation file.     */
-#undef WITH_GPG
-
-/* The full path to GnuPG                     */
-#undef DEFAULT_GPG_PATH
-
-/* Define if you want to compile in the       */
-/* public key fingerprint.                    */
-#undef USE_FINGERPRINT
-
-/* The public key fingerprint.                */
-#undef SH_GPG_FP
-
-/* Use ptrace - screw up signal handling.     */
-#undef SCREW_IT_UP
-
-/* ---- misc                   ------------   */
-
-/* Define the package name.                   */
-#undef PACKAGE
-
-/* Define the package version.                */
-#undef VERSION
-
-/* Define to the position of the key (1...8). */
-#undef POS_TF
-
-/* Init key for exepack.                      */
-#undef EXEPACK_STATE_0
-#undef EXEPACK_STATE_1
-#undef EXEPACK_STATE_2
-
-/* ---- system-specific options ------------  */
-
-/* Define to the address of sys_call_table */
-#undef SH_SYSCALLTABLE
-
-/* Define to use SVR4 statvfs to get filesystem type.  */
-#undef FSTYPE_STATVFS
-
-/* Define to use SVR3.2 statfs to get filesystem type.  */
-#undef FSTYPE_USG_STATFS
-
-/* Define to use AIX3 statfs to get filesystem type.  */
-#undef FSTYPE_AIX_STATFS
-
-/* Define to use 4.3BSD getmntent to get filesystem type.  */
-#undef FSTYPE_MNTENT
-
-/* Define to use 4.4BSD and OSF1 statfs to get filesystem type.  */
-#undef FSTYPE_STATFS
-
-/* Define to use Ultrix getmnt to get filesystem type.  */
-#undef FSTYPE_GETMNT
-
-/* the basic type to which we can cast a uid
- */
-#undef UID_CAST
-
-/* for ext2fs flags                           */
-#undef HAVE_EXT2_IOCTLS
-#undef HAVE_STAT_FLAGS
-
-/* obvious                                    */
-#undef HOST_IS_LINUX
-#undef HOST_IS_I86LINUX
-
-/* obvious                                    */
-#undef HOST_IS_CYGWIN
-
-/* obvious                                    */
-#undef HOST_IS_DARWIN
-
-/* obvious                                    */
-#undef HOST_IS_FREEBSD
-
-/* obvious                                    */
-#undef HOST_IS_AIX
-
-/* obvious                                    */
-#undef HOST_IS_SOLARIS
-
-/* obvious                                    */
-#undef HOST_IS_I86SOLARIS
-
-/* obvious                                    */
-#undef HOST_IS_HPUX
-
-/* Define to the name of the random devices.  */
-#undef NAME_OF_DEV_RANDOM
-
-#undef NAME_OF_DEV_URANDOM
-
-/* Define if you have long long.              */
-#undef HAVE_LONG_LONG
-
-/* Define if short is 32 bits.                */
-#undef HAVE_SHORT_32
-
-/* Define if int is 32 bits.                  */
-#undef HAVE_INT_32
-
-/* Define if long is 32 bits.                 */
-#undef HAVE_LONG_32
-
-/* Define if long is 64 bits.                 */
-#undef HAVE_LONG_64
-
-/* Define if UINT64 is 32 bits.                 */
-#undef UINT64_IS_32
-
-/* Define if you have uint64_t.               */
-#undef HAVE_UINT16_T
-
-/* Define if you have uint64_t.               */
-#undef HAVE_UINT64_T
-
-/* Define if you have utmpx.h.                */
-#undef HAVE_UTMPX_H
-
-/* Define if your struct utmpx has ut_xtime.  */
-#undef HAVE_UTXTIME
-
-/* Define if your struct utmp has ut_type.    */
-#undef HAVE_UTTYPE
-
-/* Define if your struct utmp has ut_host.    */
-#undef HAVE_UTHOST
-
-/* Define if your struct utmp has ut_addr.    */
-#undef HAVE_UTADDR
-
-/* Define if your struct utmp has ut_addr_v6  */
-#undef HAVE_UTADDR_V6
-
-/* Define if your includes are broken.        */
-#undef HAVE_BROKEN_INCLUDES
-
-/* Define if your getcwd uses 'popen'.        */
-#undef HAVE_BROKEN_GETCWD
-
-/* Define if your vsnprintf is broken.        */
-#undef HAVE_BROKEN_VSNPRINTF
-
-/* Define if you have va_copy.                */
-#undef VA_COPY
-
-/* Define if va_list may be copied as array.  */
-#undef VA_COPY_AS_ARRAY
-
-/* Define if you need unix entropy gatherer.  */
-#undef HAVE_UNIX_RANDOM
-
-/* Define if you have EGD.                    */
-#undef HAVE_EGD_RANDOM
-
-/* Define if you have /dev/random.            */
-#undef HAVE_URANDOM
-
-/* Soket name for EGD.                        */
-#undef EGD_SOCKET_NAME
-
-/* Define if your mlock() is broken.          */
-#undef HAVE_BROKEN_MLOCK
-
-/* Define the proc f_type.                    */
-#undef SH_PROC_MAGIC
-
-/* Define if you have statfs.                 */
-#undef HAVE_STATFS
-
-/* Define if statfs works.                    */
-#undef STATFS_WORKS
-
-/* Define to long if not defined.             */
-#undef ptrdiff_t
-
-@BOTTOM@
-
-/* dont modify this, unless you know what you do
- */
-#define SRP_GENERATOR_1024      "2"
-#define SRP_MODULUS_1024_1        \
-_("f488fd584e49dbcd20b49de49107366b336c380d451d0f7c88b31c7c5b2d8ef6") 
-#define SRP_MODULUS_1024_2        \
-_("f3c923c043f0a55b188d8ebb558cb85d38d334fd7c175743a31d186cde33212c") 
-#define SRP_MODULUS_1024_3        \
-_("b52aff3ce1b1294018118d7c84a70a72d686c40319c807297aca950cd9969fab")
-#define SRP_MODULUS_1024_4        \
-_("d00a509b0246d3083d66a45d419f9c7cbd894b221926baaba25ec355e92f78c7")
-
-#define SDG_0RETU _("return.\n")
-#define SDG_TERRO _("ERROR: file=<%s>, line=<%d>, reason=<%s>\n")
-#define SDG_AERRO _("ERROR: file=<%s>, line=<%d>, failed_assertion=<%s>\n")
-#define SDG_AFAIL _("FAILED: file=<%s>, line=<%d>, assertion=<%s>\n")
-#define SDG_ENTER _("enter=<%s>\n")
-#define SDG_RETUR _("return=<%s>.\n")
-#define SDG_ERROR _("error=<%ld>.\n")
-
-#ifdef SH_STEALTH
-char * globber(const char * string);
-#define _(string) globber(string) 
-#define N_(string) string
-#else
-#define _(string)  string 
-#define N_(string) string
-#endif
-
-#endif
Index: /trunk/acinclude.m4
===================================================================
--- /trunk/acinclude.m4	(revision 583)
+++ /trunk/acinclude.m4	(revision 583)
@@ -0,0 +1,2106 @@
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# serial 1
+
+
+AC_DEFUN([sh_run_prog],
+[if test "$cross_compiling" = "yes"; then
+   AC_MSG_ERROR([Can not probe non-portable values when cross compiling])
+fi
+cat > conftest.$ac_ext <<EOF
+[#]line __oline__ "configure"
+#include "confdefs.h"
+ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
+extern "C" void exit(int);
+#endif
+])
+[$1]
+EOF
+if AC_TRY_EVAL(ac_link) && test -s conftest && $2=`(./conftest 2>/dev/null)`
+then
+dnl Don't remove the temporary files here, so they can be examined.
+ifelse([$3], , :, [$3])
+else
+echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+ifelse([$4], , , [  rm -fr conftest*
+  $4
+])
+fi
+rm -fr conftest* ])
+
+dnl fs type number of the proc filing system
+AC_DEFUN([sh_procfs_id],
+[AC_MSG_CHECKING([f_type of /proc])
+AC_CACHE_VAL([sh_cv_proc_fstype],
+[sh_run_prog(
+changequote(<<, >>)dnl
+<<#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifndef Q
+#define __Q(x) #x
+#define Q(x) __Q(x)
+#endif
+int main(void)
+{
+struct statfs fsbuf;
+long ft;
+if (statfs("/", &fsbuf)!=0)
+  exit(1);
+ft=fsbuf.f_type;
+if (statfs("/proc/1", &fsbuf)!=0)
+  exit(1);
+if (ft!=fsbuf.f_type)
+  printf("0x%08lx", fsbuf.f_type);
+else
+  puts("statfs useless");
+exit(0);
+} >>
+changequote([, ]), sh_cv_proc_fstype,, sh_cv_proc_fstype="a fatal error occured")])
+AC_MSG_RESULT($sh_cv_proc_fstype)
+if test "${sh_cv_proc_fstype}" = "a fatal error occured"; then
+  $1=$2
+  $4
+else if test "${sh_cv_proc_fstype}" = "statfs useless"; then
+  $1=$2
+  $4
+else
+  $1=$sh_cv_proc_fstype
+  $3
+fi; fi ])
+
+# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
+# is not called from uid 0 (not tested whether uid 0 works)
+dnl AC_CHECK_MLOCK
+dnl
+define([AC_CHECK_MLOCK],
+  [ AC_CHECK_FUNCS(mlock)
+    if test "$ac_cv_func_mlock" = "yes"; then
+        AC_MSG_CHECKING(whether mlock is broken)
+          AC_CACHE_VAL(ac_cv_have_broken_mlock,
+             AC_RUN_IFELSE([AC_LANG_SOURCE([[
+                #include <stdlib.h>
+                #include <unistd.h>
+                #include <errno.h>
+                #include <sys/mman.h>
+                #include <sys/types.h>
+                #include <fcntl.h>
+
+                int main()
+                {
+                    char *pool;
+                    int err;
+                    long int pgsize = getpagesize();
+
+                    pool = malloc( 4096 + pgsize );
+                    if( !pool )
+                        return 2;
+                    pool += (pgsize - ((long int)pool % pgsize));
+
+                    err = mlock( pool, 4096 );
+                    if( !err || errno == EPERM )
+                        return 0; /* okay */
+
+                    return 1;  /* hmmm */
+                }
+
+            ]])],[ac_cv_have_broken_mlock="no"],[ac_cv_have_broken_mlock="yes"],[ac_cv_have_broken_mlock="assume-no"
+           ])
+         )
+         if test "$ac_cv_have_broken_mlock" = "yes"; then
+             AC_DEFINE([HAVE_BROKEN_MLOCK], [1], [mlock broken])
+             AC_MSG_RESULT(yes)
+         else
+            if test "$ac_cv_have_broken_mlock" = "no"; then
+                AC_MSG_RESULT(no)
+            else
+                AC_MSG_RESULT(assuming no)
+            fi
+         fi
+    fi
+  ])
+
+dnl @synopsis AC_FUNC_VSNPRINTF
+dnl
+dnl Check whether there is a reasonably sane vsnprintf() function installed.
+dnl "Reasonably sane" in this context means never clobbering memory beyond
+dnl the buffer supplied, and having a sensible return value.  It is
+dnl explicitly allowed not to NUL-terminate the return value, however.
+dnl
+dnl @version $Id: ac_func_vsnprintf.m4,v 1.1 2001/07/26 02:00:21 guidod Exp $
+dnl @author Gaute Strokkenes <gs234@cam.ac.uk>
+dnl
+AC_DEFUN([SL_CHECK_VSNPRINTF],
+[AC_CACHE_CHECK(for working vsnprintf,
+  ac_cv_func_vsnprintf,
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
+#include <stdarg.h>
+
+int
+doit(char * s, ...)
+{
+  char buffer[32];
+  va_list args;
+  int r;
+
+  buffer[5] = 'X';
+
+  va_start(args, s);
+  r = vsnprintf(buffer, 5, s, args);
+  va_end(args);
+
+  /* -1 is pre-C99, 7 is C99. R.W. 17.01.2003 disallow -1 */
+
+  if (r != 7)
+    exit(1);
+
+  /* We deliberately do not care if the result is NUL-terminated or
+     not, since this is easy to work around like this.  */
+
+  buffer[4] = 0;
+
+  /* Simple sanity check.  */
+
+  if (strcmp(buffer, "1234"))
+    exit(1);
+
+  if (buffer[5] != 'X')
+    exit(1);
+
+  exit(0);
+}
+
+int
+main(void)
+{
+  doit("1234567");
+  exit(1);
+}]])],[ac_cv_func_vsnprintf=yes],[ac_cv_func_vsnprintf=no],[ac_cv_func_vsnprintf=no])])
+dnl Note that the default is to be pessimistic in the case 
+dnl of cross compilation.
+dnl If you know that the target has a sensible vsnprintf(), 
+dnl you can get around this
+dnl by setting ac_func_vsnprintf to yes, as described in the Autoconf manual.
+if test $ac_cv_func_vsnprintf = yes; then
+  :
+else
+  AC_DEFINE([HAVE_BROKEN_VSNPRINTF], [1],
+            [Define if you have a broken version of the `vsnprintf' function.])
+fi
+])# AC_FUNC_VSNPRINTF
+
+dnl SH_CHECK_TYPEDEF(TYPE, HAVE_NAME)
+dnl Check whether a typedef exists and create a #define $2 if it exists
+dnl
+AC_DEFUN([SH_CHECK_TYPEDEF],
+  [ AC_MSG_CHECKING(for $1 typedef)
+    sh_cv_typedef_foo=`echo sh_cv_typedef_$1 | sed -e 's% %_%g'`
+    AC_CACHE_VAL( $sh_cv_typedef_foo,
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdlib.h>
+#include <sys/types.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif]], [[
+    #undef $1
+    int a = sizeof($1);
+    ]])],[sh_cv_typedef=yes],[sh_cv_typedef=no ])])
+    AC_MSG_RESULT($sh_cv_typedef)
+    if test "$sh_cv_typedef" = yes; then
+        AC_DEFINE([$2], [1], [Define if type is defined in stdint.h or inttypes.h])
+	sh_$2=yes
+    else
+	sh_$2=no
+    fi
+  ])
+
+
+
+dnl **********************
+dnl *** va_copy checks ***
+dnl **********************
+AC_DEFUN([SL_CHECK_VA_COPY],
+[AC_MSG_CHECKING(for va_copy())
+AC_CACHE_VAL(sh_cv_va_copy,[
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+        #include <stdarg.h>
+        void f (int i, ...) {
+        va_list args1, args2;
+        va_start (args1, i);
+        va_copy (args2, args1);
+        if (va_arg (args2, int) != 42)
+	  exit (1);
+	if (va_arg (args1, int) != 42)
+          exit (1);
+        va_end (args1); va_end (args2);
+        }
+        int main() {
+          f (0, 42);
+          return 0;
+        }]])],[sh_cv_va_copy=yes
+        ],[sh_cv_va_copy=no
+        ],[sh_cv_va_copy=no])
+])
+AC_MSG_RESULT($sh_cv_va_copy)
+AC_MSG_CHECKING(for __va_copy())
+AC_CACHE_VAL(sh_cv___va_copy,[
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+        #include <stdarg.h>
+        void f (int i, ...) {
+        va_list args1, args2;
+        va_start (args1, i);
+        __va_copy (args2, args1);
+        if (va_arg (args2, int) != 42)
+	  exit (1);
+	if (va_arg (args1, int) != 42)
+          exit (1);
+        va_end (args1); va_end (args2);
+        }
+        int main() {
+          f (0, 42);
+          return 0;
+        }]])],[sh_cv___va_copy=yes
+        ],[sh_cv___va_copy=no
+        ],[sh_cv___va_copy=no])
+])
+AC_MSG_RESULT($sh_cv___va_copy)
+AC_MSG_CHECKING(whether va_lists can be copied by value)
+AC_CACHE_VAL(sh_cv_va_val_copy,[
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+        #include <stdarg.h>
+        void f (int i, ...) {
+        va_list args1, args2;
+        va_start (args1, i);
+        args2 = args1;
+        if (va_arg (args2, int) != 42)
+	  exit (1);
+	if (va_arg (args1, int) != 42)
+          exit (1);
+        va_end (args1); va_end (args2);
+        }
+        int main() {
+          f (0, 42);
+          return 0;
+        }]])],[sh_cv_va_val_copy=yes
+        ],[sh_cv_va_val_copy=no
+        ],[sh_cv_va_val_copy=no])
+])
+if test "x$sh_cv_va_copy" = "xyes"; then
+  AC_DEFINE([VA_COPY], [va_copy], [va_copy type])
+else if test "x$sh_cv___va_copy" = "xyes"; then
+  AC_DEFINE([VA_COPY], [__va_copy], [va_copy type])
+fi
+fi
+if test "x$sh_cv_va_val_copy" = "xno"; then
+  AC_DEFINE([VA_COPY_AS_ARRAY], [1], [va_copy type])
+fi
+AC_MSG_RESULT($sh_cv_va_val_copy)
+])
+
+
+dnl SH_INIT_PARSE_ARGS()
+m4_define([SH_INIT_PARSE_ARGS],
+[
+m4_divert_push([PARSE_ARGS])dnl
+
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[[^_$as_cr_alnum]]%_%g"
+
+as_tr_sh="eval sed 'y%*+%pp%;s%[[^_$as_cr_alnum]]%_%g'"
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+AC_SUBST(exec_prefix, NONE)dnl
+no_create=
+no_recursion=
+AC_SUBST(prefix, NONE)dnl
+program_prefix=NONE
+program_suffix=NONE
+AC_SUBST(program_transform_name, [s,x,x,])dnl
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+DESTDIR=
+SH_ENABLE_OPTS="selinux posix-acl asm ssp db-reload xml-log message-queue login-watch process-check port-check mounts-check logfile-monitor userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc ipv6 shellexpand suid"
+SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver signify pubkey-checksum gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file"
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+dnl Use braces instead of parens because sh, perl, etc. also accept them.
+sbindir='${exec_prefix}/sbin'
+sysconfdir='${prefix}/etc'
+localstatedir='${prefix}/var'
+mandir='${prefix}/share/man'
+
+AC_SUBST([sbindir],        ['${exec_prefix}/sbin'])dnl
+AC_SUBST([sysconfdir],     ['${prefix}/etc'])dnl
+AC_SUBST([localstatedir],  ['${prefix}/var'])dnl
+AC_SUBST([mandir],         ['${prefix}/share/man'])dnl
+
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  case "$ac_option" in
+changequote(, )dnl
+  *=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+changequote([, ])dnl
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid feature name: $ac_feature])
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    ac_enable_check_opt=no
+    for f in ${SH_ENABLE_OPTS}
+    do
+	f=`echo $f | sed 's/-/_/g'`
+	if test x${f} = x"${ac_feature}"
+	then
+		ac_enable_check_opt=yes
+	fi
+    done
+    if test x${ac_enable_check_opt} = xno
+    then
+	AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    fi
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid feature name: $ac_feature])
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    ac_enable_check_opt=no
+    for f in ${SH_ENABLE_OPTS}
+    do
+	f=`echo $f | sed 's/-/_/g'`
+	if test x${f} = x"${ac_feature}"
+	then
+		ac_enable_check_opt=yes
+	fi
+    done
+    if test x${ac_enable_check_opt} = xno
+    then
+	AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    fi
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix 
+    ac_exec_prefix_set="yes"
+    ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" 
+    ac_exec_prefix_set="yes"
+    ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir 
+    ac_localstatedir_set="yes"
+    ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" 
+    ac_localstatedir_set="yes"
+    ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir 
+    ac_mandir_set="yes"
+    ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" 
+    ac_mandir_set="yes"
+    ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix
+    ac_prefix_set="yes" 
+    ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" 
+    ac_prefix_set="yes" 
+    ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir 
+    ac_sbindir_set="yes" 
+    ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" 
+    ac_sbindir_set="yes" 
+    ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi | --b)
+    echo "WARNING: bindir will be ignored, use sbindir" 
+    ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* \
+  | --bi=* | --b=*)
+    echo "WARNING: bindir will be ignored, use sbindir" 
+    ;;
+
+  -datadir | --datadir)
+    echo "WARNING: datadir will be ignored" 
+   ;;
+  -datadir=* | --datadir=*)
+    echo "WARNING: datadir will be ignored" 
+   ;;
+ 
+  -includedir | --includedir)
+    echo "WARNING: includedir will be ignored" 
+   ;;
+  -includedir=* | --includedir=*)
+    echo "WARNING: includedir will be ignored" 
+   ;;
+
+  -infodir | --infodir)
+    echo "WARNING: infodir will be ignored" 
+   ;;
+  -infodir=* | --infodir=*)
+    echo "WARNING: infodir will be ignored" 
+   ;;
+ 
+  -libdir | --libdir)
+    echo "WARNING: libdir will be ignored" 
+   ;;
+  -libdir=* | --libdir=*)
+    echo "WARNING: libdir will be ignored" 
+   ;;
+ 
+  -libexecdir | --libexecdir)
+    echo "WARNING: libexecdir will be ignored" 
+   ;;
+  -libexecdir=* | --libexecdir=*)
+    echo "WARNING: libexecdir will be ignored" 
+   ;;
+
+  -sharedstatedir | --sharedstatedir)
+    echo "WARNING: sharedstatedir will be ignored" 
+   ;;
+  -sharedstatedir=* | --sharedstatedir=*)
+    echo "WARNING: sharedstatedir will be ignored" 
+   ;;
+ 
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir 
+    ac_sysconfdir_set="yes" 
+    ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" 
+    ac_sysconfdir_set="yes" 
+    ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    ac_init_version=: ;;
+
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid package name: $ac_package])
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    ac_with_check_opt=no
+    for f in ${SH_WITH_OPTS}
+    do
+	f=`echo $f | sed 's/-/_/g'`
+	if test x${f} = x"${ac_package}"
+	then
+		ac_with_check_opt=yes
+	fi
+    done
+    if test x${ac_with_check_opt} = xno
+    then
+	AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    fi
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid package name: $ac_package])
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    ac_with_check_opt=no
+    for f in ${SH_WITH_OPTS}
+    do
+	f=`echo $f | sed 's/-/_/g'`
+	if test x${f} = x"${ac_package}"
+	then
+		ac_with_check_opt=yes
+	fi
+    done
+    if test x${ac_with_check_opt} = xno
+    then
+	AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    fi
+    eval "with_$ac_package=no" ;;
+
+
+  -*) AC_MSG_ERROR([unrecognized option: $ac_option
+Try `$[0] --help' for more information.])
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_ERROR([invalid variable name: $ac_envvar])
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    AC_MSG_WARN([you should use --build, --host, --target])
+    expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
+      AC_MSG_WARN([invalid host type: $ac_option])
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`)
+fi
+
+# Be sure to have absolute paths.
+for ac_var in prefix exec_prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [[\\/$]]* | ?:[[\\/]]* | NONE | '' | OPT | USR ) ;;
+    *)  AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in sbindir sysconfdir localstatedir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [[\\/$]]* | ?:[[\\/]]* ) ;;
+    *)  AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used.])
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
+
+m4_divert_pop([PARSE_ARGS])dnl
+])# SH_INIT_PARSE_ARGS
+
+m4_define([SH_INIT_HELP],
+[m4_divert_push([HELP_BEGIN])dnl
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures m4_ifset([AC_PACKAGE_STRING],
+                        [AC_PACKAGE_STRING],
+                        [this package]) to adapt to many kinds of systems.
+
+Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
+
+[To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install binaries in \`/usr/local/sbin',
+the config file in \`/etc', manpage in \`/usr/local/share/man', and state
+data in \`/var/lib/INSTALL_NAME' (FSH layout).  You can specify other
+FSH compliant layouts with \`--prefix=OPT' or \`--prefix=USR', or you
+can specify a directory with \`--prefix=DIR' to install in \`DIR/sbin',
+\`DIR/etc', etc.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --mandir=DIR           man documentation [PREFIX/man]
+
+For even finer tuning, paths can be specified for individual files (see below)
+
+_ACEOF
+
+  cat <<\_ACEOF]
+m4_divert_pop([HELP_BEGIN])dnl
+dnl The order of the diversions here is
+dnl - HELP_BEGIN
+dnl   which may be prolongated by extra generic options such as with X or
+dnl   AC_ARG_PROGRAM.  Displayed only in long --help.
+dnl
+dnl - HELP_CANON
+dnl   Support for cross compilation (--build, --host and --target).
+dnl   Display only in long --help.
+dnl
+dnl - HELP_ENABLE
+dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
+dnl   then implements the header of the non generic options.
+dnl
+dnl - HELP_WITH
+dnl
+dnl - HELP_VAR
+dnl
+dnl - HELP_VAR_END
+dnl
+dnl - HELP_END
+dnl   initialized below, in which we dump the trailer (handling of the
+dnl   recursion for instance).
+m4_divert_push([HELP_ENABLE])dnl
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+m4_ifset([AC_PACKAGE_STRING],
+[  case $ac_init_help in
+     short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
+   esac])
+  cat <<\_ACEOF
+m4_divert_pop([HELP_ENABLE])dnl
+m4_divert_push([HELP_END])dnl
+m4_ifset([AC_PACKAGE_BUGREPORT], [
+Report bugs to <AC_PACKAGE_BUGREPORT>.])
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    _AC_SRCPATHS(["$ac_dir"])
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+           test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      AC_MSG_WARN([no configuration information is in $ac_dir])
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+m4_divert_pop([HELP_END])dnl
+])# SH_INIT_HELP
+
+
+
+
+
+
+
+
+# Check whether sa_sigaction works.
+# Rainer Wichmann <support@la-samhna.de>, 2003.
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License.
+
+AC_DEFUN([AM_SA_SIGACTION_WORKS],
+  [
+   am_cv_val_SA_SIGACTION=no
+   AC_CHECK_HEADER(signal.h,
+     [
+      AM_SI_USER
+      AM_SA_SIGINFO
+      if test $am_cv_val_SI_USER = yes && test $am_cv_val_SA_SIGINFO = yes
+      then
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <signal.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+volatile int xnum  = 0;
+volatile int xcode = 0; 
+jmp_buf      Buf;
+int          xsig  = SIGSEGV;
+
+void sighandler (int xsignam, siginfo_t * xsiginfo, void * xsigadd)
+{
+  static sigset_t x;
+
+  if (xsiginfo == NULL)
+    exit(__LINE__);
+  if (xsiginfo->si_signo != xsignam)
+    exit(__LINE__);
+  ++xnum;
+  xcode   = xsiginfo->si_code;
+  sigemptyset (&x);
+  sigprocmask(SIG_SETMASK, &x, NULL);
+  longjmp ( Buf, 1);
+}
+
+int main ()
+{
+  struct sigaction newact;
+
+  newact.sa_sigaction = sighandler;
+  sigemptyset (&newact.sa_mask);
+  newact.sa_flags = SA_SIGINFO;
+  if (0 != sigaction (xsig, &newact, NULL))
+    exit (__LINE__);
+  if(setjmp ( Buf)) {
+      if (xnum > 1)
+	goto Third;
+      goto Second;
+  }
+  memcpy((void *) 0x0, "test", 5);
+ Second:
+  if (xcode == SI_USER)
+    exit (__LINE__);
+  raise(xsig);
+ Third:
+  if (xcode != SI_USER)
+    exit (__LINE__);
+  if (xnum != 2)
+    exit (__LINE__);
+  return (0);
+}]])],[am_cv_val_SA_SIGACTION=yes],[am_cv_val_SA_SIGACTION=no],[am_cv_val_SA_SIGACTION=no])
+   fi
+      ])
+     AC_MSG_CHECKING([whether sa_sigaction is supported])
+     if test $am_cv_val_SA_SIGACTION = yes
+     then
+       AC_MSG_RESULT(yes)
+       AC_DEFINE([SA_SIGACTION_WORKS], [1], [Define if sa_sigaction works])
+     else
+	AC_MSG_RESULT(no)
+     fi
+     ])
+
+# Check whether SI_USER is available in <signal.h>.
+# Rainer Wichmann <support@la-samhna.de>, 2003.
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License.
+
+
+AC_DEFUN([AM_SI_USER],
+  [if test $ac_cv_header_signal_h = yes; then
+    AC_CACHE_CHECK([for SI_USER in signal.h], am_cv_val_SI_USER,
+      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[return SI_USER]])],[am_cv_val_SI_USER=yes],[am_cv_val_SI_USER=no])])
+    if test $am_cv_val_SI_USER = yes; then
+      AC_DEFINE([HAVE_SI_USER], [1], [Define if you have SI_USER])
+    fi
+  fi])
+
+# Check whether SA_SIGINFO is available in <signal.h>.
+# Rainer Wichmann <support@la-samhna.de>, 2003.
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License.
+
+
+AC_DEFUN([AM_SA_SIGINFO],
+  [if test $ac_cv_header_signal_h = yes; then
+    AC_CACHE_CHECK([for SA_SIGINFO in signal.h], am_cv_val_SA_SIGINFO,
+      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[return SA_SIGINFO]])],[am_cv_val_SA_SIGINFO=yes],[am_cv_val_SA_SIGINFO=no])])
+    if test $am_cv_val_SA_SIGINFO = yes; then
+      AC_DEFINE([HAVE_SA_SIGINFO], [1], [Define if you have SA_SIGINFO])
+    fi
+  fi])
+
+dnl
+dnl Useful macros for autoconf to check for ssp-patched gcc
+dnl 1.0 - September 2003 - Tiago Sousa <mirage@kaotik.org>
+dnl 1.1 - August 2006 - Ted Percival <ted@midg3t.net>
+dnl     * Stricter language checking (C or C++)
+dnl     * Adds GCC_STACK_PROTECT_LIB to add -lssp to LDFLAGS as necessary
+dnl     * Caches all results
+dnl     * Uses macros to ensure correct ouput in quiet/silent mode
+dnl 1.2 - April 2007 - Ted Percival <ted@midg3t.net>
+dnl     * Added GCC_STACK_PROTECTOR macro for simpler (one-line) invocation
+dnl     * GCC_STACK_PROTECT_LIB now adds -lssp to LIBS rather than LDFLAGS
+dnl
+dnl About ssp:
+dnl GCC extension for protecting applications from stack-smashing attacks
+dnl http://www.research.ibm.com/trl/projects/security/ssp/
+dnl
+dnl Usage:
+dnl Most people will simply call GCC_STACK_PROTECTOR.
+dnl If you only use one of C or C++, you can save time by only calling the
+dnl macro appropriate for that language. In that case you should also call
+dnl GCC_STACK_PROTECT_LIB first.
+dnl
+dnl GCC_STACK_PROTECTOR
+dnl Tries to turn on stack protection for C and C++ by calling the following
+dnl three macros with the right languages.
+dnl
+dnl GCC_STACK_PROTECT_CC
+dnl checks -fstack-protector with the C compiler, if it exists then updates
+dnl CFLAGS and defines ENABLE_SSP_CC
+dnl
+dnl GCC_STACK_PROTECT_CXX
+dnl checks -fstack-protector with the C++ compiler, if it exists then updates
+dnl CXXFLAGS and defines ENABLE_SSP_CXX
+dnl
+dnl GCC_STACK_PROTECT_LIB
+dnl adds -lssp to LIBS if it is available
+dnl ssp is usually provided as part of libc, but was previously a separate lib
+dnl It does not hurt to add -lssp even if libc provides SSP - in that case
+dnl libssp will simply be ignored.
+dnl
+
+AC_DEFUN([GCC_STACK_PROTECT_LIB],[
+  AC_CACHE_CHECK([whether libssp exists], ssp_cv_lib,
+    [ssp_old_libs="$LIBS"
+     LIBS="$LIBS -lssp"
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_lib=yes],[ssp_cv_lib=no])
+     LIBS="$ssp_old_libs"
+    ])
+  if test $ssp_cv_lib = yes; then
+    LIBS="$LIBS -lssp"
+  fi
+])
+
+AC_DEFUN([GCC_STACK_PROTECT_CC],[
+  AC_LANG_ASSERT(C)
+  if test "X$CC" != "X"; then
+    AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-strong],
+      ssp_cv_cc,
+      [ssp_old_cflags="$CFLAGS"
+       CFLAGS="$CFLAGS -fstack-protector-strong"
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_cc=yes],[ssp_cv_cc=no])
+       CFLAGS="$ssp_old_cflags"
+      ])
+    if test $ssp_cv_cc = no; then
+      AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-all],
+        ssp_cv_cc,
+        [ssp_old_cflags="$CFLAGS"
+         CFLAGS="$CFLAGS -fstack-protector-all"
+         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_cc=yes],[ssp_cv_cc=no])
+         CFLAGS="$ssp_old_cflags"
+        ])
+      if test $ssp_cv_cc = no; then
+        AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector],
+          ssp_cv_cc,
+          [ssp_old_cflags="$CFLAGS"
+           CFLAGS="$CFLAGS -fstack-protector"
+           AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_cc=yes],[ssp_cv_cc=no])
+           CFLAGS="$ssp_old_cflags"
+          ])
+        if test $ssp_cv_cc = yes; then
+          CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector"
+	  LDFLAGS="$LDFLAGS -fstack-protector"
+          AC_DEFINE([ENABLE_SSP_CC], [1], [Define if SSP C support is enabled.])
+        fi
+      else
+        if test $ssp_cv_cc = yes; then
+          CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
+	  LDFLAGS="$LDFLAGS -fstack-protector-all"
+          AC_DEFINE([ENABLE_SSP_CC], [1], [Define if SSP C support is enabled.])
+        fi
+      fi
+    else
+      if test $ssp_cv_cc = yes; then
+        CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-strong"
+	LDFLAGS="$LDFLAGS -fstack-protector-strong"
+        AC_DEFINE([ENABLE_SSP_CC], [1], [Define if SSP C support is enabled.])
+      fi
+    fi
+  fi
+])
+
+AC_DEFUN([GCC_STACK_PROTECT_CXX],[
+  AC_LANG_ASSERT(C++)
+  if test "X$CXX" != "X"; then
+    AC_CACHE_CHECK([whether ${CXX} accepts -fstack-protector],
+      ssp_cv_cxx,
+      [ssp_old_cxxflags="$CXXFLAGS"
+       CXXFLAGS="$CXXFLAGS -fstack-protector"
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ssp_cv_cxx=yes],[ssp_cv_cxx=no])
+       CXXFLAGS="$ssp_old_cxxflags"
+      ])
+    if test $ssp_cv_cxx = yes; then
+      CXXFLAGS="$CXXFLAGS -fstack-protector"
+      AC_DEFINE([ENABLE_SSP_CXX], [1], [Define if SSP C++ support is enabled.])
+    fi
+  fi
+])
+
+AC_DEFUN([GCC_STACK_PROTECTOR],[
+  GCC_STACK_PROTECT_LIB
+
+  AC_LANG_PUSH([C])
+  GCC_STACK_PROTECT_CC
+  AC_LANG_POP([C])
+
+  AC_LANG_PUSH([C++])
+  GCC_STACK_PROTECT_CXX
+  AC_LANG_POP([C++])
+])
+
+
+AC_DEFUN([GCC_PIE_CC],[
+  AC_LANG_ASSERT(C)
+  if test "X$CC" != "X"; then
+    AC_CACHE_CHECK([whether ${CC} accepts -pie -fPIE],
+      pie_cv_cc,
+      [pie_old_cflags="$CFLAGS"
+       CFLAGS="$CFLAGS -pie -fPIE"
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[pie_cv_cc=yes],[pie_cv_cc=no])
+       CFLAGS="$pie_old_cflags"
+      ])
+    if test $pie_cv_cc = yes; then
+      case "$host_os" in
+      *cygwin*)
+      ;;
+      *)
+      PIE_CFLAGS="-fPIE"
+      PIE_LDFLAGS="-pie"
+      ;;
+      esac
+    fi
+  fi
+])
+
+AC_DEFUN([GCC_STACK_CHECK_CC],[
+  AC_LANG_ASSERT(C)
+  if test "X$CC" != "X"; then
+    AC_CACHE_CHECK([whether ${CC} accepts -fstack-clash-protection],
+      stackcheck_cv_cc,
+      [stackcheck_old_cflags="$CFLAGS"
+       CFLAGS="$CFLAGS -fstack-clash-protection"
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[stackcheck_cv_cc=yes],[stackcheck_cv_cc=no])
+       CFLAGS="$stackcheck_old_cflags"
+      ])
+    if test $stackcheck_cv_cc = yes; then
+      CFLAGS="$CFLAGS -fstack-clash-protection"
+    fi
+  fi
+])
+
+AC_DEFUN([GCC_FLAG_CHECK],[
+  AC_LANG_ASSERT(C)
+  if test "X$CC" != "X"; then
+     AC_MSG_CHECKING([whether ${CC} accepts $1])
+     saved_cflags="$CFLAGS"
+     # any -Wno- option will always succeed :-(
+     flag_check_opt=`echo $1 | sed 's,-Wno-,-W,'`
+     CFLAGS="$CFLAGS -Werror $flag_check_opt"
+     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[flag_check_cv=yes],[flag_check_cv=no])
+     CFLAGS="$saved_cflags"
+     if test $flag_check_cv = yes; then
+      	CFLAGS="$CFLAGS $1"
+	AC_MSG_RESULT([yes])
+     else
+        AC_MSG_RESULT([no])
+     fi
+  fi
+])
+
+AC_DEFUN([SAMHAIN_POSIX],[
+	AC_MSG_CHECKING([whether _POSIX_SOURCE is necessary])
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+void fileno(int);int fdopen(int, char *); ]], [[]])],[
+	AC_MSG_RESULT(yes)
+	AC_DEFINE([_POSIX_SOURCE], [1], [Define if POSIX functions are required])
+	],[AC_MSG_RESULT(no)])
+])dnl
+
+dnl checks for a known 64 bit programming environment
+dnl AC_RUN_IFELSE(PROGRAM,
+dnl               [ACTION-IF-TRUE], [ACTION-IF-FALSE],
+dnl               [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
+dnl
+AC_DEFUN([SAMHAIN_PRG_ENV],[
+    AC_MSG_CHECKING([for a known 64 bit programming environment])
+    # Compile and run a program that determines the programming environment
+    AC_RUN_IFELSE([
+      AC_LANG_SOURCE([[
+#include <stdio.h>
+int main(int argc,char **argv)
+{
+  if (argc > 1) {
+#if defined(__arch64__)
+  printf("__arch64__\n");
+#elif defined(__ia64__)
+  printf("__ia64__\n");
+#elif defined(__x86_64__)
+  printf("__x86_64__\n");
+#elif defined(__LP64__)
+  printf("__LP64__\n");
+#elif defined(__64BIT__)
+  printf("__64BIT__\n");
+#elif defined(_LP64)
+  printf("_LP64\n");
+#elif defined(_M_IA64)
+  printf("_M_IA64\n");
+#elif defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64)
+  printf("_MIPS_64\n");
+#else
+choke me
+#endif
+  }
+  return 0;
+}
+      ]])
+    ],[
+      # Program compiled and ran, so get version by adding argument.
+      samhain_prg_ENV=`./conftest$ac_exeext x`
+      samhain_64=yes
+      AC_MSG_RESULT([$samhain_prg_ENV])
+    ],[
+      AC_MSG_RESULT([none])
+	],[
+      AC_MSG_RESULT([none])
+	])
+])dnl
+
+AC_DEFUN([SAMHAIN_X86_64],[
+	AC_MSG_CHECKING([for x86_64])
+	AC_RUN_IFELSE([AC_LANG_SOURCE([[
+int main() {
+__asm__ volatile (
+"movq %rax, %rax"
+);
+return 0;
+}
+	]])],[
+	AC_MSG_RESULT(yes)
+	samhain_64=yes
+	tiger_src=sh_tiger1_64.c
+	samhain_64_asm=yes
+	],[
+	AC_MSG_RESULT([no])
+	],[
+	AC_MSG_RESULT([no])
+	])
+])dnl
+
+
+AC_DEFUN([SAMHAIN_64],[
+samhain_64=no
+tiger_src=sh_tiger1.c
+samhain_64_asm=no
+#
+# if sizeof(unsigned long) = 4, try compiler macros for 64bit
+#
+if test "x$ac_cv_sizeof_unsigned_long" = x4; then
+  if test "x$ac_cv_sizeof_unsigned_long_long" = x8; then
+	SAMHAIN_PRG_ENV
+	if test "x$samhain_64" = xyes; then
+	  tiger_src=sh_tiger1_64.c
+        fi
+	#
+	# if GCC and __i386__, use precompiled assembler
+	#
+	if test "x$GCC" = xyes; then
+	  AC_MSG_CHECKING([for non-apple non-cygwin i386])
+	  samhain_i386=no
+          $CC -E -dM - < /dev/null | egrep '__i386__' >/dev/null 2>&1 
+          if test $? = 0; then
+	    case "$host_os" in
+	    	 *linux*)
+            	 # apples gcc does not understand the assembly we provide
+            	 $CC -E -dM - < /dev/null | egrep '(__sun__|__APPLE__|__CYGWIN__)' >/dev/null 2>&1 || samhain_i386=yes
+	    	 ;;
+	    	 *)
+	    	 ;;
+	    esac
+          fi
+	  AC_MSG_RESULT([$samhain_i386])
+	  if test "x$samhain_i386" = xyes; then
+	    GCC_PIE_CC
+	    if test $pie_cv_cc = yes; then
+	       tiger_src=sh_tiger1.s
+	       AC_DEFINE([TIGER_32_BIT_S], [1], [Define to use tiger 32 bit i386 assembler])
+	    fi
+          fi
+	fi
+	#
+	#
+	#
+  else
+	samhain_64=no
+	tiger_src=sh_tiger1.c
+  fi
+else
+  #
+  # sizeof(unsigned long) = 8
+  #
+  tiger_src=sh_tiger1_64.c
+  samhain_64=yes
+  #
+  # check for x86_64 (enables assembly optimizations)
+  #
+  if test "x$GCC" = xyes; then
+     $CC -E -dM - < /dev/null | egrep '__clang__' >/dev/null 2>&1 
+     if ! test $? = 0; then
+     	 case "$host_os" in
+     	     *linux*)
+    	     SAMHAIN_X86_64
+	     ;;
+     	     *bsd*)
+    	     SAMHAIN_X86_64
+	     ;;
+     	     *)
+    	     SAMHAIN_X86_64
+	     ;;
+      	 esac
+     fi	
+  fi
+fi
+if test "x$samhain_64" = xyes; then 
+	AC_DEFINE([TIGER_64_BIT], [1], [Define to use tiger 64 bit implementation])
+fi
+AC_MSG_CHECKING([for 64 bit environment])
+AC_MSG_RESULT([$samhain_64])
+AC_MSG_CHECKING([for tiger source to use])
+AC_MSG_RESULT([$tiger_src])
+AC_SUBST(tiger_src)
+])dnl
+
+AC_DEFUN([sh_CHECK_POSIX_ACL],
+[
+  AC_CHECK_HEADERS(sys/acl.h)
+  if test $ac_cv_header_sys_acl_h = yes; then
+
+  	AC_CHECK_LIB([acl], [acl_get_file], sh_lacl=yes, sh_lacl=no)
+  	if test x"$sh_lacl" = xyes; then
+    		LIBACL=-lacl
+  	else
+    		LIBACL=
+  	fi
+
+  	OLDLIBS="$LIBS"
+  	LIBS="$LIBS $LIBACL"
+  	AC_CHECK_FUNCS([acl_free acl_get_file acl_get_fd],
+                       [sh_facl=yes],[sh_facl=no])
+  	LIBS="$OLDLIBS"
+  fi	
+
+  if test x"$sh_facl" = xyes; then
+  	  AC_DEFINE([USE_ACL], [1], [Define if you want ACL support.])
+	  LIBS="$LIBS $LIBACL"
+  else
+	  if test "x$enable_posix_acl" != xcheck; then
+             AC_MSG_FAILURE([--enable-posix-acl was given, but test for acl support failed])
+          fi
+  fi
+])
+
+AC_DEFUN([sh_CHECK_XATTR],
+[
+  AC_CHECK_HEADERS(attr/xattr.h)
+  if test $ac_cv_header_attr_xattr_h = yes; then
+
+  	AC_CHECK_LIB([attr], [getxattr], sh_lattr=yes, sh_lattr=no)
+  	if test x"$sh_lattr" = xyes; then
+    		LIBATTR=-lattr
+  	else
+    		LIBATTR=
+  	fi
+  
+  	OLDLIBS="$LIBS"
+  	LIBS="$LIBS $LIBATTR"
+  	AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr],
+                       [sh_fattr=yes],[sh_fattr=no])
+  	LIBS="$OLDLIBS"
+  fi
+
+  if test x"$sh_fattr" = xyes; then
+	  AC_DEFINE([USE_XATTR], [1], [Define if you want extended attributes support.])
+	  LIBS="$LIBS $LIBATTR"
+  else
+	  if test "x$enable_selinux" != xcheck; then
+             AC_MSG_FAILURE([--enable-selinux was given, but test for selinux support failed])
+          fi
+  fi
+])
+
+dnl Autoconf macros for libprelude
+dnl $id$
+
+# Modified for LIBPRELUDE -- Yoann Vandoorselaere
+# Modified for LIBGNUTLS -- nmav
+# Configure paths for LIBGCRYPT
+# Shamelessly stolen from the one of XDELTA by Owen Taylor
+# Werner Koch   99-12-09
+
+dnl AM_PATH_LIBPRELUDE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl Test for libprelude, and define LIBPRELUDE_PREFIX, LIBPRELUDE_CFLAGS, LIBPRELUDE_PTHREAD_CFLAGS, 
+dnl LIBPRELUDE_LDFLAGS, and LIBPRELUDE_LIBS
+dnl
+AC_DEFUN([AM_PATH_LIBPRELUDE],
+[dnl
+dnl Get the cflags and libraries from the libprelude-config script
+dnl
+dnl AC_ARG_WITH(libprelude-prefix,
+dnl          [  --with-libprelude-prefix=PFX   Prefix where libprelude is installed (optional)],
+dnl          libprelude_config_prefix="$withval", libprelude_config_prefix="")
+dnl
+dnl  if test x$libprelude_config_prefix != x ; then
+dnl     if test x${LIBPRELUDE_CONFIG+set} != xset ; then
+dnl        LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
+dnl     fi
+dnl  fi
+dnl
+dnl  AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
+  min_libprelude_version=ifelse([$1], ,0.1.0,$1)
+  AC_MSG_CHECKING(for libprelude - version >= $min_libprelude_version)
+  no_libprelude=""
+  if test "$LIBPRELUDE_CONFIG" = "no" ; then
+    no_libprelude=yes
+  else
+    LIBPRELUDE_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --cflags`
+    LIBPRELUDE_PTHREAD_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --pthread-cflags`
+    LIBPRELUDE_LDFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --ldflags`
+    LIBPRELUDE_LIBS=`$LIBPRELUDE_CONFIG $libprelude_config_args --libs`
+    LIBPRELUDE_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --prefix`
+    LIBPRELUDE_CONFIG_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --config-prefix`
+    libprelude_config_version=`$LIBPRELUDE_CONFIG $libprelude_config_args --version`
+
+
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LDFLAGS="$LDFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
+      LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
+      LIBS="$LIBS $LIBPRELUDE_LIBS"
+dnl
+dnl Now check if the installed libprelude is sufficiently new. Also sanity
+dnl checks the results of libprelude-config to some extent
+dnl
+      rm -f conf.libpreludetest
+      AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libprelude/prelude.h>
+
+int
+main ()
+{
+    system ("touch conf.libpreludetest");
+
+    if( strcmp( prelude_check_version(NULL), "$libprelude_config_version" ) )
+    {
+      printf("\n*** 'libprelude-config --version' returned %s, but LIBPRELUDE (%s)\n",
+             "$libprelude_config_version", prelude_check_version(NULL) );
+      printf("*** was found! If libprelude-config was correct, then it is best\n");
+      printf("*** to remove the old version of LIBPRELUDE. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If libprelude-config was wrong, set the environment variable LIBPRELUDE_CONFIG\n");
+      printf("*** to point to the correct copy of libprelude-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    }
+    else if ( strcmp(prelude_check_version(NULL), LIBPRELUDE_VERSION ) )
+    {
+      printf("\n*** LIBPRELUDE header file (version %s) does not match\n", LIBPRELUDE_VERSION);
+      printf("*** library (version %s)\n", prelude_check_version(NULL) );
+    }
+    else
+    {
+      if ( prelude_check_version( "$min_libprelude_version" ) )
+      {
+        return 0;
+      }
+     else
+      {
+        printf("no\n*** An old version of LIBPRELUDE (%s) was found.\n",
+                prelude_check_version(NULL) );
+        printf("*** You need a version of LIBPRELUDE newer than %s. The latest version of\n",
+               "$min_libprelude_version" );
+        printf("*** LIBPRELUDE is always available from http://www.prelude-ids.org/download/releases.\n");
+        printf("*** \n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the libprelude-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of LIBPRELUDE, but you can also set the LIBPRELUDE_CONFIG environment to point to the\n");
+        printf("*** correct copy of libprelude-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+]])],[],[no_libprelude=yes],[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+       LDFLAGS="$ac_save_LDFLAGS"
+  fi
+
+  if test "x$no_libprelude" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+  else
+     if test -f conf.libpreludetest ; then
+        :
+     else
+        AC_MSG_RESULT(no)
+     fi
+     if test "$LIBPRELUDE_CONFIG" = "no" ; then
+       echo "*** The libprelude-config script installed by LIBPRELUDE could not be found"
+       echo "*** If LIBPRELUDE was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the LIBPRELUDE_CONFIG environment variable to the"
+       echo "*** full path to libprelude-config."
+     else
+       if test -f conf.libpreludetest ; then
+        :
+       else
+          echo "*** Could not run libprelude test program, checking why..."
+          CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
+	  LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
+          LIBS="$LIBS $LIBPRELUDE_LIBS"
+          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libprelude/prelude.h>
+]], [[ return !!prelude_check_version(NULL); ]])],[ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding LIBPRELUDE or finding the wrong"
+          echo "*** version of LIBPRELUDE. If it is not finding LIBPRELUDE, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+          echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***" ],[ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means LIBPRELUDE was incorrectly installed"
+          echo "*** or that you have moved LIBPRELUDE since it was installed. In the latter case, you"
+          echo "*** may want to edit the libprelude-config script: $LIBPRELUDE_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+	  LDFLAGS="$ac_save_LDFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     LIBPRELUDE_CFLAGS=""
+     LIBPRELUDE_LDFLAGS=""
+     LIBPRELUDE_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  rm -f conf.libpreludetest
+  AC_SUBST(LIBPRELUDE_CFLAGS)
+  AC_SUBST(LIBPRELUDE_PTHREAD_CFLAGS)
+  AC_SUBST(LIBPRELUDE_LDFLAGS)
+  AC_SUBST(LIBPRELUDE_LIBS)
+  AC_SUBST(LIBPRELUDE_PREFIX)
+  AC_SUBST(LIBPRELUDE_CONFIG_PREFIX)
+])
+
+
+##### http://autoconf-archive.cryp.to/acx_pthread.html
+#
+# SYNOPSIS
+#
+#   ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro figures out how to build C programs using POSIX threads.
+#   It sets the PTHREAD_LIBS output variable to the threads library and
+#   linker flags, and the PTHREAD_CFLAGS output variable to any special
+#   C compiler flags that are needed. (The user can also force certain
+#   compiler flags/libs to be tested by setting these environment
+#   variables.)
+#
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
+#   multi-threaded programs (defaults to the value of CC otherwise).
+#   (This is necessary on AIX to use the special cc_r compiler alias.)
+#
+#   NOTE: You are assumed to not only compile your program with these
+#   flags, but also link it with them as well. e.g. you should link
+#   with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
+#   $LIBS
+#
+#   If you are only building threads programs, you may wish to use
+#   these variables in your default LIBS, CFLAGS, and CC:
+#
+#          LIBS="$PTHREAD_LIBS $LIBS"
+#          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#          CC="$PTHREAD_CC"
+#
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
+#   constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
+#   that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads
+#   library is found, and ACTION-IF-NOT-FOUND is a list of commands to
+#   run it if it is not found. If ACTION-IF-FOUND is not specified, the
+#   default action will define HAVE_PTHREAD.
+#
+#   Please let the authors know if this macro fails on any platform, or
+#   if you have any other suggestions or comments. This macro was based
+#   on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
+#   (with help from M. Frigo), as well as ac_pthread and hb_pthread
+#   macros posted by Alejandro Forero Cuervo to the autoconf macro
+#   repository. We are also grateful for the helpful feedback of
+#   numerous users.
+#
+# LAST MODIFICATION
+#
+#   2007-07-29
+#
+# COPYLEFT
+#
+#   Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+#   This program is free software: you can redistribute it and/or
+#   modify it under the terms of the GNU General Public License as
+#   published by the Free Software Foundation, either version 3 of the
+#   License, or (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+#   General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program. If not, see
+#   <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright
+#   owner gives unlimited permission to copy, distribute and modify the
+#   configure scripts that are the output of Autoconf when processing
+#   the Macro. You need not follow the terms of the GNU General Public
+#   License when using or distributing such scripts, even though
+#   portions of the text of the Macro appear in them. The GNU General
+#   Public License (GPL) does govern all other use of the material that
+#   constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the
+#   Autoconf Macro released by the Autoconf Macro Archive. When you
+#   make and distribute a modified version of the Autoconf Macro, you
+#   may extend this special exception to the GPL to apply to your
+#   modified version as well.
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG([C])
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test x"$acx_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+        ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -pthread)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+		if test x"$acx_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+		;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        save_LDFLAGS="$LDFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_t th; pthread_join(th, 0);
+                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
+                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ]])],[acx_pthread_ok=yes],[])
+
+        LIBS="$save_LIBS"
+        LDFLAGS="$save_LDFLAGS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT($acx_pthread_ok)
+        if test "x$acx_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	AC_MSG_CHECKING([for joinable pthread attribute])
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[int attr=$attr; return attr;]])],[attr_name=$attr; break],[])
+	done
+        AC_MSG_RESULT($attr_name)
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+            AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [${attr_name}],
+                               [Define to necessary symbol if this constant
+                                uses a non-standard name on your system.])
+        fi
+
+	# Solaris lossage: default is obsolete semantics for getpwnam_r,
+	# getpwuid_r, getgrgid_r, unless _POSIX_PTHREAD_SEMANTICS is defined
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *-osf* | *-hpux*) flag="-D_REENTRANT";;
+	    *solaris*) flag="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        # Detect PTHREAD_MUTEX_RECURSIVE
+	AC_MSG_CHECKING([for recursive mutexes])
+	mutex_recursive=no
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#define _XOPEN_SOURCE 500
+#include <pthread.h>]], [[
+pthread_mutexattr_t   mta;
+pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
+return 0;]])],[mutex_recursive=yes],[])
+	if test "x$mutex_recursive" = "xyes"
+	then
+	  AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [Define if you have recursive mutexes.])
+	fi
+        AC_MSG_RESULT($mutex_recursive)
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+	if test x"$GCC" != xyes; then
+          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+        else
+          PTHREAD_CC=$CC
+	fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+if test x"$acx_pthread_ok" = xyes; then
+   PTHREAD_CFLAGS="${PTHREAD_CFLAGS} -DUSE_MALLOC_LOCK=1"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_LDFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.]),[$1])
+        :
+else
+        acx_pthread_ok=no
+        $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
+
+
+
+
+dnl Copyright Â© 2004 Loic Dachary <loic@senga.org>
+dnl
+dnl This program is free software; you can redistribute it and/or modify 
+dnl it under the terms of the GNU General Public License as published by 
+dnl the Free Software Foundation; either version 2 of the License, or (at 
+dnl your option) any later version.
+dnl
+dnl Use ZLIB_HOME instead of option
+
+AC_DEFUN([CHECK_ZLIB],[
+
+if test "x${ZLIB_HOME}" = "x"; then 
+	ZLIB_HOME=/usr/local
+	if test ! -f "${ZLIB_HOME}/include/zlib.h"
+	then
+        	ZLIB_HOME=/usr
+	fi
+fi
+
+zlib_found=no
+
+ZLIB_OLD_LDFLAGS=$LDFLAGS
+ZLIB_OLD_CPPFLAGS=$LDFLAGS
+if test "x${ZLIB_HOME}" = "x/usr"; then
+	:
+else
+	LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+	CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+fi
+AC_LANG_SAVE
+AC_LANG([C])
+AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
+AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
+AC_LANG_RESTORE
+if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
+then
+        #
+        # If both library and header were found, use them
+        #
+        AC_CHECK_LIB(z, inflateEnd)
+        AC_MSG_CHECKING([zlib in ${ZLIB_HOME}])
+        AC_MSG_RESULT(ok)
+	AC_CHECK_FUNCS([compressBound])
+	zlib_found=yes
+else
+        #
+        # If either header or library was not found, revert and bomb
+        #
+        AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
+        LDFLAGS="$ZLIB_OLD_LDFLAGS"
+        CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
+        AC_MSG_RESULT(failed)
+        AC_MSG_WARN([zlib not found in ZLIB_HOME, /usr/local, or /usr])
+fi
+
+])
+
+# SH_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([SH_PROG_LD],
+[
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+else
+  AC_MSG_CHECKING([for ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+        with_gnu_ld=yes
+        ;;
+      *)
+        with_gnu_ld=no
+        ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+# SH_STRFTIME_Z
+# -------------
+# check whether strftime supports %z
+AC_DEFUN([SH_STRFTIME_Z],
+[
+AC_MSG_CHECKING([whether strftime supports %z])
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <time.h>
+#include <string.h>
+int main()
+{
+   struct tm tm;
+   char tt[64];
+   memset(&tm, 0, sizeof(tm));
+   strftime(tt, sizeof(tt), "%z", &tm);
+
+   if (strlen(tt) != 5) return 1;
+   return 0;
+}
+]])],[
+AC_MSG_RESULT([yes])
+AC_DEFINE([HAVE_STRFTIME_Z], [1], [strftime supports %z])
+],[
+AC_MSG_RESULT([no])
+],[
+AC_MSG_RESULT([no])
+])])
+
+AC_DEFUN([SH_GCC_VERSION], [
+  GCC_VERSION=""
+  gcc_VERSION_MAJOR=0
+  gcc_VERSION_MINOR=0
+  AC_MSG_CHECKING([for gcc version])
+  if test "x$GCC" = "xyes"
+  then
+	$CC -dumpversion >/dev/null 2>&1
+	if test $? -eq 0
+	then
+		GCC_VERSION=`$CC -dumpversion`
+      		gcc_VERSION_MAJOR=`echo $GCC_VERSION | cut -d'.' -f1`
+      		gcc_VERSION_MINOR=`echo $GCC_VERSION | cut -d'.' -f2`
+      		AC_DEFINE_UNQUOTED([GCC_VERSION_MAJOR], [${gcc_VERSION_MAJOR}], [gcc version major])
+      		AC_DEFINE_UNQUOTED([GCC_VERSION_MINOR], [${gcc_VERSION_MINOR}], [gcc version minor])
+		AC_MSG_RESULT([$GCC_VERSION])
+	else
+		AC_MSG_RESULT([$CC -dumpversion working])
+	fi
+  else
+	AC_MSG_RESULT([compiler is not gcc])
+  fi
+])
+
+
+
+dnl *-*wedit:notab*-*  Please keep this as the last line.
+
Index: unk/aclocal.m4
===================================================================
--- /trunk/aclocal.m4	(revision 582)
+++ 	(revision )
@@ -1,2175 +1,0 @@
-dnl aclocal.m4 generated automatically by aclocal 1.3
-
-dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-dnl This Makefile.in is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
-
-#
-# Check to make sure that the build environment is sane.
-#
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[
-AC_REQUIRE([AC_PROG_INSTALL])
-PACKAGE=[$1]
-AC_SUBST(PACKAGE)
-VERSION=[$2]
-AC_SUBST(VERSION)
-dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
-  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
-ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
-AC_REQUIRE([AC_PROG_MAKE_SET])])
-
-
-# Define a conditional.
-
-AC_DEFUN([AM_CONDITIONAL],
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi])
-
-
-AC_DEFUN([sh_run_prog],
-[if test "$cross_compiling" = "yes"; then
-   AC_MSG_ERROR([Can not probe non-portable values when cross compiling])
-fi
-cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-#include "confdefs.h"
-ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
-extern "C" void exit(int);
-#endif
-])
-[$1]
-EOF
-if AC_TRY_EVAL(ac_link) && test -s conftest && $2=`(./conftest 2>/dev/null)`
-then
-dnl Don't remove the temporary files here, so they can be examined.
-ifelse([$3], , :, [$3])
-else
-echo "configure: failed program was:" >&AC_FD_CC
-cat conftest.$ac_ext >&AC_FD_CC
-ifelse([$4], , , [  rm -fr conftest*
-  $4
-])
-fi
-rm -fr conftest* ])
-
-dnl fs type number of the proc filing system
-AC_DEFUN([sh_procfs_id],
-[AC_MSG_CHECKING([f_type of /proc])
-AC_CACHE_VAL([sh_cv_proc_fstype],
-[sh_run_prog(
-changequote(<<, >>)dnl
-<<#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
-#endif
-#ifndef Q
-#define __Q(x) #x
-#define Q(x) __Q(x)
-#endif
-int main(void)
-{
-struct statfs fsbuf;
-long ft;
-if (statfs("/", &fsbuf)!=0)
-  exit(1);
-ft=fsbuf.f_type;
-if (statfs("/proc/1", &fsbuf)!=0)
-  exit(1);
-if (ft!=fsbuf.f_type)
-  printf("0x%08lx", fsbuf.f_type);
-else
-  puts("statfs useless");
-exit(0);
-} >>
-changequote([, ]), sh_cv_proc_fstype,, sh_cv_proc_fstype="a fatal error occured")])
-AC_MSG_RESULT($sh_cv_proc_fstype)
-if test "${sh_cv_proc_fstype}" = "a fatal error occured"; then
-  $1=$2
-  $4
-else if test "${sh_cv_proc_fstype}" = "statfs useless"; then
-  $1=$2
-  $4
-else
-  $1=$sh_cv_proc_fstype
-  $3
-fi; fi ])
-
-# Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock
-# is not called from uid 0 (not tested whether uid 0 works)
-dnl AC_CHECK_MLOCK
-dnl
-define([AC_CHECK_MLOCK],
-  [ AC_CHECK_FUNCS(mlock)
-    if test "$ac_cv_func_mlock" = "yes"; then
-        AC_MSG_CHECKING(whether mlock is broken)
-          AC_CACHE_VAL(ac_cv_have_broken_mlock,
-             AC_TRY_RUN([
-                #include <stdlib.h>
-                #include <unistd.h>
-                #include <errno.h>
-                #include <sys/mman.h>
-                #include <sys/types.h>
-                #include <fcntl.h>
-
-                int main()
-                {
-                    char *pool;
-                    int err;
-                    long int pgsize = getpagesize();
-
-                    pool = malloc( 4096 + pgsize );
-                    if( !pool )
-                        return 2;
-                    pool += (pgsize - ((long int)pool % pgsize));
-
-                    err = mlock( pool, 4096 );
-                    if( !err || errno == EPERM )
-                        return 0; /* okay */
-
-                    return 1;  /* hmmm */
-                }
-
-            ],
-            ac_cv_have_broken_mlock="no",
-            ac_cv_have_broken_mlock="yes",
-            ac_cv_have_broken_mlock="assume-no"
-           )
-         )
-         if test "$ac_cv_have_broken_mlock" = "yes"; then
-             AC_DEFINE(HAVE_BROKEN_MLOCK)
-             AC_MSG_RESULT(yes)
-         else
-            if test "$ac_cv_have_broken_mlock" = "no"; then
-                AC_MSG_RESULT(no)
-            else
-                AC_MSG_RESULT(assuming no)
-            fi
-         fi
-    fi
-  ])
-
-dnl @synopsis AC_FUNC_VSNPRINTF
-dnl
-dnl Check whether there is a reasonably sane vsnprintf() function installed.
-dnl "Reasonably sane" in this context means never clobbering memory beyond
-dnl the buffer supplied, and having a sensible return value.  It is
-dnl explicitly allowed not to NUL-terminate the return value, however.
-dnl
-dnl @version $Id: ac_func_vsnprintf.m4,v 1.1 2001/07/26 02:00:21 guidod Exp $
-dnl @author Gaute Strokkenes <gs234@cam.ac.uk>
-dnl
-AC_DEFUN([SL_CHECK_VSNPRINTF],
-[AC_CACHE_CHECK(for working vsnprintf,
-  ac_cv_func_vsnprintf,
-[AC_TRY_RUN(
-[#include <stdio.h>
-#include <stdarg.h>
-
-int
-doit(char * s, ...)
-{
-  char buffer[32];
-  va_list args;
-  int r;
-
-  buffer[5] = 'X';
-
-  va_start(args, s);
-  r = vsnprintf(buffer, 5, s, args);
-  va_end(args);
-
-  /* -1 is pre-C99, 7 is C99. R.W. 17.01.2003 disallow -1 */
-
-  if (r != 7)
-    exit(1);
-
-  /* We deliberately do not care if the result is NUL-terminated or
-     not, since this is easy to work around like this.  */
-
-  buffer[4] = 0;
-
-  /* Simple sanity check.  */
-
-  if (strcmp(buffer, "1234"))
-    exit(1);
-
-  if (buffer[5] != 'X')
-    exit(1);
-
-  exit(0);
-}
-
-int
-main(void)
-{
-  doit("1234567");
-  exit(1);
-}], ac_cv_func_vsnprintf=yes, ac_cv_func_vsnprintf=no, ac_cv_func_vsnprintf=no)])
-dnl Note that the default is to be pessimistic in the case 
-dnl of cross compilation.
-dnl If you know that the target has a sensible vsnprintf(), 
-dnl you can get around this
-dnl by setting ac_func_vsnprintf to yes, as described in the Autoconf manual.
-if test $ac_cv_func_vsnprintf = yes; then
-  :
-else
-  AC_DEFINE(HAVE_BROKEN_VSNPRINTF, 1,
-            [Define if you have a broken version of the `vsnprintf' function.])
-fi
-])# AC_FUNC_VSNPRINTF
-
-dnl SH_CHECK_TYPEDEF(TYPE, HAVE_NAME)
-dnl Check whether a typedef exists and create a #define $2 if it exists
-dnl
-AC_DEFUN([SH_CHECK_TYPEDEF],
-  [ AC_MSG_CHECKING(for $1 typedef)
-    sh_cv_typedef_foo=`echo sh_cv_typedef_$1 | sed -e 's% %_%g'`
-    AC_CACHE_VAL( $sh_cv_typedef_foo,
-    [AC_TRY_COMPILE([
-#include <stdlib.h>
-#include <sys/types.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif], [
-    #undef $1
-    int a = sizeof($1);
-    ], sh_cv_typedef=yes, sh_cv_typedef=no )])
-    AC_MSG_RESULT($sh_cv_typedef)
-    if test "$sh_cv_typedef" = yes; then
-        AC_DEFINE([$2], [1], [Define if type is defined in stdint.h or inttypes.h])
-	sh_$2=yes
-    else
-	sh_$2=no
-    fi
-  ])
-
-
-
-dnl **********************
-dnl *** va_copy checks ***
-dnl **********************
-AC_DEFUN([SL_CHECK_VA_COPY],
-[AC_MSG_CHECKING(for va_copy())
-AC_CACHE_VAL(sh_cv_va_copy,[
-        AC_TRY_RUN([
-        #include <stdarg.h>
-        void f (int i, ...) {
-        va_list args1, args2;
-        va_start (args1, i);
-        va_copy (args2, args1);
-        if (va_arg (args2, int) != 42)
-	  exit (1);
-	if (va_arg (args1, int) != 42)
-          exit (1);
-        va_end (args1); va_end (args2);
-        }
-        int main() {
-          f (0, 42);
-          return 0;
-        }],
-        sh_cv_va_copy=yes
-        ,
-        sh_cv_va_copy=no
-        ,
-	sh_cv_va_copy=no)
-])
-AC_MSG_RESULT($sh_cv_va_copy)
-AC_MSG_CHECKING(for __va_copy())
-AC_CACHE_VAL(sh_cv___va_copy,[
-        AC_TRY_RUN([
-        #include <stdarg.h>
-        void f (int i, ...) {
-        va_list args1, args2;
-        va_start (args1, i);
-        __va_copy (args2, args1);
-        if (va_arg (args2, int) != 42)
-	  exit (1);
-	if (va_arg (args1, int) != 42)
-          exit (1);
-        va_end (args1); va_end (args2);
-        }
-        int main() {
-          f (0, 42);
-          return 0;
-        }],
-        sh_cv___va_copy=yes
-        ,
-        sh_cv___va_copy=no
-        ,
-	sh_cv___va_copy=no)
-])
-AC_MSG_RESULT($sh_cv___va_copy)
-AC_MSG_CHECKING(whether va_lists can be copied by value)
-AC_CACHE_VAL(sh_cv_va_val_copy,[
-        AC_TRY_RUN([
-        #include <stdarg.h>
-        void f (int i, ...) {
-        va_list args1, args2;
-        va_start (args1, i);
-        args2 = args1;
-        if (va_arg (args2, int) != 42)
-	  exit (1);
-	if (va_arg (args1, int) != 42)
-          exit (1);
-        va_end (args1); va_end (args2);
-        }
-        int main() {
-          f (0, 42);
-          return 0;
-        }],
-        sh_cv_va_val_copy=yes
-        ,
-        sh_cv_va_val_copy=no
-        ,
-	sh_cv_va_val_copy=no)
-])
-if test "x$sh_cv_va_copy" = "xyes"; then
-  AC_DEFINE(VA_COPY, va_copy)
-else if test "x$sh_cv___va_copy" = "xyes"; then
-  AC_DEFINE(VA_COPY, __va_copy)
-fi
-fi
-if test "x$sh_cv_va_val_copy" = "xno"; then
-  AC_DEFINE(VA_COPY_AS_ARRAY)
-fi
-AC_MSG_RESULT($sh_cv_va_val_copy)
-])
-
-
-dnl SH_INIT_PARSE_ARGS()
-m4_define([SH_INIT_PARSE_ARGS],
-[
-m4_divert_push([PARSE_ARGS])dnl
-
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[[^_$as_cr_alnum]]%_%g"
-
-as_tr_sh="eval sed 'y%*+%pp%;s%[[^_$as_cr_alnum]]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-AC_SUBST(exec_prefix, NONE)dnl
-no_create=
-no_recursion=
-AC_SUBST(prefix, NONE)dnl
-program_prefix=NONE
-program_suffix=NONE
-AC_SUBST(program_transform_name, [s,x,x,])dnl
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-DESTDIR=
-SH_ENABLE_OPTS="selinux posix-acl asm ssp db-reload xml-log message-queue login-watch process-check port-check mounts-check logfile-monitor userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc ipv6 shellexpand suid"
-SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver signify pubkey-checksum gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file"
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-dnl Use braces instead of parens because sh, perl, etc. also accept them.
-sbindir='${exec_prefix}/sbin'
-sysconfdir='${prefix}/etc'
-localstatedir='${prefix}/var'
-mandir='${prefix}/share/man'
-
-AC_SUBST([sbindir],        ['${exec_prefix}/sbin'])dnl
-AC_SUBST([sysconfdir],     ['${prefix}/etc'])dnl
-AC_SUBST([localstatedir],  ['${prefix}/var'])dnl
-AC_SUBST([mandir],         ['${prefix}/share/man'])dnl
-
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
-    ac_prev=
-    continue
-  fi
-
-  case "$ac_option" in
-changequote(, )dnl
-  *=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-changequote([, ])dnl
-  *) ac_optarg= ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case "$ac_option" in
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias="$ac_optarg" ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid feature name: $ac_feature])
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    ac_enable_check_opt=no
-    for f in ${SH_ENABLE_OPTS}
-    do
-	f=`echo $f | sed 's/-/_/g'`
-	if test x${f} = x"${ac_feature}"
-	then
-		ac_enable_check_opt=yes
-	fi
-    done
-    if test x${ac_enable_check_opt} = xno
-    then
-	AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    fi
-    eval "enable_$ac_feature=no" ;;
-
-  -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid feature name: $ac_feature])
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    ac_enable_check_opt=no
-    for f in ${SH_ENABLE_OPTS}
-    do
-	f=`echo $f | sed 's/-/_/g'`
-	if test x${f} = x"${ac_feature}"
-	then
-		ac_enable_check_opt=yes
-	fi
-    done
-    if test x${ac_enable_check_opt} = xno
-    then
-	AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    fi
-    eval "enable_$ac_feature='$ac_optarg'" ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix 
-    ac_exec_prefix_set="yes"
-    ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" 
-    ac_exec_prefix_set="yes"
-    ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias="$ac_optarg" ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
-    ac_prev=localstatedir 
-    ac_localstatedir_set="yes"
-    ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" 
-    ac_localstatedir_set="yes"
-    ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir 
-    ac_mandir_set="yes"
-    ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" 
-    ac_mandir_set="yes"
-    ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix
-    ac_prefix_set="yes" 
-    ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix="$ac_optarg" 
-    ac_prefix_set="yes" 
-    ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir 
-    ac_sbindir_set="yes" 
-    ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" 
-    ac_sbindir_set="yes" 
-    ;;
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi | --b)
-    echo "WARNING: bindir will be ignored, use sbindir" 
-    ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* \
-  | --bi=* | --b=*)
-    echo "WARNING: bindir will be ignored, use sbindir" 
-    ;;
-
-  -datadir | --datadir)
-    echo "WARNING: datadir will be ignored" 
-   ;;
-  -datadir=* | --datadir=*)
-    echo "WARNING: datadir will be ignored" 
-   ;;
- 
-  -includedir | --includedir)
-    echo "WARNING: includedir will be ignored" 
-   ;;
-  -includedir=* | --includedir=*)
-    echo "WARNING: includedir will be ignored" 
-   ;;
-
-  -infodir | --infodir)
-    echo "WARNING: infodir will be ignored" 
-   ;;
-  -infodir=* | --infodir=*)
-    echo "WARNING: infodir will be ignored" 
-   ;;
- 
-  -libdir | --libdir)
-    echo "WARNING: libdir will be ignored" 
-   ;;
-  -libdir=* | --libdir=*)
-    echo "WARNING: libdir will be ignored" 
-   ;;
- 
-  -libexecdir | --libexecdir)
-    echo "WARNING: libexecdir will be ignored" 
-   ;;
-  -libexecdir=* | --libexecdir=*)
-    echo "WARNING: libexecdir will be ignored" 
-   ;;
-
-  -sharedstatedir | --sharedstatedir)
-    echo "WARNING: sharedstatedir will be ignored" 
-   ;;
-  -sharedstatedir=* | --sharedstatedir=*)
-    echo "WARNING: sharedstatedir will be ignored" 
-   ;;
- 
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site="$ac_optarg" ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir="$ac_optarg" ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir 
-    ac_sysconfdir_set="yes" 
-    ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir="$ac_optarg" 
-    ac_sysconfdir_set="yes" 
-    ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias="$ac_optarg" ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers)
-    ac_init_version=: ;;
-
-
-  -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid package name: $ac_package])
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    ac_with_check_opt=no
-    for f in ${SH_WITH_OPTS}
-    do
-	f=`echo $f | sed 's/-/_/g'`
-	if test x${f} = x"${ac_package}"
-	then
-		ac_with_check_opt=yes
-	fi
-    done
-    if test x${ac_with_check_opt} = xno
-    then
-	AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    fi
-    eval "with_$ac_package='$ac_optarg'" ;;
-
-  -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid package name: $ac_package])
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    ac_with_check_opt=no
-    for f in ${SH_WITH_OPTS}
-    do
-	f=`echo $f | sed 's/-/_/g'`
-	if test x${f} = x"${ac_package}"
-	then
-		ac_with_check_opt=yes
-	fi
-    done
-    if test x${ac_with_check_opt} = xno
-    then
-	AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    fi
-    eval "with_$ac_package=no" ;;
-
-
-  -*) AC_MSG_ERROR([unrecognized option: $ac_option
-Try `$[0] --help' for more information.])
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_ERROR([invalid variable name: $ac_envvar])
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    AC_MSG_WARN([you should use --build, --host, --target])
-    expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
-      AC_MSG_WARN([invalid host type: $ac_option])
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-    ;;
-
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`)
-fi
-
-# Be sure to have absolute paths.
-for ac_var in prefix exec_prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [[\\/$]]* | ?:[[\\/]]* | NONE | '' | OPT | USR ) ;;
-    *)  AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in sbindir sysconfdir localstatedir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [[\\/$]]* | ?:[[\\/]]* ) ;;
-    *)  AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
-  esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-    AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used.])
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
-
-m4_divert_pop([PARSE_ARGS])dnl
-])# SH_INIT_PARSE_ARGS
-
-m4_define([SH_INIT_HELP],
-[m4_divert_push([HELP_BEGIN])dnl
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures m4_ifset([AC_PACKAGE_STRING],
-                        [AC_PACKAGE_STRING],
-                        [this package]) to adapt to many kinds of systems.
-
-Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
-
-[To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-_ACEOF
-
-  cat <<_ACEOF
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install binaries in \`/usr/local/sbin',
-the config file in \`/etc', manpage in \`/usr/local/share/man', and state
-data in \`/var/lib/INSTALL_NAME' (FSH layout).  You can specify other
-FSH compliant layouts with \`--prefix=OPT' or \`--prefix=USR', or you
-can specify a directory with \`--prefix=DIR' to install in \`DIR/sbin',
-\`DIR/etc', etc.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --mandir=DIR           man documentation [PREFIX/man]
-
-For even finer tuning, paths can be specified for individual files (see below)
-
-_ACEOF
-
-  cat <<\_ACEOF]
-m4_divert_pop([HELP_BEGIN])dnl
-dnl The order of the diversions here is
-dnl - HELP_BEGIN
-dnl   which may be prolongated by extra generic options such as with X or
-dnl   AC_ARG_PROGRAM.  Displayed only in long --help.
-dnl
-dnl - HELP_CANON
-dnl   Support for cross compilation (--build, --host and --target).
-dnl   Display only in long --help.
-dnl
-dnl - HELP_ENABLE
-dnl   which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
-dnl   then implements the header of the non generic options.
-dnl
-dnl - HELP_WITH
-dnl
-dnl - HELP_VAR
-dnl
-dnl - HELP_VAR_END
-dnl
-dnl - HELP_END
-dnl   initialized below, in which we dump the trailer (handling of the
-dnl   recursion for instance).
-m4_divert_push([HELP_ENABLE])dnl
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-m4_ifset([AC_PACKAGE_STRING],
-[  case $ac_init_help in
-     short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
-   esac])
-  cat <<\_ACEOF
-m4_divert_pop([HELP_ENABLE])dnl
-m4_divert_push([HELP_END])dnl
-m4_ifset([AC_PACKAGE_BUGREPORT], [
-Report bugs to <AC_PACKAGE_BUGREPORT>.])
-_ACEOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
-    _AC_SRCPATHS(["$ac_dir"])
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-           test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
-    else
-      AC_MSG_WARN([no configuration information is in $ac_dir])
-    fi
-    cd $ac_popdir
-  done
-fi
-
-test -n "$ac_init_help" && exit 0
-m4_divert_pop([HELP_END])dnl
-])# SH_INIT_HELP
-
-
-
-
-
-
-
-
-# Check whether sa_sigaction works.
-# Rainer Wichmann <support@la-samhna.de>, 2003.
-#
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License.
-
-# serial 1
-
-AC_DEFUN([AM_SA_SIGACTION_WORKS],
-  [
-   am_cv_val_SA_SIGACTION=no
-   AC_CHECK_HEADER(signal.h,
-     [
-      AM_SI_USER
-      AM_SA_SIGINFO
-      if test $am_cv_val_SI_USER = yes && test $am_cv_val_SA_SIGINFO = yes
-      then
-        AC_TRY_RUN([
-#include <signal.h>
-#include <setjmp.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-volatile int xnum  = 0;
-volatile int xcode = 0; 
-jmp_buf      Buf;
-int          xsig  = SIGSEGV;
-
-void sighandler (int xsignam, siginfo_t * xsiginfo, void * xsigadd)
-{
-  static sigset_t x;
-
-  if (xsiginfo == NULL)
-    exit(__LINE__);
-  if (xsiginfo->si_signo != xsignam)
-    exit(__LINE__);
-  ++xnum;
-  xcode   = xsiginfo->si_code;
-  sigemptyset (&x);
-  sigprocmask(SIG_SETMASK, &x, NULL);
-  longjmp ( Buf, 1);
-}
-
-int main ()
-{
-  struct sigaction newact;
-
-  newact.sa_sigaction = sighandler;
-  sigemptyset (&newact.sa_mask);
-  newact.sa_flags = SA_SIGINFO;
-  if (0 != sigaction (xsig, &newact, NULL))
-    exit (__LINE__);
-  if(setjmp ( Buf)) {
-      if (xnum > 1)
-	goto Third;
-      goto Second;
-  }
-  memcpy((void *) 0x0, "test", 5);
- Second:
-  if (xcode == SI_USER)
-    exit (__LINE__);
-  raise(xsig);
- Third:
-  if (xcode != SI_USER)
-    exit (__LINE__);
-  if (xnum != 2)
-    exit (__LINE__);
-  return (0);
-}], am_cv_val_SA_SIGACTION=yes, am_cv_val_SA_SIGACTION=no, am_cv_val_SA_SIGACTION=no)
-   fi
-      ])
-     AC_MSG_CHECKING([whether sa_sigaction is supported])
-     if test $am_cv_val_SA_SIGACTION = yes
-     then
-       AC_MSG_RESULT(yes)
-       AC_DEFINE([SA_SIGACTION_WORKS], 1, [Define if sa_sigaction works])
-     else
-	AC_MSG_RESULT(no)
-     fi
-     ])
-
-# Check whether SI_USER is available in <signal.h>.
-# Rainer Wichmann <support@la-samhna.de>, 2003.
-#
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License.
-
-# serial 1
-
-
-AC_DEFUN([AM_SI_USER],
-  [if test $ac_cv_header_signal_h = yes; then
-    AC_CACHE_CHECK([for SI_USER in signal.h], am_cv_val_SI_USER,
-      [AC_TRY_LINK([#include <signal.h>], [return SI_USER],
-       am_cv_val_SI_USER=yes, am_cv_val_SI_USER=no)])
-    if test $am_cv_val_SI_USER = yes; then
-      AC_DEFINE([HAVE_SI_USER], 1, [Define if you have SI_USER])
-    fi
-  fi])
-
-# Check whether SA_SIGINFO is available in <signal.h>.
-# Rainer Wichmann <support@la-samhna.de>, 2003.
-#
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU Public License.
-
-# serial 1
-
-
-AC_DEFUN([AM_SA_SIGINFO],
-  [if test $ac_cv_header_signal_h = yes; then
-    AC_CACHE_CHECK([for SA_SIGINFO in signal.h], am_cv_val_SA_SIGINFO,
-      [AC_TRY_LINK([#include <signal.h>], [return SA_SIGINFO],
-       am_cv_val_SA_SIGINFO=yes, am_cv_val_SA_SIGINFO=no)])
-    if test $am_cv_val_SA_SIGINFO = yes; then
-      AC_DEFINE([HAVE_SA_SIGINFO], 1, [Define if you have SA_SIGINFO])
-    fi
-  fi])
-
-dnl
-dnl Useful macros for autoconf to check for ssp-patched gcc
-dnl 1.0 - September 2003 - Tiago Sousa <mirage@kaotik.org>
-dnl 1.1 - August 2006 - Ted Percival <ted@midg3t.net>
-dnl     * Stricter language checking (C or C++)
-dnl     * Adds GCC_STACK_PROTECT_LIB to add -lssp to LDFLAGS as necessary
-dnl     * Caches all results
-dnl     * Uses macros to ensure correct ouput in quiet/silent mode
-dnl 1.2 - April 2007 - Ted Percival <ted@midg3t.net>
-dnl     * Added GCC_STACK_PROTECTOR macro for simpler (one-line) invocation
-dnl     * GCC_STACK_PROTECT_LIB now adds -lssp to LIBS rather than LDFLAGS
-dnl
-dnl About ssp:
-dnl GCC extension for protecting applications from stack-smashing attacks
-dnl http://www.research.ibm.com/trl/projects/security/ssp/
-dnl
-dnl Usage:
-dnl Most people will simply call GCC_STACK_PROTECTOR.
-dnl If you only use one of C or C++, you can save time by only calling the
-dnl macro appropriate for that language. In that case you should also call
-dnl GCC_STACK_PROTECT_LIB first.
-dnl
-dnl GCC_STACK_PROTECTOR
-dnl Tries to turn on stack protection for C and C++ by calling the following
-dnl three macros with the right languages.
-dnl
-dnl GCC_STACK_PROTECT_CC
-dnl checks -fstack-protector with the C compiler, if it exists then updates
-dnl CFLAGS and defines ENABLE_SSP_CC
-dnl
-dnl GCC_STACK_PROTECT_CXX
-dnl checks -fstack-protector with the C++ compiler, if it exists then updates
-dnl CXXFLAGS and defines ENABLE_SSP_CXX
-dnl
-dnl GCC_STACK_PROTECT_LIB
-dnl adds -lssp to LIBS if it is available
-dnl ssp is usually provided as part of libc, but was previously a separate lib
-dnl It does not hurt to add -lssp even if libc provides SSP - in that case
-dnl libssp will simply be ignored.
-dnl
-
-AC_DEFUN([GCC_STACK_PROTECT_LIB],[
-  AC_CACHE_CHECK([whether libssp exists], ssp_cv_lib,
-    [ssp_old_libs="$LIBS"
-     LIBS="$LIBS -lssp"
-     AC_TRY_LINK(,, ssp_cv_lib=yes, ssp_cv_lib=no)
-     LIBS="$ssp_old_libs"
-    ])
-  if test $ssp_cv_lib = yes; then
-    LIBS="$LIBS -lssp"
-  fi
-])
-
-AC_DEFUN([GCC_STACK_PROTECT_CC],[
-  AC_LANG_ASSERT(C)
-  if test "X$CC" != "X"; then
-    AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-strong],
-      ssp_cv_cc,
-      [ssp_old_cflags="$CFLAGS"
-       CFLAGS="$CFLAGS -fstack-protector-strong"
-       AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
-       CFLAGS="$ssp_old_cflags"
-      ])
-    if test $ssp_cv_cc = no; then
-      AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-all],
-        ssp_cv_cc,
-        [ssp_old_cflags="$CFLAGS"
-         CFLAGS="$CFLAGS -fstack-protector-all"
-         AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
-         CFLAGS="$ssp_old_cflags"
-        ])
-      if test $ssp_cv_cc = no; then
-        AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector],
-          ssp_cv_cc,
-          [ssp_old_cflags="$CFLAGS"
-           CFLAGS="$CFLAGS -fstack-protector"
-           AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
-           CFLAGS="$ssp_old_cflags"
-          ])
-        if test $ssp_cv_cc = yes; then
-          CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector"
-	  LDFLAGS="$LDFLAGS -fstack-protector"
-          AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
-        fi
-      else
-        if test $ssp_cv_cc = yes; then
-          CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
-	  LDFLAGS="$LDFLAGS -fstack-protector-all"
-          AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
-        fi
-      fi
-    else
-      if test $ssp_cv_cc = yes; then
-        CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-strong"
-	LDFLAGS="$LDFLAGS -fstack-protector-strong"
-        AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
-      fi
-    fi
-  fi
-])
-
-AC_DEFUN([GCC_STACK_PROTECT_CXX],[
-  AC_LANG_ASSERT(C++)
-  if test "X$CXX" != "X"; then
-    AC_CACHE_CHECK([whether ${CXX} accepts -fstack-protector],
-      ssp_cv_cxx,
-      [ssp_old_cxxflags="$CXXFLAGS"
-       CXXFLAGS="$CXXFLAGS -fstack-protector"
-       AC_TRY_COMPILE(,, ssp_cv_cxx=yes, ssp_cv_cxx=no)
-       CXXFLAGS="$ssp_old_cxxflags"
-      ])
-    if test $ssp_cv_cxx = yes; then
-      CXXFLAGS="$CXXFLAGS -fstack-protector"
-      AC_DEFINE([ENABLE_SSP_CXX], 1, [Define if SSP C++ support is enabled.])
-    fi
-  fi
-])
-
-AC_DEFUN([GCC_STACK_PROTECTOR],[
-  GCC_STACK_PROTECT_LIB
-
-  AC_LANG_PUSH([C])
-  GCC_STACK_PROTECT_CC
-  AC_LANG_POP([C])
-
-  AC_LANG_PUSH([C++])
-  GCC_STACK_PROTECT_CXX
-  AC_LANG_POP([C++])
-])
-
-
-AC_DEFUN([GCC_PIE_CC],[
-  AC_LANG_ASSERT(C)
-  if test "X$CC" != "X"; then
-    AC_CACHE_CHECK([whether ${CC} accepts -pie -fPIE],
-      pie_cv_cc,
-      [pie_old_cflags="$CFLAGS"
-       CFLAGS="$CFLAGS -pie -fPIE"
-       AC_TRY_COMPILE(,, pie_cv_cc=yes, pie_cv_cc=no)
-       CFLAGS="$pie_old_cflags"
-      ])
-    if test $pie_cv_cc = yes; then
-      case "$host_os" in
-      *cygwin*)
-      ;;
-      *)
-      PIE_CFLAGS="-fPIE"
-      PIE_LDFLAGS="-pie"
-      ;;
-      esac
-    fi
-  fi
-])
-
-AC_DEFUN([GCC_STACK_CHECK_CC],[
-  AC_LANG_ASSERT(C)
-  if test "X$CC" != "X"; then
-    AC_CACHE_CHECK([whether ${CC} accepts -fstack-clash-protection],
-      stackcheck_cv_cc,
-      [stackcheck_old_cflags="$CFLAGS"
-       CFLAGS="$CFLAGS -fstack-clash-protection"
-       AC_TRY_COMPILE(,, stackcheck_cv_cc=yes, stackcheck_cv_cc=no)
-       CFLAGS="$stackcheck_old_cflags"
-      ])
-    if test $stackcheck_cv_cc = yes; then
-      CFLAGS="$CFLAGS -fstack-clash-protection"
-    fi
-  fi
-])
-
-AC_DEFUN([GCC_FLAG_CHECK],[
-  AC_LANG_ASSERT(C)
-  if test "X$CC" != "X"; then
-     AC_MSG_CHECKING([whether ${CC} accepts $1])
-     saved_cflags="$CFLAGS"
-     # any -Wno- option will always succeed :-(
-     flag_check_opt=`echo $1 | sed 's,-Wno-,-W,'`
-     CFLAGS="$CFLAGS -Werror $flag_check_opt"
-     AC_TRY_COMPILE(,, flag_check_cv=yes, flag_check_cv=no)
-     CFLAGS="$saved_cflags"
-     if test $flag_check_cv = yes; then
-      	CFLAGS="$CFLAGS $1"
-	AC_MSG_RESULT([yes])
-     else
-        AC_MSG_RESULT([no])
-     fi
-  fi
-])
-
-AC_DEFUN([SAMHAIN_POSIX],[
-	AC_MSG_CHECKING([whether _POSIX_SOURCE is necessary])
-	AC_TRY_COMPILE([#include <stdio.h>
-void fileno(int);int fdopen(int, char *); ],,
-	[
-	AC_MSG_RESULT(yes)
-	AC_DEFINE([_POSIX_SOURCE],1,[Define if POSIX functions are required])
-	],
-	[AC_MSG_RESULT(no)])
-])dnl
-
-dnl checks for a known 64 bit programming environment
-dnl AC_RUN_IFELSE(PROGRAM,
-dnl               [ACTION-IF-TRUE], [ACTION-IF-FALSE],
-dnl               [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
-dnl
-AC_DEFUN([SAMHAIN_PRG_ENV],[
-    AC_MSG_CHECKING([for a known 64 bit programming environment])
-    # Compile and run a program that determines the programming environment
-    AC_RUN_IFELSE([
-      AC_LANG_SOURCE([[
-#include <stdio.h>
-int main(int argc,char **argv)
-{
-  if (argc > 1) {
-#if defined(__arch64__)
-  printf("__arch64__\n");
-#elif defined(__ia64__)
-  printf("__ia64__\n");
-#elif defined(__x86_64__)
-  printf("__x86_64__\n");
-#elif defined(__LP64__)
-  printf("__LP64__\n");
-#elif defined(__64BIT__)
-  printf("__64BIT__\n");
-#elif defined(_LP64)
-  printf("_LP64\n");
-#elif defined(_M_IA64)
-  printf("_M_IA64\n");
-#elif defined(_MIPS_SZLONG) && (_MIPS_SZLONG == 64)
-  printf("_MIPS_64\n");
-#else
-choke me
-#endif
-  }
-  return 0;
-}
-      ]])
-    ],[
-      # Program compiled and ran, so get version by adding argument.
-      samhain_prg_ENV=`./conftest$ac_exeext x`
-      samhain_64=yes
-      AC_MSG_RESULT([$samhain_prg_ENV])
-    ],[
-      AC_MSG_RESULT([none])
-	],[
-      AC_MSG_RESULT([none])
-	])
-])dnl
-
-AC_DEFUN([SAMHAIN_X86_64],[
-	AC_MSG_CHECKING([for x86_64])
-	AC_TRY_RUN([
-int main() {
-__asm__ volatile (
-"movq %rax, %rax"
-);
-return 0;
-}
-	],
-	[
-	AC_MSG_RESULT(yes)
-	samhain_64=yes
-	tiger_src=sh_tiger1_64.c
-	samhain_64_asm=yes
-	],
-	[
-	AC_MSG_RESULT([no])
-	],[
-	AC_MSG_RESULT([no])
-	])
-])dnl
-
-
-AC_DEFUN([SAMHAIN_64],[
-samhain_64=no
-tiger_src=sh_tiger1.c
-samhain_64_asm=no
-#
-# if sizeof(unsigned long) = 4, try compiler macros for 64bit
-#
-if test "x$ac_cv_sizeof_unsigned_long" = x4; then
-  if test "x$ac_cv_sizeof_unsigned_long_long" = x8; then
-	SAMHAIN_PRG_ENV
-	if test "x$samhain_64" = xyes; then
-	  tiger_src=sh_tiger1_64.c
-        fi
-	#
-	# if GCC and __i386__, use precompiled assembler
-	#
-	if test "x$GCC" = xyes; then
-	  AC_MSG_CHECKING([for non-apple non-cygwin i386])
-	  samhain_i386=no
-          $CC -E -dM - < /dev/null | egrep '__i386__' >/dev/null 2>&1 
-          if test $? = 0; then
-	    case "$host_os" in
-	    	 *linux*)
-            	 # apples gcc does not understand the assembly we provide
-            	 $CC -E -dM - < /dev/null | egrep '(__sun__|__APPLE__|__CYGWIN__)' >/dev/null 2>&1 || samhain_i386=yes
-	    	 ;;
-	    	 *)
-	    	 ;;
-	    esac
-          fi
-	  AC_MSG_RESULT([$samhain_i386])
-	  if test "x$samhain_i386" = xyes; then
-	    GCC_PIE_CC
-	    if test $pie_cv_cc = yes; then
-	       tiger_src=sh_tiger1.s
-	       AC_DEFINE([TIGER_32_BIT_S],1,[Define to use tiger 32 bit i386 assembler])
-	    fi
-          fi
-	fi
-	#
-	#
-	#
-  else
-	samhain_64=no
-	tiger_src=sh_tiger1.c
-  fi
-else
-  #
-  # sizeof(unsigned long) = 8
-  #
-  tiger_src=sh_tiger1_64.c
-  samhain_64=yes
-  #
-  # check for x86_64 (enables assembly optimizations)
-  #
-  if test "x$GCC" = xyes; then
-     $CC -E -dM - < /dev/null | egrep '__clang__' >/dev/null 2>&1 
-     if ! test $? = 0; then
-     	 case "$host_os" in
-     	     *linux*)
-    	     SAMHAIN_X86_64
-	     ;;
-     	     *bsd*)
-    	     SAMHAIN_X86_64
-	     ;;
-     	     *)
-    	     SAMHAIN_X86_64
-	     ;;
-      	 esac
-     fi	
-  fi
-fi
-if test "x$samhain_64" = xyes; then 
-	AC_DEFINE([TIGER_64_BIT],1,[Define to use tiger 64 bit implementation])
-fi
-AC_MSG_CHECKING([for 64 bit environment])
-AC_MSG_RESULT([$samhain_64])
-AC_MSG_CHECKING([for tiger source to use])
-AC_MSG_RESULT([$tiger_src])
-AC_SUBST(tiger_src)
-])dnl
-
-AC_DEFUN([sh_CHECK_POSIX_ACL],
-[
-  AC_CHECK_HEADERS(sys/acl.h)
-  if test $ac_cv_header_sys_acl_h = yes; then
-
-  	AC_CHECK_LIB([acl], [acl_get_file], sh_lacl=yes, sh_lacl=no)
-  	if test x"$sh_lacl" = xyes; then
-    		LIBACL=-lacl
-  	else
-    		LIBACL=
-  	fi
-
-  	OLDLIBS="$LIBS"
-  	LIBS="$LIBS $LIBACL"
-  	AC_CHECK_FUNCS([acl_free acl_get_file acl_get_fd],
-                       [sh_facl=yes],[sh_facl=no])
-  	LIBS="$OLDLIBS"
-  fi	
-
-  if test x"$sh_facl" = xyes; then
-  	  AC_DEFINE(USE_ACL, 1, [Define if you want ACL support.])
-	  LIBS="$LIBS $LIBACL"
-  else
-	  if test "x$enable_posix_acl" != xcheck; then
-             AC_MSG_FAILURE([--enable-posix-acl was given, but test for acl support failed])
-          fi
-  fi
-])
-
-AC_DEFUN([sh_CHECK_XATTR],
-[
-  AC_CHECK_HEADERS(attr/xattr.h)
-  if test $ac_cv_header_attr_xattr_h = yes; then
-
-  	AC_CHECK_LIB([attr], [getxattr], sh_lattr=yes, sh_lattr=no)
-  	if test x"$sh_lattr" = xyes; then
-    		LIBATTR=-lattr
-  	else
-    		LIBATTR=
-  	fi
-  
-  	OLDLIBS="$LIBS"
-  	LIBS="$LIBS $LIBATTR"
-  	AC_CHECK_FUNCS([getxattr lgetxattr fgetxattr],
-                       [sh_fattr=yes],[sh_fattr=no])
-  	LIBS="$OLDLIBS"
-  fi
-
-  if test x"$sh_fattr" = xyes; then
-	  AC_DEFINE(USE_XATTR, 1, [Define if you want extended attributes support.])
-	  LIBS="$LIBS $LIBATTR"
-  else
-	  if test "x$enable_selinux" != xcheck; then
-             AC_MSG_FAILURE([--enable-selinux was given, but test for selinux support failed])
-          fi
-  fi
-])
-
-dnl Autoconf macros for libprelude
-dnl $id$
-
-# Modified for LIBPRELUDE -- Yoann Vandoorselaere
-# Modified for LIBGNUTLS -- nmav
-# Configure paths for LIBGCRYPT
-# Shamelessly stolen from the one of XDELTA by Owen Taylor
-# Werner Koch   99-12-09
-
-dnl AM_PATH_LIBPRELUDE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
-dnl Test for libprelude, and define LIBPRELUDE_PREFIX, LIBPRELUDE_CFLAGS, LIBPRELUDE_PTHREAD_CFLAGS, 
-dnl LIBPRELUDE_LDFLAGS, and LIBPRELUDE_LIBS
-dnl
-AC_DEFUN([AM_PATH_LIBPRELUDE],
-[dnl
-dnl Get the cflags and libraries from the libprelude-config script
-dnl
-dnl AC_ARG_WITH(libprelude-prefix,
-dnl          [  --with-libprelude-prefix=PFX   Prefix where libprelude is installed (optional)],
-dnl          libprelude_config_prefix="$withval", libprelude_config_prefix="")
-dnl
-dnl  if test x$libprelude_config_prefix != x ; then
-dnl     if test x${LIBPRELUDE_CONFIG+set} != xset ; then
-dnl        LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
-dnl     fi
-dnl  fi
-dnl
-dnl  AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
-  min_libprelude_version=ifelse([$1], ,0.1.0,$1)
-  AC_MSG_CHECKING(for libprelude - version >= $min_libprelude_version)
-  no_libprelude=""
-  if test "$LIBPRELUDE_CONFIG" = "no" ; then
-    no_libprelude=yes
-  else
-    LIBPRELUDE_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --cflags`
-    LIBPRELUDE_PTHREAD_CFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --pthread-cflags`
-    LIBPRELUDE_LDFLAGS=`$LIBPRELUDE_CONFIG $libprelude_config_args --ldflags`
-    LIBPRELUDE_LIBS=`$LIBPRELUDE_CONFIG $libprelude_config_args --libs`
-    LIBPRELUDE_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --prefix`
-    LIBPRELUDE_CONFIG_PREFIX=`$LIBPRELUDE_CONFIG $libprelude_config_args --config-prefix`
-    libprelude_config_version=`$LIBPRELUDE_CONFIG $libprelude_config_args --version`
-
-
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LDFLAGS="$LDFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
-      LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
-      LIBS="$LIBS $LIBPRELUDE_LIBS"
-dnl
-dnl Now check if the installed libprelude is sufficiently new. Also sanity
-dnl checks the results of libprelude-config to some extent
-dnl
-      rm -f conf.libpreludetest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libprelude/prelude.h>
-
-int
-main ()
-{
-    system ("touch conf.libpreludetest");
-
-    if( strcmp( prelude_check_version(NULL), "$libprelude_config_version" ) )
-    {
-      printf("\n*** 'libprelude-config --version' returned %s, but LIBPRELUDE (%s)\n",
-             "$libprelude_config_version", prelude_check_version(NULL) );
-      printf("*** was found! If libprelude-config was correct, then it is best\n");
-      printf("*** to remove the old version of LIBPRELUDE. You may also be able to fix the error\n");
-      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
-      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
-      printf("*** required on your system.\n");
-      printf("*** If libprelude-config was wrong, set the environment variable LIBPRELUDE_CONFIG\n");
-      printf("*** to point to the correct copy of libprelude-config, and remove the file config.cache\n");
-      printf("*** before re-running configure\n");
-    }
-    else if ( strcmp(prelude_check_version(NULL), LIBPRELUDE_VERSION ) )
-    {
-      printf("\n*** LIBPRELUDE header file (version %s) does not match\n", LIBPRELUDE_VERSION);
-      printf("*** library (version %s)\n", prelude_check_version(NULL) );
-    }
-    else
-    {
-      if ( prelude_check_version( "$min_libprelude_version" ) )
-      {
-        return 0;
-      }
-     else
-      {
-        printf("no\n*** An old version of LIBPRELUDE (%s) was found.\n",
-                prelude_check_version(NULL) );
-        printf("*** You need a version of LIBPRELUDE newer than %s. The latest version of\n",
-               "$min_libprelude_version" );
-        printf("*** LIBPRELUDE is always available from http://www.prelude-ids.org/download/releases.\n");
-        printf("*** \n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the libprelude-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of LIBPRELUDE, but you can also set the LIBPRELUDE_CONFIG environment to point to the\n");
-        printf("*** correct copy of libprelude-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-      }
-    }
-  return 1;
-}
-],, no_libprelude=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-       LDFLAGS="$ac_save_LDFLAGS"
-  fi
-
-  if test "x$no_libprelude" = x ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$2], , :, [$2])
-  else
-     if test -f conf.libpreludetest ; then
-        :
-     else
-        AC_MSG_RESULT(no)
-     fi
-     if test "$LIBPRELUDE_CONFIG" = "no" ; then
-       echo "*** The libprelude-config script installed by LIBPRELUDE could not be found"
-       echo "*** If LIBPRELUDE was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the LIBPRELUDE_CONFIG environment variable to the"
-       echo "*** full path to libprelude-config."
-     else
-       if test -f conf.libpreludetest ; then
-        :
-       else
-          echo "*** Could not run libprelude test program, checking why..."
-          CFLAGS="$CFLAGS $LIBPRELUDE_CFLAGS"
-	  LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
-          LIBS="$LIBS $LIBPRELUDE_LIBS"
-          AC_TRY_LINK([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <libprelude/prelude.h>
-],      [ return !!prelude_check_version(NULL); ],
-        [ echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding LIBPRELUDE or finding the wrong"
-          echo "*** version of LIBPRELUDE. If it is not finding LIBPRELUDE, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-          echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-          echo "***" ],
-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means LIBPRELUDE was incorrectly installed"
-          echo "*** or that you have moved LIBPRELUDE since it was installed. In the latter case, you"
-          echo "*** may want to edit the libprelude-config script: $LIBPRELUDE_CONFIG" ])
-          CFLAGS="$ac_save_CFLAGS"
-	  LDFLAGS="$ac_save_LDFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     LIBPRELUDE_CFLAGS=""
-     LIBPRELUDE_LDFLAGS=""
-     LIBPRELUDE_LIBS=""
-     ifelse([$3], , :, [$3])
-  fi
-  rm -f conf.libpreludetest
-  AC_SUBST(LIBPRELUDE_CFLAGS)
-  AC_SUBST(LIBPRELUDE_PTHREAD_CFLAGS)
-  AC_SUBST(LIBPRELUDE_LDFLAGS)
-  AC_SUBST(LIBPRELUDE_LIBS)
-  AC_SUBST(LIBPRELUDE_PREFIX)
-  AC_SUBST(LIBPRELUDE_CONFIG_PREFIX)
-])
-
-
-##### http://autoconf-archive.cryp.to/acx_pthread.html
-#
-# SYNOPSIS
-#
-#   ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-#
-# DESCRIPTION
-#
-#   This macro figures out how to build C programs using POSIX threads.
-#   It sets the PTHREAD_LIBS output variable to the threads library and
-#   linker flags, and the PTHREAD_CFLAGS output variable to any special
-#   C compiler flags that are needed. (The user can also force certain
-#   compiler flags/libs to be tested by setting these environment
-#   variables.)
-#
-#   Also sets PTHREAD_CC to any special C compiler that is needed for
-#   multi-threaded programs (defaults to the value of CC otherwise).
-#   (This is necessary on AIX to use the special cc_r compiler alias.)
-#
-#   NOTE: You are assumed to not only compile your program with these
-#   flags, but also link it with them as well. e.g. you should link
-#   with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
-#   $LIBS
-#
-#   If you are only building threads programs, you may wish to use
-#   these variables in your default LIBS, CFLAGS, and CC:
-#
-#          LIBS="$PTHREAD_LIBS $LIBS"
-#          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-#          CC="$PTHREAD_CC"
-#
-#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
-#   constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
-#   that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
-#
-#   ACTION-IF-FOUND is a list of shell commands to run if a threads
-#   library is found, and ACTION-IF-NOT-FOUND is a list of commands to
-#   run it if it is not found. If ACTION-IF-FOUND is not specified, the
-#   default action will define HAVE_PTHREAD.
-#
-#   Please let the authors know if this macro fails on any platform, or
-#   if you have any other suggestions or comments. This macro was based
-#   on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
-#   (with help from M. Frigo), as well as ac_pthread and hb_pthread
-#   macros posted by Alejandro Forero Cuervo to the autoconf macro
-#   repository. We are also grateful for the helpful feedback of
-#   numerous users.
-#
-# LAST MODIFICATION
-#
-#   2007-07-29
-#
-# COPYLEFT
-#
-#   Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
-#
-#   This program is free software: you can redistribute it and/or
-#   modify it under the terms of the GNU General Public License as
-#   published by the Free Software Foundation, either version 3 of the
-#   License, or (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-#   General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program. If not, see
-#   <http://www.gnu.org/licenses/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright
-#   owner gives unlimited permission to copy, distribute and modify the
-#   configure scripts that are the output of Autoconf when processing
-#   the Macro. You need not follow the terms of the GNU General Public
-#   License when using or distributing such scripts, even though
-#   portions of the text of the Macro appear in them. The GNU General
-#   Public License (GPL) does govern all other use of the material that
-#   constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the
-#   Autoconf Macro released by the Autoconf Macro Archive. When you
-#   make and distribute a modified version of the Autoconf Macro, you
-#   may extend this special exception to the GPL to apply to your
-#   modified version as well.
-
-AC_DEFUN([ACX_PTHREAD], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG_C
-acx_pthread_ok=no
-
-# We used to check for pthread.h first, but this fails if pthread.h
-# requires special compiler flags (e.g. on True64 or Sequent).
-# It gets checked for in the link test anyway.
-
-# First of all, check if the user has set any of the PTHREAD_LIBS,
-# etcetera environment variables, and if threads linking works using
-# them:
-if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
-        save_CFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-        save_LIBS="$LIBS"
-        LIBS="$PTHREAD_LIBS $LIBS"
-        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
-        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
-        AC_MSG_RESULT($acx_pthread_ok)
-        if test x"$acx_pthread_ok" = xno; then
-                PTHREAD_LIBS=""
-                PTHREAD_CFLAGS=""
-        fi
-        LIBS="$save_LIBS"
-        CFLAGS="$save_CFLAGS"
-fi
-
-# We must check for the threads library under a number of different
-# names; the ordering is very important because some systems
-# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
-# libraries is broken (non-POSIX).
-
-# Create a list of thread flags to try.  Items starting with a "-" are
-# C compiler flags, and other items are library names, except for "none"
-# which indicates that we try without any flags at all, and "pthread-config"
-# which is a program returning the flags for the Pth emulation library.
-
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
-
-# The ordering *is* (sometimes) important.  Some notes on the
-# individual items follow:
-
-# pthreads: AIX (must check this before -lpthread)
-# none: in case threads are in libc; should be tried before -Kthread and
-#       other compiler flags to prevent continual compiler warnings
-# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
-# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
-# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
-# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
-# -pthreads: Solaris/gcc
-# -mthreads: Mingw32/gcc, Lynx/gcc
-# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
-#      doesn't hurt to check since this sometimes defines pthreads too;
-#      also defines -D_REENTRANT)
-#      ... -mt is also the pthreads flag for HP/aCC
-# pthread: Linux, etcetera
-# --thread-safe: KAI C++
-# pthread-config: use pthread-config program (for GNU Pth library)
-
-case "${host_cpu}-${host_os}" in
-        *solaris*)
-
-        # On Solaris (at least, for some versions), libc contains stubbed
-        # (non-functional) versions of the pthreads routines, so link-based
-        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
-        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
-        # a function called by this macro, so we could check for that, but
-        # who knows whether they'll stub that too in a future libc.)  So,
-        # we'll just look for -pthreads and -lpthread first:
-
-        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
-        ;;
-esac
-
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
-
-        case $flag in
-                none)
-                AC_MSG_CHECKING([whether pthreads work without any flags])
-                ;;
-
-                -pthread)
-                AC_MSG_CHECKING([whether pthreads work with $flag])
-                PTHREAD_CFLAGS="$flag"
-                ;;
-
-                -*)
-                AC_MSG_CHECKING([whether pthreads work with $flag])
-                PTHREAD_CFLAGS="$flag"
-                ;;
-
-		pthread-config)
-		AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
-		if test x"$acx_pthread_config" = xno; then continue; fi
-		PTHREAD_CFLAGS="`pthread-config --cflags`"
-		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
-		;;
-
-                *)
-                AC_MSG_CHECKING([for the pthreads library -l$flag])
-                PTHREAD_LIBS="-l$flag"
-                ;;
-        esac
-
-        save_LIBS="$LIBS"
-        save_CFLAGS="$CFLAGS"
-        save_LDFLAGS="$LDFLAGS"
-        LIBS="$PTHREAD_LIBS $LIBS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-        LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
-
-        # Check for various functions.  We must include pthread.h,
-        # since some functions may be macros.  (On the Sequent, we
-        # need a special flag -Kthread to make this header compile.)
-        # We check for pthread_join because it is in -lpthread on IRIX
-        # while pthread_create is in libc.  We check for pthread_attr_init
-        # due to DEC craziness with -lpthreads.  We check for
-        # pthread_cleanup_push because it is one of the few pthread
-        # functions on Solaris that doesn't have a non-functional libc stub.
-        # We try pthread_create on general principles.
-        AC_TRY_LINK([#include <pthread.h>],
-                    [pthread_t th; pthread_join(th, 0);
-                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
-                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
-                    [acx_pthread_ok=yes])
-
-        LIBS="$save_LIBS"
-        LDFLAGS="$save_LDFLAGS"
-        CFLAGS="$save_CFLAGS"
-
-        AC_MSG_RESULT($acx_pthread_ok)
-        if test "x$acx_pthread_ok" = xyes; then
-                break;
-        fi
-
-        PTHREAD_LIBS=""
-        PTHREAD_CFLAGS=""
-done
-fi
-
-# Various other checks:
-if test "x$acx_pthread_ok" = xyes; then
-        save_LIBS="$LIBS"
-        LIBS="$PTHREAD_LIBS $LIBS"
-        save_CFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
-        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
-	AC_MSG_CHECKING([for joinable pthread attribute])
-	attr_name=unknown
-	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
-	    AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
-                        [attr_name=$attr; break])
-	done
-        AC_MSG_RESULT($attr_name)
-        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
-            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
-                               [Define to necessary symbol if this constant
-                                uses a non-standard name on your system.])
-        fi
-
-	# Solaris lossage: default is obsolete semantics for getpwnam_r,
-	# getpwuid_r, getgrgid_r, unless _POSIX_PTHREAD_SEMANTICS is defined
-        AC_MSG_CHECKING([if more special flags are required for pthreads])
-        flag=no
-        case "${host_cpu}-${host_os}" in
-            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
-            *-osf* | *-hpux*) flag="-D_REENTRANT";;
-	    *solaris*) flag="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
-        esac
-        AC_MSG_RESULT(${flag})
-        if test "x$flag" != xno; then
-            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
-        fi
-
-        # Detect PTHREAD_MUTEX_RECURSIVE
-	AC_MSG_CHECKING([for recursive mutexes])
-	mutex_recursive=no
-	AC_TRY_LINK([
-#define _XOPEN_SOURCE 500
-#include <pthread.h>], [
-pthread_mutexattr_t   mta;
-pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
-return 0;],[mutex_recursive=yes])
-	if test "x$mutex_recursive" = "xyes"
-	then
-	  AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE,1,[Define if you have recursive mutexes.])
-	fi
-        AC_MSG_RESULT($mutex_recursive)
-
-        LIBS="$save_LIBS"
-        CFLAGS="$save_CFLAGS"
-
-        # More AIX lossage: must compile with xlc_r or cc_r
-	if test x"$GCC" != xyes; then
-          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
-        else
-          PTHREAD_CC=$CC
-	fi
-else
-        PTHREAD_CC="$CC"
-fi
-
-if test x"$acx_pthread_ok" = xyes; then
-   PTHREAD_CFLAGS="${PTHREAD_CFLAGS} -DUSE_MALLOC_LOCK=1"
-fi
-
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_LDFLAGS)
-AC_SUBST(PTHREAD_CC)
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$acx_pthread_ok" = xyes; then
-        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
-        :
-else
-        acx_pthread_ok=no
-        $2
-fi
-AC_LANG_RESTORE
-])dnl ACX_PTHREAD
-
-
-
-
-dnl Copyright Â© 2004 Loic Dachary <loic@senga.org>
-dnl
-dnl This program is free software; you can redistribute it and/or modify 
-dnl it under the terms of the GNU General Public License as published by 
-dnl the Free Software Foundation; either version 2 of the License, or (at 
-dnl your option) any later version.
-dnl
-dnl Use ZLIB_HOME instead of option
-
-AC_DEFUN([CHECK_ZLIB],[
-
-if test "x${ZLIB_HOME}" = "x"; then 
-	ZLIB_HOME=/usr/local
-	if test ! -f "${ZLIB_HOME}/include/zlib.h"
-	then
-        	ZLIB_HOME=/usr
-	fi
-fi
-
-zlib_found=no
-
-ZLIB_OLD_LDFLAGS=$LDFLAGS
-ZLIB_OLD_CPPFLAGS=$LDFLAGS
-if test "x${ZLIB_HOME}" = "x/usr"; then
-	:
-else
-	LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
-	CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
-fi
-AC_LANG_SAVE
-AC_LANG_C
-AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
-AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
-AC_LANG_RESTORE
-if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
-then
-        #
-        # If both library and header were found, use them
-        #
-        AC_CHECK_LIB(z, inflateEnd)
-        AC_MSG_CHECKING([zlib in ${ZLIB_HOME}])
-        AC_MSG_RESULT(ok)
-	AC_CHECK_FUNCS([compressBound])
-	zlib_found=yes
-else
-        #
-        # If either header or library was not found, revert and bomb
-        #
-        AC_MSG_CHECKING(zlib in ${ZLIB_HOME})
-        LDFLAGS="$ZLIB_OLD_LDFLAGS"
-        CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
-        AC_MSG_RESULT(failed)
-        AC_MSG_WARN([zlib not found in ZLIB_HOME, /usr/local, or /usr])
-fi
-
-])
-
-# SH_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([SH_PROG_LD],
-[
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-else
-  AC_MSG_CHECKING([for ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-        with_gnu_ld=yes
-        ;;
-      *)
-        with_gnu_ld=no
-        ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-# SH_STRFTIME_Z
-# -------------
-# check whether strftime supports %z
-AC_DEFUN([SH_STRFTIME_Z],
-[
-AC_MSG_CHECKING([whether strftime supports %z])
-AC_TRY_RUN([
-#include <time.h>
-#include <string.h>
-int main()
-{
-   struct tm tm;
-   char tt[64];
-   memset(&tm, 0, sizeof(tm));
-   strftime(tt, sizeof(tt), "%z", &tm);
-
-   if (strlen(tt) != 5) return 1;
-   return 0;
-}
-],
-[
-AC_MSG_RESULT([yes])
-AC_DEFINE(HAVE_STRFTIME_Z, 1, [strftime supports %z])
-],
-[
-AC_MSG_RESULT([no])
-],[
-AC_MSG_RESULT([no])
-])])
-
-AC_DEFUN([SH_GCC_VERSION], [
-  GCC_VERSION=""
-  gcc_VERSION_MAJOR=0
-  gcc_VERSION_MINOR=0
-  AC_MSG_CHECKING([for gcc version])
-  if test "x$GCC" = "xyes"
-  then
-	$CC -dumpversion >/dev/null 2>&1
-	if test $? -eq 0
-	then
-		GCC_VERSION=`$CC -dumpversion`
-      		gcc_VERSION_MAJOR=`echo $GCC_VERSION | cut -d'.' -f1`
-      		gcc_VERSION_MINOR=`echo $GCC_VERSION | cut -d'.' -f2`
-      		AC_DEFINE_UNQUOTED(GCC_VERSION_MAJOR, [${gcc_VERSION_MAJOR}], [gcc version major])
-      		AC_DEFINE_UNQUOTED(GCC_VERSION_MINOR, [${gcc_VERSION_MINOR}], [gcc version minor])
-		AC_MSG_RESULT([$GCC_VERSION])
-	else
-		AC_MSG_RESULT([$CC -dumpversion working])
-	fi
-  else
-	AC_MSG_RESULT([compiler is not gcc])
-  fi
-])
-
-
-
-dnl *-*wedit:notab*-*  Please keep this as the last line.
-
Index: /trunk/compile
===================================================================
--- /trunk/compile	(revision 583)
+++ /trunk/compile	(revision 583)
@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN* | MSYS*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/* | msys/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
Index: /trunk/config.guess
===================================================================
--- /trunk/config.guess	(revision 582)
+++ /trunk/config.guess	(revision 583)
@@ -1,11 +1,13 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2018 Free Software Foundation, Inc.
-
-timestamp='2018-02-24'
+#   Copyright 1992-2022 Free Software Foundation, Inc.
+
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2022-01-09'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
@@ -28,7 +30,15 @@
 #
 # You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
 #
 # Please send patches to <config-patches@gnu.org>.
+
+
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX.  However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
 
 
@@ -51,5 +61,5 @@
 
 Originally written by Per Bothner.
-Copyright 1992-2018 Free Software Foundation, Inc.
+Copyright 1992-2022 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -85,5 +95,6 @@
 fi
 
-trap 'exit 1' 1 2 15
+# Just in case it came from the environment.
+GUESS=
 
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
@@ -97,32 +108,38 @@
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > "$dummy.c" ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+    # prevent multiple calls if $tmp is already set
+    test "$tmp" && return 0
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039,SC3028
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+	,,)    echo "int x;" > "$dummy.c"
+	       for driver in cc gcc c89 c99 ; do
+		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+		       CC_FOR_BUILD=$driver
+		       break
+		   fi
+	       done
+	       if test x"$CC_FOR_BUILD" = x ; then
+		   CC_FOR_BUILD=no_compiler_found
+	       fi
+	       ;;
+	,,*)   CC_FOR_BUILD=$CC ;;
+	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
@@ -130,14 +147,12 @@
 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "$UNAME_SYSTEM" in
+case $UNAME_SYSTEM in
 Linux|GNU|GNU/*)
-	# If the system lacks a compiler, then just pick glibc.
-	# We could probably try harder.
-	LIBC=gnu
-
-	eval "$set_cc_for_build"
+	LIBC=unknown
+
+	set_cc_for_build
 	cat <<-EOF > "$dummy.c"
 	#include <features.h>
@@ -146,15 +161,28 @@
 	#elif defined(__dietlibc__)
 	LIBC=dietlibc
+	#elif defined(__GLIBC__)
+	LIBC=gnu
 	#else
-	LIBC=gnu
+	#include <stdarg.h>
+	/* First heuristic to detect musl libc.  */
+	#ifdef __DEFINED_va_list
+	LIBC=musl
+	#endif
 	#endif
 	EOF
-	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
-
-	# If ldd exists, use it to detect musl libc.
-	if command -v ldd >/dev/null && \
-		ldd --version 2>&1 | grep -q ^musl
-	then
-	    LIBC=musl
+	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	eval "$cc_set_libc"
+
+	# Second heuristic to detect musl libc.
+	if [ "$LIBC" = unknown ] &&
+	   command -v ldd >/dev/null &&
+	   ldd --version 2>&1 | grep -q ^musl; then
+		LIBC=musl
+	fi
+
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	if [ "$LIBC" = unknown ]; then
+		LIBC=gnu
 	fi
 	;;
@@ -163,5 +191,5 @@
 # Note: order is significant - the case branches are not exclusive.
 
-case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
@@ -175,10 +203,10 @@
 	# Note: NetBSD doesn't particularly care about the vendor
 	# portion of the name.  We always set it to "unknown".
-	sysctl="sysctl -n hw.machine_arch"
 	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-	    "/sbin/$sysctl" 2>/dev/null || \
-	    "/usr/sbin/$sysctl" 2>/dev/null || \
+	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
 	    echo unknown)`
-	case "$UNAME_MACHINE_ARCH" in
+	case $UNAME_MACHINE_ARCH in
+	    aarch64eb) machine=aarch64_be-unknown ;;
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
@@ -189,16 +217,16 @@
 		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
 		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
-		machine="${arch}${endian}"-unknown
+		machine=${arch}${endian}-unknown
 		;;
-	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
+	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently (or will in the future) and ABI.
-	case "$UNAME_MACHINE_ARCH" in
+	case $UNAME_MACHINE_ARCH in
 	    earm*)
 		os=netbsdelf
 		;;
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval "$set_cc_for_build"
+		set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
@@ -216,5 +244,5 @@
 	esac
 	# Determine ABI tags.
-	case "$UNAME_MACHINE_ARCH" in
+	case $UNAME_MACHINE_ARCH in
 	    earm*)
 		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
@@ -227,5 +255,5 @@
 	# kernel version information, so it can be replaced with a
 	# suitable tag, in the style of linux-gnu.
-	case "$UNAME_VERSION" in
+	case $UNAME_VERSION in
 	    Debian*)
 		release='-gnu'
@@ -238,43 +266,55 @@
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "$machine-${os}${release}${abi}"
-	exit ;;
+	GUESS=$machine-${os}${release}${abi-}
+	;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
+	;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
+	;;
+    *:SecBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
+	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
+	;;
     *:LibertyBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
+	;;
     *:MidnightBSD:*:*)
-	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
+	;;
     *:ekkoBSD:*:*)
-	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
+	;;
     *:SolidBSD:*:*)
-	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
+	;;
+    *:OS108:*:*)
+	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
+	;;
     macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
-	exit ;;
+	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
+	;;
     *:MirBSD:*:*)
-	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
+	;;
     *:Sortix:*:*)
-	echo "$UNAME_MACHINE"-unknown-sortix
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-sortix
+	;;
+    *:Twizzler:*:*)
+	GUESS=$UNAME_MACHINE-unknown-twizzler
+	;;
     *:Redox:*:*)
-	echo "$UNAME_MACHINE"-unknown-redox
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-redox
+	;;
     mips:OSF1:*.*)
-        echo mips-dec-osf1
-        exit ;;
+	GUESS=mips-dec-osf1
+	;;
     alpha:OSF1:*:*)
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	trap '' 0
 	case $UNAME_RELEASE in
 	*4.0)
@@ -290,5 +330,5 @@
 	# types through head -n 1, so we only detect the type of CPU 0.
 	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-	case "$ALPHA_CPU_TYPE" in
+	case $ALPHA_CPU_TYPE in
 	    "EV4 (21064)")
 		UNAME_MACHINE=alpha ;;
@@ -327,75 +367,76 @@
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
-	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
-	exitcode=$?
-	trap '' 0
-	exit $exitcode ;;
+	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
+	;;
     Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-unknown-sysv4
-	exit ;;
+	GUESS=m68k-unknown-sysv4
+	;;
     *:[Aa]miga[Oo][Ss]:*:*)
-	echo "$UNAME_MACHINE"-unknown-amigaos
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-amigaos
+	;;
     *:[Mm]orph[Oo][Ss]:*:*)
-	echo "$UNAME_MACHINE"-unknown-morphos
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-morphos
+	;;
     *:OS/390:*:*)
-	echo i370-ibm-openedition
-	exit ;;
+	GUESS=i370-ibm-openedition
+	;;
     *:z/VM:*:*)
-	echo s390-ibm-zvmoe
-	exit ;;
+	GUESS=s390-ibm-zvmoe
+	;;
     *:OS400:*:*)
-	echo powerpc-ibm-os400
-	exit ;;
+	GUESS=powerpc-ibm-os400
+	;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix"$UNAME_RELEASE"
-	exit ;;
+	GUESS=arm-acorn-riscix$UNAME_RELEASE
+	;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
-	echo arm-unknown-riscos
-	exit ;;
+	GUESS=arm-unknown-riscos
+	;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-	echo hppa1.1-hitachi-hiuxmpp
-	exit ;;
+	GUESS=hppa1.1-hitachi-hiuxmpp
+	;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-	if test "`(/bin/universe) 2>/dev/null`" = att ; then
-		echo pyramid-pyramid-sysv3
-	else
-		echo pyramid-pyramid-bsd
-	fi
-	exit ;;
+	case `(/bin/universe) 2>/dev/null` in
+	    att) GUESS=pyramid-pyramid-sysv3 ;;
+	    *)   GUESS=pyramid-pyramid-bsd   ;;
+	esac
+	;;
     NILE*:*:*:dcosx)
-	echo pyramid-pyramid-svr4
-	exit ;;
+	GUESS=pyramid-pyramid-svr4
+	;;
     DRS?6000:unix:4.0:6*)
-	echo sparc-icl-nx6
-	exit ;;
+	GUESS=sparc-icl-nx6
+	;;
     DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
 	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7; exit ;;
-	esac ;;
+	    sparc) GUESS=sparc-icl-nx7 ;;
+	esac
+	;;
     s390x:SunOS:*:*)
-	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
-	exit ;;
+	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
+	;;
     sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
-	exit ;;
+	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+	GUESS=sparc-hal-solaris2$SUN_REL
+	;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
-	exit ;;
+	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+	GUESS=sparc-sun-solaris2$SUN_REL
+	;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=i386-pc-auroraux$UNAME_RELEASE
+	;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	SUN_ARCH=i386
 	# If there is a compiler, see if it is configured for 64-bit objects.
 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
 	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+	if test "$CC_FOR_BUILD" != no_compiler_found; then
 	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
 		grep IS_64BIT_ARCH >/dev/null
 	    then
@@ -403,14 +444,16 @@
 	    fi
 	fi
-	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
-	exit ;;
+	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
+	;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
-	exit ;;
+	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+	GUESS=sparc-sun-solaris3$SUN_REL
+	;;
     sun4*:SunOS:*:*)
-	case "`/usr/bin/arch -k`" in
+	case `/usr/bin/arch -k` in
 	    Series*|S4*)
 		UNAME_RELEASE=`uname -v`
@@ -418,24 +461,25 @@
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
-	exit ;;
+	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
+	GUESS=sparc-sun-sunos$SUN_REL
+	;;
     sun3*:SunOS:*:*)
-	echo m68k-sun-sunos"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-sun-sunos$UNAME_RELEASE
+	;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
-	case "`/bin/arch`" in
+	case `/bin/arch` in
 	    sun3)
-		echo m68k-sun-sunos"$UNAME_RELEASE"
+		GUESS=m68k-sun-sunos$UNAME_RELEASE
 		;;
 	    sun4)
-		echo sparc-sun-sunos"$UNAME_RELEASE"
+		GUESS=sparc-sun-sunos$UNAME_RELEASE
 		;;
 	esac
-	exit ;;
+	;;
     aushp:SunOS:*:*)
-	echo sparc-auspex-sunos"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sparc-auspex-sunos$UNAME_RELEASE
+	;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -447,41 +491,41 @@
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-atari-mint$UNAME_RELEASE
+	;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-atari-mint$UNAME_RELEASE
+	;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	echo m68k-atari-mint"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-atari-mint$UNAME_RELEASE
+	;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	echo m68k-milan-mint"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-milan-mint$UNAME_RELEASE
+	;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-hades-mint$UNAME_RELEASE
+	;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-unknown-mint$UNAME_RELEASE
+	;;
     m68k:machten:*:*)
-	echo m68k-apple-machten"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-apple-machten$UNAME_RELEASE
+	;;
     powerpc:machten:*:*)
-	echo powerpc-apple-machten"$UNAME_RELEASE"
-	exit ;;
+	GUESS=powerpc-apple-machten$UNAME_RELEASE
+	;;
     RISC*:Mach:*:*)
-	echo mips-dec-mach_bsd4.3
-	exit ;;
+	GUESS=mips-dec-mach_bsd4.3
+	;;
     RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix"$UNAME_RELEASE"
-	exit ;;
+	GUESS=mips-dec-ultrix$UNAME_RELEASE
+	;;
     VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix"$UNAME_RELEASE"
-	exit ;;
+	GUESS=vax-dec-ultrix$UNAME_RELEASE
+	;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix"$UNAME_RELEASE"
-	exit ;;
+	GUESS=clipper-intergraph-clix$UNAME_RELEASE
+	;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	sed 's/^	//' << EOF > "$dummy.c"
 #ifdef __cplusplus
@@ -509,76 +553,77 @@
 	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
 	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos"$UNAME_RELEASE"
-	exit ;;
+	GUESS=mips-mips-riscos$UNAME_RELEASE
+	;;
     Motorola:PowerMAX_OS:*:*)
-	echo powerpc-motorola-powermax
-	exit ;;
+	GUESS=powerpc-motorola-powermax
+	;;
     Motorola:*:4.3:PL8-*)
-	echo powerpc-harris-powermax
-	exit ;;
+	GUESS=powerpc-harris-powermax
+	;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
-	echo powerpc-harris-powermax
-	exit ;;
+	GUESS=powerpc-harris-powermax
+	;;
     Night_Hawk:Power_UNIX:*:*)
-	echo powerpc-harris-powerunix
-	exit ;;
+	GUESS=powerpc-harris-powerunix
+	;;
     m88k:CX/UX:7*:*)
-	echo m88k-harris-cxux7
-	exit ;;
+	GUESS=m88k-harris-cxux7
+	;;
     m88k:*:4*:R4*)
-	echo m88k-motorola-sysv4
-	exit ;;
+	GUESS=m88k-motorola-sysv4
+	;;
     m88k:*:3*:R3*)
-	echo m88k-motorola-sysv3
-	exit ;;
+	GUESS=m88k-motorola-sysv3
+	;;
     AViiON:dgux:*:*)
 	# DG/UX returns AViiON for all architectures
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
+	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
 	then
-	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
-	       [ "$TARGET_BINARY_INTERFACE"x = x ]
+	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+	       test "$TARGET_BINARY_INTERFACE"x = x
 	    then
-		echo m88k-dg-dgux"$UNAME_RELEASE"
+		GUESS=m88k-dg-dgux$UNAME_RELEASE
 	    else
-		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
+		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
 	    fi
 	else
-	    echo i586-dg-dgux"$UNAME_RELEASE"
-	fi
-	exit ;;
+	    GUESS=i586-dg-dgux$UNAME_RELEASE
+	fi
+	;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
-	echo m88k-dolphin-sysv3
-	exit ;;
+	GUESS=m88k-dolphin-sysv3
+	;;
     M88*:*:R3*:*)
 	# Delta 88k system running SVR3
-	echo m88k-motorola-sysv3
-	exit ;;
+	GUESS=m88k-motorola-sysv3
+	;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-	echo m88k-tektronix-sysv3
-	exit ;;
+	GUESS=m88k-tektronix-sysv3
+	;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-	echo m68k-tektronix-bsd
-	exit ;;
+	GUESS=m68k-tektronix-bsd
+	;;
     *:IRIX*:*:*)
-	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
-	exit ;;
+	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
+	GUESS=mips-sgi-irix$IRIX_REL
+	;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
+	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
-	echo i386-ibm-aix
-	exit ;;
+	GUESS=i386-ibm-aix
+	;;
     ia64:AIX:*:*)
-	if [ -x /usr/bin/oslevel ] ; then
+	if test -x /usr/bin/oslevel ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
-	fi
-	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
-	exit ;;
+		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
+	fi
+	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
+	;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval "$set_cc_for_build"
+		set_cc_for_build
 		sed 's/^		//' << EOF > "$dummy.c"
 		#include <sys/systemcfg.h>
@@ -594,14 +639,14 @@
 		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
 		then
-			echo "$SYSTEM_NAME"
+			GUESS=$SYSTEM_NAME
 		else
-			echo rs6000-ibm-aix3.2.5
+			GUESS=rs6000-ibm-aix3.2.5
 		fi
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-		echo rs6000-ibm-aix3.2.4
+		GUESS=rs6000-ibm-aix3.2.4
 	else
-		echo rs6000-ibm-aix3.2
-	fi
-	exit ;;
+		GUESS=rs6000-ibm-aix3.2
+	fi
+	;;
     *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
@@ -611,47 +656,47 @@
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/lslpp ] ; then
-		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+	if test -x /usr/bin/lslpp ; then
+		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
 			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
-		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
-	fi
-	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
-	exit ;;
+		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
+	fi
+	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
+	;;
     *:AIX:*:*)
-	echo rs6000-ibm-aix
-	exit ;;
+	GUESS=rs6000-ibm-aix
+	;;
     ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
-	echo romp-ibm-bsd4.4
-	exit ;;
+	GUESS=romp-ibm-bsd4.4
+	;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
-	exit ;;                             # report: romp-ibm BSD 4.3
+	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
+	;;                                  # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
-	echo rs6000-bull-bosx
-	exit ;;
+	GUESS=rs6000-bull-bosx
+	;;
     DPX/2?00:B.O.S.:*:*)
-	echo m68k-bull-sysv3
-	exit ;;
+	GUESS=m68k-bull-sysv3
+	;;
     9000/[34]??:4.3bsd:1.*:*)
-	echo m68k-hp-bsd
-	exit ;;
+	GUESS=m68k-hp-bsd
+	;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-	echo m68k-hp-bsd4.4
-	exit ;;
+	GUESS=m68k-hp-bsd4.4
+	;;
     9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
-	case "$UNAME_MACHINE" in
+	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+	case $UNAME_MACHINE in
 	    9000/31?)            HP_ARCH=m68000 ;;
 	    9000/[34]??)         HP_ARCH=m68k ;;
 	    9000/[678][0-9][0-9])
-		if [ -x /usr/bin/getconf ]; then
+		if test -x /usr/bin/getconf; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case "$sc_cpu_version" in
+		    case $sc_cpu_version in
 		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
 		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
 		      532)                      # CPU_PA_RISC2_0
-			case "$sc_kernel_bits" in
+			case $sc_kernel_bits in
 			  32) HP_ARCH=hppa2.0n ;;
 			  64) HP_ARCH=hppa2.0w ;;
@@ -660,6 +705,6 @@
 		    esac
 		fi
-		if [ "$HP_ARCH" = "" ]; then
-		    eval "$set_cc_for_build"
+		if test "$HP_ARCH" = ""; then
+		    set_cc_for_build
 		    sed 's/^		//' << EOF > "$dummy.c"
 
@@ -699,7 +744,7 @@
 		fi ;;
 	esac
-	if [ "$HP_ARCH" = hppa2.0w ]
+	if test "$HP_ARCH" = hppa2.0w
 	then
-	    eval "$set_cc_for_build"
+	    set_cc_for_build
 
 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
@@ -720,12 +765,12 @@
 	    fi
 	fi
-	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
-	exit ;;
+	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
+	;;
     ia64:HP-UX:*:*)
-	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux"$HPUX_REV"
-	exit ;;
+	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+	GUESS=ia64-hp-hpux$HPUX_REV
+	;;
     3050*:HI-UX:*:*)
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	sed 's/^	//' << EOF > "$dummy.c"
 	#include <unistd.h>
@@ -755,34 +800,34 @@
 	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
 		{ echo "$SYSTEM_NAME"; exit; }
-	echo unknown-hitachi-hiuxwe2
-	exit ;;
+	GUESS=unknown-hitachi-hiuxwe2
+	;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
-	echo hppa1.1-hp-bsd
-	exit ;;
+	GUESS=hppa1.1-hp-bsd
+	;;
     9000/8??:4.3bsd:*:*)
-	echo hppa1.0-hp-bsd
-	exit ;;
+	GUESS=hppa1.0-hp-bsd
+	;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-	echo hppa1.0-hp-mpeix
-	exit ;;
+	GUESS=hppa1.0-hp-mpeix
+	;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
-	echo hppa1.1-hp-osf
-	exit ;;
+	GUESS=hppa1.1-hp-osf
+	;;
     hp8??:OSF1:*:*)
-	echo hppa1.0-hp-osf
-	exit ;;
+	GUESS=hppa1.0-hp-osf
+	;;
     i*86:OSF1:*:*)
-	if [ -x /usr/sbin/sysversion ] ; then
-	    echo "$UNAME_MACHINE"-unknown-osf1mk
+	if test -x /usr/sbin/sysversion ; then
+	    GUESS=$UNAME_MACHINE-unknown-osf1mk
 	else
-	    echo "$UNAME_MACHINE"-unknown-osf1
-	fi
-	exit ;;
+	    GUESS=$UNAME_MACHINE-unknown-osf1
+	fi
+	;;
     parisc*:Lites*:*:*)
-	echo hppa1.1-hp-lites
-	exit ;;
+	GUESS=hppa1.1-hp-lites
+	;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-	echo c1-convex-bsd
-	exit ;;
+	GUESS=c1-convex-bsd
+	;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
@@ -792,15 +837,16 @@
 	exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-	echo c34-convex-bsd
-	exit ;;
+	GUESS=c34-convex-bsd
+	;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-	echo c38-convex-bsd
-	exit ;;
+	GUESS=c38-convex-bsd
+	;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-	echo c4-convex-bsd
-	exit ;;
+	GUESS=c4-convex-bsd
+	;;
     CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+	GUESS=ymp-cray-unicos$CRAY_REL
+	;;
     CRAY*[A-Z]90:*:*:*)
 	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
@@ -810,38 +856,55 @@
 	exit ;;
     CRAY*TS:*:*:*)
-	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+	GUESS=t90-cray-unicos$CRAY_REL
+	;;
     CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+	GUESS=alphaev5-cray-unicosmk$CRAY_REL
+	;;
     CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+	GUESS=sv1-cray-unicos$CRAY_REL
+	;;
     *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+	GUESS=craynv-cray-unicosmp$CRAY_REL
+	;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
 	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
-	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
+	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+	;;
     5000:UNIX_System_V:4.*:*)
 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
 	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
-	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
+	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+	;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
+	;;
     sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
+	;;
     *:BSD/OS:*:*)
-	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
+	;;
+    arm:FreeBSD:*:*)
+	UNAME_PROCESSOR=`uname -p`
+	set_cc_for_build
+	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_PCS_VFP
+	then
+	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
+	else
+	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
+	fi
+	;;
     *:FreeBSD:*:*)
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case "$UNAME_PROCESSOR" in
+	case $UNAME_PROCESSOR in
 	    amd64)
 		UNAME_PROCESSOR=x86_64 ;;
@@ -849,62 +912,71 @@
 		UNAME_PROCESSOR=i586 ;;
 	esac
-	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
-	exit ;;
+	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
+	;;
     i*:CYGWIN*:*)
-	echo "$UNAME_MACHINE"-pc-cygwin
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-cygwin
+	;;
     *:MINGW64*:*)
-	echo "$UNAME_MACHINE"-pc-mingw64
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-mingw64
+	;;
     *:MINGW*:*)
-	echo "$UNAME_MACHINE"-pc-mingw32
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-mingw32
+	;;
     *:MSYS*:*)
-	echo "$UNAME_MACHINE"-pc-msys
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-msys
+	;;
     i*:PW*:*)
-	echo "$UNAME_MACHINE"-pc-pw32
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-pw32
+	;;
+    *:SerenityOS:*:*)
+        GUESS=$UNAME_MACHINE-pc-serenity
+        ;;
     *:Interix*:*)
-	case "$UNAME_MACHINE" in
+	case $UNAME_MACHINE in
 	    x86)
-		echo i586-pc-interix"$UNAME_RELEASE"
-		exit ;;
+		GUESS=i586-pc-interix$UNAME_RELEASE
+		;;
 	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix"$UNAME_RELEASE"
-		exit ;;
+		GUESS=x86_64-unknown-interix$UNAME_RELEASE
+		;;
 	    IA64)
-		echo ia64-unknown-interix"$UNAME_RELEASE"
-		exit ;;
+		GUESS=ia64-unknown-interix$UNAME_RELEASE
+		;;
 	esac ;;
     i*:UWIN*:*)
-	echo "$UNAME_MACHINE"-pc-uwin
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-uwin
+	;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
-	exit ;;
+	GUESS=x86_64-pc-cygwin
+	;;
     prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
-	exit ;;
+	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+	GUESS=powerpcle-unknown-solaris2$SUN_REL
+	;;
     *:GNU:*:*)
 	# the GNU system
-	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
-	exit ;;
+	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
+	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
+	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
+	;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
-	exit ;;
-    i*86:Minix:*:*)
-	echo "$UNAME_MACHINE"-pc-minix
-	exit ;;
+	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
+	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
+	;;
+    *:Minix:*:*)
+	GUESS=$UNAME_MACHINE-unknown-minix
+	;;
     aarch64:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
 	  EV56)  UNAME_MACHINE=alphaev56 ;;
@@ -917,149 +989,187 @@
 	objdump --private-headers /bin/sh | grep -q ld.so.1
 	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
-    arc:Linux:*:* | arceb:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
+    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     arm*:Linux:*:*)
-	eval "$set_cc_for_build"
+	set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
+		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
 	    else
-		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
-	exit ;;
+	;;
     avr32*:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     cris:Linux:*:*)
-	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+	;;
     crisv32:Linux:*:*)
-	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+	;;
     e2k:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     frv:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     hexagon:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     i*86:Linux:*:*)
-	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
+	;;
     ia64:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     k1om:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
+    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     m32r*:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     m68*:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     mips:Linux:*:* | mips64:Linux:*:*)
-	eval "$set_cc_for_build"
+	set_cc_for_build
+	IS_GLIBC=0
+	test x"${LIBC}" = xgnu && IS_GLIBC=1
 	sed 's/^	//' << EOF > "$dummy.c"
 	#undef CPU
-	#undef ${UNAME_MACHINE}
-	#undef ${UNAME_MACHINE}el
+	#undef mips
+	#undef mipsel
+	#undef mips64
+	#undef mips64el
+	#if ${IS_GLIBC} && defined(_ABI64)
+	LIBCABI=gnuabi64
+	#else
+	#if ${IS_GLIBC} && defined(_ABIN32)
+	LIBCABI=gnuabin32
+	#else
+	LIBCABI=${LIBC}
+	#endif
+	#endif
+
+	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+	CPU=mipsisa64r6
+	#else
+	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+	CPU=mipsisa32r6
+	#else
+	#if defined(__mips64)
+	CPU=mips64
+	#else
+	CPU=mips
+	#endif
+	#endif
+	#endif
+
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=${UNAME_MACHINE}el
+	MIPS_ENDIAN=el
 	#else
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=${UNAME_MACHINE}
+	MIPS_ENDIAN=
 	#else
-	CPU=
+	MIPS_ENDIAN=
 	#endif
 	#endif
 EOF
-	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
-	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
+	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
+	eval "$cc_set_vars"
+	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
 	;;
     mips64el:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     openrisc*:Linux:*:*)
-	echo or1k-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=or1k-unknown-linux-$LIBC
+	;;
     or32:Linux:*:* | or1k*:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=sparc-unknown-linux-$LIBC
+	;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=hppa64-unknown-linux-$LIBC
+	;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
-	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
-	  *)    echo hppa-unknown-linux-"$LIBC" ;;
+	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
+	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
+	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
 	esac
-	exit ;;
+	;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=powerpc64-unknown-linux-$LIBC
+	;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=powerpc-unknown-linux-$LIBC
+	;;
     ppc64le:Linux:*:*)
-	echo powerpc64le-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=powerpc64le-unknown-linux-$LIBC
+	;;
     ppcle:Linux:*:*)
-	echo powerpcle-unknown-linux-"$LIBC"
-	exit ;;
-    riscv32:Linux:*:* | riscv64:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=powerpcle-unknown-linux-$LIBC
+	;;
+    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
+	;;
     sh64*:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     sh*:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     tile*:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     vax:Linux:*:*)
-	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
+	;;
     x86_64:Linux:*:*)
-	if objdump -f /bin/sh | grep -q elf32-x86-64; then
-	    echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
-	else
-	    echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
-	fi
-	exit ;;
+	set_cc_for_build
+	LIBCABI=$LIBC
+	if test "$CC_FOR_BUILD" != no_compiler_found; then
+	    if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
+		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_X32 >/dev/null
+	    then
+		LIBCABI=${LIBC}x32
+	    fi
+	fi
+	GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
+	;;
     xtensa*:Linux:*:*)
-	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+	;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
 	# sysname and nodename.
-	echo i386-sequent-sysv4
-	exit ;;
+	GUESS=i386-sequent-sysv4
+	;;
     i*86:UNIX_SV:4.2MP:2.*)
 	# Unixware is an offshoot of SVR4, but it has its own version
@@ -1068,34 +1178,34 @@
 	# I just have to hope.  -- rms.
 	# Use sysv4.2uw... so that sysv4* matches it.
-	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
+	;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
-	echo "$UNAME_MACHINE"-pc-os2-emx
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-os2-emx
+	;;
     i*86:XTS-300:*:STOP)
-	echo "$UNAME_MACHINE"-unknown-stop
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-stop
+	;;
     i*86:atheos:*:*)
-	echo "$UNAME_MACHINE"-unknown-atheos
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-atheos
+	;;
     i*86:syllable:*:*)
-	echo "$UNAME_MACHINE"-pc-syllable
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-syllable
+	;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos"$UNAME_RELEASE"
-	exit ;;
+	GUESS=i386-unknown-lynxos$UNAME_RELEASE
+	;;
     i*86:*DOS:*:*)
-	echo "$UNAME_MACHINE"-pc-msdosdjgpp
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
+	;;
     i*86:*:4.*:*)
 	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
+		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
 	else
-		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
-	fi
-	exit ;;
+		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
+	fi
+	;;
     i*86:*:5:[678]*)
 	# UnixWare 7.x, OpenUNIX and OpenServer 6.
@@ -1105,10 +1215,10 @@
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
+		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
@@ -1120,9 +1230,9 @@
 		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 			&& UNAME_MACHINE=i686
-		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
+		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
 	else
-		echo "$UNAME_MACHINE"-pc-sysv32
-	fi
-	exit ;;
+		GUESS=$UNAME_MACHINE-pc-sysv32
+	fi
+	;;
     pc:*:*:*)
 	# Left here for compatibility:
@@ -1132,29 +1242,29 @@
 	# prints for the "djgpp" host, or else GDB configure will decide that
 	# this is a cross-build.
-	echo i586-pc-msdosdjgpp
-	exit ;;
+	GUESS=i586-pc-msdosdjgpp
+	;;
     Intel:Mach:3*:*)
-	echo i386-pc-mach3
-	exit ;;
+	GUESS=i386-pc-mach3
+	;;
     paragon:*:*:*)
-	echo i860-intel-osf1
-	exit ;;
+	GUESS=i860-intel-osf1
+	;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
+	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
-	fi
-	exit ;;
+	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
+	fi
+	;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
-	echo m68010-convergent-sysv
-	exit ;;
+	GUESS=m68010-convergent-sysv
+	;;
     mc68k:UNIX:SYSTEM5:3.51m)
-	echo m68k-convergent-sysv
-	exit ;;
+	GUESS=m68k-convergent-sysv
+	;;
     M680?0:D-NIX:5.3:*)
-	echo m68k-diab-dnix
-	exit ;;
+	GUESS=m68k-diab-dnix
+	;;
     M68*:*:R3V[5678]*:*)
 	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
@@ -1181,147 +1291,151 @@
 	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
+	;;
     mc68030:UNIX_System_V:4.*:*)
-	echo m68k-atari-sysv4
-	exit ;;
+	GUESS=m68k-atari-sysv4
+	;;
     TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
+	;;
     rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
-	exit ;;
+	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
+	;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
-	exit ;;
+	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
+	;;
     SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv"$UNAME_RELEASE"
-	exit ;;
+	GUESS=mips-dde-sysv$UNAME_RELEASE
+	;;
     RM*:ReliantUNIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
+	GUESS=mips-sni-sysv4
+	;;
     RM*:SINIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
+	GUESS=mips-sni-sysv4
+	;;
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo "$UNAME_MACHINE"-sni-sysv4
+		GUESS=$UNAME_MACHINE-sni-sysv4
 	else
-		echo ns32k-sni-sysv
-	fi
-	exit ;;
+		GUESS=ns32k-sni-sysv
+	fi
+	;;
     PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 			# says <Richard.M.Bartel@ccMail.Census.GOV>
-	echo i586-unisys-sysv4
-	exit ;;
+	GUESS=i586-unisys-sysv4
+	;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes@openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
-	echo hppa1.1-stratus-sysv4
-	exit ;;
+	GUESS=hppa1.1-stratus-sysv4
+	;;
     *:*:*:FTX*)
 	# From seanf@swdc.stratus.com.
-	echo i860-stratus-sysv4
-	exit ;;
+	GUESS=i860-stratus-sysv4
+	;;
     i*86:VOS:*:*)
 	# From Paul.Green@stratus.com.
-	echo "$UNAME_MACHINE"-stratus-vos
-	exit ;;
+	GUESS=$UNAME_MACHINE-stratus-vos
+	;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
-	echo hppa1.1-stratus-vos
-	exit ;;
+	GUESS=hppa1.1-stratus-vos
+	;;
     mc68*:A/UX:*:*)
-	echo m68k-apple-aux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=m68k-apple-aux$UNAME_RELEASE
+	;;
     news*:NEWS-OS:6*:*)
-	echo mips-sony-newsos6
-	exit ;;
+	GUESS=mips-sony-newsos6
+	;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-	if [ -d /usr/nec ]; then
-		echo mips-nec-sysv"$UNAME_RELEASE"
+	if test -d /usr/nec; then
+		GUESS=mips-nec-sysv$UNAME_RELEASE
 	else
-		echo mips-unknown-sysv"$UNAME_RELEASE"
-	fi
-	exit ;;
+		GUESS=mips-unknown-sysv$UNAME_RELEASE
+	fi
+	;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
-	echo powerpc-be-beos
-	exit ;;
+	GUESS=powerpc-be-beos
+	;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
-	echo powerpc-apple-beos
-	exit ;;
+	GUESS=powerpc-apple-beos
+	;;
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
-	echo i586-pc-beos
-	exit ;;
+	GUESS=i586-pc-beos
+	;;
     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
-	echo i586-pc-haiku
-	exit ;;
+	GUESS=i586-pc-haiku
+	;;
     x86_64:Haiku:*:*)
-	echo x86_64-unknown-haiku
-	exit ;;
+	GUESS=x86_64-unknown-haiku
+	;;
     SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sx4-nec-superux$UNAME_RELEASE
+	;;
     SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sx5-nec-superux$UNAME_RELEASE
+	;;
     SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sx6-nec-superux$UNAME_RELEASE
+	;;
     SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sx7-nec-superux$UNAME_RELEASE
+	;;
     SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sx8-nec-superux$UNAME_RELEASE
+	;;
     SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sx8r-nec-superux$UNAME_RELEASE
+	;;
     SX-ACE:SUPER-UX:*:*)
-	echo sxace-nec-superux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=sxace-nec-superux$UNAME_RELEASE
+	;;
     Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
-	exit ;;
+	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
+	;;
     *:Rhapsody:*:*)
-	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
+	;;
+    arm64:Darwin:*:*)
+	GUESS=aarch64-apple-darwin$UNAME_RELEASE
+	;;
     *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	eval "$set_cc_for_build"
-	if test "$UNAME_PROCESSOR" = unknown ; then
-	    UNAME_PROCESSOR=powerpc
-	fi
-	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
-	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
-		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		       grep IS_64BIT_ARCH >/dev/null
-		then
-		    case $UNAME_PROCESSOR in
-			i386) UNAME_PROCESSOR=x86_64 ;;
-			powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		    esac
-		fi
-		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
-		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
-		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		       grep IS_PPC >/dev/null
-		then
-		    UNAME_PROCESSOR=powerpc
-		fi
+	UNAME_PROCESSOR=`uname -p`
+	case $UNAME_PROCESSOR in
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	if command -v xcode-select > /dev/null 2> /dev/null && \
+		! xcode-select --print-path > /dev/null 2> /dev/null ; then
+	    # Avoid executing cc if there is no toolchain installed as
+	    # cc will be a stub that puts up a graphical alert
+	    # prompting the user to install developer tools.
+	    CC_FOR_BUILD=no_compiler_found
+	else
+	    set_cc_for_build
+	fi
+	if test "$CC_FOR_BUILD" != no_compiler_found; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		   grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
+	    fi
+	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		   grep IS_PPC >/dev/null
+	    then
+		UNAME_PROCESSOR=powerpc
 	    fi
 	elif test "$UNAME_PROCESSOR" = i386 ; then
-	    # Avoid executing cc on OS X 10.9, as it ships with a stub
-	    # that puts up a graphical alert prompting to install
-	    # developer tools.  Any system running Mac OS X 10.7 or
-	    # later (Darwin 11 and later) is required to have a 64-bit
-	    # processor. This is not true of the ARM version of Darwin
-	    # that Apple uses in portable devices.
-	    UNAME_PROCESSOR=x86_64
-	fi
-	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
-	exit ;;
+	    # uname -m returns i386 or x86_64
+	    UNAME_PROCESSOR=$UNAME_MACHINE
+	fi
+	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
+	;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
@@ -1330,98 +1444,249 @@
 		UNAME_MACHINE=pc
 	fi
-	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
+	;;
     *:QNX:*:4*)
-	echo i386-pc-qnx
-	exit ;;
+	GUESS=i386-pc-qnx
+	;;
     NEO-*:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk"$UNAME_RELEASE"
-	exit ;;
+	GUESS=neo-tandem-nsk$UNAME_RELEASE
+	;;
     NSE-*:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk"$UNAME_RELEASE"
-	exit ;;
+	GUESS=nse-tandem-nsk$UNAME_RELEASE
+	;;
     NSR-*:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk"$UNAME_RELEASE"
-	exit ;;
+	GUESS=nsr-tandem-nsk$UNAME_RELEASE
+	;;
     NSV-*:NONSTOP_KERNEL:*:*)
-	echo nsv-tandem-nsk"$UNAME_RELEASE"
-	exit ;;
+	GUESS=nsv-tandem-nsk$UNAME_RELEASE
+	;;
     NSX-*:NONSTOP_KERNEL:*:*)
-	echo nsx-tandem-nsk"$UNAME_RELEASE"
-	exit ;;
+	GUESS=nsx-tandem-nsk$UNAME_RELEASE
+	;;
     *:NonStop-UX:*:*)
-	echo mips-compaq-nonstopux
-	exit ;;
+	GUESS=mips-compaq-nonstopux
+	;;
     BS2000:POSIX*:*:*)
-	echo bs2000-siemens-sysv
-	exit ;;
+	GUESS=bs2000-siemens-sysv
+	;;
     DS/*:UNIX_System_V:*:*)
-	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
-	exit ;;
+	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
+	;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
 	# operating systems.
-	if test "$cputype" = 386; then
+	if test "${cputype-}" = 386; then
 	    UNAME_MACHINE=i386
-	else
-	    UNAME_MACHINE="$cputype"
-	fi
-	echo "$UNAME_MACHINE"-unknown-plan9
-	exit ;;
+	elif test "x${cputype-}" != x; then
+	    UNAME_MACHINE=$cputype
+	fi
+	GUESS=$UNAME_MACHINE-unknown-plan9
+	;;
     *:TOPS-10:*:*)
-	echo pdp10-unknown-tops10
-	exit ;;
+	GUESS=pdp10-unknown-tops10
+	;;
     *:TENEX:*:*)
-	echo pdp10-unknown-tenex
-	exit ;;
+	GUESS=pdp10-unknown-tenex
+	;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-	echo pdp10-dec-tops20
-	exit ;;
+	GUESS=pdp10-dec-tops20
+	;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-	echo pdp10-xkl-tops20
-	exit ;;
+	GUESS=pdp10-xkl-tops20
+	;;
     *:TOPS-20:*:*)
-	echo pdp10-unknown-tops20
-	exit ;;
+	GUESS=pdp10-unknown-tops20
+	;;
     *:ITS:*:*)
-	echo pdp10-unknown-its
-	exit ;;
+	GUESS=pdp10-unknown-its
+	;;
     SEI:*:*:SEIUX)
-	echo mips-sei-seiux"$UNAME_RELEASE"
-	exit ;;
+	GUESS=mips-sei-seiux$UNAME_RELEASE
+	;;
     *:DragonFly:*:*)
-	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
-	exit ;;
+	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
+	;;
     *:*VMS:*:*)
 	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "$UNAME_MACHINE" in
-	    A*) echo alpha-dec-vms ; exit ;;
-	    I*) echo ia64-dec-vms ; exit ;;
-	    V*) echo vax-dec-vms ; exit ;;
+	case $UNAME_MACHINE in
+	    A*) GUESS=alpha-dec-vms ;;
+	    I*) GUESS=ia64-dec-vms ;;
+	    V*) GUESS=vax-dec-vms ;;
 	esac ;;
     *:XENIX:*:SysV)
-	echo i386-pc-xenix
-	exit ;;
+	GUESS=i386-pc-xenix
+	;;
     i*86:skyos:*:*)
-	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
-	exit ;;
+	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
+	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
+	;;
     i*86:rdos:*:*)
-	echo "$UNAME_MACHINE"-pc-rdos
-	exit ;;
-    i*86:AROS:*:*)
-	echo "$UNAME_MACHINE"-pc-aros
-	exit ;;
+	GUESS=$UNAME_MACHINE-pc-rdos
+	;;
+    i*86:Fiwix:*:*)
+	GUESS=$UNAME_MACHINE-pc-fiwix
+	;;
+    *:AROS:*:*)
+	GUESS=$UNAME_MACHINE-unknown-aros
+	;;
     x86_64:VMkernel:*:*)
-	echo "$UNAME_MACHINE"-unknown-esx
-	exit ;;
+	GUESS=$UNAME_MACHINE-unknown-esx
+	;;
     amd64:Isilon\ OneFS:*:*)
-	echo x86_64-unknown-onefs
-	exit ;;
+	GUESS=x86_64-unknown-onefs
+	;;
+    *:Unleashed:*:*)
+	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
+	;;
 esac
 
+# Do we have a guess based on uname results?
+if test "x$GUESS" != x; then
+    echo "$GUESS"
+    exit
+fi
+
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
+#ifdef _SEQUENT_
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+  "4"
+#else
+  ""
+#endif
+  ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+  struct utsname un;
+
+  uname(&un);
+  if (strncmp(un.version, "V2", 2) == 0) {
+    printf ("i386-sequent-ptx2\n"); exit (0);
+  }
+  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+    printf ("i386-sequent-ptx1\n"); exit (0);
+  }
+  printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+  printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+  printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+  struct utsname un;
+  uname (&un);
+  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+  printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+  struct utsname *un;
+  uname (&un);
+  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+  printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
 echo "$0: unable to guess system type" >&2
 
-case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+case $UNAME_MACHINE:$UNAME_SYSTEM in
     mips:Linux | mips64:Linux)
 	# If we got here on MIPS GNU/Linux, output extra information.
@@ -1440,7 +1705,15 @@
 copies of config.guess and config.sub with the latest versions from:
 
-  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
 and
-  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+EOF
+
+our_year=`echo $timestamp | sed 's,-.*,,'`
+thisyear=`date +%Y`
+# shellcheck disable=SC2003
+script_age=`expr "$thisyear" - "$our_year"`
+if test "$script_age" -lt 3 ; then
+   cat >&2 <<EOF
 
 If $0 has already been updated, send the following data and any
@@ -1470,9 +1743,10 @@
 UNAME_VERSION = "$UNAME_VERSION"
 EOF
+fi
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-functions 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
Index: unk/config.h.in
===================================================================
--- /trunk/config.h.in	(revision 582)
+++ 	(revision )
@@ -1,1200 +1,0 @@
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-
-
-/* ---- compile options        ------------   */
-
-/* Define if you want database support        */
-#undef WITH_DATABASE
-
-/* Define if the database is unixODBC         */
-#undef WITH_ODBC
-
-/* Define if the database is oracle           */
-#undef WITH_ORACLE
-
-/* Define if the database is mysql            */
-#undef WITH_MYSQL
-
-/* Define if the database is postgresql       */
-#undef WITH_POSTGRES
-
-/* Define if the server may listen on 514/udp */
-#undef INET_SYSLOG
-
-/* Define if you want logfile in XML format   */
-#undef SH_USE_XML
-
-/* Define if you want external programs.      */
-#undef WITH_EXTERNAL
-
-/* Define if you want to reload the database  */
-/* on SIGHUP.                                 */
-#undef RELOAD_DATABASE
-
-/* Define if you want SysV message queue.     */
-#undef WITH_MESSAGE_QUEUE
-
-/* Define the mode of the message queue.      */
-#undef MESSAGE_QUEUE_MODE
-
-/* Define which users are always trusted.     */
-/* default = 0 ( = root)                      */
-#undef SL_ALWAYS_TRUSTED
-
-/* Define if you want network time.           */
-/* default = no                               */
-#undef HAVE_NTIME
-
-/* The time server host address.              */
-/* default = "NULL"                           */
-#undef DEFAULT_TIMESERVER
-#undef ALT_TIMESERVER
-
-/* Define if you want to use the mail code.   */
-/* default = yes                              */
-#undef  SH_WITH_MAIL
-
-/* Define if you want client/server encryption*/
-#undef  SH_ENCRYPT
-
-/* Define if you want version 2 encryption    */
-#undef  SH_ENCRYPT_2
-
-/* Define if you want to watch for login/-out.*/
-/* default = no                               */
-#undef  SH_USE_UTMP
-
-/* Define if you want to check mount options on filesystems */
-/* default = no                               */
-#undef SH_USE_MOUNTS
-
-/* Define if you want to keep an eye on       */
-/* sensitive files that your users own        */
-#undef SH_USE_USERFILES
-
-/* Define if you want to watch for suid/sgid  */
-/* files                                      */
-#undef  SH_USE_SUIDCHK
-
-/* Define if you want to check kernel syscall */
-/* table to detect LKM rootkits.              */
-/* default = no                               */
-#undef  SH_USE_KERN
-
-/* Define if you want to use the Kernel       */
-/* module to hide samhain.                    */
-#undef  SH_USE_LKM
-
-/* Define if you have a vanilla  Kernel       */
-/* (2.4 or 2.2)                               */
-#undef  SH_VANILLA_KERNEL
-
-/* Define to the name of the MAGIC_HIDE       */
-/* string if you use the Kernel module to     */
-/* hide samhain.                              */
-#undef  SH_MAGIC_HIDE
-
-/* Define if you want 'micro' stealth mode.   */
-/* default = no                               */
-#undef SH_STEALTH_MICRO
-
-/* Define if you want to use stealth mode.    */
-/* default = no                               */
-#undef SH_STEALTH
-
-/* Define if you want stealth w/o CL parsing. */
-/* default = no                               */
-#undef SH_STEALTH_NOCL
-
-/* The magic argv[1] to re-enable CL parsing. */
-/* default = "yes"                            */
-#undef NOCL_CODE
-
-/* XOR value to hide literal strings.         */
-/* default = 0                                */
-#undef XOR_CODE
-
-/* The port number for TCP/IP connection.     */
-/* default = 49777                            */
-#undef SH_DEFAULT_PORT
-
-/* The identity to assume when dropping root  */
-/* default = "nobody"                         */
-#undef DEFAULT_IDENT
-
-/* Directory for tmp files                    */
-#undef SH_TMPDIR
-
-/* The data root directory.                   */
-/* default="/var/lib/samhain"                 */
-#undef DEFAULT_DATAROOT
-
-/* The quarantine directory.                  */
-/* default="/var/lib/samhain/.quarantine      */
-#undef DEFAULT_QDIR
-
-/* The location of the log file.              */
-/* default="/var/log/samhain_log"             */
-#undef DEFAULT_ERRFILE
-
-/* The directory of the log file.             */
-/* default="/var/log"                         */
-#undef DEFAULT_LOGDIR
-
-/* The location of the pid file.              */
-/* default="/var/run/samhain.pid"             */
-#undef DEFAULT_ERRLOCK
-
-/* The location of the pid file directory.    */
-/* default="/var/run            "             */
-#undef DEFAULT_PIDDIR
-
-/* The location of the configuration file.    */ 
-/* default="/etc/samhainrc"                   */
-#undef DEFAULT_CONFIGFILE
-
-/* The location of the checksum data.         */
-/* default="/var/lib/samhain/samhain_file"    */
-#undef DEFAULT_DATA_FILE
-
-/* The location of the html report.           */
-/* default="/var/log/.samhain.html"           */
-#undef DEFAULT_HTML_FILE
-
-/* The install directory.                     */
-/* default="/usr/local/sbin"                  */
-#undef SH_INSTALL_DIR
-
-/* The install path.                          */
-/* default="/usr/local/sbin/samhain"          */
-#undef SH_INSTALL_PATH
-#undef SH_INSTALL_YULE_PATH
-
-/* The install name.                          */
-/* default="samhain"                          */
-#undef SH_INSTALL_NAME
-
-/* The sender name to use.                    */
-/* default = "daemon"                         */
-#undef  DEFAULT_SENDER 
-
-/* The address to send mail to.               */ 
-/* default = "NULL"                           */
-#undef  DEFAULT_MAILADDRESS 
-#undef  ALT_MAILADDRESS 
-
-/* The log server.                            */ 
-/* default = "NULL"                           */
-#undef  DEFAULT_LOGSERVER 
-#undef  ALT_LOGSERVER 
-
-/* The console.                               */ 
-/* default = "NULL"                           */
-#undef  DEFAULT_CONSOLE 
-#undef  ALT_CONSOLE 
-
-/* The default base for one-time pads.        */ 
-/* default = compile_time,compile_time        */
-#undef  DEFKEY
-
-/* Define if you want more debug options.     */
-/* default = no                               */
-#undef MEM_DEBUG
-
-/* Define if you want more debug output.      */
-/* default = no                               */
-#undef WITH_TPT
-
-/* Define if you want tracing.                */
-/* default = no                               */
-#undef WITH_TRACE
-
-/* Define if you want slib debug.             */
-/* default = no                               */
-#undef SL_DEBUG
-
-/* Define if you want slib to abort on errors.*/
-/* default = no                               */
-#undef SL_FAIL_ON_ERROR
-
-/* Define if you want to use SRP authenticaton*/
-#undef USE_SRP_PROTOCOL
-
-/* Define if you want to use GnuPG to         */
-/* verify database and configuation file.     */
-#undef WITH_GPG
-
-/* The full path to GnuPG                     */
-#undef DEFAULT_GPG_PATH
-
-/* Define if you want to compile in the       */
-/* public key fingerprint.                    */
-#undef USE_FINGERPRINT
-
-/* The public key fingerprint.                */
-#undef SH_GPG_FP
-
-/* Use ptrace - screw up signal handling.     */
-#undef SCREW_IT_UP
-
-/* ---- misc                   ------------   */
-
-/* Define the package name.                   */
-#undef PACKAGE
-
-/* Define the package version.                */
-#undef VERSION
-
-/* Define to the position of the key (1...8). */
-#undef POS_TF
-
-/* Init key for exepack.                      */
-#undef EXEPACK_STATE_0
-#undef EXEPACK_STATE_1
-#undef EXEPACK_STATE_2
-
-/* ---- system-specific options ------------  */
-
-/* Define to the address of sys_call_table */
-#undef SH_SYSCALLTABLE
-
-/* Define to use SVR4 statvfs to get filesystem type.  */
-#undef FSTYPE_STATVFS
-
-/* Define to use SVR3.2 statfs to get filesystem type.  */
-#undef FSTYPE_USG_STATFS
-
-/* Define to use AIX3 statfs to get filesystem type.  */
-#undef FSTYPE_AIX_STATFS
-
-/* Define to use 4.3BSD getmntent to get filesystem type.  */
-#undef FSTYPE_MNTENT
-
-/* Define to use 4.4BSD and OSF1 statfs to get filesystem type.  */
-#undef FSTYPE_STATFS
-
-/* Define to use Ultrix getmnt to get filesystem type.  */
-#undef FSTYPE_GETMNT
-
-/* the basic type to which we can cast a uid
- */
-#undef UID_CAST
-
-/* for ext2fs flags                           */
-#undef HAVE_EXT2_IOCTLS
-#undef HAVE_STAT_FLAGS
-
-/* obvious                                    */
-#undef HOST_IS_LINUX
-#undef HOST_IS_I86LINUX
-
-/* obvious                                    */
-#undef HOST_IS_CYGWIN
-
-/* obvious                                    */
-#undef HOST_IS_DARWIN
-
-/* obvious                                    */
-#undef HOST_IS_FREEBSD
-
-/* obvious                                    */
-#undef HOST_IS_AIX
-
-/* obvious                                    */
-#undef HOST_IS_SOLARIS
-
-/* obvious                                    */
-#undef HOST_IS_I86SOLARIS
-
-/* obvious                                    */
-#undef HOST_IS_HPUX
-
-/* Define to the name of the random devices.  */
-#undef NAME_OF_DEV_RANDOM
-
-#undef NAME_OF_DEV_URANDOM
-
-/* Define if you have long long.              */
-#undef HAVE_LONG_LONG
-
-/* Define if short is 32 bits.                */
-#undef HAVE_SHORT_32
-
-/* Define if int is 32 bits.                  */
-#undef HAVE_INT_32
-
-/* Define if long is 32 bits.                 */
-#undef HAVE_LONG_32
-
-/* Define if long is 64 bits.                 */
-#undef HAVE_LONG_64
-
-/* Define if UINT64 is 32 bits.                 */
-#undef UINT64_IS_32
-
-/* Define if you have uint64_t.               */
-#undef HAVE_UINT16_T
-
-/* Define if you have uint64_t.               */
-#undef HAVE_UINT64_T
-
-/* Define if you have utmpx.h.                */
-#undef HAVE_UTMPX_H
-
-/* Define if your struct utmpx has ut_xtime.  */
-#undef HAVE_UTXTIME
-
-/* Define if your struct utmp has ut_type.    */
-#undef HAVE_UTTYPE
-
-/* Define if your struct utmp has ut_host.    */
-#undef HAVE_UTHOST
-
-/* Define if your struct utmp has ut_addr.    */
-#undef HAVE_UTADDR
-
-/* Define if your struct utmp has ut_addr_v6  */
-#undef HAVE_UTADDR_V6
-
-/* Define if your includes are broken.        */
-#undef HAVE_BROKEN_INCLUDES
-
-/* Define if your getcwd uses 'popen'.        */
-#undef HAVE_BROKEN_GETCWD
-
-/* Define if your vsnprintf is broken.        */
-#undef HAVE_BROKEN_VSNPRINTF
-
-/* Define if you have va_copy.                */
-#undef VA_COPY
-
-/* Define if va_list may be copied as array.  */
-#undef VA_COPY_AS_ARRAY
-
-/* Define if you need unix entropy gatherer.  */
-#undef HAVE_UNIX_RANDOM
-
-/* Define if you have EGD.                    */
-#undef HAVE_EGD_RANDOM
-
-/* Define if you have /dev/random.            */
-#undef HAVE_URANDOM
-
-/* Soket name for EGD.                        */
-#undef EGD_SOCKET_NAME
-
-/* Define if your mlock() is broken.          */
-#undef HAVE_BROKEN_MLOCK
-
-/* Define the proc f_type.                    */
-#undef SH_PROC_MAGIC
-
-/* Define if you have statfs.                 */
-#undef HAVE_STATFS
-
-/* Define if statfs works.                    */
-#undef STATFS_WORKS
-
-/* Define to long if not defined.             */
-#undef ptrdiff_t
-
-
-/* type of arg3 of accept */
-#undef ACCEPT_TYPE_ARG3
-
-/* Define if <sys/acct.h>'s AC_ETIME field is a COMP_T. */
-#undef ACETIME_COMPT
-
-/* Define if <sys/acct.h>'s AC_IO field is a COMP_T. */
-#undef ACIO_COMPT
-
-/* Define if <sys/acct.h>'s AC_MAJFLT field is a COMP_T. */
-#undef ACMAJFLT_COMPT
-
-/* Define if <sys/acct.h>'s AC_MEM field is a COMP_T. */
-#undef ACMEM_COMPT
-
-/* Define if <sys/acct.h>'s AC_MINFLT field is a COMP_T. */
-#undef ACMINFLT_COMPT
-
-/* Define if <sys/acct.h>'s AC_STIME field is a COMP_T. */
-#undef ACSTIME_COMPT
-
-/* Define if <sys/acct.h>'s AC_SWAPS field is a COMP_T. */
-#undef ACSWAPS_COMPT
-
-/* Define if <sys/acct.h>'s AC_UTIME field is a COMP_T. */
-#undef ACUTIME_COMPT
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define as path to signing binary */
-#undef DEFAULT_SIG_PATH
-
-/* Debug dnmalloc */
-#undef DNMALLOC_CHECKS
-
-/* Define if SSP C support is enabled. */
-#undef ENABLE_SSP_CC
-
-/* gcc version major */
-#undef GCC_VERSION_MAJOR
-
-/* gcc version minor */
-#undef GCC_VERSION_MINOR
-
-/* Define if <sys/acct.h> has struct acctv2. */
-#undef HAVE_ACCTV2
-
-/* Define if <sys/acct.h> has struct acct_v3. */
-#undef HAVE_ACCT_V3
-
-/* Define if <sys/acct.h> has the AC_ETIME field. */
-#undef HAVE_ACETIME
-
-/* Define if <sys/acct.h> has the AC_IO field. */
-#undef HAVE_ACIO
-
-/* Define to 1 if you have the `acl_free' function. */
-#undef HAVE_ACL_FREE
-
-/* Define to 1 if you have the `acl_get_fd' function. */
-#undef HAVE_ACL_GET_FD
-
-/* Define to 1 if you have the `acl_get_file' function. */
-#undef HAVE_ACL_GET_FILE
-
-/* Define if <sys/acct.h> has the AC_MEM field. */
-#undef HAVE_ACMEM
-
-/* Define if <sys/acct.h> has the AC_STIME field. */
-#undef HAVE_ACSTIME
-
-/* Define if <sys/acct.h> has the AC_UTIME field. */
-#undef HAVE_ACUTIME
-
-/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
-#undef HAVE_ARPA_NAMESER_COMPAT_H
-
-/* Define to 1 if you have the <arpa/nameser.h> header file. */
-#undef HAVE_ARPA_NAMESER_H
-
-/* Define to 1 if you have the <asm/segment.h> header file. */
-#undef HAVE_ASM_SEGMENT_H
-
-/* Define to 1 if you have the <attr/xattr.h> header file. */
-#undef HAVE_ATTR_XATTR_H
-
-/* Define to 1 if you have the <auparse.h> header file. */
-#undef HAVE_AUPARSE_H
-
-/* Define if you have the auparse lib */
-#undef HAVE_AUPARSE_LIB
-
-/* Define to 1 if you have the `basename' function. */
-#undef HAVE_BASENAME
-
-/* Define if you have a broken version of the `vsnprintf' function. */
-#undef HAVE_BROKEN_VSNPRINTF
-
-/* Define to 1 if you have the `compressBound' function. */
-#undef HAVE_COMPRESSBOUND
-
-/* Define if <sys/acct.h> uses the COMP_T type. */
-#undef HAVE_COMP_T
-
-/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SYS_SIGLIST
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_DIRENT_H
-
-/* Define to 1 if you have the <elf.h> header file. */
-#undef HAVE_ELF_H
-
-/* Define to 1 if you have the `endpwent' function. */
-#undef HAVE_ENDPWENT
-
-/* Define to 1 if you have the `explicit_bzero' function. */
-#undef HAVE_EXPLICIT_BZERO
-
-/* Define to 1 if you have the `explicit_memset' function. */
-#undef HAVE_EXPLICIT_MEMSET
-
-/* Define to 1 if you have the <ext2fs/ext2_fs.h> header file. */
-#undef HAVE_EXT2FS_EXT2_FS_H
-
-/* Define to 1 if you have the `fchmod' function. */
-#undef HAVE_FCHMOD
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the `fgetxattr' function. */
-#undef HAVE_FGETXATTR
-
-/* Define to 1 if you have the <fnmatch.h> header file. */
-#undef HAVE_FNMATCH_H
-
-/* Define to 1 if you have the `fpurge' function. */
-#undef HAVE_FPURGE
-
-/* Define to 1 if you have the `getaddrinfo' function. */
-#undef HAVE_GETADDRINFO
-
-/* Define to 1 if you have the `getcwd' function. */
-#undef HAVE_GETCWD
-
-/* Define to 1 if you have the `getgrgid_r' function. */
-#undef HAVE_GETGRGID_R
-
-/* Define to 1 if you have the `gethostbyname' function. */
-#undef HAVE_GETHOSTBYNAME
-
-/* Define to 1 if you have the `gethostname' function. */
-#undef HAVE_GETHOSTNAME
-
-/* Define to 1 if you have the `getnameinfo' function. */
-#undef HAVE_GETNAMEINFO
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getpeereid' function. */
-#undef HAVE_GETPEEREID
-
-/* Define to 1 if you have the `getpgid' function. */
-#undef HAVE_GETPGID
-
-/* Define to 1 if you have the `getpriority' function. */
-#undef HAVE_GETPRIORITY
-
-/* Define to 1 if you have the `getpwent' function. */
-#undef HAVE_GETPWENT
-
-/* Define to 1 if you have the `getpwnam_r' function. */
-#undef HAVE_GETPWNAM_R
-
-/* Define to 1 if you have the `getpwuid_r' function. */
-#undef HAVE_GETPWUID_R
-
-/* Define to 1 if you have the `getsid' function. */
-#undef HAVE_GETSID
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#undef HAVE_GETTIMEOFDAY
-
-/* Define to 1 if you have the `getutxent' function. */
-#undef HAVE_GETUTXENT
-
-/* Define to 1 if you have the `getwd' function. */
-#undef HAVE_GETWD
-
-/* Define to 1 if you have the `getxattr' function. */
-#undef HAVE_GETXATTR
-
-/* Define to 1 if you have the <glob.h> header file. */
-#undef HAVE_GLOB_H
-
-/* Define to 1 if you have the <gmp.h> header file. */
-#undef HAVE_GMP_H
-
-/* Define to 1 if you have the `gmtime_r' function. */
-#undef HAVE_GMTIME_R
-
-/* Define to 1 if you have the `hasmntopt' function. */
-#undef HAVE_HASMNTOPT
-
-/* Define to 1 if you have the <ifaddrs.h> header file. */
-#undef HAVE_IFADDRS_H
-
-/* Define to 1 if you have the `inet_aton' function. */
-#undef HAVE_INET_ATON
-
-/* Define to 1 if you have the `initgroups' function. */
-#undef HAVE_INITGROUPS
-
-/* Define to 1 if you have the `inotify_init1' function. */
-#undef HAVE_INOTIFY_INIT1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `lgetxattr' function. */
-#undef HAVE_LGETXATTR
-
-/* Define to 1 if you have the <libgen.h> header file. */
-#undef HAVE_LIBGEN_H
-
-/* Have GNU gmp library */
-#undef HAVE_LIBGMP
-
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Have libprelude */
-#undef HAVE_LIBPRELUDE
-
-/* Define to 1 if you have the `resolv' library (-lresolv). */
-#undef HAVE_LIBRESOLV
-
-/* Define to 1 if you have the `z' library (-lz). */
-#undef HAVE_LIBZ
-
-/* Define to 1 if you have the <linux/elf.h> header file. */
-#undef HAVE_LINUX_ELF_H
-
-/* Define to 1 if you have the <linux/ext2_fs.h> header file. */
-#undef HAVE_LINUX_EXT2_FS_H
-
-/* Define to 1 if you have the <linux/fs.h> header file. */
-#undef HAVE_LINUX_FS_H
-
-/* Define to 1 if you have the `localtime_r' function. */
-#undef HAVE_LOCALTIME_R
-
-/* Define to 1 if the type `long double' works and has more range or precision
-   than `double'. */
-#undef HAVE_LONG_DOUBLE
-
-/* Define to 1 if the type `long double' works and has more range or precision
-   than `double'. */
-#undef HAVE_LONG_DOUBLE_WIDER
-
-/* Define if type is defined in stdint.h or inttypes.h */
-#undef HAVE_LONG_LONG
-
-/* Define if you have 64bit long long */
-#undef HAVE_LONG_LONG_64
-
-/* Define to 1 if you have the `lstat' function. */
-#undef HAVE_LSTAT
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the `memcmp' function. */
-#undef HAVE_MEMCMP
-
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
-/* Define to 1 if you have the `mincore' function. */
-#undef HAVE_MINCORE
-
-/* Define to 1 if you have the `mlock' function. */
-#undef HAVE_MLOCK
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <mntent.h> header file. */
-#undef HAVE_MNTENT_H
-
-/* Define to 1 if you have the <mysql/mysql.h> header file. */
-#undef HAVE_MYSQL_MYSQL_H
-
-/* Define to 1 if you have the `nanosleep' function. */
-#undef HAVE_NANOSLEEP
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-#undef HAVE_NDIR_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields. */
-#undef HAVE_PAGING
-
-/* Define to 1 if you have the <paths.h> header file. */
-#undef HAVE_PATHS_H
-
-/* Define if you have pcre_dfa_exec */
-#undef HAVE_PCRE_DFA_EXEC
-
-/* Define if you have pcre/pcre.h. */
-#undef HAVE_PCRE_PCRE_H
-
-/* Define to 1 if you have the <pgsql/libpq-fe.h> header file. */
-#undef HAVE_PGSQL_LIBPQ_FE_H
-
-/* Define if pmap_getmaps available */
-#undef HAVE_PMAP_GETMAPS
-
-/* Define to 1 if you have the `posix_fadvise' function. */
-#undef HAVE_POSIX_FADVISE
-
-/* Define to 1 if you have the <postgresql/libpq-fe.h> header file. */
-#undef HAVE_POSTGRESQL_LIBPQ_FE_H
-
-/* Define if you have a proc fs */
-#undef HAVE_PROCFS
-
-/* Define if you have POSIX threads libraries and header files. */
-#undef HAVE_PTHREAD
-
-/* Define if you have recursive mutexes. */
-#undef HAVE_PTHREAD_MUTEX_RECURSIVE
-
-/* Define to 1 if you have the `ptrace' function. */
-#undef HAVE_PTRACE
-
-/* Define to 1 if you have the `rand_r' function. */
-#undef HAVE_RAND_R
-
-/* Define to 1 if you have the `readdir_r' function. */
-#undef HAVE_READDIR_R
-
-/* Define to 1 if you have the <regex.h> header file. */
-#undef HAVE_REGEX_H
-
-/* Define to 1 if you have the <rpc/rpcent.h> header file. */
-#undef HAVE_RPC_RPCENT_H
-
-/* Define to 1 if you have the <rpc/rpc.h> header file. */
-#undef HAVE_RPC_RPC_H
-
-/* Define if you have SA_SIGINFO */
-#undef HAVE_SA_SIGINFO
-
-/* Define to 1 if you have the `scandir' function. */
-#undef HAVE_SCANDIR
-
-/* Define to 1 if you have the <sched.h> header file. */
-#undef HAVE_SCHED_H
-
-/* Define to 1 if you have the `sched_yield' function. */
-#undef HAVE_SCHED_YIELD
-
-/* Define to 1 if you have the `seteuid' function. */
-#undef HAVE_SETEUID
-
-/* Define to 1 if you have the `setpriority' function. */
-#undef HAVE_SETPRIORITY
-
-/* Define to 1 if you have the `setresuid' function. */
-#undef HAVE_SETRESUID
-
-/* Define to 1 if you have the `setreuid' function. */
-#undef HAVE_SETREUID
-
-/* Define to 1 if you have the `setrlimit' function. */
-#undef HAVE_SETRLIMIT
-
-/* Define to 1 if you have the `setutent' function. */
-#undef HAVE_SETUTENT
-
-/* Define if signing binary checksum available. */
-#undef HAVE_SIG_CHECKSUM
-
-/* Define if signing binary checksum available. */
-#undef HAVE_SIG_KEY_HASH
-
-/* Define if you have SI_USER */
-#undef HAVE_SI_USER
-
-/* Define if you have socklen_t */
-#undef HAVE_SOCKLEN_T
-
-/* Have SO_PEERCRED define */
-#undef HAVE_SO_PEERCRED
-
-/* Define to 1 if you have the `statvfs' function. */
-#undef HAVE_STATVFS
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#undef HAVE_STDDEF_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strchr' function. */
-#undef HAVE_STRCHR
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the `strerror_r' function. */
-#undef HAVE_STRERROR_R
-
-/* Define to 1 if you have the `strftime' function. */
-#undef HAVE_STRFTIME
-
-/* strftime supports %z */
-#undef HAVE_STRFTIME_Z
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strlcat' function. */
-#undef HAVE_STRLCAT
-
-/* Define to 1 if you have the `strlcpy' function. */
-#undef HAVE_STRLCPY
-
-/* Define to 1 if you have the `strptime' function. */
-#undef HAVE_STRPTIME
-
-/* Define to 1 if you have the `strsignal' function. */
-#undef HAVE_STRSIGNAL
-
-/* Define to 1 if you have the `strstr' function. */
-#undef HAVE_STRSTR
-
-/* Define to 1 if you have the `strtok_r' function. */
-#undef HAVE_STRTOK_R
-
-/* Have cmsgcred structure */
-#undef HAVE_STRUCT_CMSGCRED
-
-/* Have fcred structure */
-#undef HAVE_STRUCT_FCRED
-
-/* Have sockcred structure */
-#undef HAVE_STRUCT_SOCKCRED
-
-/* Define to 1 if `f_flags' is a member of `struct statfs'. */
-#undef HAVE_STRUCT_STATFS_F_FLAGS
-
-/* Define if you have the <sys/acct.h> header file. */
-#undef HAVE_SYS_ACCT_H
-
-/* Define to 1 if you have the <sys/acl.h> header file. */
-#undef HAVE_SYS_ACL_H
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/inotify.h> header file. */
-#undef HAVE_SYS_INOTIFY_H
-
-/* Define to 1 if you have the <sys/ipc.h> header file. */
-#undef HAVE_SYS_IPC_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/msg.h> header file. */
-#undef HAVE_SYS_MSG_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_NDIR_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/sem.h> header file. */
-#undef HAVE_SYS_SEM_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/statvfs.h> header file. */
-#undef HAVE_SYS_STATVFS_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/sysmacros.h> header file. */
-#undef HAVE_SYS_SYSMACROS_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#undef HAVE_SYS_UIO_H
-
-/* Define to 1 if you have the <sys/vfs.h> header file. */
-#undef HAVE_SYS_VFS_H
-
-/* Define to 1 if you have the `ttyname' function. */
-#undef HAVE_TTYNAME
-
-/* Define to 1 if you have the `tzset' function. */
-#undef HAVE_TZSET
-
-/* Define if type is defined in stdint.h or inttypes.h */
-#undef HAVE_UINT16_T
-
-/* Define if type is defined in stdint.h or inttypes.h */
-#undef HAVE_UINT32_T
-
-/* Define if type is defined in stdint.h or inttypes.h */
-#undef HAVE_UINT64_T
-
-/* Define to 1 if you have the `uname' function. */
-#undef HAVE_UNAME
-
-/* union semun already defined in sys/ipc.h or sys/sem.h */
-#undef HAVE_UNION_SEMUN
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the `usleep' function. */
-#undef HAVE_USLEEP
-
-/* Define to 1 if you have the `vsnprintf' function. */
-#undef HAVE_VSNPRINTF
-
-/* Define to 1 if you have the `writev' function. */
-#undef HAVE_WRITEV
-
-/* Define if host OS is 64bit Linux */
-#undef HOST_IS_64LINUX
-
-/* Define if host OS is OPENBSD */
-#undef HOST_IS_OPENBSD
-
-/* Define if host OS is OSF */
-#undef HOST_IS_OSF
-
-/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
-   */
-#undef MAJOR_IN_MKDEV
-
-/* Define to 1 if `major', `minor', and `makedev' are declared in
-   <sysmacros.h>. */
-#undef MAJOR_IN_SYSMACROS
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Paranoia level for dnmalloc */
-#undef PARANOIA
-
-/* Argument for ps */
-#undef PSARG
-
-/* Path to ps */
-#undef PSPATH
-
-/* Define to necessary symbol if this constant uses a non-standard name on
-   your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Application is samhain */
-#undef SAMHAIN
-
-/* Define if sa_sigaction works */
-#undef SA_SIGACTION_WORKS
-
-/* Use abort */
-#undef SH_ABORT_ON_ERROR
-
-/* Define if you want to allow suid execution for samhain */
-#undef SH_ALLOW_SUID
-
-/* Define if compiling static */
-#undef SH_COMPILE_STATIC
-
-/* Define if you want shell expansion in configuration file */
-#undef SH_EVAL_SHELL
-
-/* Build with tcp wrapper support */
-#undef SH_USE_LIBWRAP
-
-/* Define if you want to check ports */
-#undef SH_USE_PORTCHECK
-
-/* Define if you want to check processes */
-#undef SH_USE_PROCESSCHECK
-
-/* Define as the signing binary TIGER192 checksum. */
-#undef SIG_HASH
-
-/* Define as the signify public key checksum. */
-#undef SIG_KEY_HASH
-
-/* The size of `char *', as computed by sizeof. */
-#undef SIZEOF_CHAR_P
-
-/* The size of `size_t', as computed by sizeof. */
-#undef SIZEOF_SIZE_T
-
-/* The size of `unsigned int', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_INT
-
-/* The size of `unsigned long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG
-
-/* The size of `unsigned long long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG_LONG
-
-/* The size of `unsigned short', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_SHORT
-
-/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-#undef STAT_MACROS_BROKEN
-
-/* Define to 1 if all of the C90 standard headers exist (not just the ones
-   required in a freestanding environment). This macro is provided for
-   backward compatibility; new code need not use it. */
-#undef STDC_HEADERS
-
-/* Define to use tiger 32 bit i386 assembler */
-#undef TIGER_32_BIT_S
-
-/* Define to use tiger 64 bit implementation */
-#undef TIGER_64_BIT
-
-/* Define to use tiger x86_64 optimized assembly */
-#undef TIGER_OPT_ASM
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
-   macro is obsolete. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#undef TM_IN_SYS_TIME
-
-/* Define if you want ACL support. */
-#undef USE_ACL
-
-/* Define if you do not want IPv6 */
-#undef USE_IPV4
-
-/* Define if you want the logfile monitor module. */
-#undef USE_LOGFILE_MONITOR
-
-/* Define for registry check */
-#undef USE_REGISTRY_CHECK
-
-/* Define if you want to use the system malloc */
-#undef USE_SYSTEM_MALLOC
-
-/* Define if you want extended attributes support. */
-#undef USE_XATTR
-
-/* Define if signature checking is supported. */
-#undef WITH_SIG
-
-/* Define if using OpenBSD signify for signature checking. */
-#undef WITH_SIGNIFY
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define if POSIX functions are required */
-#undef _POSIX_SOURCE
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-/* Define to `long' if <sys/types.h> does not define. */
-#undef ptrdiff_t
-
-/* Define to the equivalent of the C99 'restrict' keyword, or to
-   nothing if this is not supported.  Do not define if restrict is
-   supported only directly.  */
-#undef restrict
-/* Work around a bug in older versions of Sun C++, which did not
-   #define __restrict__ or support _Restrict or __restrict__
-   even though the corresponding Sun C compiler ended up with
-   "#define restrict _Restrict" or "#define restrict __restrict__"
-   in the previous line.  This workaround can be removed once
-   we assume Oracle Developer Studio 12.5 (2016) or later.  */
-#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
-# define _Restrict
-# define __restrict__
-#endif
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* dont modify this, unless you know what you do
- */
-#define SRP_GENERATOR_1024      "2"
-#define SRP_MODULUS_1024_1        \
-_("f488fd584e49dbcd20b49de49107366b336c380d451d0f7c88b31c7c5b2d8ef6") 
-#define SRP_MODULUS_1024_2        \
-_("f3c923c043f0a55b188d8ebb558cb85d38d334fd7c175743a31d186cde33212c") 
-#define SRP_MODULUS_1024_3        \
-_("b52aff3ce1b1294018118d7c84a70a72d686c40319c807297aca950cd9969fab")
-#define SRP_MODULUS_1024_4        \
-_("d00a509b0246d3083d66a45d419f9c7cbd894b221926baaba25ec355e92f78c7")
-
-#define SDG_0RETU _("return.\n")
-#define SDG_TERRO _("ERROR: file=<%s>, line=<%d>, reason=<%s>\n")
-#define SDG_AERRO _("ERROR: file=<%s>, line=<%d>, failed_assertion=<%s>\n")
-#define SDG_AFAIL _("FAILED: file=<%s>, line=<%d>, assertion=<%s>\n")
-#define SDG_ENTER _("enter=<%s>\n")
-#define SDG_RETUR _("return=<%s>.\n")
-#define SDG_ERROR _("error=<%ld>.\n")
-
-#ifdef SH_STEALTH
-char * globber(const char * string);
-#define _(string) globber(string) 
-#define N_(string) string
-#else
-#define _(string)  string 
-#define N_(string) string
-#endif
-
-#endif
Index: /trunk/config.sub
===================================================================
--- /trunk/config.sub	(revision 582)
+++ /trunk/config.sub	(revision 583)
@@ -1,11 +1,13 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2018 Free Software Foundation, Inc.
-
-timestamp='2018-02-22'
+#   Copyright 1992-2022 Free Software Foundation, Inc.
+
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2022-01-03'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
@@ -34,5 +36,5 @@
 
 # You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
 
 # This file is supposed to be the same for all GNU packages
@@ -51,4 +53,11 @@
 # It is wrong to echo any other type of specification.
 
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX.  However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -68,5 +77,5 @@
 GNU config.sub ($timestamp)
 
-Copyright 1992-2018 Free Software Foundation, Inc.
+Copyright 1992-2022 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -90,5 +99,5 @@
        break ;;
     -* )
-       echo "$me: invalid option $1$help"
+       echo "$me: invalid option $1$help" >&2
        exit 1 ;;
 
@@ -111,1425 +120,1400 @@
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | cloudabi*-eabi* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
-    if [ "$basic_machine" != "$1" ]
-    then os=`echo "$1" | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
+# Split fields of configuration type
+# shellcheck disable=SC2162
+saved_IFS=$IFS
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
+IFS=$saved_IFS
+
+# Separate into logical components for further validation
+case $1 in
+	*-*-*-*-*)
+		echo Invalid configuration \`"$1"\': more than four components >&2
+		exit 1
+		;;
+	*-*-*-*)
+		basic_machine=$field1-$field2
+		basic_os=$field3-$field4
+		;;
+	*-*-*)
+		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+		# parts
+		maybe_os=$field2-$field3
+		case $maybe_os in
+			nto-qnx* | linux-* | uclinux-uclibc* \
+			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+			| storm-chaos* | os2-emx* | rtmk-nova*)
+				basic_machine=$field1
+				basic_os=$maybe_os
+				;;
+			android-linux)
+				basic_machine=$field1-unknown
+				basic_os=linux-android
+				;;
+			*)
+				basic_machine=$field1-$field2
+				basic_os=$field3
+				;;
+		esac
+		;;
+	*-*)
+		# A lone config we happen to match not fitting any pattern
+		case $field1-$field2 in
+			decstation-3100)
+				basic_machine=mips-dec
+				basic_os=
+				;;
+			*-*)
+				# Second component is usually, but not always the OS
+				case $field2 in
+					# Prevent following clause from handling this valid os
+					sun*os*)
+						basic_machine=$field1
+						basic_os=$field2
+						;;
+					zephyr*)
+						basic_machine=$field1-unknown
+						basic_os=$field2
+						;;
+					# Manufacturers
+					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
+					| convergent* | ncr* | news | 32* | 3600* | 3100* \
+					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+					| ultra | tti* | harris | dolphin | highlevel | gould \
+					| cbm | ns | masscomp | apple | axis | knuth | cray \
+					| microblaze* | sim | cisco \
+					| oki | wec | wrs | winbond)
+						basic_machine=$field1-$field2
+						basic_os=
+						;;
+					*)
+						basic_machine=$field1
+						basic_os=$field2
+						;;
+				esac
+			;;
+		esac
+		;;
+	*)
+		# Convert single-component short-hands not valid as part of
+		# multi-component configurations.
+		case $field1 in
+			386bsd)
+				basic_machine=i386-pc
+				basic_os=bsd
+				;;
+			a29khif)
+				basic_machine=a29k-amd
+				basic_os=udi
+				;;
+			adobe68k)
+				basic_machine=m68010-adobe
+				basic_os=scout
+				;;
+			alliant)
+				basic_machine=fx80-alliant
+				basic_os=
+				;;
+			altos | altos3068)
+				basic_machine=m68k-altos
+				basic_os=
+				;;
+			am29k)
+				basic_machine=a29k-none
+				basic_os=bsd
+				;;
+			amdahl)
+				basic_machine=580-amdahl
+				basic_os=sysv
+				;;
+			amiga)
+				basic_machine=m68k-unknown
+				basic_os=
+				;;
+			amigaos | amigados)
+				basic_machine=m68k-unknown
+				basic_os=amigaos
+				;;
+			amigaunix | amix)
+				basic_machine=m68k-unknown
+				basic_os=sysv4
+				;;
+			apollo68)
+				basic_machine=m68k-apollo
+				basic_os=sysv
+				;;
+			apollo68bsd)
+				basic_machine=m68k-apollo
+				basic_os=bsd
+				;;
+			aros)
+				basic_machine=i386-pc
+				basic_os=aros
+				;;
+			aux)
+				basic_machine=m68k-apple
+				basic_os=aux
+				;;
+			balance)
+				basic_machine=ns32k-sequent
+				basic_os=dynix
+				;;
+			blackfin)
+				basic_machine=bfin-unknown
+				basic_os=linux
+				;;
+			cegcc)
+				basic_machine=arm-unknown
+				basic_os=cegcc
+				;;
+			convex-c1)
+				basic_machine=c1-convex
+				basic_os=bsd
+				;;
+			convex-c2)
+				basic_machine=c2-convex
+				basic_os=bsd
+				;;
+			convex-c32)
+				basic_machine=c32-convex
+				basic_os=bsd
+				;;
+			convex-c34)
+				basic_machine=c34-convex
+				basic_os=bsd
+				;;
+			convex-c38)
+				basic_machine=c38-convex
+				basic_os=bsd
+				;;
+			cray)
+				basic_machine=j90-cray
+				basic_os=unicos
+				;;
+			crds | unos)
+				basic_machine=m68k-crds
+				basic_os=
+				;;
+			da30)
+				basic_machine=m68k-da30
+				basic_os=
+				;;
+			decstation | pmax | pmin | dec3100 | decstatn)
+				basic_machine=mips-dec
+				basic_os=
+				;;
+			delta88)
+				basic_machine=m88k-motorola
+				basic_os=sysv3
+				;;
+			dicos)
+				basic_machine=i686-pc
+				basic_os=dicos
+				;;
+			djgpp)
+				basic_machine=i586-pc
+				basic_os=msdosdjgpp
+				;;
+			ebmon29k)
+				basic_machine=a29k-amd
+				basic_os=ebmon
+				;;
+			es1800 | OSE68k | ose68k | ose | OSE)
+				basic_machine=m68k-ericsson
+				basic_os=ose
+				;;
+			gmicro)
+				basic_machine=tron-gmicro
+				basic_os=sysv
+				;;
+			go32)
+				basic_machine=i386-pc
+				basic_os=go32
+				;;
+			h8300hms)
+				basic_machine=h8300-hitachi
+				basic_os=hms
+				;;
+			h8300xray)
+				basic_machine=h8300-hitachi
+				basic_os=xray
+				;;
+			h8500hms)
+				basic_machine=h8500-hitachi
+				basic_os=hms
+				;;
+			harris)
+				basic_machine=m88k-harris
+				basic_os=sysv3
+				;;
+			hp300 | hp300hpux)
+				basic_machine=m68k-hp
+				basic_os=hpux
+				;;
+			hp300bsd)
+				basic_machine=m68k-hp
+				basic_os=bsd
+				;;
+			hppaosf)
+				basic_machine=hppa1.1-hp
+				basic_os=osf
+				;;
+			hppro)
+				basic_machine=hppa1.1-hp
+				basic_os=proelf
+				;;
+			i386mach)
+				basic_machine=i386-mach
+				basic_os=mach
+				;;
+			isi68 | isi)
+				basic_machine=m68k-isi
+				basic_os=sysv
+				;;
+			m68knommu)
+				basic_machine=m68k-unknown
+				basic_os=linux
+				;;
+			magnum | m3230)
+				basic_machine=mips-mips
+				basic_os=sysv
+				;;
+			merlin)
+				basic_machine=ns32k-utek
+				basic_os=sysv
+				;;
+			mingw64)
+				basic_machine=x86_64-pc
+				basic_os=mingw64
+				;;
+			mingw32)
+				basic_machine=i686-pc
+				basic_os=mingw32
+				;;
+			mingw32ce)
+				basic_machine=arm-unknown
+				basic_os=mingw32ce
+				;;
+			monitor)
+				basic_machine=m68k-rom68k
+				basic_os=coff
+				;;
+			morphos)
+				basic_machine=powerpc-unknown
+				basic_os=morphos
+				;;
+			moxiebox)
+				basic_machine=moxie-unknown
+				basic_os=moxiebox
+				;;
+			msdos)
+				basic_machine=i386-pc
+				basic_os=msdos
+				;;
+			msys)
+				basic_machine=i686-pc
+				basic_os=msys
+				;;
+			mvs)
+				basic_machine=i370-ibm
+				basic_os=mvs
+				;;
+			nacl)
+				basic_machine=le32-unknown
+				basic_os=nacl
+				;;
+			ncr3000)
+				basic_machine=i486-ncr
+				basic_os=sysv4
+				;;
+			netbsd386)
+				basic_machine=i386-pc
+				basic_os=netbsd
+				;;
+			netwinder)
+				basic_machine=armv4l-rebel
+				basic_os=linux
+				;;
+			news | news700 | news800 | news900)
+				basic_machine=m68k-sony
+				basic_os=newsos
+				;;
+			news1000)
+				basic_machine=m68030-sony
+				basic_os=newsos
+				;;
+			necv70)
+				basic_machine=v70-nec
+				basic_os=sysv
+				;;
+			nh3000)
+				basic_machine=m68k-harris
+				basic_os=cxux
+				;;
+			nh[45]000)
+				basic_machine=m88k-harris
+				basic_os=cxux
+				;;
+			nindy960)
+				basic_machine=i960-intel
+				basic_os=nindy
+				;;
+			mon960)
+				basic_machine=i960-intel
+				basic_os=mon960
+				;;
+			nonstopux)
+				basic_machine=mips-compaq
+				basic_os=nonstopux
+				;;
+			os400)
+				basic_machine=powerpc-ibm
+				basic_os=os400
+				;;
+			OSE68000 | ose68000)
+				basic_machine=m68000-ericsson
+				basic_os=ose
+				;;
+			os68k)
+				basic_machine=m68k-none
+				basic_os=os68k
+				;;
+			paragon)
+				basic_machine=i860-intel
+				basic_os=osf
+				;;
+			parisc)
+				basic_machine=hppa-unknown
+				basic_os=linux
+				;;
+			psp)
+				basic_machine=mipsallegrexel-sony
+				basic_os=psp
+				;;
+			pw32)
+				basic_machine=i586-unknown
+				basic_os=pw32
+				;;
+			rdos | rdos64)
+				basic_machine=x86_64-pc
+				basic_os=rdos
+				;;
+			rdos32)
+				basic_machine=i386-pc
+				basic_os=rdos
+				;;
+			rom68k)
+				basic_machine=m68k-rom68k
+				basic_os=coff
+				;;
+			sa29200)
+				basic_machine=a29k-amd
+				basic_os=udi
+				;;
+			sei)
+				basic_machine=mips-sei
+				basic_os=seiux
+				;;
+			sequent)
+				basic_machine=i386-sequent
+				basic_os=
+				;;
+			sps7)
+				basic_machine=m68k-bull
+				basic_os=sysv2
+				;;
+			st2000)
+				basic_machine=m68k-tandem
+				basic_os=
+				;;
+			stratus)
+				basic_machine=i860-stratus
+				basic_os=sysv4
+				;;
+			sun2)
+				basic_machine=m68000-sun
+				basic_os=
+				;;
+			sun2os3)
+				basic_machine=m68000-sun
+				basic_os=sunos3
+				;;
+			sun2os4)
+				basic_machine=m68000-sun
+				basic_os=sunos4
+				;;
+			sun3)
+				basic_machine=m68k-sun
+				basic_os=
+				;;
+			sun3os3)
+				basic_machine=m68k-sun
+				basic_os=sunos3
+				;;
+			sun3os4)
+				basic_machine=m68k-sun
+				basic_os=sunos4
+				;;
+			sun4)
+				basic_machine=sparc-sun
+				basic_os=
+				;;
+			sun4os3)
+				basic_machine=sparc-sun
+				basic_os=sunos3
+				;;
+			sun4os4)
+				basic_machine=sparc-sun
+				basic_os=sunos4
+				;;
+			sun4sol2)
+				basic_machine=sparc-sun
+				basic_os=solaris2
+				;;
+			sun386 | sun386i | roadrunner)
+				basic_machine=i386-sun
+				basic_os=
+				;;
+			sv1)
+				basic_machine=sv1-cray
+				basic_os=unicos
+				;;
+			symmetry)
+				basic_machine=i386-sequent
+				basic_os=dynix
+				;;
+			t3e)
+				basic_machine=alphaev5-cray
+				basic_os=unicos
+				;;
+			t90)
+				basic_machine=t90-cray
+				basic_os=unicos
+				;;
+			toad1)
+				basic_machine=pdp10-xkl
+				basic_os=tops20
+				;;
+			tpf)
+				basic_machine=s390x-ibm
+				basic_os=tpf
+				;;
+			udi29k)
+				basic_machine=a29k-amd
+				basic_os=udi
+				;;
+			ultra3)
+				basic_machine=a29k-nyu
+				basic_os=sym1
+				;;
+			v810 | necv810)
+				basic_machine=v810-nec
+				basic_os=none
+				;;
+			vaxv)
+				basic_machine=vax-dec
+				basic_os=sysv
+				;;
+			vms)
+				basic_machine=vax-dec
+				basic_os=vms
+				;;
+			vsta)
+				basic_machine=i386-pc
+				basic_os=vsta
+				;;
+			vxworks960)
+				basic_machine=i960-wrs
+				basic_os=vxworks
+				;;
+			vxworks68)
+				basic_machine=m68k-wrs
+				basic_os=vxworks
+				;;
+			vxworks29k)
+				basic_machine=a29k-wrs
+				basic_os=vxworks
+				;;
+			xbox)
+				basic_machine=i686-pc
+				basic_os=mingw32
+				;;
+			ymp)
+				basic_machine=ymp-cray
+				basic_os=unicos
+				;;
+			*)
+				basic_machine=$1
+				basic_os=
+				;;
+		esac
+		;;
 esac
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	-sun*os*)
-		# Prevent following clause from handling this invalid input.
-		;;
-	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze*)
-		os=
-		basic_machine=$1
-		;;
-	-bluegene*)
-		os=-cnk
-		;;
-	-sim | -cisco | -oki | -wec | -winbond)
-		os=
-		basic_machine=$1
-		;;
-	-scout)
-		;;
-	-wrs)
-		os=-vxworks
-		basic_machine=$1
-		;;
-	-chorusos*)
-		os=-chorusos
-		basic_machine=$1
-		;;
-	-chorusrdb)
-		os=-chorusrdb
-		basic_machine=$1
-		;;
-	-hiux*)
-		os=-hiuxwe2
-		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5)
-		os=-sco3.2v5
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco4)
-		os=-sco3.2v4
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco*)
-		os=-sco3.2v2
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-udk*)
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-isc)
-		os=-isc2.2
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-clix*)
-		basic_machine=clipper-intergraph
-		;;
-	-isc*)
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	-lynx*178)
-		os=-lynxos178
-		;;
-	-lynx*5)
-		os=-lynxos5
-		;;
-	-lynx*)
-		os=-lynxos
-		;;
-	-ptx*)
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
-		;;
-	-psos*)
-		os=-psos
-		;;
-	-mint | -mint[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-	# Recognize the basic CPU types without company name.
-	# Some are omitted here because they have special meanings below.
-	1750a | 580 \
-	| a29k \
-	| aarch64 | aarch64_be \
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arceb \
-	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-	| avr | avr32 \
-	| ba \
-	| be32 | be64 \
-	| bfin \
-	| c4x | c8051 | clipper \
-	| d10v | d30v | dlx | dsp16xx \
-	| e2k | epiphany \
-	| fido | fr30 | frv | ft32 \
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| hexagon \
-	| i370 | i860 | i960 | ia16 | ia64 \
-	| ip2k | iq2000 \
-	| k1om \
-	| le32 | le64 \
-	| lm32 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-	| mips | mipsbe | mipseb | mipsel | mipsle \
-	| mips16 \
-	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
-	| mips64vr | mips64vrel \
-	| mips64vr4100 | mips64vr4100el \
-	| mips64vr4300 | mips64vr4300el \
-	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
-	| mipsisa32 | mipsisa32el \
-	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa32r6 | mipsisa32r6el \
-	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64r6 | mipsisa64r6el \
-	| mipsisa64sb1 | mipsisa64sb1el \
-	| mipsisa64sr71k | mipsisa64sr71kel \
-	| mipsr5900 | mipsr5900el \
-	| mipstx39 | mipstx39el \
-	| mn10200 | mn10300 \
-	| moxie \
-	| mt \
-	| msp430 \
-	| nds32 | nds32le | nds32be \
-	| nios | nios2 | nios2eb | nios2el \
-	| ns16k | ns32k \
-	| open8 | or1k | or1knd | or32 \
-	| pdp10 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
-	| pru \
-	| pyramid \
-	| riscv32 | riscv64 \
-	| rl78 | rx \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu \
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-	| ubicom32 \
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-	| visium \
-	| wasm32 \
-	| x86 | xc16x | xstormy16 | xtensa \
-	| z8k | z80)
-		basic_machine=$basic_machine-unknown
-		;;
-	c54x)
-		basic_machine=tic54x-unknown
-		;;
-	c55x)
-		basic_machine=tic55x-unknown
-		;;
-	c6x)
-		basic_machine=tic6x-unknown
+	# Here we handle the default manufacturer of certain CPU types.  It is in
+	# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		cpu=hppa1.1
+		vendor=winbond
+		;;
+	op50n)
+		cpu=hppa1.1
+		vendor=oki
+		;;
+	op60c)
+		cpu=hppa1.1
+		vendor=oki
+		;;
+	ibm*)
+		cpu=i370
+		vendor=ibm
+		;;
+	orion105)
+		cpu=clipper
+		vendor=highlevel
+		;;
+	mac | mpw | mac-mpw)
+		cpu=m68k
+		vendor=apple
+		;;
+	pmac | pmac-mpw)
+		cpu=powerpc
+		vendor=apple
+		;;
+
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		cpu=m68000
+		vendor=att
+		;;
+	3b*)
+		cpu=we32k
+		vendor=att
+		;;
+	bluegene*)
+		cpu=powerpc
+		vendor=ibm
+		basic_os=cnk
+		;;
+	decsystem10* | dec10*)
+		cpu=pdp10
+		vendor=dec
+		basic_os=tops10
+		;;
+	decsystem20* | dec20*)
+		cpu=pdp10
+		vendor=dec
+		basic_os=tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		cpu=m68k
+		vendor=motorola
+		;;
+	dpx2*)
+		cpu=m68k
+		vendor=bull
+		basic_os=sysv3
+		;;
+	encore | umax | mmax)
+		cpu=ns32k
+		vendor=encore
+		;;
+	elxsi)
+		cpu=elxsi
+		vendor=elxsi
+		basic_os=${basic_os:-bsd}
+		;;
+	fx2800)
+		cpu=i860
+		vendor=alliant
+		;;
+	genix)
+		cpu=ns32k
+		vendor=ns
+		;;
+	h3050r* | hiux*)
+		cpu=hppa1.1
+		vendor=hitachi
+		basic_os=hiuxwe2
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		cpu=hppa1.0
+		vendor=hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		cpu=m68000
+		vendor=hp
+		;;
+	hp9k3[2-9][0-9])
+		cpu=m68k
+		vendor=hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		cpu=hppa1.0
+		vendor=hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		cpu=hppa1.1
+		vendor=hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		cpu=hppa1.1
+		vendor=hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		cpu=hppa1.1
+		vendor=hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		cpu=hppa1.1
+		vendor=hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		cpu=hppa1.0
+		vendor=hp
+		;;
+	i*86v32)
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		basic_os=sysv32
+		;;
+	i*86v4*)
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		basic_os=sysv4
+		;;
+	i*86v)
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		basic_os=sysv
+		;;
+	i*86sol2)
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		basic_os=solaris2
+		;;
+	j90 | j90-cray)
+		cpu=j90
+		vendor=cray
+		basic_os=${basic_os:-unicos}
+		;;
+	iris | iris4d)
+		cpu=mips
+		vendor=sgi
+		case $basic_os in
+		    irix*)
+			;;
+		    *)
+			basic_os=irix4
+			;;
+		esac
+		;;
+	miniframe)
+		cpu=m68000
+		vendor=convergent
+		;;
+	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		cpu=m68k
+		vendor=atari
+		basic_os=mint
+		;;
+	news-3600 | risc-news)
+		cpu=mips
+		vendor=sony
+		basic_os=newsos
+		;;
+	next | m*-next)
+		cpu=m68k
+		vendor=next
+		case $basic_os in
+		    openstep*)
+		        ;;
+		    nextstep*)
+			;;
+		    ns2*)
+		      basic_os=nextstep2
+			;;
+		    *)
+		      basic_os=nextstep3
+			;;
+		esac
+		;;
+	np1)
+		cpu=np1
+		vendor=gould
+		;;
+	op50n-* | op60c-*)
+		cpu=hppa1.1
+		vendor=oki
+		basic_os=proelf
+		;;
+	pa-hitachi)
+		cpu=hppa1.1
+		vendor=hitachi
+		basic_os=hiuxwe2
+		;;
+	pbd)
+		cpu=sparc
+		vendor=tti
+		;;
+	pbb)
+		cpu=m68k
+		vendor=tti
+		;;
+	pc532)
+		cpu=ns32k
+		vendor=pc532
+		;;
+	pn)
+		cpu=pn
+		vendor=gould
+		;;
+	power)
+		cpu=power
+		vendor=ibm
+		;;
+	ps2)
+		cpu=i386
+		vendor=ibm
+		;;
+	rm[46]00)
+		cpu=mips
+		vendor=siemens
+		;;
+	rtpc | rtpc-*)
+		cpu=romp
+		vendor=ibm
+		;;
+	sde)
+		cpu=mipsisa32
+		vendor=sde
+		basic_os=${basic_os:-elf}
+		;;
+	simso-wrs)
+		cpu=sparclite
+		vendor=wrs
+		basic_os=vxworks
+		;;
+	tower | tower-32)
+		cpu=m68k
+		vendor=ncr
+		;;
+	vpp*|vx|vx-*)
+		cpu=f301
+		vendor=fujitsu
+		;;
+	w65)
+		cpu=w65
+		vendor=wdc
+		;;
+	w89k-*)
+		cpu=hppa1.1
+		vendor=winbond
+		basic_os=proelf
+		;;
+	none)
+		cpu=none
+		vendor=none
 		;;
 	leon|leon[3-9])
-		basic_machine=sparc-$basic_machine
-		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
-		;;
-	ms1)
-		basic_machine=mt-unknown
-		;;
-
-	strongarm | thumb | xscale)
-		basic_machine=arm-unknown
-		;;
-	xgate)
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	xscaleeb)
-		basic_machine=armeb-unknown
-		;;
-
-	xscaleel)
-		basic_machine=armel-unknown
-		;;
-
+		cpu=sparc
+		vendor=$basic_machine
+		;;
+	leon-*|leon[3-9]-*)
+		cpu=sparc
+		vendor=`echo "$basic_machine" | sed 's/-.*//'`
+		;;
+
+	*-*)
+		# shellcheck disable=SC2162
+		saved_IFS=$IFS
+		IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
+		IFS=$saved_IFS
+		;;
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
 	i*86 | x86_64)
-	  basic_machine=$basic_machine-pc
-	  ;;
-	# Object if more than one company name word.
-	*-*-*)
-		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
-		exit 1
-		;;
-	# Recognize the basic CPU types with company name.
-	580-* \
-	| a29k-* \
-	| aarch64-* | aarch64_be-* \
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| ba-* \
-	| be32-* | be64-* \
-	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| c8051-* | clipper-* | craynv-* | cydra-* \
-	| d10v-* | d30v-* | dlx-* \
-	| e2k-* | elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-	| h8300-* | h8500-* \
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| hexagon-* \
-	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| k1om-* \
-	| le32-* | le64-* \
-	| lm32-* \
-	| m32c-* | m32r-* | m32rle-* \
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-	| microblaze-* | microblazeel-* \
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-	| mips16-* \
-	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
-	| mips64vr-* | mips64vrel-* \
-	| mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* \
-	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
-	| mipsisa32-* | mipsisa32el-* \
-	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa32r6-* | mipsisa32r6el-* \
-	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64r6-* | mipsisa64r6el-* \
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
-	| mipsr5900-* | mipsr5900el-* \
-	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
-	| msp430-* \
-	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* | nios2eb-* | nios2el-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
-	| open8-* \
-	| or1k*-* \
-	| orion-* \
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-	| pru-* \
-	| pyramid-* \
-	| riscv32-* | riscv64-* \
-	| rl78-* | romp-* | rs6000-* | rx-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
-	| tahoe-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile*-* \
-	| tron-* \
-	| ubicom32-* \
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-	| vax-* \
-	| visium-* \
-	| wasm32-* \
-	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
-	| xstormy16-* | xtensa*-* \
-	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
-		;;
-	# Recognize the various machine names and aliases which stand
-	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-pc
-		os=-bsd
-		;;
-	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		basic_machine=m68000-att
-		;;
-	3b*)
-		basic_machine=we32k-att
-		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	abacus)
-		basic_machine=abacus-unknown
-		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=-scout
-		;;
-	alliant | fx80)
-		basic_machine=fx80-alliant
-		;;
-	altos | altos3068)
-		basic_machine=m68k-altos
-		;;
-	am29k)
-		basic_machine=a29k-none
-		os=-bsd
-		;;
-	amd64)
-		basic_machine=x86_64-pc
-		;;
+		cpu=$basic_machine
+		vendor=pc
+		;;
+	# These rules are duplicated from below for sake of the special case above;
+	# i.e. things that normalized to x86 arches should also default to "pc"
+	pc98)
+		cpu=i386
+		vendor=pc
+		;;
+	x64 | amd64)
+		cpu=x86_64
+		vendor=pc
+		;;
+	# Recognize the basic CPU types without company name.
+	*)
+		cpu=$basic_machine
+		vendor=unknown
+		;;
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+	# some cases the only manufacturer, in others, it is the most popular.
+	craynv-unknown)
+		vendor=cray
+		basic_os=${basic_os:-unicosmp}
+		;;
+	c90-unknown | c90-cray)
+		vendor=cray
+		basic_os=${Basic_os:-unicos}
+		;;
+	fx80-unknown)
+		vendor=alliant
+		;;
+	romp-unknown)
+		vendor=ibm
+		;;
+	mmix-unknown)
+		vendor=knuth
+		;;
+	microblaze-unknown | microblazeel-unknown)
+		vendor=xilinx
+		;;
+	rs6000-unknown)
+		vendor=ibm
+		;;
+	vax-unknown)
+		vendor=dec
+		;;
+	pdp11-unknown)
+		vendor=dec
+		;;
+	we32k-unknown)
+		vendor=att
+		;;
+	cydra-unknown)
+		vendor=cydrome
+		;;
+	i370-ibm*)
+		vendor=ibm
+		;;
+	orion-unknown)
+		vendor=highlevel
+		;;
+	xps-unknown | xps100-unknown)
+		cpu=xps100
+		vendor=honeywell
+		;;
+
+	# Here we normalize CPU types with a missing or matching vendor
+	armh-unknown | armh-alt)
+		cpu=armv7l
+		vendor=alt
+		basic_os=${basic_os:-linux-gnueabihf}
+		;;
+	dpx20-unknown | dpx20-bull)
+		cpu=rs6000
+		vendor=bull
+		basic_os=${basic_os:-bosx}
+		;;
+
+	# Here we normalize CPU types irrespective of the vendor
 	amd64-*)
-		basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=-sysv
-		;;
-	amiga | amiga-*)
-		basic_machine=m68k-unknown
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=-amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=-sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=-sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=-bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=-aros
-		;;
-	asmjs)
-		basic_machine=asmjs-unknown
-		;;
-	aux)
-		basic_machine=m68k-apple
-		os=-aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=-dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
+		cpu=x86_64
 		;;
 	blackfin-*)
-		basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	bluegene*)
-		basic_machine=powerpc-ibm
-		os=-cnk
+		cpu=bfin
+		basic_os=linux
 		;;
 	c54x-*)
-		basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+		cpu=tic54x
 		;;
 	c55x-*)
-		basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+		cpu=tic55x
 		;;
 	c6x-*)
-		basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	c90)
-		basic_machine=c90-cray
-		os=-unicos
-		;;
-	cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
-	convex-c1)
-		basic_machine=c1-convex
-		os=-bsd
-		;;
-	convex-c2)
-		basic_machine=c2-convex
-		os=-bsd
-		;;
-	convex-c32)
-		basic_machine=c32-convex
-		os=-bsd
-		;;
-	convex-c34)
-		basic_machine=c34-convex
-		os=-bsd
-		;;
-	convex-c38)
-		basic_machine=c38-convex
-		os=-bsd
-		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=-unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16 | cr16-*)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
-	crds | unos)
-		basic_machine=m68k-crds
-		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
-	cris | cris-* | etrax*)
-		basic_machine=cris-axis
-		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
-	da30 | da30-*)
-		basic_machine=m68k-da30
-		;;
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-		basic_machine=mips-dec
-		;;
-	decsystem10* | dec10*)
-		basic_machine=pdp10-dec
-		os=-tops10
-		;;
-	decsystem20* | dec20*)
-		basic_machine=pdp10-dec
-		os=-tops20
-		;;
-	delta | 3300 | motorola-3300 | motorola-delta \
-	      | 3300-motorola | delta-motorola)
-		basic_machine=m68k-motorola
-		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=-sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
-	dpx20 | dpx20-*)
-		basic_machine=rs6000-bull
-		os=-bosx
-		;;
-	dpx2*)
-		basic_machine=m68k-bull
-		os=-sysv3
-		;;
-	e500v[12])
-		basic_machine=powerpc-unknown
-		os=$os"spe"
+		cpu=tic6x
 		;;
 	e500v[12]-*)
-		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		os=$os"spe"
-		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=-ebmon
-		;;
-	elxsi)
-		basic_machine=elxsi-elxsi
-		os=-bsd
-		;;
-	encore | umax | mmax)
-		basic_machine=ns32k-encore
-		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=-ose
-		;;
-	fx2800)
-		basic_machine=i860-alliant
-		;;
-	genix)
-		basic_machine=ns32k-ns
-		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=-sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=-go32
-		;;
-	h3050r* | hiux*)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=-hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=-xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=-hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=-sysv3
-		;;
-	hp300-*)
-		basic_machine=m68k-hp
-		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=-bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=-hpux
-		;;
-	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k2[0-9][0-9] | hp9k31[0-9])
-		basic_machine=m68000-hp
-		;;
-	hp9k3[2-9][0-9])
-		basic_machine=m68k-hp
-		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k78[0-9] | hp78[0-9])
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=-osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=-proelf
-		;;
-	i370-ibm* | ibm*)
-		basic_machine=i370-ibm
-		;;
-	i*86v32)
-		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
-		os=-sysv32
-		;;
-	i*86v4*)
-		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
-		os=-sysv4
-		;;
-	i*86v)
-		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
-		os=-sysv
-		;;
-	i*86sol2)
-		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
-		os=-solaris2
-		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=-mach
-		;;
-	vsta)
-		basic_machine=i386-unknown
-		os=-vsta
-		;;
-	iris | iris4d)
-		basic_machine=mips-sgi
-		case $os in
-		    -irix*)
-			;;
-		    *)
-			os=-irix4
-			;;
+		cpu=powerpc
+		basic_os=${basic_os}"spe"
+		;;
+	mips3*-*)
+		cpu=mips64
+		;;
+	ms1-*)
+		cpu=mt
+		;;
+	m68knommu-*)
+		cpu=m68k
+		basic_os=linux
+		;;
+	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+		cpu=s12z
+		;;
+	openrisc-*)
+		cpu=or32
+		;;
+	parisc-*)
+		cpu=hppa
+		basic_os=linux
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		cpu=i586
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+		cpu=i686
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		cpu=i686
+		;;
+	pentium4-*)
+		cpu=i786
+		;;
+	pc98-*)
+		cpu=i386
+		;;
+	ppc-* | ppcbe-*)
+		cpu=powerpc
+		;;
+	ppcle-* | powerpclittle-*)
+		cpu=powerpcle
+		;;
+	ppc64-*)
+		cpu=powerpc64
+		;;
+	ppc64le-* | powerpc64little-*)
+		cpu=powerpc64le
+		;;
+	sb1-*)
+		cpu=mipsisa64sb1
+		;;
+	sb1el-*)
+		cpu=mipsisa64sb1el
+		;;
+	sh5e[lb]-*)
+		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
+		;;
+	spur-*)
+		cpu=spur
+		;;
+	strongarm-* | thumb-*)
+		cpu=arm
+		;;
+	tx39-*)
+		cpu=mipstx39
+		;;
+	tx39el-*)
+		cpu=mipstx39el
+		;;
+	x64-*)
+		cpu=x86_64
+		;;
+	xscale-* | xscalee[bl]-*)
+		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
+		;;
+	arm64-* | aarch64le-*)
+		cpu=aarch64
+		;;
+
+	# Recognize the canonical CPU Types that limit and/or modify the
+	# company names they are paired with.
+	cr16-*)
+		basic_os=${basic_os:-elf}
+		;;
+	crisv32-* | etraxfs*-*)
+		cpu=crisv32
+		vendor=axis
+		;;
+	cris-* | etrax*-*)
+		cpu=cris
+		vendor=axis
+		;;
+	crx-*)
+		basic_os=${basic_os:-elf}
+		;;
+	neo-tandem)
+		cpu=neo
+		vendor=tandem
+		;;
+	nse-tandem)
+		cpu=nse
+		vendor=tandem
+		;;
+	nsr-tandem)
+		cpu=nsr
+		vendor=tandem
+		;;
+	nsv-tandem)
+		cpu=nsv
+		vendor=tandem
+		;;
+	nsx-tandem)
+		cpu=nsx
+		vendor=tandem
+		;;
+	mipsallegrexel-sony)
+		cpu=mipsallegrexel
+		vendor=sony
+		;;
+	tile*-*)
+		basic_os=${basic_os:-linux-gnu}
+		;;
+
+	*)
+		# Recognize the canonical CPU types that are allowed with any
+		# company name.
+		case $cpu in
+			1750a | 580 \
+			| a29k \
+			| aarch64 | aarch64_be \
+			| abacus \
+			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+			| alphapca5[67] | alpha64pca5[67] \
+			| am33_2.0 \
+			| amdgcn \
+			| arc | arceb | arc32 | arc64 \
+			| arm | arm[lb]e | arme[lb] | armv* \
+			| avr | avr32 \
+			| asmjs \
+			| ba \
+			| be32 | be64 \
+			| bfin | bpf | bs2000 \
+			| c[123]* | c30 | [cjt]90 | c4x \
+			| c8051 | clipper | craynv | csky | cydra \
+			| d10v | d30v | dlx | dsp16xx \
+			| e2k | elxsi | epiphany \
+			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+			| h8300 | h8500 \
+			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+			| hexagon \
+			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
+			| ip2k | iq2000 \
+			| k1om \
+			| le32 | le64 \
+			| lm32 \
+			| loongarch32 | loongarch64 | loongarchx32 \
+			| m32c | m32r | m32rle \
+			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+			| m88110 | m88k | maxq | mb | mcore | mep | metag \
+			| microblaze | microblazeel \
+			| mips | mipsbe | mipseb | mipsel | mipsle \
+			| mips16 \
+			| mips64 | mips64eb | mips64el \
+			| mips64octeon | mips64octeonel \
+			| mips64orion | mips64orionel \
+			| mips64r5900 | mips64r5900el \
+			| mips64vr | mips64vrel \
+			| mips64vr4100 | mips64vr4100el \
+			| mips64vr4300 | mips64vr4300el \
+			| mips64vr5000 | mips64vr5000el \
+			| mips64vr5900 | mips64vr5900el \
+			| mipsisa32 | mipsisa32el \
+			| mipsisa32r2 | mipsisa32r2el \
+			| mipsisa32r3 | mipsisa32r3el \
+			| mipsisa32r5 | mipsisa32r5el \
+			| mipsisa32r6 | mipsisa32r6el \
+			| mipsisa64 | mipsisa64el \
+			| mipsisa64r2 | mipsisa64r2el \
+			| mipsisa64r3 | mipsisa64r3el \
+			| mipsisa64r5 | mipsisa64r5el \
+			| mipsisa64r6 | mipsisa64r6el \
+			| mipsisa64sb1 | mipsisa64sb1el \
+			| mipsisa64sr71k | mipsisa64sr71kel \
+			| mipsr5900 | mipsr5900el \
+			| mipstx39 | mipstx39el \
+			| mmix \
+			| mn10200 | mn10300 \
+			| moxie \
+			| mt \
+			| msp430 \
+			| nds32 | nds32le | nds32be \
+			| nfp \
+			| nios | nios2 | nios2eb | nios2el \
+			| none | np1 | ns16k | ns32k | nvptx \
+			| open8 \
+			| or1k* \
+			| or32 \
+			| orion \
+			| picochip \
+			| pdp10 | pdp11 | pj | pjl | pn | power \
+			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+			| pru \
+			| pyramid \
+			| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+			| rl78 | romp | rs6000 | rx \
+			| s390 | s390x \
+			| score \
+			| sh | shl \
+			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+			| sparclite \
+			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+			| spu \
+			| tahoe \
+			| thumbv7* \
+			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+			| tron \
+			| ubicom32 \
+			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+			| vax \
+			| visium \
+			| w65 \
+			| wasm32 | wasm64 \
+			| we32k \
+			| x86 | x86_64 | xc16x | xgate | xps100 \
+			| xstormy16 | xtensa* \
+			| ymp \
+			| z8k | z80)
+				;;
+
+			*)
+				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+				exit 1
+				;;
 		esac
 		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=-sysv
-		;;
-	leon-*|leon[3-9]-*)
-		basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
-		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=-sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=-sysv
-		;;
-	microblaze*)
-		basic_machine=microblaze-xilinx
-		;;
-	mingw64)
-		basic_machine=x86_64-pc
-		os=-mingw64
-		;;
-	mingw32)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
-	miniframe)
-		basic_machine=m68000-convergent
-		;;
-	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-	mips3*-*)
-		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
-		;;
-	mips3*)
-		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=-morphos
-		;;
-	moxiebox)
-		basic_machine=moxie-unknown
-		os=-moxiebox
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=-msdos
-		;;
-	ms1-*)
-		basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
-		;;
-	msys)
-		basic_machine=i686-pc
-		os=-msys
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=-mvs
-		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=-nacl
-		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=-sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=-netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=-linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=-newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=-newsos
-		;;
-	news-3600 | risc-news)
-		basic_machine=mips-sony
-		os=-newsos
-		;;
-	necv70)
-		basic_machine=v70-nec
-		os=-sysv
-		;;
-	next | m*-next)
-		basic_machine=m68k-next
-		case $os in
-		    -nextstep* )
-			;;
-		    -ns2*)
-		      os=-nextstep2
-			;;
-		    *)
-		      os=-nextstep3
-			;;
-		esac
-		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=-cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=-cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=-nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=-mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=-nonstopux
-		;;
-	np1)
-		basic_machine=np1-gould
-		;;
-	neo-tandem)
-		basic_machine=neo-tandem
-		;;
-	nse-tandem)
-		basic_machine=nse-tandem
-		;;
-	nsr-tandem)
-		basic_machine=nsr-tandem
-		;;
-	nsv-tandem)
-		basic_machine=nsv-tandem
-		;;
-	nsx-tandem)
-		basic_machine=nsx-tandem
-		;;
-	op50n-* | op60c-*)
-		basic_machine=hppa1.1-oki
-		os=-proelf
-		;;
-	openrisc | openrisc-*)
-		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=-ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=-os68k
-		;;
-	pa-hitachi)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	paragon)
-		basic_machine=i860-intel
-		os=-osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	pbd)
-		basic_machine=sparc-tti
-		;;
-	pbb)
-		basic_machine=m68k-tti
-		;;
-	pc532 | pc532-*)
-		basic_machine=ns32k-pc532
-		;;
-	pc98)
-		basic_machine=i386-pc
-		;;
-	pc98-*)
-		basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	pentium | p5 | k5 | k6 | nexgen | viac3)
-		basic_machine=i586-pc
-		;;
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
-		basic_machine=i686-pc
-		;;
-	pentiumii | pentium2 | pentiumiii | pentium3)
-		basic_machine=i686-pc
-		;;
-	pentium4)
-		basic_machine=i786-pc
-		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	pentium4-*)
-		basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	pn)
-		basic_machine=pn-gould
-		;;
-	power)	basic_machine=power-ibm
-		;;
-	ppc | ppcbe)	basic_machine=powerpc-unknown
-		;;
-	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	ppcle | powerpclittle)
-		basic_machine=powerpcle-unknown
-		;;
-	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	ppc64)	basic_machine=powerpc64-unknown
-		;;
-	ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	ppc64le | powerpc64little)
-		basic_machine=powerpc64le-unknown
-		;;
-	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	ps2)
-		basic_machine=i386-ibm
-		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=-pw32
-		;;
-	rdos | rdos64)
-		basic_machine=x86_64-pc
-		os=-rdos
-		;;
-	rdos32)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	rm[46]00)
-		basic_machine=mips-siemens
-		;;
-	rtpc | rtpc-*)
-		basic_machine=romp-ibm
-		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	sb1)
-		basic_machine=mipsisa64sb1-unknown
-		;;
-	sb1el)
-		basic_machine=mipsisa64sb1el-unknown
-		;;
-	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
-		;;
-	sei)
-		basic_machine=mips-sei
-		os=-seiux
-		;;
-	sequent)
-		basic_machine=i386-sequent
-		;;
-	sh5el)
-		basic_machine=sh5le-unknown
-		;;
-	simso-wrs)
-		basic_machine=sparclite-wrs
-		os=-vxworks
-		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=-sysv2
-		;;
-	spur)
-		basic_machine=spur-unknown
-		;;
-	st2000)
-		basic_machine=m68k-tandem
-		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=-sysv4
-		;;
-	strongarm-* | thumb-*)
-		basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
-		;;
-	sun2)
-		basic_machine=m68000-sun
-		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=-sunos3
-		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=-sunos4
-		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=-sunos3
-		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=-sunos4
-		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=-sunos3
-		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=-sunos4
-		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=-solaris2
-		;;
-	sun3 | sun3-*)
-		basic_machine=m68k-sun
-		;;
-	sun4)
-		basic_machine=sparc-sun
-		;;
-	sun386 | sun386i | roadrunner)
-		basic_machine=i386-sun
-		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=-unicos
-		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=-dynix
-		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=-unicos
-		;;
-	t90)
-		basic_machine=t90-cray
-		os=-unicos
-		;;
-	tile*)
-		basic_machine=$basic_machine-unknown
-		os=-linux-gnu
-		;;
-	tx39)
-		basic_machine=mipstx39-unknown
-		;;
-	tx39el)
-		basic_machine=mipstx39el-unknown
-		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=-tops20
-		;;
-	tower | tower-32)
-		basic_machine=m68k-ncr
-		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
-		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=-sym1
-		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=-none
-		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=-sysv
-		;;
-	vms)
-		basic_machine=vax-dec
-		os=-vms
-		;;
-	vpp*|vx|vx-*)
-		basic_machine=f301-fujitsu
-		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=-vxworks
-		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=-vxworks
-		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=-vxworks
-		;;
-	w65*)
-		basic_machine=w65-wdc
-		os=-none
-		;;
-	w89k-*)
-		basic_machine=hppa1.1-winbond
-		os=-proelf
-		;;
-	x64)
-		basic_machine=x86_64-pc
-		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	xps | xps100)
-		basic_machine=xps100-honeywell
-		;;
-	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
-		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=-unicos
-		;;
-	none)
-		basic_machine=none-none
-		os=-none
-		;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		basic_machine=hppa1.1-winbond
-		;;
-	op50n)
-		basic_machine=hppa1.1-oki
-		;;
-	op60c)
-		basic_machine=hppa1.1-oki
-		;;
-	romp)
-		basic_machine=romp-ibm
-		;;
-	mmix)
-		basic_machine=mmix-knuth
-		;;
-	rs6000)
-		basic_machine=rs6000-ibm
-		;;
-	vax)
-		basic_machine=vax-dec
-		;;
-	pdp11)
-		basic_machine=pdp11-dec
-		;;
-	we32k)
-		basic_machine=we32k-att
-		;;
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-		basic_machine=sh-unknown
-		;;
-	cydra)
-		basic_machine=cydra-cydrome
-		;;
-	orion)
-		basic_machine=orion-highlevel
-		;;
-	orion105)
-		basic_machine=clipper-highlevel
-		;;
-	mac | mpw | mac-mpw)
-		basic_machine=m68k-apple
-		;;
-	pmac | pmac-mpw)
-		basic_machine=powerpc-apple
-		;;
-	*-unknown)
-		# Make sure to match an already-canonicalized machine name.
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $vendor in
+	digital*)
+		vendor=dec
+		;;
+	commodore*)
+		vendor=cbm
 		;;
 	*)
-		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
-		exit 1
 		;;
 esac
 
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-	*-digital*)
-		basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
-		;;
-	*-commodore*)
-		basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if test x$basic_os != x
+then
+
+# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+	gnu/linux*)
+		kernel=linux
+		os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
+		;;
+	os2-emx)
+		kernel=os2
+		os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
+		;;
+	nto-qnx*)
+		kernel=nto
+		os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
+		;;
+	*-*)
+		# shellcheck disable=SC2162
+		saved_IFS=$IFS
+		IFS="-" read kernel os <<EOF
+$basic_os
+EOF
+		IFS=$saved_IFS
+		;;
+	# Default OS when just kernel was specified
+	nto*)
+		kernel=nto
+		os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
+		;;
+	linux*)
+		kernel=linux
+		os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
 		;;
 	*)
+		kernel=
+		os=$basic_os
 		;;
 esac
 
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
+# Now, normalize the OS (knowing we just have one component, it's not a kernel,
+# etc.)
 case $os in
 	# First match some system type aliases that might get confused
 	# with valid system types.
-	# -solaris* is a basic system type, with this one exception.
-	-auroraux)
-		os=-auroraux
-		;;
-	-solaris1 | -solaris1.*)
-		os=`echo $os | sed -e 's|solaris1|sunos4|'`
-		;;
-	-solaris)
-		os=-solaris2
-		;;
-	-unixware*)
-		os=-sysv4.2uw
-		;;
-	-gnu/linux*)
-		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+	# solaris* is a basic system type, with this one exception.
+	auroraux)
+		os=auroraux
+		;;
+	bluegene*)
+		os=cnk
+		;;
+	solaris1 | solaris1.*)
+		os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
+		;;
+	solaris)
+		os=solaris2
+		;;
+	unixware*)
+		os=sysv4.2uw
 		;;
 	# es1800 is here to avoid being matched by es* (a different OS)
-	-es1800*)
-		os=-ose
-		;;
-	# Now accept the basic system types.
-	# The portable systems comes first.
-	# Each alternative MUST end in a * to match a version number.
-	# -sysv* is not here because it comes later, after sysvr4.
-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* | -plan9* \
-	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* | -cloudabi* | -sortix* \
-	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
-	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
-	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
-	      | -midnightbsd*)
-	# Remember, each alternative MUST END IN *, to match a version number.
-		;;
-	-qnx*)
-		case $basic_machine in
-		    x86-* | i*86-*)
-			;;
-		    *)
-			os=-nto$os
-			;;
-		esac
-		;;
-	-nto-qnx*)
-		;;
-	-nto*)
-		os=`echo $os | sed -e 's|nto|nto-qnx|'`
-		;;
-	-sim | -xray | -os68k* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* \
-	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
-		;;
-	-mac*)
+	es1800*)
+		os=ose
+		;;
+	# Some version numbers need modification
+	chorusos*)
+		os=chorusos
+		;;
+	isc)
+		os=isc2.2
+		;;
+	sco6)
+		os=sco5v6
+		;;
+	sco5)
+		os=sco3.2v5
+		;;
+	sco4)
+		os=sco3.2v4
+		;;
+	sco3.2.[4-9]*)
+		os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
+		;;
+	sco*v* | scout)
+		# Don't match below
+		;;
+	sco*)
+		os=sco3.2v2
+		;;
+	psos*)
+		os=psos
+		;;
+	qnx*)
+		os=qnx
+		;;
+	hiux*)
+		os=hiuxwe2
+		;;
+	lynx*178)
+		os=lynxos178
+		;;
+	lynx*5)
+		os=lynxos5
+		;;
+	lynxos*)
+		# don't get caught up in next wildcard
+		;;
+	lynx*)
+		os=lynxos
+		;;
+	mac[0-9]*)
 		os=`echo "$os" | sed -e 's|mac|macos|'`
 		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
-		;;
-	-linux*)
-		os=`echo $os | sed -e 's|linux|linux-gnu|'`
-		;;
-	-sunos5*)
+	opened*)
+		os=openedition
+		;;
+	os400*)
+		os=os400
+		;;
+	sunos5*)
 		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
 		;;
-	-sunos6*)
+	sunos6*)
 		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
 		;;
-	-opened*)
-		os=-openedition
-		;;
-	-os400*)
-		os=-os400
-		;;
-	-wince*)
-		os=-wince
-		;;
-	-utek*)
-		os=-bsd
-		;;
-	-dynix*)
-		os=-bsd
-		;;
-	-acis*)
-		os=-aos
-		;;
-	-atheos*)
-		os=-atheos
-		;;
-	-syllable*)
-		os=-syllable
-		;;
-	-386bsd)
-		os=-bsd
-		;;
-	-ctix* | -uts*)
-		os=-sysv
-		;;
-	-nova*)
-		os=-rtmk-nova
-		;;
-	-ns2)
-		os=-nextstep2
-		;;
-	-nsk*)
-		os=-nsk
+	wince*)
+		os=wince
+		;;
+	utek*)
+		os=bsd
+		;;
+	dynix*)
+		os=bsd
+		;;
+	acis*)
+		os=aos
+		;;
+	atheos*)
+		os=atheos
+		;;
+	syllable*)
+		os=syllable
+		;;
+	386bsd)
+		os=bsd
+		;;
+	ctix* | uts*)
+		os=sysv
+		;;
+	nova*)
+		os=rtmk-nova
+		;;
+	ns2)
+		os=nextstep2
 		;;
 	# Preserve the version number of sinix5.
-	-sinix5.*)
-		os=`echo $os | sed -e 's|sinix|sysv|'`
-		;;
-	-sinix*)
-		os=-sysv4
-		;;
-	-tpf*)
-		os=-tpf
-		;;
-	-triton*)
-		os=-sysv3
-		;;
-	-oss*)
-		os=-sysv3
-		;;
-	-svr4*)
-		os=-sysv4
-		;;
-	-svr3)
-		os=-sysv3
-		;;
-	-sysvr4)
-		os=-sysv4
-		;;
-	# This must come after -sysvr4.
-	-sysv*)
-		;;
-	-ose*)
-		os=-ose
-		;;
-	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-		os=-mint
-		;;
-	-zvmoe)
-		os=-zvmoe
-		;;
-	-dicos*)
-		os=-dicos
-		;;
-	-pikeos*)
+	sinix5.*)
+		os=`echo "$os" | sed -e 's|sinix|sysv|'`
+		;;
+	sinix*)
+		os=sysv4
+		;;
+	tpf*)
+		os=tpf
+		;;
+	triton*)
+		os=sysv3
+		;;
+	oss*)
+		os=sysv3
+		;;
+	svr4*)
+		os=sysv4
+		;;
+	svr3)
+		os=sysv3
+		;;
+	sysvr4)
+		os=sysv4
+		;;
+	ose*)
+		os=ose
+		;;
+	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+		os=mint
+		;;
+	dicos*)
+		os=dicos
+		;;
+	pikeos*)
 		# Until real need of OS specific support for
 		# particular features comes up, bare metal
 		# configurations are quite functional.
-		case $basic_machine in
+		case $cpu in
 		    arm*)
-			os=-eabi
+			os=eabi
 			;;
 		    *)
-			os=-elf
+			os=elf
 			;;
 		esac
 		;;
-	-nacl*)
-		;;
-	-ios)
-		;;
-	-none)
-		;;
 	*)
-		# Get rid of the `-' at the beginning of $os.
-		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
-		exit 1
+		# No normalization, but not necessarily accepted, that comes below.
 		;;
 esac
+
 else
 
@@ -1544,256 +1528,361 @@
 # system, and we'll never get to this point.
 
-case $basic_machine in
+kernel=
+case $cpu-$vendor in
 	score-*)
-		os=-elf
+		os=elf
 		;;
 	spu-*)
-		os=-elf
+		os=elf
 		;;
 	*-acorn)
-		os=-riscix1.2
+		os=riscix1.2
 		;;
 	arm*-rebel)
-		os=-linux
+		kernel=linux
+		os=gnu
 		;;
 	arm*-semi)
-		os=-aout
+		os=aout
 		;;
 	c4x-* | tic4x-*)
-		os=-coff
+		os=coff
 		;;
 	c8051-*)
-		os=-elf
+		os=elf
+		;;
+	clipper-intergraph)
+		os=clix
 		;;
 	hexagon-*)
-		os=-elf
+		os=elf
 		;;
 	tic54x-*)
-		os=-coff
+		os=coff
 		;;
 	tic55x-*)
-		os=-coff
+		os=coff
 		;;
 	tic6x-*)
-		os=-coff
+		os=coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
-		os=-tops20
+		os=tops20
 		;;
 	pdp11-*)
-		os=-none
+		os=none
 		;;
 	*-dec | vax-*)
-		os=-ultrix4.2
+		os=ultrix4.2
 		;;
 	m68*-apollo)
-		os=-domain
+		os=domain
 		;;
 	i386-sun)
-		os=-sunos4.0.2
+		os=sunos4.0.2
 		;;
 	m68000-sun)
-		os=-sunos3
+		os=sunos3
 		;;
 	m68*-cisco)
-		os=-aout
+		os=aout
 		;;
 	mep-*)
-		os=-elf
+		os=elf
 		;;
 	mips*-cisco)
-		os=-elf
+		os=elf
 		;;
 	mips*-*)
-		os=-elf
+		os=elf
 		;;
 	or32-*)
-		os=-coff
+		os=coff
 		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=-sysv3
+		os=sysv3
 		;;
 	sparc-* | *-sun)
-		os=-sunos4.1.1
+		os=sunos4.1.1
 		;;
 	pru-*)
-		os=-elf
+		os=elf
 		;;
 	*-be)
-		os=-beos
+		os=beos
 		;;
 	*-ibm)
-		os=-aix
+		os=aix
 		;;
 	*-knuth)
-		os=-mmixware
+		os=mmixware
 		;;
 	*-wec)
-		os=-proelf
+		os=proelf
 		;;
 	*-winbond)
-		os=-proelf
+		os=proelf
 		;;
 	*-oki)
-		os=-proelf
+		os=proelf
 		;;
 	*-hp)
-		os=-hpux
+		os=hpux
 		;;
 	*-hitachi)
-		os=-hiux
+		os=hiux
 		;;
 	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=-sysv
+		os=sysv
 		;;
 	*-cbm)
-		os=-amigaos
+		os=amigaos
 		;;
 	*-dg)
-		os=-dgux
+		os=dgux
 		;;
 	*-dolphin)
-		os=-sysv3
+		os=sysv3
 		;;
 	m68k-ccur)
-		os=-rtu
+		os=rtu
 		;;
 	m88k-omron*)
-		os=-luna
+		os=luna
 		;;
 	*-next)
-		os=-nextstep
+		os=nextstep
 		;;
 	*-sequent)
-		os=-ptx
+		os=ptx
 		;;
 	*-crds)
-		os=-unos
+		os=unos
 		;;
 	*-ns)
-		os=-genix
+		os=genix
 		;;
 	i370-*)
-		os=-mvs
+		os=mvs
 		;;
 	*-gould)
-		os=-sysv
+		os=sysv
 		;;
 	*-highlevel)
-		os=-bsd
+		os=bsd
 		;;
 	*-encore)
-		os=-bsd
+		os=bsd
 		;;
 	*-sgi)
-		os=-irix
+		os=irix
 		;;
 	*-siemens)
-		os=-sysv4
+		os=sysv4
 		;;
 	*-masscomp)
-		os=-rtu
+		os=rtu
 		;;
 	f30[01]-fujitsu | f700-fujitsu)
-		os=-uxpv
+		os=uxpv
 		;;
 	*-rom68k)
-		os=-coff
+		os=coff
 		;;
 	*-*bug)
-		os=-coff
+		os=coff
 		;;
 	*-apple)
-		os=-macos
+		os=macos
 		;;
 	*-atari*)
-		os=-mint
+		os=mint
+		;;
+	*-wrs)
+		os=vxworks
 		;;
 	*)
-		os=-none
+		os=none
 		;;
 esac
+
 fi
+
+# Now, validate our (potentially fixed-up) OS.
+case $os in
+	# Sometimes we do "kernel-libc", so those need to count as OSes.
+	musl* | newlib* | relibc* | uclibc*)
+		;;
+	# Likewise for "kernel-abi"
+	eabi* | gnueabi*)
+		;;
+	# VxWorks passes extra cpu info in the 4th filed.
+	simlinux | simwindows | spe)
+		;;
+	# Now accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST end in a * to match a version number.
+	gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+	     | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
+	     | hiux* | abug | nacl* | netware* | windows* \
+	     | os9* | macos* | osx* | ios* \
+	     | mpw* | magic* | mmixware* | mon960* | lnews* \
+	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
+	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+	     | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+	     | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
+	     | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+	     | udi* | lites* | ieee* | go32* | aux* | hcos* \
+	     | chorusrdb* | cegcc* | glidix* | serenity* \
+	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+	     | midipix* | mingw32* | mingw64* | mint* \
+	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+	     | interix* | uwin* | mks* | rhapsody* | darwin* \
+	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
+	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
+	     | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+	     | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
+	     | fiwix* )
+		;;
+	# This one is extra strict with allowed versions
+	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		;;
+	none)
+		;;
+	*)
+		echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os in
+	linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
+		   | linux-musl* | linux-relibc* | linux-uclibc* )
+		;;
+	uclinux-uclibc* )
+		;;
+	-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
+		# These are just libc implementations, not actual OSes, and thus
+		# require a kernel.
+		echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
+		exit 1
+		;;
+	kfreebsd*-gnu* | kopensolaris*-gnu*)
+		;;
+	vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+		;;
+	nto-qnx*)
+		;;
+	os2-emx)
+		;;
+	*-eabi* | *-gnueabi*)
+		;;
+	-*)
+		# Blank kernel with real OS is always fine.
+		;;
+	*-*)
+		echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+		exit 1
+		;;
+esac
 
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-	*-unknown)
-		case $os in
-			-riscix*)
+case $vendor in
+	unknown)
+		case $cpu-$os in
+			*-riscix*)
 				vendor=acorn
 				;;
-			-sunos*)
+			*-sunos*)
 				vendor=sun
 				;;
-			-cnk*|-aix*)
+			*-cnk* | *-aix*)
 				vendor=ibm
 				;;
-			-beos*)
+			*-beos*)
 				vendor=be
 				;;
-			-hpux*)
+			*-hpux*)
 				vendor=hp
 				;;
-			-mpeix*)
+			*-mpeix*)
 				vendor=hp
 				;;
-			-hiux*)
+			*-hiux*)
 				vendor=hitachi
 				;;
-			-unos*)
+			*-unos*)
 				vendor=crds
 				;;
-			-dgux*)
+			*-dgux*)
 				vendor=dg
 				;;
-			-luna*)
+			*-luna*)
 				vendor=omron
 				;;
-			-genix*)
+			*-genix*)
 				vendor=ns
 				;;
-			-mvs* | -opened*)
+			*-clix*)
+				vendor=intergraph
+				;;
+			*-mvs* | *-opened*)
 				vendor=ibm
 				;;
-			-os400*)
+			*-os400*)
 				vendor=ibm
 				;;
-			-ptx*)
+			s390-* | s390x-*)
+				vendor=ibm
+				;;
+			*-ptx*)
 				vendor=sequent
 				;;
-			-tpf*)
+			*-tpf*)
 				vendor=ibm
 				;;
-			-vxsim* | -vxworks* | -windiss*)
+			*-vxsim* | *-vxworks* | *-windiss*)
 				vendor=wrs
 				;;
-			-aux*)
+			*-aux*)
 				vendor=apple
 				;;
-			-hms*)
+			*-hms*)
 				vendor=hitachi
 				;;
-			-mpw* | -macos*)
+			*-mpw* | *-macos*)
 				vendor=apple
 				;;
-			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+			*-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
 				vendor=atari
 				;;
-			-vos*)
+			*-vos*)
 				vendor=stratus
 				;;
 		esac
-		basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
 		;;
 esac
 
-echo "$basic_machine$os"
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-functions 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 582)
+++ /trunk/configure.ac	(revision 583)
@@ -1,9 +1,9 @@
 dnl We want to override the standard _AC_INIT_PARSE_ARGS
 dnl
-AU_ALIAS([_AC_INIT_PARSE_ARGS], [SH_INIT_PARSE_ARGS])
-AU_ALIAS([_AC_INIT_help], [SH_INIT_HELP])
-
-AC_INIT(src/samhain.c)
-
+AU_ALIAS([_AC_INIT_PARSE_ARGS], [SH_INIT_PARSE_ARGS], [], [silent])
+dnl AU_ALIAS([_AC_INIT_help], [SH_INIT_HELP])
+
+AC_INIT([samhain],[4.5.2])
+AC_CONFIG_SRCDIR(src/samhain.c)
 
 AC_ARG_VAR([LIBS], [libraries to link against, e.g. -lintl])
@@ -12,6 +12,9 @@
 dnl start
 dnl
-AM_INIT_AUTOMAKE(samhain, 4.5.1)
+dnl AM_INIT_AUTOMAKE
+m4_pattern_allow([AC_DEFINE])
 AC_DEFINE([SAMHAIN], 1, [Application is samhain])
+AC_DEFINE_UNQUOTED([VERSION], [_("${PACKAGE_VERSION}")], [Current version] )
+AC_DEFINE_UNQUOTED([PACKAGE], [_("${PACKAGE_NAME}")], [Application name] )
 AC_CANONICAL_HOST
 
@@ -34,4 +37,5 @@
 AC_SUBST(cmd_hostname)
 AC_SUBST(BUILD_CC)
+
 
 if test "x$GCC" = "xyes"; then
@@ -55,6 +59,4 @@
 
 
-AC_HEADER_STDC
-
 AC_CHECK_HEADERS([sys/ipc.h sys/sem.h sys/msg.h sys/uio.h fcntl.h])
 
@@ -74,13 +76,13 @@
 	*linux*)
 	sh_use_lcaps="yes"
-	AC_DEFINE(HOST_IS_LINUX)
-        AC_DEFINE(HAVE_EXT2_IOCTLS)
+	AC_DEFINE([HOST_IS_LINUX], [1], [] )
+        AC_DEFINE([HAVE_EXT2_IOCTLS], [1], [] )
 	AC_MSG_RESULT([use ioctl to get e2fs flags])
 	case "$host_cpu" in 
 	   i*86*)
-	   AC_DEFINE(HOST_IS_I86LINUX)
+	   AC_DEFINE([HOST_IS_I86LINUX], [1], [] )
 	   ;;
 	   x86_64)
-	   AC_DEFINE([HOST_IS_64LINUX], 1, [Define if host OS is 64bit Linux])
+	   AC_DEFINE([HOST_IS_64LINUX], [1], [Define if host OS is 64bit Linux])
 	   ;;
 	   *)
@@ -103,5 +105,5 @@
 	
 	*cygwin*) 
-	AC_DEFINE(HOST_IS_CYGWIN)
+	AC_DEFINE([HOST_IS_CYGWIN], [1], [] )
 	AC_DEFINE([USE_REGISTRY_CHECK], 1, [Define for registry check])
 	dnmalloc_ok=no
@@ -111,25 +113,11 @@
 
 	*darwin*|*apple*) 
-	AC_DEFINE(HOST_IS_DARWIN)
+	AC_DEFINE([HOST_IS_DARWIN], [1], [] )
 	dnmalloc_ok=no
 	AC_MSG_RESULT([check resource forks, no dnmalloc])
 	;;
 
-	*freebsd8*|*freebsd9*)
-	AC_DEFINE(HOST_IS_FREEBSD)
-	selectconfig=freebsd
-	case "$host_cpu" in
-		amd64|x86_64)
-		dnmalloc_ok=no
-		AC_MSG_RESULT([no dnmalloc])
-		;;
-		*)
-		AC_MSG_RESULT([none])
-		;;
-	esac
-	;;
-	
 	*freebsd7*)
-	AC_DEFINE(HOST_IS_FREEBSD)
+	AC_DEFINE([HOST_IS_FREEBSD], [1], [] )
 	selectconfig=freebsd
 	case "$host_cpu" in
@@ -146,6 +134,15 @@
 	
 	*freebsd*)
-	AC_DEFINE(HOST_IS_FREEBSD)
+	AC_DEFINE([HOST_IS_FREEBSD], [1], [] )
 	selectconfig=freebsd
+	case "$host_cpu" in
+		amd64|x86_64)
+		dnmalloc_ok=no
+		AC_MSG_RESULT([no dnmalloc])
+		;;
+		*)
+		AC_MSG_RESULT([none])
+		;;
+	esac
 	AC_MSG_RESULT([none])
 	;;
@@ -166,8 +163,8 @@
         *solaris*)
 	selectconfig=solaris
-	AC_DEFINE(HOST_IS_SOLARIS)
+	AC_DEFINE([HOST_IS_SOLARIS], [1], [] )
 	case "$host_cpu" in
 		i*86)
-		AC_DEFINE(HOST_IS_I86SOLARIS)
+		AC_DEFINE([HOST_IS_I86SOLARIS], [1], [] )
 		AC_MSG_RESULT([vsnprintf prototype])
 		;;
@@ -193,10 +190,10 @@
         *sun*)
 	selectconfig=solaris
-	AC_DEFINE(HOST_IS_SOLARIS)
+	AC_DEFINE([HOST_IS_SOLARIS], [1], [])
 	AC_MSG_RESULT([none])
         ;;
 
 	*aix*)
-        AC_DEFINE(HOST_IS_AIX)
+        AC_DEFINE([HOST_IS_AIX], [1], [aix])
 	selectconfig=aix5.2.0
 	uid_cast="unsigned long"
@@ -219,5 +216,5 @@
         *hpux*)
         AC_MSG_RESULT([HPUX need _XOPEN_SOURCE_EXTENDED for h_errno])
-	AC_DEFINE(HOST_IS_HPUX)
+	AC_DEFINE([HOST_IS_HPUX], [1], [hpux])
 	if test "x$GCC" != "xyes"; then
   	  if test ! -z "`echo "$CFLAGS" | grep "\-g" 2> /dev/null`" ; then
@@ -232,5 +229,5 @@
         *ultrix*)
         AC_MSG_RESULT([ULTRIX getcwd uses popen])
-        AC_DEFINE(HAVE_BROKEN_GETCWD)
+        AC_DEFINE([HAVE_BROKEN_GETCWD], [1], [bad implementation of getcwd])
         ;;
 
@@ -241,5 +238,5 @@
 
 AC_SUBST(selectconfig)
-AC_DEFINE_UNQUOTED(UID_CAST, ${uid_cast})
+AC_DEFINE_UNQUOTED([UID_CAST], [${uid_cast}], [basic type to which we can cast a uid])
 
 
@@ -253,8 +250,15 @@
 AC_HEADER_DIRENT
 AC_HEADER_MAJOR
-AC_HEADER_TIME
+AC_CHECK_HEADERS([sys/time.h])
 dnl used in minilzo.c
 AC_HEADER_STAT
-AC_DECL_SYS_SIGLIST 
+
+AC_CHECK_DECLS([sys_siglist], [], [],
+[#include <signal.h>
+/* NetBSD declares sys_siglist in unistd.h.  */
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+])
 
 AC_CHECK_HEADERS(stddef.h libgen.h sched.h malloc.h sys/uio.h \
@@ -275,14 +279,14 @@
 AC_CHECK_HEADER(utmpx.h, sh_utmpx="yes", sh_utmpx="no")
 if test "x$sh_utmpx" = "xyes"; then
-  AC_DEFINE(HAVE_UTMPX_H)
-  AC_EGREP_HEADER(ut_host, utmpx.h, AC_DEFINE(HAVE_UTHOST) )
-  AC_EGREP_HEADER(ut_addr, utmpx.h, AC_DEFINE(HAVE_UTADDR) )
-  AC_EGREP_HEADER(ut_addr_v6, utmpx.h, AC_DEFINE(HAVE_UTADDR_V6) )
-  AC_EGREP_HEADER(ut_xtime,utmpx.h, AC_DEFINE(HAVE_UTXTIME) )
-  AC_EGREP_HEADER(ut_type, utmpx.h, AC_DEFINE(HAVE_UTTYPE) )
+  AC_DEFINE([HAVE_UTMPX_H], [1], [whether we have utmpx.h])
+  AC_EGREP_HEADER(ut_host, utmpx.h, AC_DEFINE([HAVE_UTHOST], [1], [] ))
+  AC_EGREP_HEADER(ut_addr, utmpx.h, AC_DEFINE([HAVE_UTADDR], [1], [] ))
+  AC_EGREP_HEADER(ut_addr_v6, utmpx.h, AC_DEFINE([HAVE_UTADDR_V6], [1], [] ))
+  AC_EGREP_HEADER(ut_xtime,utmpx.h, AC_DEFINE([HAVE_UTXTIME], [1], [] ))
+  AC_EGREP_HEADER(ut_type, utmpx.h, AC_DEFINE([HAVE_UTTYPE], [1], [] ))
 else
-  AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE(HAVE_UTADDR) )
-  AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE(HAVE_UTHOST) )
-  AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE(HAVE_UTTYPE) )
+  AC_EGREP_HEADER(ut_addr, utmp.h, AC_DEFINE([HAVE_UTADDR], [1], [] ))
+  AC_EGREP_HEADER(ut_host, utmp.h, AC_DEFINE([HAVE_UTHOST], [1], [] ))
+  AC_EGREP_HEADER(ut_type, utmp.h, AC_DEFINE([HAVE_UTTYPE], [1], [] ))
 fi
 
@@ -301,51 +305,51 @@
 		AC_DEFINE(HAVE_SYS_ACCT_H, ,
 			  [Define if you have the <sys/acct.h> header file.])
-		AC_HEADER_EGREP(ac_utime, sys/acct.h,
+		AC_EGREP_HEADER(ac_utime, sys/acct.h,
 				AC_DEFINE(HAVE_ACUTIME, ,
 					  [Define if <sys/acct.h> has the AC_UTIME field.])
-				AC_HEADER_EGREP(comp_t.*ac_utime, sys/acct.h,
+				AC_EGREP_HEADER(comp_t.*ac_utime, sys/acct.h,
 						AC_DEFINE(ACUTIME_COMPT, ,
 							  [Define if <sys/acct.h>'s AC_UTIME field is a COMP_T.]))
 		)
-		AC_HEADER_EGREP(ac_stime, sys/acct.h,
+		AC_EGREP_HEADER(ac_stime, sys/acct.h,
 				AC_DEFINE(HAVE_ACSTIME, ,
 					  [Define if <sys/acct.h> has the AC_STIME field.])
-				AC_HEADER_EGREP(comp_t.*ac_stime, sys/acct.h,
+				AC_EGREP_HEADER(comp_t.*ac_stime, sys/acct.h,
 						AC_DEFINE(ACSTIME_COMPT, ,
 							  [Define if <sys/acct.h>'s AC_STIME field is a COMP_T.]))
 		)
-		AC_HEADER_EGREP(ac_etime, sys/acct.h,
+		AC_EGREP_HEADER(ac_etime, sys/acct.h,
 				AC_DEFINE(HAVE_ACETIME, ,
 					  [Define if <sys/acct.h> has the AC_ETIME field.])
-				AC_HEADER_EGREP(comp_t.*ac_etime, sys/acct.h,
+				AC_EGREP_HEADER(comp_t.*ac_etime, sys/acct.h,
 						AC_DEFINE(ACETIME_COMPT, ,
 							  [Define if <sys/acct.h>'s AC_ETIME field is a COMP_T.]))
 		)
-		AC_HEADER_EGREP(ac_io,    sys/acct.h,
+		AC_EGREP_HEADER(ac_io,    sys/acct.h,
 				AC_DEFINE(HAVE_ACIO, ,
 					  [Define if <sys/acct.h> has the AC_IO field.])
-				AC_HEADER_EGREP(comp_t.*ac_io,    sys/acct.h,
+				AC_EGREP_HEADER(comp_t.*ac_io,    sys/acct.h,
 						AC_DEFINE(ACIO_COMPT, ,
 							  [Define if <sys/acct.h>'s AC_IO field is a COMP_T.]))
 		)
-		AC_HEADER_EGREP(ac_mem,   sys/acct.h,
+		AC_EGREP_HEADER(ac_mem,   sys/acct.h,
 				AC_DEFINE(HAVE_ACMEM, ,
 					  [Define if <sys/acct.h> has the AC_MEM field.])
-				AC_HEADER_EGREP(comp_t.*ac_mem,   sys/acct.h,
+				AC_EGREP_HEADER(comp_t.*ac_mem,   sys/acct.h,
 						AC_DEFINE(ACMEM_COMPT, ,
 							  [Define if <sys/acct.h>'s AC_MEM field is a COMP_T.]))
 		)
-		AC_HEADER_EGREP(ac_minflt,   sys/acct.h,
-				AC_HEADER_EGREP(ac_majflt,   sys/acct.h,
-						AC_HEADER_EGREP(ac_swaps,   sys/acct.h,
+		AC_EGREP_HEADER(ac_minflt,   sys/acct.h,
+				AC_EGREP_HEADER(ac_majflt,   sys/acct.h,
+						AC_EGREP_HEADER(ac_swaps,   sys/acct.h,
 								AC_DEFINE(HAVE_PAGING, ,
 									  [Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields.])
-								AC_HEADER_EGREP(comp_t.*ac_minflt, sys/acct.h,
+								AC_EGREP_HEADER(comp_t.*ac_minflt, sys/acct.h,
 										AC_DEFINE(ACMINFLT_COMPT, ,
 											  [Define if <sys/acct.h>'s AC_MINFLT field is a COMP_T.]))
-								AC_HEADER_EGREP(comp_t.*ac_mayflt, sys/acct.h,
+								AC_EGREP_HEADER(comp_t.*ac_mayflt, sys/acct.h,
 										AC_DEFINE(ACMAJFLT_COMPT, ,
 											  [Define if <sys/acct.h>'s AC_MAJFLT field is a COMP_T.]))
-								AC_HEADER_EGREP(comp_t.*ac_swaps, sys/acct.h,
+								AC_EGREP_HEADER(comp_t.*ac_swaps, sys/acct.h,
 										AC_DEFINE(ACSWAPS_COMPT, ,
 											  [Define if <sys/acct.h>'s AC_SWAPS field is a COMP_T.]))
@@ -353,13 +357,12 @@
 				)
 		)
-		AC_HEADER_EGREP(comp_t,   sys/acct.h, AC_DEFINE(HAVE_COMP_T, ,
+		AC_EGREP_HEADER(comp_t,   sys/acct.h, AC_DEFINE(HAVE_COMP_T, ,
 								[Define if <sys/acct.h> uses the COMP_T type.]))
-		AC_HEADER_EGREP([struct acct_v3],   sys/acct.h, AC_DEFINE(HAVE_ACCT_V3, ,
+		AC_EGREP_HEADER([struct acct_v3],   sys/acct.h, AC_DEFINE(HAVE_ACCT_V3, ,
 								[Define if <sys/acct.h> has struct acct_v3.]))
-		AC_HEADER_EGREP([struct acctv2],    sys/acct.h, AC_DEFINE(HAVE_ACCTV2, ,
+		AC_EGREP_HEADER([struct acctv2],    sys/acct.h, AC_DEFINE(HAVE_ACCTV2, ,
 								[Define if <sys/acct.h> has struct acctv2.]))
 
  )
-
 
 dnl need to check because AIX 4.2 does not have it
@@ -408,5 +411,8 @@
 	mincore posix_fadvise inotify_init1 scandir
 )
-AC_CHECK_FUNC(statfs, AC_DEFINE(HAVE_STATFS) statfs="yes",  statfs="no")
+AC_CHECK_FUNC([statfs], [
+			AC_DEFINE([HAVE_STATFS], [1], [have statfs func])
+			statfs="yes"
+			], [statfs="no"])
 SL_CHECK_VA_COPY
 AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
@@ -417,28 +423,41 @@
 fstype=no
 # The order of these tests is important.
-AC_TRY_CPP([#include <sys/statvfs.h>
-#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statvfs.h>
+#include <sys/fstyp.h>
+]])], [
+      AC_DEFINE([FSTYPE_STATVFS], [1], [statvfs])
+      fstype=SVR4])
+
 if test $fstype = no; then
-AC_TRY_CPP([#include <sys/statfs.h>
-#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
-fi
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statfs.h>
+#include <sys/fstyp.h>
+]])], [
+      AC_DEFINE([FSTYPE_USG_STATFS], [1], [usg])
+      fstype=SVR3])
+fi
+
 if test $fstype = no; then
-AC_TRY_CPP([#include <sys/statfs.h>
-#include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
-fi
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statfs.h>
+#include <sys/vmount.h>
+]])], AC_DEFINE([FSTYPE_AIX_STATFS], [1], [aix]) fstype=AIX)
+fi
+
 if test $fstype = no; then
-AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
-fi
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <mntent.h>
+]])], AC_DEFINE([FSTYPE_MNTENT], [1], [mtent]) fstype=4.3BSD)
+fi
+
 if test $fstype = no; then
-AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF)
-fi
+AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE([FSTYPE_STATFS], [1], [statfs]) fstype=4.4BSD/OSF)
+fi
+
 if test $fstype = no; then
-AC_TRY_CPP([#include <sys/mount.h>
-#include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/mount.h>
+#include <sys/fs_types.h>
+]])], AC_DEFINE([FSTYPE_GETMNT], [1], [getmnt]) fstype=Ultrix)
 fi
 AC_MSG_RESULT($fstype)
 
 sh_libsocket=
-
 dnl Solaris needs -lsocket and -lnsl. Unisys system includes
 dnl gethostbyname in libsocket but needs libnsl for socket.
@@ -485,5 +504,5 @@
    			 LIBS="$LIBS -lauparse"
 			 sh_auparse=yes
-			 AC_DEFINE(HAVE_AUPARSE_LIB, 1, [Define if you have the auparse lib])
+			 AC_DEFINE([HAVE_AUPARSE_LIB], [1], [Define if you have the auparse lib])
 			 ])
 fi
@@ -500,5 +519,6 @@
 
 AC_MSG_CHECKING(for socklen_t)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([[
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -508,10 +528,12 @@
 #endif
   socklen_t x;
-], [],[
+]], [[]])],
+[
   AC_MSG_RESULT(yes)
   AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[socklen_t], [type of arg3 of accept])
   AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have socklen_t])
 ],[
-  AC_TRY_COMPILE([
+  AC_COMPILE_IFELSE(
+	[AC_LANG_PROGRAM([[
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -521,5 +543,6 @@
 #endif
     int accept (int, struct sockaddr *, size_t *);
-    ],[],[
+    ]],[[]])],
+    [
       AC_MSG_RESULT(size_t)
       AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[size_t], [type of arg3 of accept])
@@ -556,5 +579,5 @@
 dnl *****************************************
 
-AC_C_LONG_DOUBLE
+AC_TYPE_LONG_DOUBLE
 SH_CHECK_TYPEDEF(long long, HAVE_LONG_LONG)
 SH_CHECK_TYPEDEF(uint16_t, HAVE_UINT16_T)
@@ -565,5 +588,5 @@
    sh_sizeof_unsigned_long_long=`echo "$ac_cv_sizeof_unsigned_long_long" | sed 's%[^0-9]%%g'`
    if test "$sh_sizeof_unsigned_long_long" = "8"; then
-      AC_DEFINE(HAVE_LONG_LONG_64, 1, [Define if you have 64bit long long])
+      AC_DEFINE([HAVE_LONG_LONG_64], [1], [Define if you have 64bit long long])
    fi
 fi
@@ -581,16 +604,16 @@
 sh_sizeof_unsigned_long=`echo "$ac_cv_sizeof_unsigned_long" | sed 's%[^0-9]%%g'`
 if test "$sh_sizeof_unsigned_long"  = "4"; then
-	AC_DEFINE(HAVE_LONG_32)
+	AC_DEFINE([HAVE_LONG_32], [1], [long32])
 fi
 if test "$sh_sizeof_unsigned_long"  = "8"; then
-	AC_DEFINE(HAVE_LONG_64)
+	AC_DEFINE([HAVE_LONG_64], [1], [long64])
 fi
 sh_sizeof_unsigned_int=`echo "$ac_cv_sizeof_unsigned_int" | sed 's%[^0-9]%%g'`
 if test "$sh_sizeof_unsigned_int"   = "4"; then
-	AC_DEFINE(HAVE_INT_32)
+	AC_DEFINE([HAVE_INT_32], [1], [int32])
 fi
 sh_sizeof_unsigned_short=`echo "$ac_cv_sizeof_unsigned_short" | sed 's%[^0-9]%%g'`
 if test "$sh_sizeof_unsigned_short" = "4"; then
-	AC_DEFINE(HAVE_SHORT_32)
+	AC_DEFINE([HAVE_SHORT_32], [1], [short32])
 fi
 
@@ -612,19 +635,28 @@
 AC_MSG_CHECKING(whether struct stat has a st_flags field)
 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
-        AC_TRY_COMPILE([#include <sys/stat.h>],
-                [struct stat stat; stat.st_flags = 0;],
+        AC_COMPILE_IFELSE(
+		[AC_LANG_PROGRAM([[
+#include <sys/stat.h>
+]],
+                [[struct stat stat; stat.st_flags = 0;]])],
                 [e2fsprogs_cv_struct_st_flags=yes],
-                [e2fsprogs_cv_struct_st_flags=no]))
+                [e2fsprogs_cv_struct_st_flags=no]
+		))
 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
+
 if test "$e2fsprogs_cv_struct_st_flags" = yes; then
   AC_MSG_CHECKING(whether st_flags field is useful)
   AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
-        AC_TRY_COMPILE([#include <sys/stat.h>],
-                [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
+        AC_COMPILE_IFELSE(
+		[AC_LANG_PROGRAM([[
+#include <sys/stat.h>
+]],
+                [[struct stat stat; stat.st_flags |= UF_IMMUTABLE;]])],
                 [e2fsprogs_cv_struct_st_flags_immut=yes],
-                [e2fsprogs_cv_struct_st_flags_immut=no]))
+                [e2fsprogs_cv_struct_st_flags_immut=no]
+		))
   AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
   if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
-          AC_DEFINE(HAVE_STAT_FLAGS)
+          AC_DEFINE([HAVE_STAT_FLAGS], [1], [Have stat flags])
   fi
 fi
@@ -634,67 +666,76 @@
 dnl
 AC_MSG_CHECKING(for struct cmsgcred)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #include <sys/socket.h>
-],[
+]],[[
 struct cmsgcred cred;
 
 cred.cmcred_pid = 0;
-],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
+]])],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
 AC_MSG_RESULT($sh_have_struct_cmsgcred)
 
 if test x$sh_have_struct_cmsgcred = xyes; then
-    AC_DEFINE(HAVE_STRUCT_CMSGCRED,1,[Have cmsgcred structure])
+    AC_DEFINE([HAVE_STRUCT_CMSGCRED], [1], [Have cmsgcred structure])
 fi
 
 AC_MSG_CHECKING(for struct fcred)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM([[
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/ucred.h>
-],[
+]],[[
 struct fcred sockcred;
-],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
+]])],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
 AC_MSG_RESULT($sh_have_struct_fcred)
 
 if test x$sh_have_struct_fcred = xyes; then
-    AC_DEFINE(HAVE_STRUCT_FCRED,1,[Have fcred structure])
+    AC_DEFINE([HAVE_STRUCT_FCRED], [1], [Have fcred structure])
 fi
 
 AC_MSG_CHECKING(for struct sockcred)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM([[
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/ucred.h>
-],[
+]],[[
 struct sockcred sockcred;
-],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
+]])],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
 AC_MSG_RESULT($sh_have_struct_sockcred)
 
 if test x$sh_have_struct_sockcred = xyes; then
-    AC_DEFINE(HAVE_STRUCT_SOCKCRED,1,[Have sockcred structure])
+    AC_DEFINE([HAVE_STRUCT_SOCKCRED], [1], [Have sockcred structure])
 fi
 
 AC_MSG_CHECKING(for SO_PEERCRED)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #include <sys/socket.h>
-],[
+]],[[
 int test = SO_PEERCRED;
-],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
+]])],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
 AC_MSG_RESULT($sh_have_SO_PEERCRED)
 
 if test x$sh_have_SO_PEERCRED = xyes; then
-    AC_DEFINE(HAVE_SO_PEERCRED,1,[Have SO_PEERCRED define])
+    AC_DEFINE([HAVE_SO_PEERCRED], [1], [Have SO_PEERCRED define])
 fi
 
 AC_MSG_CHECKING(for union semun)
-AC_TRY_COMPILE([#include <sys/types.h>
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM([[
+#include <sys/types.h>
 #include <sys/ipc.h>
-#include <sys/sem.h>],[union semun foo;], [sh_have_semun=yes], [sh_have_semun=no])
+#include <sys/sem.h>
+]],[[
+union semun foo;
+]])], [sh_have_semun=yes], [sh_have_semun=no])
 AC_MSG_RESULT($sh_have_semun)
 if test x$sh_have_semun = xyes
 then
-  AC_DEFINE(HAVE_UNION_SEMUN, 1, [union semun already defined in sys/ipc.h or sys/sem.h])
+  AC_DEFINE([HAVE_UNION_SEMUN], [1], [union semun already defined in sys/ipc.h or sys/sem.h])
 fi
 
@@ -741,5 +782,5 @@
 if test -d "/proc/$$"
 then
-        AC_DEFINE([HAVE_PROCFS],[1],[Define if you have a proc fs])
+        AC_DEFINE([HAVE_PROCFS], [1], [Define if you have a proc fs])
 fi
 
@@ -755,5 +796,5 @@
 then
 	# LIBS="-lgmp $LIBS"
-	AC_DEFINE(HAVE_LIBGMP, 1, [Have GNU gmp library])
+	AC_DEFINE([HAVE_LIBGMP], [1], [Have GNU gmp library])
 fi
 AC_CHECK_HEADERS(gmp.h)
@@ -773,5 +814,5 @@
 	AC_MSG_ERROR([Cannot find ps in any of /usr/ucb /bin /usr/bin])
 fi
-AC_DEFINE_UNQUOTED([PSPATH], _("$PS"), [Path to ps])
+AC_DEFINE_UNQUOTED([PSPATH], [_("$PS")], [Path to ps executable])
 
 AC_MSG_CHECKING([how to use ps])
@@ -808,5 +849,5 @@
 	PSARG="-e"
 fi
-AC_DEFINE_UNQUOTED([PSARG], _("$PSARG"), [Argument for ps])
+AC_DEFINE_UNQUOTED([PSARG], [_("$PSARG")], [Argument for ps])
 AC_MSG_RESULT([$PS $PSARG])
 
@@ -821,5 +862,5 @@
 	[
 	if test "x${enable_db_reload}" = xyes; then
-		AC_DEFINE(RELOAD_DATABASE)
+		AC_DEFINE([RELOAD_DATABASE], [1], [database reload on SIGHUP])
 	fi
 	]
@@ -830,5 +871,5 @@
 	[
 	if test "x${enable_xml_log}" = xyes; then
-		AC_DEFINE(SH_USE_XML)
+		AC_DEFINE([SH_USE_XML], [1], [logfile in XML format])
 	fi
 	]
@@ -842,8 +883,8 @@
 		:
 	else
-		AC_DEFINE(SH_WITH_MAIL)
+		AC_DEFINE([SH_WITH_MAIL], [1], [internal SMTP mailer])
 	fi
 	],
-	[AC_DEFINE(SH_WITH_MAIL)]
+	[AC_DEFINE([SH_WITH_MAIL], [1], [internal SMTP mailer])]
 )
 
@@ -875,8 +916,8 @@
                 :
 	else
-		AC_DEFINE(WITH_EXTERNAL)
+		AC_DEFINE([WITH_EXTERNAL], [1], [can use external scripts])
         fi
         ],
-	[AC_DEFINE(WITH_EXTERNAL)]
+	[AC_DEFINE([WITH_EXTERNAL], [1], [can use external scripts])]
 )
 
@@ -886,6 +927,6 @@
        if test "x${ac_cv_header_sys_msg_h}" = "xyes"; then
 	   if test "x${enable_message_queue}" = xyes; then
-	       AC_DEFINE(WITH_MESSAGE_QUEUE)
-	       AC_DEFINE_UNQUOTED(MESSAGE_QUEUE_MODE, 0700)
+	       AC_DEFINE([WITH_MESSAGE_QUEUE], [1], [SysV message queue])
+	       AC_DEFINE_UNQUOTED([MESSAGE_QUEUE_MODE], [0700], [mode of message queue])
 	   elif test "x${enable_message_queue}" != xno; then
 	       echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
@@ -894,6 +935,6 @@
 		   grep ['0[0123456789][0123456789][0123456789]'] >/dev/null 2>&1 ||
 		   AC_MSG_ERROR([With --enable-message-queue=MODE, MODE must be an octal (0nnn) number])
-               AC_DEFINE(WITH_MESSAGE_QUEUE)
-               AC_DEFINE_UNQUOTED(MESSAGE_QUEUE_MODE, ${enable_message_queue})
+               AC_DEFINE([WITH_MESSAGE_QUEUE], [1], [SysV message queue])
+               AC_DEFINE_UNQUOTED([MESSAGE_QUEUE_MODE], [${enable_message_queue}], [mode of message queue])
            fi
        else
@@ -966,9 +1007,14 @@
 		     [],
 		     [ AC_MSG_ERROR([Could not find tcpd.h for libwrap. You need to install tcp_wrappers.]) ])
-     AC_TRY_LINK([ #include <tcpd.h>
-		   int allow_severity; int deny_severity; ],
-		 [ hosts_access((struct request_info *) 0); ],
-		 [ AC_DEFINE(SH_USE_LIBWRAP,1,[Build with tcp wrapper support]) ],
-		 [ AC_MSG_ERROR([Could not find the libwrap library.]) ])
+     AC_LINK_IFELSE(
+	[AC_LANG_PROGRAM([[
+#include <tcpd.h>
+]],[[
+int allow_severity;
+int deny_severity; 
+hosts_access((struct request_info *) 0); ]])],
+	[ AC_DEFINE([SH_USE_LIBWRAP], [1], [Build with tcp wrapper support]) ],
+	[ AC_MSG_ERROR([Could not find the libwrap library.]) ]
+	)
   fi ],
   AC_MSG_RESULT(no)
@@ -1072,5 +1118,5 @@
 			
 			*)
-				AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static])
+				AC_DEFINE([SH_COMPILE_STATIC], [1], [Define if compiling static])
 		   		sh_no_gcc_static=no
                         	LDFLAGS="$LDFLAGS -static"
@@ -1078,5 +1124,5 @@
 		    esac
                 else
-		   AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static])
+		   AC_DEFINE([SH_COMPILE_STATIC], [1], [Define if compiling static])
 		   sh_no_gcc_static=yes
                    case "$host_os" in
@@ -1149,5 +1195,5 @@
 fi
 AC_CHECK_FUNC(pmap_getmaps, 
-	AC_DEFINE([HAVE_PMAP_GETMAPS], [], [Define if pmap_getmaps available]), [],[])
+	AC_DEFINE([HAVE_PMAP_GETMAPS], [1], [Define if pmap_getmaps available]), [],[])
 
 	
@@ -1203,5 +1249,5 @@
 	       AM_PATH_LIBPRELUDE([0.9.6],
 	       [
-		AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
+		AC_DEFINE([HAVE_LIBPRELUDE], [1], [Have libprelude])
 		CFLAGS="$CFLAGS $LIBPRELUDE_PTHREAD_CFLAGS"
 		LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
@@ -1313,6 +1359,6 @@
 		CPPFLAGS="$CPPFLAGS -I${MYSQL_INC_DIR}"
 	  fi  
-          AC_DEFINE(WITH_MYSQL)
-          AC_DEFINE(WITH_DATABASE)
+          AC_DEFINE([WITH_MYSQL], [1], [Use mysql as database])
+          AC_DEFINE([WITH_DATABASE], [1], [Use a database])
           if test "x$zlib_found" = "xyes"
           then
@@ -1343,6 +1389,6 @@
 	  AC_CHECK_HEADERS(mysql/mysql.h)
         elif test "x${withval}" = "xpostgresql"; then
-          AC_DEFINE(WITH_POSTGRES)
-          AC_DEFINE(WITH_DATABASE)
+          AC_DEFINE([WITH_POSTGRES], [1], [Use postgres as database])
+          AC_DEFINE([WITH_DATABASE], [1], [Use a database])
 	  #
 	  PGCONF="no"
@@ -1489,6 +1535,6 @@
           CPPFLAGS="${CPPFLAGS} -I${ODBC_INC_DIR}"
           LIBS="${LIBS} -L${ODBC_LIB_DIR} -l$ODBC_LIB"
-          AC_DEFINE(WITH_ODBC)
-          AC_DEFINE(WITH_DATABASE)
+          AC_DEFINE([WITH_ODBC], [1], [Use odbc as database])
+          AC_DEFINE([WITH_DATABASE], [1], [Use a database])
 
 	elif test "x${withval}" = "xoracle"; then
@@ -1555,6 +1601,6 @@
 	    fi
           fi
-          AC_DEFINE(WITH_ORACLE)
-          AC_DEFINE(WITH_DATABASE)
+          AC_DEFINE([WITH_ORACLE], [1], [Use oracle as database])
+          AC_DEFINE([WITH_DATABASE], [1], [Use a database])
 
         else
@@ -1569,5 +1615,5 @@
 	if test "x${withval}" != xno; then
         	mycons="$withval"
-        	AC_DEFINE_UNQUOTED(DEFAULT_CONSOLE, _("${mycons}") )
+        	AC_DEFINE_UNQUOTED([DEFAULT_CONSOLE], [_("${mycons}")], [] )
 	fi
         ])
@@ -1583,5 +1629,5 @@
 	],
         [myaltcons="NULL"])
-AC_DEFINE_UNQUOTED(ALT_CONSOLE, _("${myaltcons}") )
+AC_DEFINE_UNQUOTED([ALT_CONSOLE], [_("${myaltcons}")], [] )
 
 AC_ARG_WITH(timeserver,
@@ -1590,5 +1636,5 @@
 	if test "x${withval}" != xno; then
         	mytimeserv="$withval"
-        	AC_DEFINE(HAVE_NTIME)
+        	AC_DEFINE([HAVE_NTIME], [1], [use time server])
 	else
 		mytimeserv="NULL"
@@ -1596,5 +1642,5 @@
         ],
         mytimeserv="NULL")
-AC_DEFINE_UNQUOTED(DEFAULT_TIMESERVER, _("${mytimeserv}") )
+AC_DEFINE_UNQUOTED([DEFAULT_TIMESERVER], [_("${mytimeserv}")], []  )
 
 AC_ARG_WITH(alttimeserver,
@@ -1603,5 +1649,5 @@
 	if test "x${withval}" != xno; then
         	myalttimeserv="$withval"
-        	AC_DEFINE(HAVE_NTIME)
+        	AC_DEFINE([HAVE_NTIME], [1], [use time server])
 	else
 		myalttimeserv="NULL"
@@ -1609,5 +1655,5 @@
         ],
         myalttimeserv="NULL")
-AC_DEFINE_UNQUOTED(ALT_TIMESERVER, _("${myalttimeserv}") )
+AC_DEFINE_UNQUOTED([ALT_TIMESERVER], [_("${myalttimeserv}")], []  )
 
 AC_ARG_ENABLE(login-watch,
@@ -1615,5 +1661,5 @@
         [
         if test "x${enable_login_watch}" = xyes; then
-                AC_DEFINE(SH_USE_UTMP)
+                AC_DEFINE([SH_USE_UTMP], [1], [watch for login/logout])
         fi
         ]
@@ -1624,5 +1670,5 @@
         [
         if test "x${enable_mounts_check}" = xyes; then
-                AC_DEFINE(SH_USE_MOUNTS)
+                AC_DEFINE([SH_USE_MOUNTS], [1], [check mount options])
         fi
         ]
@@ -1635,5 +1681,5 @@
 	   AC_CHECK_HEADER(pcre.h,
                            [ 
-			   AC_DEFINE(USE_LOGFILE_MONITOR, 1, [Define if you want the logfile monitor module.])
+			   AC_DEFINE([USE_LOGFILE_MONITOR], [1], [Define if you want the logfile monitor module.])
 			   LIBS="-lpcre $LIBS"
 			   ],
@@ -1641,14 +1687,14 @@
 				AC_CHECK_HEADER(pcre/pcre.h,
 			   	[
-			   	AC_DEFINE(USE_LOGFILE_MONITOR, 1, [Define if you want the logfile monitor module.])
-				AC_DEFINE(HAVE_PCRE_PCRE_H, 1, [Define if you have pcre/pcre.h.])
+			   	AC_DEFINE([USE_LOGFILE_MONITOR], [1], [Define if you want the logfile monitor module.])
+				AC_DEFINE([HAVE_PCRE_PCRE_H], [1], [Define if you have pcre/pcre.h.])
 			   	LIBS="-lpcre $LIBS"
 			   	],
-	                   	AC_MSG_ERROR([The --enable-logfile-monitor option requires libpcre. For compiling the pcre development package is needed.])
+	                   	[AC_MSG_ERROR([The --enable-logfile-monitor option requires libpcre. For compiling the pcre development package is needed.])]
 				)
 			  ]
 	   )
 	   AC_CHECK_LIB(pcre, pcre_dfa_exec, [
-	   		      AC_DEFINE([HAVE_PCRE_DFA_EXEC], 1, [Define if you have pcre_dfa_exec])
+	   		      AC_DEFINE([HAVE_PCRE_DFA_EXEC], [1], [Define if you have pcre_dfa_exec])
 			      ], [
 			      AC_MSG_WARN([pcre_dfa_exec not available])
@@ -1670,5 +1716,5 @@
 		fi
 		LIBS="$LIBS $LIBRT"
-                AC_DEFINE(SH_USE_PROCESSCHECK, [1], [Define if you want to check processes])
+                AC_DEFINE([SH_USE_PROCESSCHECK], [1], [Define if you want to check processes])
         fi
         ]
@@ -1679,5 +1725,5 @@
         [
         if test "x${enable_port_check}" = xyes; then
-                AC_DEFINE(SH_USE_PORTCHECK, [1], [Define if you want to check ports])
+                AC_DEFINE([SH_USE_PORTCHECK], [1], [Define if you want to check ports])
         fi
         ]
@@ -1688,5 +1734,5 @@
        [
        if test "x${enableval}" = "xyes"; then
-               AC_DEFINE(SH_USE_USERFILES)
+               AC_DEFINE([SH_USE_USERFILES], [1], [check user files])
        fi
        ]
@@ -1698,11 +1744,11 @@
         if test "x${enable_debug}" = "xyes"; then
                 if test "x${mydebugflag}" != "xyes"; then
-                        AC_DEFINE(MEM_DEBUG)
+                        AC_DEFINE([MEM_DEBUG], [1], [] )
                 fi
-                AC_DEFINE(WITH_TPT)
-                AC_DEFINE(SL_DEBUG)
-		AC_DEFINE(DNMALLOC_CHECKS, 1, [Debug dnmalloc])
-		AC_DEFINE(PARANOIA, 0, [Paranoia level for dnmalloc])
-                AC_DEFINE(SL_FAIL_ON_ERROR)
+                AC_DEFINE([WITH_TPT], [1], [] )
+                AC_DEFINE([SL_DEBUG], [1], [] )
+		AC_DEFINE([DNMALLOC_CHECKS], [1], [Debug dnmalloc])
+		AC_DEFINE([PARANOIA], [0], [Paranoia level for dnmalloc])
+                AC_DEFINE([SL_FAIL_ON_ERROR], [1], [] )
                 if test "x${myneedg3}" = "xyes"; then
                         mydebugdef="-g3"
@@ -1712,6 +1758,6 @@
                 mydebugit="yes"
 	elif test "x${enable_debug}" = "xmem"; then
-                AC_DEFINE(MEM_DEBUG)
-		AC_DEFINE(SH_ABORT_ON_ERROR, 1, [Use abort])
+                AC_DEFINE([MEM_DEBUG], [1], [] )
+		AC_DEFINE([SH_ABORT_ON_ERROR], [1], [Use abort])
                 if test "x${myneedg3}" = "xyes"; then
                         mydebugdef="-g3"
@@ -1721,5 +1767,5 @@
 		mydebugit="yes"
 	elif test "x${enable_debug}" = "xgdb"; then
-	     	AC_DEFINE(SH_ABORT_ON_ERROR, 1, [Use abort])
+	     	AC_DEFINE([SH_ABORT_ON_ERROR], [1], [Use abort])
                 if test "x${myneedg3}" = "xyes"; then
                         mydebugdef="-g3"
@@ -1749,5 +1795,5 @@
 if test "x${samhain_64_asm}" = xyes; then
    	if test "x${sh_enable_asm}" = xyes; then
-	   AC_DEFINE([TIGER_OPT_ASM],1,[Define to use tiger x86_64 optimized assembly])
+	   AC_DEFINE([TIGER_OPT_ASM], [1], [Define to use tiger x86_64 optimized assembly])
 	fi
 fi
@@ -1757,5 +1803,5 @@
         [
         if test "x${enable_ipv6}" = xno; then
-		AC_DEFINE(USE_IPV4,1,[Define if you do not want IPv6])
+		AC_DEFINE([USE_IPV4], [1], [Define if you do not want IPv6])
         fi
         ]
@@ -1797,5 +1843,5 @@
 
 if test "x${sh_dnmalloc_enabled}" = xno; then
-   AC_DEFINE(USE_SYSTEM_MALLOC,1,[Define if you want to use the system malloc])
+   AC_DEFINE([USE_SYSTEM_MALLOC], [1], [Define if you want to use the system malloc])
 fi
 
@@ -1805,5 +1851,5 @@
         if test "x${enable_ptrace}" = xyes; then
                 if test "x$mydebugit" != "xyes"; then
-                        AC_DEFINE(SCREW_IT_UP)
+                        AC_DEFINE([SCREW_IT_UP], [1], [anti debug])
                 fi
         fi
@@ -1878,8 +1924,9 @@
 esac
 
+dnl for entropy gathering daemon
 AC_ARG_WITH(egd-socket,
     [  --with-egd-socket=NAME  	EGD socket name],
             egd_socket_name="$withval", egd_socket_name="" )
-AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, _("$egd_socket_name") )
+AC_DEFINE_UNQUOTED([EGD_SOCKET_NAME], [_("$egd_socket_name")], []  )
 
 dnl
@@ -1893,9 +1940,9 @@
   ;;
 egd)
-  AC_DEFINE(HAVE_EGD_RANDOM)
+  AC_DEFINE([HAVE_EGD_RANDOM], [1], [entropy gathering daemon])
   try_dev_random=no
   ;;
 unix)
-  AC_DEFINE(HAVE_UNIX_RANDOM)
+  AC_DEFINE([HAVE_UNIX_RANDOM], [1], [unix entropy gathering])
   try_dev_random=no
   ;;
@@ -1906,21 +1953,21 @@
   AC_MSG_CHECKING(whether /dev/random exists)
     if test -r "/dev/srandom" && test -c "/dev/srandom"; then
-        AC_DEFINE(HAVE_URANDOM)
-        AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/srandom") )
+        AC_DEFINE([HAVE_URANDOM], [1], [] )
+        AC_DEFINE_UNQUOTED([NAME_OF_DEV_RANDOM], [_("/dev/srandom")], []  )
         AC_MSG_RESULT(yes)
         if test -r "/dev/urandom" && test -c "/dev/urandom"; then
-          AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
+          AC_DEFINE_UNQUOTED([NAME_OF_DEV_URANDOM], [_("/dev/urandom")], []  )
         fi
     else
         if test -r "/dev/random" && test -c "/dev/random"; then
-                AC_DEFINE(HAVE_URANDOM)
-                AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, _("/dev/random") )
+                AC_DEFINE([HAVE_URANDOM], [1], [] )
+                AC_DEFINE_UNQUOTED([NAME_OF_DEV_RANDOM], [_("/dev/random")], []  )
                 AC_MSG_RESULT(yes)
                 if test -r "/dev/urandom" && test -c "/dev/urandom"; then
-                   AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, _("/dev/urandom") )
+                   AC_DEFINE_UNQUOTED([NAME_OF_DEV_URANDOM], [_("/dev/urandom")], []  )
                 fi
         else
                 AC_MSG_RESULT(no)
-                AC_DEFINE(HAVE_UNIX_RANDOM)
+                AC_DEFINE([HAVE_UNIX_RANDOM], [1], [unix entropy gathering])
         fi
     fi
@@ -1932,5 +1979,5 @@
         [
         if test "x${enable_udp}" = xyes; then
-                AC_DEFINE(INET_SYSLOG)
+                AC_DEFINE([INET_SYSLOG], [1], [server may listen on 514/udp for syslog reports])
         fi
         ]
@@ -1947,6 +1994,6 @@
 )
 if test "x${myencrypt}" = "xyes"; then
-        AC_DEFINE(SH_ENCRYPT)
-        AC_DEFINE(SH_ENCRYPT_2)
+        AC_DEFINE([SH_ENCRYPT], [1], [client/server encryption])
+        AC_DEFINE([SH_ENCRYPT_2], [1], [client/server encryption v2])
 fi
 
@@ -1961,5 +2008,5 @@
 )
 if test "x${sh_use_srp_proto}" = xyes; then
-        AC_DEFINE(USE_SRP_PROTOCOL)
+        AC_DEFINE([USE_SRP_PROTOCOL], [1], [auth with SRP])
 fi
 
@@ -1972,5 +2019,5 @@
 	],
 	[myport="49777"])
-AC_DEFINE_UNQUOTED(SH_DEFAULT_PORT, ${myport})
+AC_DEFINE_UNQUOTED([SH_DEFAULT_PORT], [${myport}], [TCP port for client/server connection])
 AC_SUBST(myport)
 
@@ -1988,5 +2035,5 @@
 	],
         [mylogsrv="NULL"])
-AC_DEFINE_UNQUOTED(DEFAULT_LOGSERVER, _("${mylogsrv}") )
+AC_DEFINE_UNQUOTED([DEFAULT_LOGSERVER], [_("${mylogsrv}")], []  )
 AC_SUBST(mylogsrv)
 
@@ -2004,5 +2051,5 @@
 	],
         [myaltlogsrv="NULL"])
-AC_DEFINE_UNQUOTED(ALT_LOGSERVER, _("${myaltlogsrv}"))
+AC_DEFINE_UNQUOTED([ALT_LOGSERVER], [_("${myaltlogsrv}")], [] )
 
 
@@ -2017,5 +2064,5 @@
         [
 	if test "x${enableval}" != "x"; then
-		AC_DEFINE(SH_STEALTH_NOCL)
+		AC_DEFINE([SH_STEALTH_NOCL], [1], [restrict CL parsing])
 	fi
 	if test "x${enableval}" = "xstop" || test "x${enableval}" = "xstart"; then
@@ -2034,9 +2081,10 @@
 	]
 )
-AC_DEFINE_UNQUOTED(NOCL_CODE, _("${nocl_code}") )
+AC_DEFINE_UNQUOTED([NOCL_CODE], [_("${nocl_code}")], [code to enable CL parsing] )
 AC_SUBST(nocl_code)
 AC_ARG_ENABLE(stealth,
         [  --enable-stealth=XOR_VAL	enable stealth mode [[no]]],
-        [AC_DEFINE(SH_STEALTH)
+        [
+	AC_DEFINE([SH_STEALTH], [1], [enable stealth mode])
 	if test "x${enableval}" != "xyes"; then
 		echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
@@ -2063,6 +2111,6 @@
         [  --enable-micro-stealth=XOR_VAL	enable micro stealth mode [[no]]],
         [
-	AC_DEFINE(SH_STEALTH)
-	AC_DEFINE(SH_STEALTH_MICRO)
+	AC_DEFINE([SH_STEALTH], [1], [enable stealth mode])
+	AC_DEFINE([SH_STEALTH_MICRO], [1], [enable micro stealth mode])
 	if test "x${enableval}" != "xyes"; then
 		echo "${enableval}" | grep ['[^0123456789]'] >/dev/null 2>&1 &&
@@ -2139,5 +2187,5 @@
 	fi
 	])
-AC_DEFINE_UNQUOTED(DEFAULT_IDENT, _("${myident}") )
+AC_DEFINE_UNQUOTED([DEFAULT_IDENT], [_("${myident}")], [use this as install name] )
 AC_SUBST(myident)
 AC_SUBST(need_user_install)
@@ -2148,6 +2196,5 @@
 AC_SUBST(xor_code)
 
-AC_DEFINE_UNQUOTED(XOR_CODE, ${xor_code})
-AC_DEFINE_UNQUOTED(SH_SYSCALLTABLE, ${sh_syscalltable})
+AC_DEFINE_UNQUOTED([XOR_CODE], [${xor_code}], [] )
 
 
@@ -2156,7 +2203,7 @@
 exepack_state2=`${srcdir}/c_random.sh 2>/dev/null`
 
-AC_DEFINE_UNQUOTED(EXEPACK_STATE_0, ${exepack_state0})
-AC_DEFINE_UNQUOTED(EXEPACK_STATE_1, ${exepack_state1})
-AC_DEFINE_UNQUOTED(EXEPACK_STATE_2, ${exepack_state2})
+AC_DEFINE_UNQUOTED([EXEPACK_STATE_0], [${exepack_state0}], [exepack init key p1])
+AC_DEFINE_UNQUOTED([EXEPACK_STATE_1], [${exepack_state1}], [exepack init key p2])
+AC_DEFINE_UNQUOTED([EXEPACK_STATE_2], [${exepack_state2}], [exepack init key p3])
 
 
@@ -2165,5 +2212,5 @@
 	[
 	if test "x${enableval}" = "xyes"; then 
-		AC_DEFINE(SH_USE_SUIDCHK)
+		AC_DEFINE([SH_USE_SUIDCHK], [1], [check for suid/sgid files])
 	fi
 	]
@@ -2236,8 +2283,8 @@
 pos_tf=`expr $pos_tf_2 + 1`
 AC_MSG_RESULT(${pos_tf})
-AC_DEFINE_UNQUOTED(POS_TF, ${pos_tf} )
+AC_DEFINE_UNQUOTED([POS_TF], [${pos_tf}], []  )
 
 mykeybase=`echo ${my_key_A},${my_key_B}`
-AC_DEFINE_UNQUOTED(DEFKEY, ${mykeybase} )
+AC_DEFINE_UNQUOTED([DEFKEY], [${mykeybase}], []  )
 AC_SUBST(mykeybase)
 
@@ -2307,7 +2354,7 @@
 		fi
 	  fi
-	  AC_DEFINE([WITH_SIG], 1, [Define if signature checking is supported.])
-	  AC_DEFINE([WITH_SIGNIFY], 1, [Define if using OpenBSD signify for signature checking.])
-	  AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], _("${mysignify}"), [Define as path to signing binary])
+	  AC_DEFINE([WITH_SIG], [1], [Define if signature checking is supported.])
+	  AC_DEFINE([WITH_SIGNIFY], [1], [Define if using OpenBSD signify for signature checking.])
+	  AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], [_("${mysignify}")], [Define as path to signing binary])
 	  AC_SUBST(mysignify)
 	fi
@@ -2326,6 +2373,6 @@
 			fi
 		fi
-		AC_DEFINE([HAVE_SIG_KEY_HASH], 1, [Define if signing binary checksum available.])
-		AC_DEFINE_UNQUOTED([SIG_KEY_HASH], _("${withval}"), [Define as the signify public key checksum.] )
+		AC_DEFINE([HAVE_SIG_KEY_HASH], [1], [Define if signing binary checksum available.])
+		AC_DEFINE_UNQUOTED([SIG_KEY_HASH], [_("${withval}")], [Define as the signify public key checksum.] )
 	fi
 	]
@@ -2397,7 +2444,7 @@
 		fi
 	  fi
-	  AC_DEFINE([WITH_SIG], 1, [Define if signature checking is supported.])
-	  AC_DEFINE(WITH_GPG)
-	  AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], _("${mygpg}"), [Define as path to signing binary])
+	  AC_DEFINE([WITH_SIG], [1], [Define if signature checking is supported.])
+	  AC_DEFINE([WITH_GPG], [1], [] )
+	  AC_DEFINE_UNQUOTED([DEFAULT_SIG_PATH], [_("${mygpg}")], [Define as path to signing binary])
 	  AC_SUBST(mygpg)
 	fi
@@ -2444,6 +2491,6 @@
 			fi
 		fi
-		AC_DEFINE([HAVE_SIG_CHECKSUM], 1, [Define if signing binary checksum available.])
-		AC_DEFINE_UNQUOTED([SIG_HASH], _("${mychk}"), [Define as the signing binary TIGER192 checksum.] )
+		AC_DEFINE([HAVE_SIG_CHECKSUM], [1], [Define if signing binary checksum available.])
+		AC_DEFINE_UNQUOTED([SIG_HASH], [_("${mychk}")], [Define as the signing binary TIGER192 checksum.] )
 		echo "${mychk}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef CHKSUM_H"; print "#define CHKSUM_H"; print "char sigchk[50];"; for (i=1; i <= m; i++) printf "sigchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "sigchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_sig_chksum.h 
 	fi
@@ -2453,6 +2500,6 @@
 	then
 		if test "x${mychk}" != "x"; then
-		   	AC_DEFINE([HAVE_SIG_CHECKSUM], 1, [Define if signing binary checksum available.])
-			AC_DEFINE_UNQUOTED([SIG_HASH], _("${mychk}"), [Define as the signing binary TIGER192 checksum.] )
+		   	AC_DEFINE([HAVE_SIG_CHECKSUM], [1], [Define if signing binary checksum available.])
+			AC_DEFINE_UNQUOTED([SIG_HASH], [_("${mychk}")], [Define as the signing binary TIGER192 checksum.] )
 			echo "${mychk}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef CHKSUM_H"; print "#define CHKSUM_H"; print "char sigchk[50];"; for (i=1; i <= m; i++) printf "sigchk[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "sigchk[48] = %c%c0%c;\n", 39, 92, 39; print "#endif"; }' > sh_sig_chksum.h 
 		fi
@@ -2475,6 +2522,6 @@
 			then
 				myfp="${withval0}"
-				AC_DEFINE(USE_FINGERPRINT)
-				AC_DEFINE_UNQUOTED(SH_GPG_FP, _("${myfp}") )
+				AC_DEFINE([USE_FINGERPRINT], [1], [] )
+				AC_DEFINE_UNQUOTED([SH_GPG_FP], [_("${myfp}")], []  )
 				echo "${myfp}" | sed 's,.*:,,g' | sed 's, ,,g' | sed 's,\(.\),\1:,g' | awk '{ split($0, arr, ":"); m = length($1)/2; print "#ifndef FINGERPRINT_H"; print "#define FINGERPRINT_H"; printf "char gpgfp[%d];\n", m+1; for (i=1; i <= m; i++) printf "gpgfp[%d] = %c%s%c;\n", i-1, 39, arr[i], 39; printf "gpgfp[%d] = %c%c0%c;\n", m, 39, 92, 39; print "#endif"; }' > sh_gpg_fp.h 
 			else
@@ -2516,5 +2563,5 @@
 	],
         [myrcp="NULL"])
-AC_DEFINE_UNQUOTED(DEFAULT_MAILADDRESS, _("${myrcp}") )
+AC_DEFINE_UNQUOTED([DEFAULT_MAILADDRESS], [_("${myrcp}")], []  )
 
 
@@ -2527,5 +2574,5 @@
 	mysender="daemon"
 	])
-AC_DEFINE_UNQUOTED(DEFAULT_SENDER, _("${mysender}") )
+AC_DEFINE_UNQUOTED([DEFAULT_SENDER], [_("${mysender}")], []  )
 
 
@@ -2555,5 +2602,5 @@
 	],
         [mytrust="0"] )
-AC_DEFINE_UNQUOTED(SL_ALWAYS_TRUSTED, ${mytrust} )
+AC_DEFINE_UNQUOTED([SL_ALWAYS_TRUSTED], [${mytrust}], [UIDs of trusted users] )
 AC_SUBST(mytrust)
 
@@ -2565,12 +2612,12 @@
 	if test "x${cross_compiling}" = xyes; then
 		mytmpdir="$withval"
-		AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
+		AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], []  )
 	else
 		if test -d "${withval}"; then
 			mytmpdir="$withval"
-			AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
+			AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], []  )
 		else
 			mytmpdir="$withval"
-			AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
+			AC_DEFINE_UNQUOTED([SH_TMPDIR], [_("${mytmpdir}")], []  )
 			AC_MSG_WARN([--with-tmp-dir: tmp directory ${withval} does not exist])
 		fi
@@ -2672,5 +2719,5 @@
 	]
 )
-AC_DEFINE_UNQUOTED(DEFAULT_CONFIGFILE, _("${myconffile}") )
+AC_DEFINE_UNQUOTED([DEFAULT_CONFIGFILE], [_("${myconffile}")], []  )
 AC_SUBST(myconffile)
 AC_SUBST(myrpmconffile)
@@ -2694,6 +2741,6 @@
 	]
 )
-AC_DEFINE_UNQUOTED(DEFAULT_ERRFILE, _("${mylogfile}") )
-AC_DEFINE_UNQUOTED(DEFAULT_LOGDIR, _("${mylogdir}") )
+AC_DEFINE_UNQUOTED([DEFAULT_ERRFILE], [_("${mylogfile}")], []  )
+AC_DEFINE_UNQUOTED([DEFAULT_LOGDIR], [_("${mylogdir}")], []  )
 AC_SUBST(mylogfile)
 AC_SUBST(mylogdir)
@@ -2717,6 +2764,6 @@
 	]
 )
-AC_DEFINE_UNQUOTED(DEFAULT_ERRLOCK, _("${mylockfile}") )
-AC_DEFINE_UNQUOTED(DEFAULT_PIDDIR, _("${mylockdir}") )
+AC_DEFINE_UNQUOTED([DEFAULT_ERRLOCK], [_("${mylockfile}")], []  )
+AC_DEFINE_UNQUOTED([DEFAULT_PIDDIR], [_("${mylockdir}")], []  )
 AC_SUBST(mylockfile)
 AC_SUBST(mylockdir)
@@ -2755,12 +2802,12 @@
 	myrpmdatafile="${mydatafile}"
 	])
-AC_DEFINE_UNQUOTED(DEFAULT_DATA_FILE, _("${mydatafile}") )
+AC_DEFINE_UNQUOTED([DEFAULT_DATA_FILE], [_("${mydatafile}")], []  )
 AC_SUBST(mydatafile)
 AC_SUBST(myrpmdatafile)
 
-AC_DEFINE_UNQUOTED(DEFAULT_DATAROOT, _("${mydataroot}") )
+AC_DEFINE_UNQUOTED([DEFAULT_DATAROOT], [_("${mydataroot}")], []  )
 AC_SUBST(mydataroot)
 
-AC_DEFINE_UNQUOTED(DEFAULT_QDIR, _("${mydataroot}/.quarantine") )
+AC_DEFINE_UNQUOTED([DEFAULT_QDIR], [_("${mydataroot}/.quarantine")], []  )
 AC_SUBST(myqdir)
 
@@ -2774,5 +2821,5 @@
         myhtmlfile="${mylogdir}/${install_name}.html"
 	])
-AC_DEFINE_UNQUOTED(DEFAULT_HTML_FILE, _("${myhtmlfile}") )
+AC_DEFINE_UNQUOTED([DEFAULT_HTML_FILE], [_("${myhtmlfile}")], []  )
 AC_SUBST(myhtmlfile)
 
@@ -2790,12 +2837,26 @@
 
 
-AC_DEFINE_UNQUOTED(SH_INSTALL_DIR,  _("${sbindir}"))
-AC_DEFINE_UNQUOTED(SH_INSTALL_PATH, _("${sbindir}/${install_name}"))
-AC_DEFINE_UNQUOTED(SH_INSTALL_NAME, _("${install_name}"))
-
-AC_CONFIG_HEADER(config.h)
-
-AC_OUTPUT(
-[
+AC_DEFINE_UNQUOTED([SH_INSTALL_DIR],  [_("${sbindir}")], [] )
+AC_DEFINE_UNQUOTED([SH_INSTALL_PATH], [_("${sbindir}/${install_name}")], [] )
+AC_DEFINE_UNQUOTED([SH_INSTALL_NAME], [_("${install_name}")], [] )
+
+AH_TOP([
+#ifndef SH_CONFIG_H
+#define SH_CONFIG_H
+])
+AH_BOTTOM([
+#ifdef SH_STEALTH
+char * globber(const char * string);
+#define _(string) globber(string) 
+#define N_(string) string
+#else
+#define _(string)  string 
+#define N_(string) string
+#endif
+
+#endif
+])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([
 Makefile
 samhain-install.sh
@@ -2823,6 +2884,6 @@
 scripts/check_samhain.pl
 deploy.sh
-],
-[
+])
+AC_CONFIG_COMMANDS([stamp-h],[
 echo timestamp > stamp-h
 chmod +x samhain-install.sh
@@ -2833,4 +2894,5 @@
 ]
 )
+AC_OUTPUT
 
 chmod +x deploy.sh
Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 582)
+++ /trunk/docs/Changelog	(revision 583)
@@ -1,3 +1,4 @@
 4.5.2
+	* fix autoreconf (problem reported by Pascal de Bruijn)
 	* add missing items to distclean Makefile target (problem
 	reported by Pascal de Bruijn)
Index: /trunk/include/sh_trace.h
===================================================================
--- /trunk/include/sh_trace.h	(revision 582)
+++ /trunk/include/sh_trace.h	(revision 583)
@@ -5,4 +5,13 @@
 /* This file should be included via samhain.h only.
  */
+#ifdef SL_DEBUG
+#define SDG_0RETU _("return.\n")
+#define SDG_TERRO _("ERROR: file=<%s>, line=<%d>, reason=<%s>\n")
+#define SDG_AERRO _("ERROR: file=<%s>, line=<%d>, failed_assertion=<%s>\n")
+#define SDG_AFAIL _("FAILED: file=<%s>, line=<%d>, assertion=<%s>\n")
+#define SDG_ENTER _("enter=<%s>\n")
+#define SDG_RETUR _("return=<%s>.\n")
+#define SDG_ERROR _("error=<%ld>.\n")
+#endif
 
 #ifdef SL_DEBUG
Index: /trunk/include/sh_unix.h
===================================================================
--- /trunk/include/sh_unix.h	(revision 582)
+++ /trunk/include/sh_unix.h	(revision 583)
@@ -391,14 +391,8 @@
 
 #ifdef HAVE_GETTIMEOFDAY
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 #endif
 
Index: /trunk/include/slib.h
===================================================================
--- /trunk/include/slib.h	(revision 582)
+++ /trunk/include/slib.h	(revision 583)
@@ -533,5 +533,5 @@
     /*@i@*/ if (assertion) ;                           \
     else {                                             \
-        dlog(0, FIL__, __LINE__, SDG_AFAIL,            \
+        dlog(0, FIL__, __LINE__, _("FAILED: file=<%s>, line=<%d>, assertion=<%s>\n"),            \
                  FIL__, __LINE__, astext);             \
         _exit(EXIT_FAILURE);                           \
@@ -621,5 +621,5 @@
 do {                                                                \
    if((long)(x) < 0) {                                              \
-      TPT((0,    FIL__, __LINE__, SDG_ERROR, (long)(x)))            \
+      TPT((0,    FIL__, __LINE__, _("error=<%ld>.\n"), (long)(x)))            \
       sl_errno=(x);                                                 \
     }                                                               \
Index: /trunk/src/minilzo.c
===================================================================
--- /trunk/src/minilzo.c	(revision 582)
+++ /trunk/src/minilzo.c	(revision 583)
@@ -82,12 +82,8 @@
 #else
 #  include <sys/types.h>
-#  if defined(STDC_HEADERS)
+#  if defined(__STDC__)
 #    include <string.h>
 #    include <stdlib.h>
-#  endif
-#  if defined(HAVE_STDDEF_H)
 #    include <stddef.h>
-#  endif
-#  if defined(HAVE_MEMORY_H)
 #    include <memory.h>
 #  endif
Index: /trunk/src/samhain.c
===================================================================
--- /trunk/src/samhain.c	(revision 582)
+++ /trunk/src/samhain.c	(revision 583)
@@ -34,15 +34,8 @@
 #include <errno.h>
 
-
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 #ifdef HAVE_MEMORY_H
Index: /trunk/src/sh_entropy.c
===================================================================
--- /trunk/src/sh_entropy.c	(revision 582)
+++ /trunk/src/sh_entropy.c	(revision 583)
@@ -30,15 +30,8 @@
 #endif
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
-
 
 #include <stdlib.h>
Index: /trunk/src/sh_extern.c
===================================================================
--- /trunk/src/sh_extern.c	(revision 582)
+++ /trunk/src/sh_extern.c	(revision 583)
@@ -74,15 +74,8 @@
 #include <sys/wait.h>
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
-
 
 #include "samhain.h"
Index: /trunk/src/sh_getopt.c
===================================================================
--- /trunk/src/sh_getopt.c	(revision 582)
+++ /trunk/src/sh_getopt.c	(revision 583)
@@ -624,5 +624,5 @@
   fprintf (stdout,
 	   _("This is samhain (%s), "\
-	     "(c) 1999-2008 Rainer Wichmann (http://la-samhna.de).\n"),
+	     "(c) 1999-2024 Rainer Wichmann (http://la-samhna.de).\n"),
 	   VERSION);
   fprintf (stdout, "%s",_("This software comes with ABSOLUTELY NO WARRANTY. "));
@@ -714,5 +714,5 @@
   fprintf (stdout,
 	   _("This is samhain (%s), "\
-	     "(c) 1999-2006 Rainer Wichmann (http://la-samhna.de).\n"),
+	     "(c) 1999-2024 Rainer Wichmann (http://la-samhna.de).\n"),
 	   VERSION);
   fprintf (stdout, "%s",_("This software comes with ABSOLUTELY NO WARRANTY. "));
Index: /trunk/src/sh_hash.c
===================================================================
--- /trunk/src/sh_hash.c	(revision 582)
+++ /trunk/src/sh_hash.c	(revision 583)
@@ -2882,14 +2882,8 @@
 } 
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 static int ListFullDetail    = S_FALSE;
Index: /trunk/src/sh_html.c
===================================================================
--- /trunk/src/sh_html.c	(revision 582)
+++ /trunk/src/sh_html.c	(revision 583)
@@ -24,14 +24,9 @@
 #include <stdlib.h>
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
+
 #include <unistd.h>
 
Index: /trunk/src/sh_login_track.c
===================================================================
--- /trunk/src/sh_login_track.c	(revision 582)
+++ /trunk/src/sh_login_track.c	(revision 583)
@@ -58,15 +58,8 @@
 
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
-
 
 #define SH_LTRACK_VERSION 1
Index: /trunk/src/sh_mail.c
===================================================================
--- /trunk/src/sh_mail.c	(revision 582)
+++ /trunk/src/sh_mail.c	(revision 583)
@@ -34,15 +34,8 @@
 #if defined(SH_WITH_MAIL)
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
-
 
 #ifdef HAVE_MEMORY_H
Index: /trunk/src/sh_prelude.c
===================================================================
--- /trunk/src/sh_prelude.c	(revision 582)
+++ /trunk/src/sh_prelude.c	(revision 583)
@@ -41,18 +41,8 @@
 #include <sys/types.h>
 
-#if TIME_WITH_SYS_TIME
-
-# include <sys/time.h>
-# include <time.h>
-
-#else
-
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-
-#endif
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
 
 #include <unistd.h>
Index: /trunk/src/sh_schedule.c
===================================================================
--- /trunk/src/sh_schedule.c	(revision 582)
+++ /trunk/src/sh_schedule.c	(revision 583)
@@ -42,14 +42,8 @@
 #endif
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 #include "samhain.h"
Index: /trunk/src/sh_socket.c
===================================================================
--- /trunk/src/sh_socket.c	(revision 582)
+++ /trunk/src/sh_socket.c	(revision 583)
@@ -33,14 +33,8 @@
 #include <string.h>
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 #include "samhain.h"
Index: /trunk/src/sh_srp.c
===================================================================
--- /trunk/src/sh_srp.c	(revision 582)
+++ /trunk/src/sh_srp.c	(revision 583)
@@ -28,4 +28,17 @@
 
 #ifdef USE_SRP_PROTOCOL
+
+/* dont modify this, unless you know what you do
+ */
+#define SRP_GENERATOR_1024      "2"
+#define SRP_MODULUS_1024_1        \
+_("f488fd584e49dbcd20b49de49107366b336c380d451d0f7c88b31c7c5b2d8ef6") 
+#define SRP_MODULUS_1024_2        \
+_("f3c923c043f0a55b188d8ebb558cb85d38d334fd7c175743a31d186cde33212c") 
+#define SRP_MODULUS_1024_3        \
+_("b52aff3ce1b1294018118d7c84a70a72d686c40319c807297aca950cd9969fab")
+#define SRP_MODULUS_1024_4        \
+_("d00a509b0246d3083d66a45d419f9c7cbd894b221926baaba25ec355e92f78c7")
+
 
 #if (defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER))
Index: /trunk/src/sh_suidchk.c
===================================================================
--- /trunk/src/sh_suidchk.c	(revision 582)
+++ /trunk/src/sh_suidchk.c	(revision 583)
@@ -42,14 +42,8 @@
 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) 
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 #ifdef HAVE_DIRENT_H
Index: /trunk/src/sh_unix.c
===================================================================
--- /trunk/src/sh_unix.c	(revision 582)
+++ /trunk/src/sh_unix.c	(revision 583)
@@ -58,14 +58,8 @@
 #endif
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 #ifdef HAVE_SYS_SELECT_H
Index: /trunk/src/sh_utils.c
===================================================================
--- /trunk/src/sh_utils.c	(revision 582)
+++ /trunk/src/sh_utils.c	(revision 583)
@@ -27,15 +27,8 @@
 #include <unistd.h>
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
-
 
 #include "samhain.h"
Index: /trunk/src/sh_xfer_client.c
===================================================================
--- /trunk/src/sh_xfer_client.c	(revision 582)
+++ /trunk/src/sh_xfer_client.c	(revision 583)
@@ -59,14 +59,8 @@
 #endif
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 #ifdef HAVE_SYS_SELECT_H
Index: /trunk/src/sh_xfer_server.c
===================================================================
--- /trunk/src/sh_xfer_server.c	(revision 582)
+++ /trunk/src/sh_xfer_server.c	(revision 583)
@@ -59,22 +59,8 @@
 #endif
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
-
-/*
-#ifdef TM_IN_SYS_TIME
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-*/
 
 #ifdef HAVE_SYS_SELECT_H
Index: /trunk/src/sh_xfer_syslog.c
===================================================================
--- /trunk/src/sh_xfer_syslog.c	(revision 582)
+++ /trunk/src/sh_xfer_syslog.c	(revision 583)
@@ -32,14 +32,8 @@
 #include <netinet/in.h>
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 #include <unistd.h>
Index: /trunk/src/slib.c
===================================================================
--- /trunk/src/slib.c	(revision 582)
+++ /trunk/src/slib.c	(revision 583)
@@ -35,14 +35,8 @@
 #endif
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
-#else
+#endif
 #include <time.h>
-#endif
-#endif
 
 #ifdef HAVE_MEMORY_H
Index: /trunk/stamp-h.in
===================================================================
--- /trunk/stamp-h.in	(revision 583)
+++ /trunk/stamp-h.in	(revision 583)
@@ -0,0 +1,1 @@
+timestamp
