Index: configure.in
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/configure.in,v
retrieving revision 1.208
diff -u -r1.208 configure.in
--- configure.in	2003/10/12 02:29:25	1.208
+++ configure.in	2003/10/16 15:38:09
@@ -5153,12 +5153,110 @@
 fi
 
 echo "  Compiler:                          $XEMACS_CC $CFLAGS"
+dnl Let's save some helpful-for-debugging info like compiler and libc versions..
+dnl First, see if it's gcc - the same check works everyplace...
+case "$CC" in
+  gcc*)	echo "  Compiler version:                  `$CC --version | head -1`"
+        echo "  Compiler specs file:               `$CC -v 2>&1 | sed 's/.* \([[^ ]]\)/\1/' | head -1`"
+	;;
+dnl non-gcc machine-specific magic - contributions welcome
+  *) case "$canonical" in
+	*-*-aix*   ) 
+          dnl Yes, it's this ugly for AIX...
+	  realcc=`which $CC`
+	  dnl Might be a symlink created by replaceCset command
+	  if test -L $realcc ; then
+	    ccdir=`dirname $realcc`
+	    ccprog=`/bin/ls -l $realcc | sed 's/.* \([[^ ]]\)/\1/'`
+	    dnl This doesn't handle ../../xlc type stuff, but I've not seen one...
+	    case $ccprog in
+		*/*) realcc=$ccprog;;
+		*) realcc=$ccdir/$ccprog;;
+	    esac
+	  fi
+	  lpp=`lslpp -wqc $realcc | cut -f2 -d:`
+	  if test ! -z "$lpp" ; then
+	    lppstr=`lslpp -Lqc $lpp`
+	    lpplev=`echo "$lppstr" | cut -f3 -d:`
+	    lppdesc=`echo "$lppstr" | cut -f8 -d:`
+	  fi
+	  if test ! -z "$lpplev" ; then
+	    echo "  Compiler version:                  $lpp $lpplev - $lppdesc"
+	  else
+	    echo "  Compiler version:                  (unknown version)"
+	  fi
+	;;
+	
+	*-*-solaris*)
+	  ccvers=`$CC -V 2>&1 | head -1`
+	  if test ! -z "$ccvers" ; then
+	    echo "  Compiler version:                  $ccvers"
+	  fi
+	;;
+
+	alpha*-dec-osf*)
+	  ccvers=`$CC -V | tr '\n' ' '`
+	  if test ! -z "$ccvers" ; then
+	    echo "  Compiler version:                  $ccvers"
+	  fi
+	;;
+
+	mips-sgi-irix*)
+	  ccvers=`$CC -version`
+	  if test ! -z "$ccvers" ; then
+	    echo "  Compiler version:                  $ccvers"
+	  fi
+	;;
+	  
+	*) echo "  Compiler version:                  $CC on $canonical";;
+  esac
+esac
+
 echo "  Relocating allocator for buffers:  $rel_alloc"
 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
 case "$ld_switch_site" in
   *nocombreloc*) echo "  Linking with \`-z nocombreloc'.
     - Consider configuring with --pdump." ;;
 esac
+
+dnl Now get the libc version - contributions welcome
+case "$canonical" in
+	*-*-linux*) 
+	  if test -f /etc/redhat-release ; then
+	    echo "  libc:                              `rpm -q glibc`";
+dnl need a Debian and Suse check here...
+          else
+	    echo "Need to guess glibc1/2/etc here";
+          fi
+	;;
+
+	*-*-aix*) 
+	  echo "  libc:                              bos.rte.libc `lslpp -Lqc bos.rte.libc | cut -f3 -d:`" 
+	;;
+
+	*-*-solaris*)
+	  libc=`pkginfo -l SUNWcsl | grep VERSION: | awk '{print $2}'`
+	  echo "  libc:                              SUNWcsl $libc"
+
+	;;
+
+	mips-sgi-irix*)
+	  echo "  IRIX version:                      `uname -sRm`'"
+	;;
+	  
+
+	alpha*-dec-osf*)
+	dnl Another ugly case
+	  (cd /usr/.smdb.;
+		libc=` grep -h libc.so *.inv | awk '$9 == "f" {print $12}' | tr '\n' ','`
+		echo "  libc:                              $libc"
+		
+	  )
+	;;
+
+	*) echo "  libc:                              system-provided libc on $canonical" ;;
+esac
+
 
 echo "
 Window System:"
