The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Only in perlmacs-0.16: .cvsignore
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/Makefile.in perlmacs-0.16/Makefile.in
*** emacs-20.6/Makefile.in	Fri Apr  9 15:16:24 1999
--- perlmacs-0.16/Makefile.in	Thu May  4 20:29:06 2000
***************
*** 1,3 ****
--- 1,7 ----
+ # Modified 1 Jan 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+ # for use with embedded Perl.
+ 
+ 
  # DIST: This is the distribution Makefile for Emacs.  configure can
  # DIST: make most of the changes to this file you might want, so try
  # DIST: that first.
***************
*** 49,54 ****
--- 53,59 ----
  C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
  LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@
  YACC=@YACC@
+ PERL=@PERL@
  
  ### These help us choose version- and architecture-specific directories
  ### to install files in.
***************
*** 56,61 ****
--- 61,67 ----
  ### This should be the number of the Emacs version we're building,
  ### like `18.59' or `19.0'.
  version=@version@
+ perlmacs_version=@perlmacs_version@
  
  ### This should be the name of the configuration we're building Emacs
  ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
***************
*** 170,175 ****
--- 176,187 ----
  # Where to put the docstring file.
  docdir=@docdir@
  
+ # Where to put the distributed Perlmacs header files.
+ includedir=@includedir@
+ 
+ # List of directories containing header files for Makefile.PL
+ includepath=@includepath@
+ 
  # ==================== Utility Programs for the Build ====================
  
  # Allow the user to specify the install program.
***************
*** 183,197 ****
  # ============================= Targets ==============================
  
  # What emacs should be called when installed.
! EMACS = emacs
  
  # Subdirectories to make recursively.  `lisp' is not included
  # because the compiled lisp files are part of the distribution
  # and you cannot remake them without installing Emacs first.
! SUBDIR = lib-src src leim
  
  # The makefiles of the directories in $SUBDIR.
! SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile
  
  # Subdirectories to install, and where they'll go.
  # lib-src's makefile knows how to install it, so we don't do that here.
--- 195,210 ----
  # ============================= Targets ==============================
  
  # What emacs should be called when installed.
! PMACS = pmacs
! PERLMACS = perlmacs
  
  # Subdirectories to make recursively.  `lisp' is not included
  # because the compiled lisp files are part of the distribution
  # and you cannot remake them without installing Emacs first.
! SUBDIR = lib-src src leim @maybe_perl@
  
  # The makefiles of the directories in $SUBDIR.
! SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile perl/Makefile
  
  # Subdirectories to install, and where they'll go.
  # lib-src's makefile knows how to install it, so we don't do that here.
***************
*** 199,206 ****
  # When installing the info files, we need to do special things to
  # avoid nuking an existing dir file, so we don't do that here;
  # instead, we have written out explicit code in the `install' targets.
! COPYDIR = ${srcdir}/etc ${srcdir}/lisp
! COPYDESTS = ${etcdir} ${lispdir}
  
  all: ${SUBDIR}
  
--- 212,219 ----
  # When installing the info files, we need to do special things to
  # avoid nuking an existing dir file, so we don't do that here;
  # instead, we have written out explicit code in the `install' targets.
! COPYDIR = ${srcdir}/etc ${srcdir}/lisp ${srcdir}/src/m ${srcdir}/src/s
! COPYDESTS = ${etcdir} ${lispdir} ${includedir}/m ${includedir}/s
  
  all: ${SUBDIR}
  
***************
*** 219,225 ****
  	  -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";'			\
  	  -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";'		\
  	  -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
! 	  -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') &&		\
  	${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h
  
  # For parallel make, src should be build before leim.
--- 232,240 ----
  	  -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";'			\
  	  -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";'		\
  	  -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
! 	  -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";'			\
! 	  -e 's;\(#.*PATH_INCLUDESEARCH\).*$$;\1 "${includepath}";'	\
! 	  -e 's;\(#.*PATH_INCLUDEDIR\).*$$;\1 "${includedir}";') &&	\
  	${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h
  
  # For parallel make, src should be build before leim.
***************
*** 236,241 ****
--- 251,264 ----
  	  CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
  	  LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
  
+ perl/Makefile: src perl/Makefile.PL
+ 	test x@maybe_perl@ = xperl || exit 0; cd perl; \
+ 		../src/perlmacs Makefile.PL
+ 	-touch $@
+ 
+ test: perl
+ 	cd perl; $(MAKE) test
+ 
  blessmail: ${SUBDIR_MAKEFILES} src FRC
  	cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \
  	  MAKE='${MAKE}' archlibdir='$(archlibdir)'
***************
*** 265,270 ****
--- 288,296 ----
  leim/Makefile: $(srcdir)/leim/Makefile.in config.status
  	./config.status
  
+ perl/Makefile.PL: $(srcdir)/perl/Makefile.PL.in config.status
+ 	./config.status
+ 
  # ==================== Installation ====================
  
  ## If we let lib-src do its own installation, that means we
***************
*** 286,292 ****
  install: all install-arch-indep install-arch-dep install-leim blessmail
  	@true
  
! ### Install the executables that were compiled specifically for this machine.
  ### It would be nice to do something for a parallel make
  ### to ensure that install-arch-indep finishes before this starts.
  install-arch-dep: mkdir
--- 312,319 ----
  install: all install-arch-indep install-arch-dep install-leim blessmail
  	@true
  
! ### Install the executables and headers that were created specifically
! ### for this machine.
  ### It would be nice to do something for a parallel make
  ### to ensure that install-arch-indep finishes before this starts.
  install-arch-dep: mkdir
***************
*** 295,307 ****
  	    exec_prefix=${exec_prefix} bindir=${bindir} \
  	    libexecdir=${libexecdir} archlibdir=${archlibdir} \
  	    INSTALL_STRIP=${INSTALL_STRIP})
! 	${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs ${bindir}/emacs-${version}
! 	-chmod 1755  ${bindir}/emacs-${version}
! 	rm -f ${bindir}/$(EMACS)
! 	-ln ${bindir}/emacs-${version} ${bindir}/$(EMACS)
! 	for f in `cd lib-src && echo fns-*.el`; do \
! 	  ${INSTALL_DATA} lib-src/$$f ${archlibdir}/$$f; \
! 	done
  
  ### Install the files that are machine-independent.
  ### Most of them come straight from the distribution;
--- 322,336 ----
  	    exec_prefix=${exec_prefix} bindir=${bindir} \
  	    libexecdir=${libexecdir} archlibdir=${archlibdir} \
  	    INSTALL_STRIP=${INSTALL_STRIP})
! 	${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs \
! 	${bindir}/perlmacs-${perlmacs_version}
! 	-chmod 1755  ${bindir}/perlmacs-${perlmacs_version}
! 	rm -f ${bindir}/$(PERLMACS)
! 	-ln ${bindir}/perlmacs-${perlmacs_version} ${bindir}/$(PERLMACS)
! 	rm -f ${bindir}/$(PMACS)
! 	-ln ${bindir}/perlmacs-${perlmacs_version} ${bindir}/$(PMACS)
! 	${INSTALL_DATA} src/config.h ${archlibdir}/include/emacs/config.h
! 	${INSTALL_DATA} src/epaths.h ${archlibdir}/include/emacs/epaths.h
  
  ### Install the files that are machine-independent.
  ### Most of them come straight from the distribution;
***************
*** 311,323 ****
  ## Note that we copy DOC* and then delete DOC
  ## as a workaround for a bug in tar on Ultrix 4.2.
  install-arch-indep: mkdir
! 	-set ${COPYDESTS} ; \
! 	for dir in ${COPYDIR} ; do \
  	  if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
  	    rm -rf $$1 ; \
  	  fi ; \
  	  shift ; \
  	done
  	-set ${COPYDESTS} ; \
  	mkdir ${COPYDESTS} ; \
  	chmod ugo+rx ${COPYDESTS} ; \
--- 340,354 ----
  ## Note that we copy DOC* and then delete DOC
  ## as a workaround for a bug in tar on Ultrix 4.2.
  install-arch-indep: mkdir
! 	-set ${COPYDESTS} ${includedir}/emacs ; \
! 	for dir in ${COPYDIR} ${srcdir}/src ; do \
  	  if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
  	    rm -rf $$1 ; \
  	  fi ; \
  	  shift ; \
  	done
+ 	mkdir ${includedir}/emacs ; \
+ 	cp -p ${srcdir}/src/*.h ${includedir}/emacs
  	-set ${COPYDESTS} ; \
  	mkdir ${COPYDESTS} ; \
  	chmod ugo+rx ${COPYDESTS} ; \
***************
*** 401,406 ****
--- 432,440 ----
  	  done; \
  	else true; fi
  	-chmod -R a+r ${datadir}/emacs ${COPYDESTS} ${infodir}
+ 	if [ -f perl/Makefile ]; then \
+ 	  (cd perl; $(MAKE) install $(MFLAGS)); \
+ 	else true; fi
  	thisdir=`/bin/pwd`; \
  	cd ${srcdir}/etc; \
  	for page in emacs etags ctags ; do \
***************
*** 431,436 ****
--- 465,471 ----
  	fi
  	$(srcdir)/mkinstalldirs ${COPYDESTS} ${infodir} ${man1dir} \
  	  ${bindir} ${docdir} ${libexecdir} \
+ 	  ${archlibdir}/include/emacs ${includedir}/emacs \
  	  ${datadir}/emacs/site-lisp \
  	  ${datadir}/emacs/${version}/site-lisp \
  	  `echo ${locallisppath} | sed 's/:/ /g'`
***************
*** 445,451 ****
  	 $(MAKE) $(MFLAGS) uninstall			\
  	    prefix=${prefix} exec_prefix=${exec_prefix}	\
  	    bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir})
! 	for dir in ${lispdir} ${etcdir} ; do 		\
  	  if [ -d $${dir} ]; then			\
  	    case `(cd $${dir} ; /bin/pwd)` in		\
  	      `(cd ${srcdir} ; /bin/pwd)`* ) ;;		\
--- 480,486 ----
  	 $(MAKE) $(MFLAGS) uninstall			\
  	    prefix=${prefix} exec_prefix=${exec_prefix}	\
  	    bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir})
! 	for dir in ${lispdir} ${etcdir} ${includedir}/emacs ; do \
  	  if [ -d $${dir} ]; then			\
  	    case `(cd $${dir} ; /bin/pwd)` in		\
  	      `(cd ${srcdir} ; /bin/pwd)`* ) ;;		\
***************
*** 460,466 ****
  	done
  	(cd ${infodir} && rm -f cl* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* vip*)
  	(cd ${man1dir}  && rm -f emacs.1 etags.1 ctags.1)
! 	(cd ${bindir}  && rm -f emacs-${version} $(EMACS))
  
  
  FRC:
--- 495,501 ----
  	done
  	(cd ${infodir} && rm -f cl* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* vip*)
  	(cd ${man1dir}  && rm -f emacs.1 etags.1 ctags.1)
! 	(cd ${bindir}  && rm -f perlmacs-${perlmacs_version} $(PERLMACS) $(PMACS))
  
  
  FRC:
***************
*** 481,486 ****
--- 516,522 ----
  	(cd lib-src;  $(MAKE) $(MFLAGS) mostlyclean)
  	-(cd man &&   $(MAKE) $(MFLAGS) mostlyclean)
  	(cd leim;     $(MAKE) $(MFLAGS) mostlyclean)
+ 	(cd perl; test -f Makefile && $(MAKE) $(MFLAGS) clean)
  
  ### `clean'
  ###      Delete all files from the current directory that are normally
***************
*** 497,502 ****
--- 533,539 ----
  	(cd lib-src;  $(MAKE) $(MFLAGS) clean)
  	-(cd man &&   $(MAKE) $(MFLAGS) clean)
  	(cd leim;     $(MAKE) $(MFLAGS) clean)
+ 	(cd perl; test -f Makefile && $(MAKE) $(MFLAGS) clean)
  
  ### `distclean'
  ###      Delete all files from the current directory that are created by
***************
*** 515,520 ****
--- 552,558 ----
  	(cd lib-src;  $(MAKE) $(MFLAGS) distclean)
  	(cd man &&    $(MAKE) $(MFLAGS) distclean)
  	(cd leim;     $(MAKE) $(MFLAGS) distclean)
+ 	(cd perl; test -f Makefile && $(MAKE) $(MFLAGS) distclean)
  	${top_distclean}
  
  ### `maintainer-clean'
***************
*** 535,540 ****
--- 573,579 ----
  	(cd lib-src;  $(MAKE) $(MFLAGS) maintainer-clean)
  	-(cd man &&   $(MAKE) $(MFLAGS) maintainer-clean)
  	(cd leim;     $(MAKE) $(MFLAGS) maintainer-clean)
+ 	(cd perl; test -f Makefile && $(MAKE) $(MFLAGS) distclean)
  	${top_distclean}
  
  ### This doesn't actually appear in the coding standards, but Karl
Only in perlmacs-0.16: aclocal.m4
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/configure perlmacs-0.16/configure
*** emacs-20.6/configure	Sat Feb 26 07:07:06 2000
--- perlmacs-0.16/configure	Thu May  4 23:11:03 2000
***************
*** 18,23 ****
--- 18,25 ----
  ac_help="$ac_help
    --with-hesiod           support Hesiod to get the POP server host"
  ac_help="$ac_help
+   --enable-perl           embed the Perl interpreter"
+ ac_help="$ac_help
    --with-x-toolkit=KIT    use an X toolkit (KIT = yes/lucid/athena/motif/no)"
  ac_help="$ac_help
    --with-x                use the X Window System"
***************
*** 538,545 ****
  '${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
  lisppath='${locallisppath}:${lispdir}'
  etcdir='${datadir}/emacs/${version}/etc'
! archlibdir='${libexecdir}/emacs/${version}/${configuration}'
! docdir='${datadir}/emacs/${version}/etc'
  
  # Check whether --with-gcc or --without-gcc was given.
  if test "${with_gcc+set}" = set; then
--- 540,550 ----
  '${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
  lisppath='${locallisppath}:${lispdir}'
  etcdir='${datadir}/emacs/${version}/etc'
! 
! archlibdir='${libexecdir}/perlmacs/${perlmacs_version}/${configuration}'
! docdir='${datadir}/perlmacs/${perlmacs_version}/etc'
! includedir='${datadir}/perlmacs/${perlmacs_version}/include'
! includepath='${archlibdir}/include:${includedir}'
  
  # Check whether --with-gcc or --without-gcc was given.
  if test "${with_gcc+set}" = set; then
***************
*** 565,570 ****
--- 570,581 ----
  
  fi
  
+ # Check whether --enable-perl or --disable-perl was given.
+ if test "${enable_perl+set}" = set; then
+   enableval="$enable_perl"
+   :
+ fi
+ 
  # Check whether --with-x-toolkit or --without-x-toolkit was given.
  if test "${with_x_toolkit+set}" = set; then
    withval="$with_x_toolkit"
***************
*** 657,663 ****
  fi
  
  echo $ac_n "checking host system type""... $ac_c" 1>&6
! echo "configure:661: checking host system type" >&5
  
  host_alias=$host
  case "$host_alias" in
--- 668,674 ----
  fi
  
  echo $ac_n "checking host system type""... $ac_c" 1>&6
! echo "configure:672: checking host system type" >&5
  
  host_alias=$host
  case "$host_alias" in
***************
*** 1608,1614 ****
    * ) # Extract the first word of "gcc", so it can be a program name with args.
  set dummy gcc; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1612: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1619,1625 ----
    * ) # Extract the first word of "gcc", so it can be a program name with args.
  set dummy gcc; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1623: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1638,1644 ****
    # Extract the first word of "cc", so it can be a program name with args.
  set dummy cc; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1642: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1649,1655 ----
    # Extract the first word of "cc", so it can be a program name with args.
  set dummy cc; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1653: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1689,1695 ****
        # Extract the first word of "cl", so it can be a program name with args.
  set dummy cl; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1693: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1700,1706 ----
        # Extract the first word of "cl", so it can be a program name with args.
  set dummy cl; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:1704: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1721,1727 ****
  fi
  
  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
! echo "configure:1725: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  
  ac_ext=c
  # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
--- 1732,1738 ----
  fi
  
  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
! echo "configure:1736: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  
  ac_ext=c
  # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
***************
*** 1732,1743 ****
  
  cat > conftest.$ac_ext << EOF
  
! #line 1736 "configure"
  #include "confdefs.h"
  
  main(){return(0);}
  EOF
! if { (eval echo configure:1741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    ac_cv_prog_cc_works=yes
    # If we can't run a trivial program, we are probably using a cross compiler.
    if (./conftest; exit) 2>/dev/null; then
--- 1743,1754 ----
  
  cat > conftest.$ac_ext << EOF
  
! #line 1747 "configure"
  #include "confdefs.h"
  
  main(){return(0);}
  EOF
! if { (eval echo configure:1752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    ac_cv_prog_cc_works=yes
    # If we can't run a trivial program, we are probably using a cross compiler.
    if (./conftest; exit) 2>/dev/null; then
***************
*** 1763,1774 ****
    { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
  fi
  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
! echo "configure:1767: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
  cross_compiling=$ac_cv_prog_cc_cross
  
  echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
! echo "configure:1772: checking whether we are using GNU C" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1774,1785 ----
    { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
  fi
  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
! echo "configure:1778: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
  cross_compiling=$ac_cv_prog_cc_cross
  
  echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
! echo "configure:1783: checking whether we are using GNU C" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1777,1783 ****
    yes;
  #endif
  EOF
! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
    ac_cv_prog_gcc=yes
  else
    ac_cv_prog_gcc=no
--- 1788,1794 ----
    yes;
  #endif
  EOF
! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
    ac_cv_prog_gcc=yes
  else
    ac_cv_prog_gcc=no
***************
*** 1796,1802 ****
  ac_save_CFLAGS="$CFLAGS"
  CFLAGS=
  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
! echo "configure:1800: checking whether ${CC-cc} accepts -g" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1807,1813 ----
  ac_save_CFLAGS="$CFLAGS"
  CFLAGS=
  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
! echo "configure:1811: checking whether ${CC-cc} accepts -g" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1876,1882 ****
  #### #undef clause to src/config.h.in for autoconf to modify.
  
  echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
! echo "configure:1880: checking whether ln -s works" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 1887,1893 ----
  #### #undef clause to src/config.h.in for autoconf to modify.
  
  echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
! echo "configure:1891: checking whether ln -s works" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 1897,1903 ****
  fi
  
  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
! echo "configure:1901: checking how to run the C preprocessor" >&5
  # On Suns, sometimes $CPP names a directory.
  if test -n "$CPP" && test -d "$CPP"; then
    CPP=
--- 1908,1914 ----
  fi
  
  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
! echo "configure:1912: checking how to run the C preprocessor" >&5
  # On Suns, sometimes $CPP names a directory.
  if test -n "$CPP" && test -d "$CPP"; then
    CPP=
***************
*** 1912,1924 ****
    # On the NeXT, cc -E runs the code through the compiler's parser,
    # not just through cpp.
    cat > conftest.$ac_ext <<EOF
! #line 1916 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1923,1935 ----
    # On the NeXT, cc -E runs the code through the compiler's parser,
    # not just through cpp.
    cat > conftest.$ac_ext <<EOF
! #line 1927 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1929,1941 ****
    rm -rf conftest*
    CPP="${CC-cc} -E -traditional-cpp"
    cat > conftest.$ac_ext <<EOF
! #line 1933 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1940,1952 ----
    rm -rf conftest*
    CPP="${CC-cc} -E -traditional-cpp"
    cat > conftest.$ac_ext <<EOF
! #line 1944 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1946,1958 ****
    rm -rf conftest*
    CPP="${CC-cc} -nologo -E"
    cat > conftest.$ac_ext <<EOF
! #line 1950 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1957,1969 ----
    rm -rf conftest*
    CPP="${CC-cc} -nologo -E"
    cat > conftest.$ac_ext <<EOF
! #line 1961 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1988,1994 ****
  # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  # ./install, which can be erroneously created by make from ./install.sh.
  echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
! echo "configure:1992: checking for a BSD compatible install" >&5
  if test -z "$INSTALL"; then
  if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 1999,2005 ----
  # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  # ./install, which can be erroneously created by make from ./install.sh.
  echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
! echo "configure:2003: checking for a BSD compatible install" >&5
  if test -z "$INSTALL"; then
  if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2045,2051 ****
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:2049: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 2056,2062 ----
  # Extract the first word of "$ac_prog", so it can be a program name with args.
  set dummy $ac_prog; ac_word=$2
  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
! echo "configure:2060: checking for $ac_word" >&5
  if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 2077,2085 ****
  
  
  echo $ac_n "checking for AIX""... $ac_c" 1>&6
! echo "configure:2081: checking for AIX" >&5
  cat > conftest.$ac_ext <<EOF
! #line 2083 "configure"
  #include "confdefs.h"
  #ifdef _AIX
    yes
--- 2088,2096 ----
  
  
  echo $ac_n "checking for AIX""... $ac_c" 1>&6
! echo "configure:2092: checking for AIX" >&5
  cat > conftest.$ac_ext <<EOF
! #line 2094 "configure"
  #include "confdefs.h"
  #ifdef _AIX
    yes
***************
*** 2105,2121 ****
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:2109: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2114 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:2119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 2116,2132 ----
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:2120: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2125 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:2130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 2142,2153 ****
  done
  
  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
! echo "configure:2146: checking for ANSI C header files" >&5
  if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2151 "configure"
  #include "confdefs.h"
  #include <stdlib.h>
  #include <stdarg.h>
--- 2153,2164 ----
  done
  
  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
! echo "configure:2157: checking for ANSI C header files" >&5
  if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2162 "configure"
  #include "confdefs.h"
  #include <stdlib.h>
  #include <stdarg.h>
***************
*** 2155,2161 ****
  #include <float.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:2159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 2166,2172 ----
  #include <float.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:2170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 2172,2178 ****
  if test $ac_cv_header_stdc = yes; then
    # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat > conftest.$ac_ext <<EOF
! #line 2176 "configure"
  #include "confdefs.h"
  #include <string.h>
  EOF
--- 2183,2189 ----
  if test $ac_cv_header_stdc = yes; then
    # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  cat > conftest.$ac_ext <<EOF
! #line 2187 "configure"
  #include "confdefs.h"
  #include <string.h>
  EOF
***************
*** 2190,2196 ****
  if test $ac_cv_header_stdc = yes; then
    # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat > conftest.$ac_ext <<EOF
! #line 2194 "configure"
  #include "confdefs.h"
  #include <stdlib.h>
  EOF
--- 2201,2207 ----
  if test $ac_cv_header_stdc = yes; then
    # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  cat > conftest.$ac_ext <<EOF
! #line 2205 "configure"
  #include "confdefs.h"
  #include <stdlib.h>
  EOF
***************
*** 2211,2217 ****
    :
  else
    cat > conftest.$ac_ext <<EOF
! #line 2215 "configure"
  #include "confdefs.h"
  #include <ctype.h>
  #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
--- 2222,2228 ----
    :
  else
    cat > conftest.$ac_ext <<EOF
! #line 2226 "configure"
  #include "confdefs.h"
  #include <ctype.h>
  #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
***************
*** 2222,2228 ****
  exit (0); }
  
  EOF
! if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    :
  else
--- 2233,2239 ----
  exit (0); }
  
  EOF
! if { (eval echo configure:2237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    :
  else
***************
*** 2246,2257 ****
  fi
  
  echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
! echo "configure:2250: checking whether time.h and sys/time.h may both be included" >&5
  if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2255 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <sys/time.h>
--- 2257,2268 ----
  fi
  
  echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
! echo "configure:2261: checking whether time.h and sys/time.h may both be included" >&5
  if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2266 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <sys/time.h>
***************
*** 2260,2266 ****
  struct tm *tp;
  ; return 0; }
  EOF
! if { (eval echo configure:2264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_header_time=yes
  else
--- 2271,2277 ----
  struct tm *tp;
  ; return 0; }
  EOF
! if { (eval echo configure:2275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_header_time=yes
  else
***************
*** 2281,2292 ****
  fi
  
  echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
! echo "configure:2285: checking for sys_siglist declaration in signal.h or unistd.h" >&5
  if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2290 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <signal.h>
--- 2292,2303 ----
  fi
  
  echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
! echo "configure:2296: checking for sys_siglist declaration in signal.h or unistd.h" >&5
  if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2301 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <signal.h>
***************
*** 2298,2304 ****
  char *msg = *(sys_siglist + 1);
  ; return 0; }
  EOF
! if { (eval echo configure:2302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_decl_sys_siglist=yes
  else
--- 2309,2315 ----
  char *msg = *(sys_siglist + 1);
  ; return 0; }
  EOF
! if { (eval echo configure:2313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_decl_sys_siglist=yes
  else
***************
*** 2320,2331 ****
  
  
  echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
! echo "configure:2324: checking for struct utimbuf" >&5
  if eval "test \"`echo '$''{'emacs_cv_struct_utimbuf'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2329 "configure"
  #include "confdefs.h"
  #ifdef TIME_WITH_SYS_TIME
  #include <sys/time.h>
--- 2331,2342 ----
  
  
  echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
! echo "configure:2335: checking for struct utimbuf" >&5
  if eval "test \"`echo '$''{'emacs_cv_struct_utimbuf'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2340 "configure"
  #include "confdefs.h"
  #ifdef TIME_WITH_SYS_TIME
  #include <sys/time.h>
***************
*** 2344,2350 ****
  static struct utimbuf x; x.actime = x.modtime;
  ; return 0; }
  EOF
! if { (eval echo configure:2348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    emacs_cv_struct_utimbuf=yes
  else
--- 2355,2361 ----
  static struct utimbuf x; x.actime = x.modtime;
  ; return 0; }
  EOF
! if { (eval echo configure:2359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    emacs_cv_struct_utimbuf=yes
  else
***************
*** 2365,2376 ****
  fi
  
  echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
! echo "configure:2369: checking return type of signal handlers" >&5
  if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2374 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <signal.h>
--- 2376,2387 ----
  fi
  
  echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
! echo "configure:2380: checking return type of signal handlers" >&5
  if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2385 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <signal.h>
***************
*** 2387,2393 ****
  int i;
  ; return 0; }
  EOF
! if { (eval echo configure:2391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_type_signal=void
  else
--- 2398,2404 ----
  int i;
  ; return 0; }
  EOF
! if { (eval echo configure:2402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_type_signal=void
  else
***************
*** 2407,2418 ****
  
  
  echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
! echo "configure:2411: checking for struct timeval" >&5
  if eval "test \"`echo '$''{'emacs_cv_struct_timeval'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2416 "configure"
  #include "confdefs.h"
  #ifdef TIME_WITH_SYS_TIME
  #include <sys/time.h>
--- 2418,2429 ----
  
  
  echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
! echo "configure:2422: checking for struct timeval" >&5
  if eval "test \"`echo '$''{'emacs_cv_struct_timeval'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2427 "configure"
  #include "confdefs.h"
  #ifdef TIME_WITH_SYS_TIME
  #include <sys/time.h>
***************
*** 2428,2434 ****
  static struct timeval x; x.tv_sec = x.tv_usec;
  ; return 0; }
  EOF
! if { (eval echo configure:2432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    emacs_cv_struct_timeval=yes
  else
--- 2439,2445 ----
  static struct timeval x; x.tv_sec = x.tv_usec;
  ; return 0; }
  EOF
! if { (eval echo configure:2443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    emacs_cv_struct_timeval=yes
  else
***************
*** 2450,2461 ****
  fi
  
  echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
! echo "configure:2454: checking whether struct tm is in sys/time.h or time.h" >&5
  if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2459 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <time.h>
--- 2461,2472 ----
  fi
  
  echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
! echo "configure:2465: checking whether struct tm is in sys/time.h or time.h" >&5
  if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2470 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <time.h>
***************
*** 2463,2469 ****
  struct tm *tp; tp->tm_sec;
  ; return 0; }
  EOF
! if { (eval echo configure:2467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_struct_tm=time.h
  else
--- 2474,2480 ----
  struct tm *tp; tp->tm_sec;
  ; return 0; }
  EOF
! if { (eval echo configure:2478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_struct_tm=time.h
  else
***************
*** 2484,2495 ****
  fi
  
  echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
! echo "configure:2488: checking for tm_zone in struct tm" >&5
  if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2493 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <$ac_cv_struct_tm>
--- 2495,2506 ----
  fi
  
  echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
! echo "configure:2499: checking for tm_zone in struct tm" >&5
  if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2504 "configure"
  #include "confdefs.h"
  #include <sys/types.h>
  #include <$ac_cv_struct_tm>
***************
*** 2497,2503 ****
  struct tm tm; tm.tm_zone;
  ; return 0; }
  EOF
! if { (eval echo configure:2501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_struct_tm_zone=yes
  else
--- 2508,2514 ----
  struct tm tm; tm.tm_zone;
  ; return 0; }
  EOF
! if { (eval echo configure:2512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_struct_tm_zone=yes
  else
***************
*** 2517,2528 ****
  
  else
    echo $ac_n "checking for tzname""... $ac_c" 1>&6
! echo "configure:2521: checking for tzname" >&5
  if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2526 "configure"
  #include "confdefs.h"
  #include <time.h>
  #ifndef tzname /* For SGI.  */
--- 2528,2539 ----
  
  else
    echo $ac_n "checking for tzname""... $ac_c" 1>&6
! echo "configure:2532: checking for tzname" >&5
  if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2537 "configure"
  #include "confdefs.h"
  #include <time.h>
  #ifndef tzname /* For SGI.  */
***************
*** 2532,2538 ****
  atoi(*tzname);
  ; return 0; }
  EOF
! if { (eval echo configure:2536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    ac_cv_var_tzname=yes
  else
--- 2543,2549 ----
  atoi(*tzname);
  ; return 0; }
  EOF
! if { (eval echo configure:2547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    ac_cv_var_tzname=yes
  else
***************
*** 2555,2572 ****
  
  
  echo $ac_n "checking for working const""... $ac_c" 1>&6
! echo "configure:2559: checking for working const" >&5
  if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2564 "configure"
  #include "confdefs.h"
  
  int main() {
  
  /* Ultrix mips cc rejects this.  */
! typedef int charset[2]; const charset x;
  /* SunOS 4.1.1 cc rejects this.  */
  char const *const *ccp;
  char **p;
--- 2566,2583 ----
  
  
  echo $ac_n "checking for working const""... $ac_c" 1>&6
! echo "configure:2570: checking for working const" >&5
  if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 2575 "configure"
  #include "confdefs.h"
  
  int main() {
  
  /* Ultrix mips cc rejects this.  */
! typedef int charset[2]; const charset x = {0,0};
  /* SunOS 4.1.1 cc rejects this.  */
  char const *const *ccp;
  char **p;
***************
*** 2609,2615 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:2613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_const=yes
  else
--- 2620,2626 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:2624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    ac_cv_c_const=yes
  else
***************
*** 2631,2637 ****
  
  
  echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
! echo "configure:2635: checking whether ${MAKE-make} sets \${MAKE}" >&5
  set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 2642,2648 ----
  
  
  echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
! echo "configure:2646: checking whether ${MAKE-make} sets \${MAKE}" >&5
  set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 2659,2665 ****
  
  
  echo $ac_n "checking for long file names""... $ac_c" 1>&6
! echo "configure:2663: checking for long file names" >&5
  if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 2670,2676 ----
  
  
  echo $ac_n "checking for long file names""... $ac_c" 1>&6
! echo "configure:2674: checking for long file names" >&5
  if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 2703,2708 ****
--- 2714,2842 ----
  fi
  
  
+ # Extract the first word of "perl", so it can be a program name with args.
+ set dummy perl; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+ echo "configure:2721: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   if test -n "$PERL"; then
+   ac_cv_prog_PERL="$PERL" # Let the user override the test.
+ else
+   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+   ac_dummy="$PATH"
+   for ac_dir in $ac_dummy; do
+     test -z "$ac_dir" && ac_dir=.
+     if test -f $ac_dir/$ac_word; then
+       ac_cv_prog_PERL="perl"
+       break
+     fi
+   done
+   IFS="$ac_save_ifs"
+ fi
+ fi
+ PERL="$ac_cv_prog_PERL"
+ if test -n "$PERL"; then
+   echo "$ac_t""$PERL" 1>&6
+ else
+   echo "$ac_t""no" 1>&6
+ fi
+ 
+ if test -n "$PERL"; then
+   echo $ac_n "checking whether ${PERL-perl} works and knows its version number""... $ac_c" 1>&6
+ echo "configure:2749: checking whether ${PERL-perl} works and knows its version number" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_perl_version'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   ac_cv_prog_perl_version=no
+ # Make perl print its version number.
+ ac_l_bracket="[" ac_r_bracket="]"  # trying to outsmart Autoconf here.
+ if { ac_try='${PERL-perl} -e "print \$$ac_r_bracket" > conftest'; { (eval echo configure:2756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+   ac_cv_prog_perl_version=`cat conftest`
+ fi
+ rm -f conftest
+ 
+ fi
+ 
+ echo "$ac_t""$ac_cv_prog_perl_version" 1>&6
+ fi
+ 
+ 
+ #### Decide whether to embed Perl.
+ 
+ perl_version="$ac_cv_prog_perl_version"
+ if test "x$enable_perl" = xyes || \
+     ( test -n "$perl_version" && \
+ 	${PERL} -e 'use 5.005;' 2>/dev/null ); then
+   echo $ac_n "checking for embeddable Perl""... $ac_c" 1>&6
+ echo "configure:2774: checking for embeddable Perl" >&5
+ if test "x$enable_perl" = xno; then
+   # The user explicitly disabled Perl.
+   ac_embed_perl=disabled
+ else
+   if eval "test \"`echo '$''{'ac_cv_embed_perl'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   PERL_CCOPTS=`${PERL-perl} -MExtUtils::Embed -e ccopts 2>/dev/null`
+     PERL_LDOPTS=`${PERL-perl} -MExtUtils::Embed -e ldopts 2>/dev/null`
+     ac_save_CFLAGS="$CFLAGS"
+     CFLAGS="$PERL_CCOPTS"
+     ac_save_LIBS="$LIBS"
+     LIBS="$PERL_LDOPTS"
+     cat > conftest.$ac_ext <<EOF
+ #line 2789 "configure"
+ #include "confdefs.h"
+ #define main bad2proto
+ #include <EXTERN.h>
+ #include <perl.h>
+ #undef main
+ int main() {
+ PerlInterpreter *i = perl_alloc()
+ ; return 0; }
+ EOF
+ if { (eval echo configure:2799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+   rm -rf conftest*
+         ac_cv_embed_perl="ac_embed_perl=yes \
+ 			 PERL_CCOPTS='$PERL_CCOPTS' \
+ 			 PERL_LDOPTS='$PERL_LDOPTS'"
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   ac_cv_embed_perl="ac_embed_perl=no PERL_CCOPTS= PERL_LDOPTS="
+ fi
+ rm -f conftest*
+     CFLAGS="$ac_save_CFLAGS"
+     LIBS="$ac_save_LIBS"
+   
+ fi
+ 
+   eval "$ac_cv_embed_perl"
+ fi
+ echo "$ac_t""$ac_embed_perl" 1>&6
+ 
+   if test "x$ac_embed_perl" = xyes; then
+     cat >> confdefs.h <<\EOF
+ #define EMBED_PERL 1
+ EOF
+ 
+     maybe_perl=perl
+     if ${PERL} -MConfig -e 'exit ($Config{usemymalloc} eq "y" ? 0 : 1)';
+     then
+       perl_malloc=yes
+       cat >> confdefs.h <<\EOF
+ #define PERL_MALLOC 1
+ EOF
+ 
+     else
+       perl_malloc=no
+     fi
+   else
+     maybe_perl=
+   fi
+ fi
+ 
  #### Choose a window system.
  
  # If we find X, set shell vars x_includes and x_libraries to the
***************
*** 2710,2716 ****
  # Uses ac_ vars as temps to allow command line to override cache and checks.
  # --without-x overrides everything else, but does not touch the cache.
  echo $ac_n "checking for X""... $ac_c" 1>&6
! echo "configure:2714: checking for X" >&5
  
  # Check whether --with-x or --without-x was given.
  if test "${with_x+set}" = set; then
--- 2844,2850 ----
  # Uses ac_ vars as temps to allow command line to override cache and checks.
  # --without-x overrides everything else, but does not touch the cache.
  echo $ac_n "checking for X""... $ac_c" 1>&6
! echo "configure:2848: checking for X" >&5
  
  # Check whether --with-x or --without-x was given.
  if test "${with_x+set}" = set; then
***************
*** 2772,2783 ****
  
    # First, try using that file with no special directory specified.
  cat > conftest.$ac_ext <<EOF
! #line 2776 "configure"
  #include "confdefs.h"
  #include <$x_direct_test_include>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:2781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 2906,2917 ----
  
    # First, try using that file with no special directory specified.
  cat > conftest.$ac_ext <<EOF
! #line 2910 "configure"
  #include "confdefs.h"
  #include <$x_direct_test_include>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:2915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 2846,2859 ****
    ac_save_LIBS="$LIBS"
    LIBS="-l$x_direct_test_library $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2850 "configure"
  #include "confdefs.h"
  
  int main() {
  ${x_direct_test_function}()
  ; return 0; }
  EOF
! if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    LIBS="$ac_save_LIBS"
  # We can link X programs with no special library path.
--- 2980,2993 ----
    ac_save_LIBS="$LIBS"
    LIBS="-l$x_direct_test_library $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 2984 "configure"
  #include "confdefs.h"
  
  int main() {
  ${x_direct_test_function}()
  ; return 0; }
  EOF
! if { (eval echo configure:2991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    LIBS="$ac_save_LIBS"
  # We can link X programs with no special library path.
***************
*** 3028,3034 ****
  echo "checking the machine- and system-dependent files to find out
   - which libraries the lib-src programs will want, and
   - whether the GNU malloc routines are usable" 1>&6
! echo "configure:3032: checking the machine- and system-dependent files to find out
   - which libraries the lib-src programs will want, and
   - whether the GNU malloc routines are usable" >&5
  
--- 3162,3168 ----
  echo "checking the machine- and system-dependent files to find out
   - which libraries the lib-src programs will want, and
   - whether the GNU malloc routines are usable" 1>&6
! echo "configure:3166: checking the machine- and system-dependent files to find out
   - which libraries the lib-src programs will want, and
   - whether the GNU malloc routines are usable" >&5
  
***************
*** 3157,3169 ****
  # Assume not, until told otherwise.
  GNU_MALLOC=yes
  doug_lea_malloc=yes
  echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
! echo "configure:3162: checking for malloc_get_state" >&5
  if eval "test \"`echo '$''{'ac_cv_func_malloc_get_state'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3167 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char malloc_get_state(); below.  */
--- 3291,3311 ----
  # Assume not, until told otherwise.
  GNU_MALLOC=yes
  doug_lea_malloc=yes
+ 
+ if test "x$perl_malloc" = xyes; then
+   GNU_MALLOC=no
+   GNU_MALLOC_reason="
+     (Perl's malloc will be linked in.)"
+   doug_lea_malloc=no
+ fi
+ 
  echo $ac_n "checking for malloc_get_state""... $ac_c" 1>&6
! echo "configure:3304: checking for malloc_get_state" >&5
  if eval "test \"`echo '$''{'ac_cv_func_malloc_get_state'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3309 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char malloc_get_state(); below.  */
***************
*** 3186,3192 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_malloc_get_state=yes"
  else
--- 3328,3334 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:3332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_malloc_get_state=yes"
  else
***************
*** 3207,3218 ****
  fi
  
  echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
! echo "configure:3211: checking for malloc_set_state" >&5
  if eval "test \"`echo '$''{'ac_cv_func_malloc_set_state'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3216 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char malloc_set_state(); below.  */
--- 3349,3360 ----
  fi
  
  echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
! echo "configure:3353: checking for malloc_set_state" >&5
  if eval "test \"`echo '$''{'ac_cv_func_malloc_set_state'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3358 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char malloc_set_state(); below.  */
***************
*** 3235,3241 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:3239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_malloc_set_state=yes"
  else
--- 3377,3383 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:3381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_malloc_set_state=yes"
  else
***************
*** 3256,3274 ****
  fi
  
  echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
! echo "configure:3260: checking whether __after_morecore_hook exists" >&5
  if eval "test \"`echo '$''{'emacs_cv_var___after_morecore_hook'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3265 "configure"
  #include "confdefs.h"
  extern void (* __after_morecore_hook)();
  int main() {
  __after_morecore_hook = 0
  ; return 0; }
  EOF
! if { (eval echo configure:3272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_var___after_morecore_hook=yes
  else
--- 3398,3416 ----
  fi
  
  echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
! echo "configure:3402: checking whether __after_morecore_hook exists" >&5
  if eval "test \"`echo '$''{'emacs_cv_var___after_morecore_hook'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3407 "configure"
  #include "confdefs.h"
  extern void (* __after_morecore_hook)();
  int main() {
  __after_morecore_hook = 0
  ; return 0; }
  EOF
! if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_var___after_morecore_hook=yes
  else
***************
*** 3318,3324 ****
  LIBS="$libsrc_libs $LIBS"
  
  echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
! echo "configure:3322: checking for dnet_ntoa in -ldnet" >&5
  ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 3460,3466 ----
  LIBS="$libsrc_libs $LIBS"
  
  echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
! echo "configure:3464: checking for dnet_ntoa in -ldnet" >&5
  ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3326,3332 ****
    ac_save_LIBS="$LIBS"
  LIBS="-ldnet  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3330 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 3468,3474 ----
    ac_save_LIBS="$LIBS"
  LIBS="-ldnet  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3472 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 3337,3343 ****
  dnet_ntoa()
  ; return 0; }
  EOF
! if { (eval echo configure:3341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 3479,3485 ----
  dnet_ntoa()
  ; return 0; }
  EOF
! if { (eval echo configure:3483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 3366,3372 ****
  
  
  echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
! echo "configure:3370: checking for main in -lXbsd" >&5
  ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 3508,3514 ----
  
  
  echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
! echo "configure:3512: checking for main in -lXbsd" >&5
  ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3374,3387 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lXbsd  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3378 "configure"
  #include "confdefs.h"
  
  int main() {
  main()
  ; return 0; }
  EOF
! if { (eval echo configure:3385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 3516,3529 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lXbsd  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3520 "configure"
  #include "confdefs.h"
  
  int main() {
  main()
  ; return 0; }
  EOF
! if { (eval echo configure:3527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 3403,3409 ****
  
  
  echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
! echo "configure:3407: checking for cma_open in -lpthreads" >&5
  ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 3545,3551 ----
  
  
  echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
! echo "configure:3549: checking for cma_open in -lpthreads" >&5
  ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3411,3417 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lpthreads  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3415 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 3553,3559 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lpthreads  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3557 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 3422,3428 ****
  cma_open()
  ; return 0; }
  EOF
! if { (eval echo configure:3426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 3564,3570 ----
  cma_open()
  ; return 0; }
  EOF
! if { (eval echo configure:3568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 3451,3457 ****
  
  
  echo $ac_n "checking for XFree86 in /usr/X386""... $ac_c" 1>&6
! echo "configure:3455: checking for XFree86 in /usr/X386" >&5
  if test -d /usr/X386/include; then
    HAVE_XFREE386=yes
    : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
--- 3593,3599 ----
  
  
  echo $ac_n "checking for XFree86 in /usr/X386""... $ac_c" 1>&6
! echo "configure:3597: checking for XFree86 in /usr/X386" >&5
  if test -d /usr/X386/include; then
    HAVE_XFREE386=yes
    : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
***************
*** 3480,3495 ****
  
    if test "${opsys}" = "gnu-linux"; then
      echo $ac_n "checking whether X on GNU/Linux needs -b to link""... $ac_c" 1>&6
! echo "configure:3484: checking whether X on GNU/Linux needs -b to link" >&5
      cat > conftest.$ac_ext <<EOF
! #line 3486 "configure"
  #include "confdefs.h"
  
  int main() {
  XOpenDisplay ("foo");
  ; return 0; }
  EOF
! if { (eval echo configure:3493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    xlinux_first_failure=no
  else
--- 3622,3637 ----
  
    if test "${opsys}" = "gnu-linux"; then
      echo $ac_n "checking whether X on GNU/Linux needs -b to link""... $ac_c" 1>&6
! echo "configure:3626: checking whether X on GNU/Linux needs -b to link" >&5
      cat > conftest.$ac_ext <<EOF
! #line 3628 "configure"
  #include "confdefs.h"
  
  int main() {
  XOpenDisplay ("foo");
  ; return 0; }
  EOF
! if { (eval echo configure:3635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    xlinux_first_failure=no
  else
***************
*** 3509,3522 ****
        CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
        LIBS="$LIBS -b i486-linuxaout"
        cat > conftest.$ac_ext <<EOF
! #line 3513 "configure"
  #include "confdefs.h"
  
  int main() {
  XOpenDisplay ("foo");
  ; return 0; }
  EOF
! if { (eval echo configure:3520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    xlinux_second_failure=no
  else
--- 3651,3664 ----
        CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
        LIBS="$LIBS -b i486-linuxaout"
        cat > conftest.$ac_ext <<EOF
! #line 3655 "configure"
  #include "confdefs.h"
  
  int main() {
  XOpenDisplay ("foo");
  ; return 0; }
  EOF
! if { (eval echo configure:3662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    xlinux_second_failure=no
  else
***************
*** 3546,3557 ****
  XScreenNumberOfScreen XSetWMProtocols
  do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:3550: checking for $ac_func" >&5
  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3555 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $ac_func(); below.  */
--- 3688,3699 ----
  XScreenNumberOfScreen XSetWMProtocols
  do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:3692: checking for $ac_func" >&5
  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3697 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $ac_func(); below.  */
***************
*** 3574,3580 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:3578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_$ac_func=yes"
  else
--- 3716,3722 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:3720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_$ac_func=yes"
  else
***************
*** 3602,3613 ****
  
  if test "${window_system}" = "x11"; then
    echo $ac_n "checking X11 version 6""... $ac_c" 1>&6
! echo "configure:3606: checking X11 version 6" >&5
    if eval "test \"`echo '$''{'emacs_cv_x11_version_6'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3611 "configure"
  #include "confdefs.h"
  #include <X11/Xlib.h>
  int main() {
--- 3744,3755 ----
  
  if test "${window_system}" = "x11"; then
    echo $ac_n "checking X11 version 6""... $ac_c" 1>&6
! echo "configure:3748: checking X11 version 6" >&5
    if eval "test \"`echo '$''{'emacs_cv_x11_version_6'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3753 "configure"
  #include "confdefs.h"
  #include <X11/Xlib.h>
  int main() {
***************
*** 3617,3623 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:3621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_x11_version_6=yes
  else
--- 3759,3765 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:3763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_x11_version_6=yes
  else
***************
*** 3642,3653 ****
  
  if test "${window_system}" = "x11"; then
    echo $ac_n "checking X11 version 5""... $ac_c" 1>&6
! echo "configure:3646: checking X11 version 5" >&5
    if eval "test \"`echo '$''{'emacs_cv_x11_version_5'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3651 "configure"
  #include "confdefs.h"
  #include <X11/Xlib.h>
  int main() {
--- 3784,3795 ----
  
  if test "${window_system}" = "x11"; then
    echo $ac_n "checking X11 version 5""... $ac_c" 1>&6
! echo "configure:3788: checking X11 version 5" >&5
    if eval "test \"`echo '$''{'emacs_cv_x11_version_5'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3793 "configure"
  #include "confdefs.h"
  #include <X11/Xlib.h>
  int main() {
***************
*** 3657,3663 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:3661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_x11_version_5=yes
  else
--- 3799,3805 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:3803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_x11_version_5=yes
  else
***************
*** 3685,3696 ****
  if test x"${USE_X_TOOLKIT}" = xmaybe; then
    if test x"${HAVE_X11R5}" = xyes; then
      echo $ac_n "checking X11 version 5 with Xaw""... $ac_c" 1>&6
! echo "configure:3689: checking X11 version 5 with Xaw" >&5
      if eval "test \"`echo '$''{'emacs_cv_x11_version_5_with_xaw'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3694 "configure"
  #include "confdefs.h"
  
  #include <X11/Intrinsic.h>
--- 3827,3838 ----
  if test x"${USE_X_TOOLKIT}" = xmaybe; then
    if test x"${HAVE_X11R5}" = xyes; then
      echo $ac_n "checking X11 version 5 with Xaw""... $ac_c" 1>&6
! echo "configure:3831: checking X11 version 5 with Xaw" >&5
      if eval "test \"`echo '$''{'emacs_cv_x11_version_5_with_xaw'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3836 "configure"
  #include "confdefs.h"
  
  #include <X11/Intrinsic.h>
***************
*** 3699,3705 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:3703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_x11_version_5_with_xaw=yes
  else
--- 3841,3847 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:3845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_x11_version_5_with_xaw=yes
  else
***************
*** 3727,3738 ****
  
  if test "${USE_X_TOOLKIT}" != "none"; then
    echo $ac_n "checking X11 toolkit version""... $ac_c" 1>&6
! echo "configure:3731: checking X11 toolkit version" >&5
    if eval "test \"`echo '$''{'emacs_cv_x11_toolkit_version_6'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3736 "configure"
  #include "confdefs.h"
  #include <X11/Intrinsic.h>
  int main() {
--- 3869,3880 ----
  
  if test "${USE_X_TOOLKIT}" != "none"; then
    echo $ac_n "checking X11 toolkit version""... $ac_c" 1>&6
! echo "configure:3873: checking X11 toolkit version" >&5
    if eval "test \"`echo '$''{'emacs_cv_x11_toolkit_version_6'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3878 "configure"
  #include "confdefs.h"
  #include <X11/Intrinsic.h>
  int main() {
***************
*** 3742,3748 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:3746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_x11_toolkit_version_6=yes
  else
--- 3884,3890 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:3888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_x11_toolkit_version_6=yes
  else
***************
*** 3772,3778 ****
      LIBS="-lXt $LIBS"
    fi
    echo $ac_n "checking for XmuConvertStandardSelection in -lXmu""... $ac_c" 1>&6
! echo "configure:3776: checking for XmuConvertStandardSelection in -lXmu" >&5
  ac_lib_var=`echo Xmu'_'XmuConvertStandardSelection | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 3914,3920 ----
      LIBS="-lXt $LIBS"
    fi
    echo $ac_n "checking for XmuConvertStandardSelection in -lXmu""... $ac_c" 1>&6
! echo "configure:3918: checking for XmuConvertStandardSelection in -lXmu" >&5
  ac_lib_var=`echo Xmu'_'XmuConvertStandardSelection | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3780,3786 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lXmu  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3784 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 3922,3928 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lXmu  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3926 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 3791,3797 ****
  XmuConvertStandardSelection()
  ; return 0; }
  EOF
! if { (eval echo configure:3795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 3933,3939 ----
  XmuConvertStandardSelection()
  ; return 0; }
  EOF
! if { (eval echo configure:3937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 3823,3834 ****
  
  if test "${USE_X_TOOLKIT}" = "MOTIF"; then
    echo $ac_n "checking for Motif version 2.1""... $ac_c" 1>&6
! echo "configure:3827: checking for Motif version 2.1" >&5
  if eval "test \"`echo '$''{'emacs_cv_motif_version_2_1'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3832 "configure"
  #include "confdefs.h"
  #include <Xm/Xm.h>
  int main() {
--- 3965,3976 ----
  
  if test "${USE_X_TOOLKIT}" = "MOTIF"; then
    echo $ac_n "checking for Motif version 2.1""... $ac_c" 1>&6
! echo "configure:3969: checking for Motif version 2.1" >&5
  if eval "test \"`echo '$''{'emacs_cv_motif_version_2_1'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3974 "configure"
  #include "confdefs.h"
  #include <Xm/Xm.h>
  int main() {
***************
*** 3839,3845 ****
  #endif
  ; return 0; }
  EOF
! if { (eval echo configure:3843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    emacs_cv_motif_version_2_1=yes
  else
--- 3981,3987 ----
  #endif
  ; return 0; }
  EOF
! if { (eval echo configure:3985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    rm -rf conftest*
    emacs_cv_motif_version_2_1=yes
  else
***************
*** 3859,3865 ****
  EOF
  
      echo $ac_n "checking for XpCreateContext in -lXp""... $ac_c" 1>&6
! echo "configure:3863: checking for XpCreateContext in -lXp" >&5
  ac_lib_var=`echo Xp'_'XpCreateContext | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 4001,4007 ----
  EOF
  
      echo $ac_n "checking for XpCreateContext in -lXp""... $ac_c" 1>&6
! echo "configure:4005: checking for XpCreateContext in -lXp" >&5
  ac_lib_var=`echo Xp'_'XpCreateContext | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 3867,3873 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lXp  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 3871 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 4009,4015 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lXp  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4013 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 3878,3884 ****
  XpCreateContext()
  ; return 0; }
  EOF
! if { (eval echo configure:3882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 4020,4026 ----
  XpCreateContext()
  ; return 0; }
  EOF
! if { (eval echo configure:4024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 3910,3928 ****
  
  # If netdb.h doesn't declare h_errno, we must declare it by hand.
  echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
! echo "configure:3914: checking whether netdb declares h_errno" >&5
  if eval "test \"`echo '$''{'emacs_cv_netdb_declares_h_errno'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3919 "configure"
  #include "confdefs.h"
  #include <netdb.h>
  int main() {
  return h_errno;
  ; return 0; }
  EOF
! if { (eval echo configure:3926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_netdb_declares_h_errno=yes
  else
--- 4052,4070 ----
  
  # If netdb.h doesn't declare h_errno, we must declare it by hand.
  echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
! echo "configure:4056: checking whether netdb declares h_errno" >&5
  if eval "test \"`echo '$''{'emacs_cv_netdb_declares_h_errno'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4061 "configure"
  #include "confdefs.h"
  #include <netdb.h>
  int main() {
  return h_errno;
  ; return 0; }
  EOF
! if { (eval echo configure:4068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_netdb_declares_h_errno=yes
  else
***************
*** 3945,3963 ****
  # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  # for constant arguments.  Useless!
  echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
! echo "configure:3949: checking for working alloca.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3954 "configure"
  #include "confdefs.h"
  #include <alloca.h>
  int main() {
! char *p = alloca(2 * sizeof(int));
  ; return 0; }
  EOF
! if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    ac_cv_header_alloca_h=yes
  else
--- 4087,4105 ----
  # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  # for constant arguments.  Useless!
  echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
! echo "configure:4091: checking for working alloca.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4096 "configure"
  #include "confdefs.h"
  #include <alloca.h>
  int main() {
! void *p = alloca(2 * sizeof(int));
  ; return 0; }
  EOF
! if { (eval echo configure:4103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    ac_cv_header_alloca_h=yes
  else
***************
*** 3978,3989 ****
  fi
  
  echo $ac_n "checking for alloca""... $ac_c" 1>&6
! echo "configure:3982: checking for alloca" >&5
  if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 3987 "configure"
  #include "confdefs.h"
  
  #ifdef __GNUC__
--- 4120,4131 ----
  fi
  
  echo $ac_n "checking for alloca""... $ac_c" 1>&6
! echo "configure:4124: checking for alloca" >&5
  if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4129 "configure"
  #include "confdefs.h"
  
  #ifdef __GNUC__
***************
*** 4011,4017 ****
  char *p = (char *) alloca(1);
  ; return 0; }
  EOF
! if { (eval echo configure:4015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    ac_cv_func_alloca_works=yes
  else
--- 4153,4159 ----
  char *p = (char *) alloca(1);
  ; return 0; }
  EOF
! if { (eval echo configure:4157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    ac_cv_func_alloca_works=yes
  else
***************
*** 4043,4054 ****
  
  
  echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
! echo "configure:4047: checking whether alloca needs Cray hooks" >&5
  if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4052 "configure"
  #include "confdefs.h"
  #if defined(CRAY) && ! defined(CRAY2)
  webecray
--- 4185,4196 ----
  
  
  echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
! echo "configure:4189: checking whether alloca needs Cray hooks" >&5
  if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4194 "configure"
  #include "confdefs.h"
  #if defined(CRAY) && ! defined(CRAY2)
  webecray
***************
*** 4073,4084 ****
  if test $ac_cv_os_cray = yes; then
  for ac_func in _getb67 GETB67 getb67; do
    echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:4077: checking for $ac_func" >&5
  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4082 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $ac_func(); below.  */
--- 4215,4226 ----
  if test $ac_cv_os_cray = yes; then
  for ac_func in _getb67 GETB67 getb67; do
    echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:4219: checking for $ac_func" >&5
  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4224 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $ac_func(); below.  */
***************
*** 4101,4107 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_$ac_func=yes"
  else
--- 4243,4249 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_$ac_func=yes"
  else
***************
*** 4128,4134 ****
  fi
  
  echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
! echo "configure:4132: checking stack direction for C alloca" >&5
  if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 4270,4276 ----
  fi
  
  echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
! echo "configure:4274: checking stack direction for C alloca" >&5
  if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 4136,4142 ****
    ac_cv_c_stack_direction=0
  else
    cat > conftest.$ac_ext <<EOF
! #line 4140 "configure"
  #include "confdefs.h"
  find_stack_direction ()
  {
--- 4278,4284 ----
    ac_cv_c_stack_direction=0
  else
    cat > conftest.$ac_ext <<EOF
! #line 4282 "configure"
  #include "confdefs.h"
  find_stack_direction ()
  {
***************
*** 4155,4161 ****
    exit (find_stack_direction() < 0);
  }
  EOF
! if { (eval echo configure:4159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_c_stack_direction=1
  else
--- 4297,4303 ----
    exit (find_stack_direction() < 0);
  }
  EOF
! if { (eval echo configure:4301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_c_stack_direction=1
  else
***************
*** 4180,4186 ****
  # fmod, logb, and frexp are found in -lm on most systems.
  # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
  echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
! echo "configure:4184: checking for sqrt in -lm" >&5
  ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 4322,4328 ----
  # fmod, logb, and frexp are found in -lm on most systems.
  # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
  echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
! echo "configure:4326: checking for sqrt in -lm" >&5
  ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 4188,4194 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lm  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4192 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 4330,4336 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lm  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4334 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 4199,4205 ****
  sqrt()
  ; return 0; }
  EOF
! if { (eval echo configure:4203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 4341,4347 ----
  sqrt()
  ; return 0; }
  EOF
! if { (eval echo configure:4345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 4229,4235 ****
  
  # Check for mail-locking functions in a "mail" library
  echo $ac_n "checking for maillock in -lmail""... $ac_c" 1>&6
! echo "configure:4233: checking for maillock in -lmail" >&5
  ac_lib_var=`echo mail'_'maillock | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 4371,4377 ----
  
  # Check for mail-locking functions in a "mail" library
  echo $ac_n "checking for maillock in -lmail""... $ac_c" 1>&6
! echo "configure:4375: checking for maillock in -lmail" >&5
  ac_lib_var=`echo mail'_'maillock | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 4237,4243 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lmail  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4241 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 4379,4385 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lmail  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4383 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 4248,4254 ****
  maillock()
  ; return 0; }
  EOF
! if { (eval echo configure:4252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 4390,4396 ----
  maillock()
  ; return 0; }
  EOF
! if { (eval echo configure:4394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 4270,4281 ****
  	     for ac_func in touchlock
  do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:4274: checking for $ac_func" >&5
  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4279 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $ac_func(); below.  */
--- 4412,4423 ----
  	     for ac_func in touchlock
  do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:4416: checking for $ac_func" >&5
  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4421 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $ac_func(); below.  */
***************
*** 4298,4304 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_$ac_func=yes"
  else
--- 4440,4446 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_$ac_func=yes"
  else
***************
*** 4326,4342 ****
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:4330: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4335 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4340: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 4468,4484 ----
  do
  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
! echo "configure:4472: checking for $ac_hdr" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4477 "configure"
  #include "confdefs.h"
  #include <$ac_hdr>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 4374,4385 ****
  utimes setrlimit setpgid getcwd shutdown strftime
  do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:4378: checking for $ac_func" >&5
  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4383 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $ac_func(); below.  */
--- 4516,4527 ----
  utimes setrlimit setpgid getcwd shutdown strftime
  do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
! echo "configure:4520: checking for $ac_func" >&5
  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4525 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char $ac_func(); below.  */
***************
*** 4402,4408 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_$ac_func=yes"
  else
--- 4544,4550 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_$ac_func=yes"
  else
***************
*** 4432,4438 ****
  # It's better to believe a function is not available
  # than to expect to find it in ncurses.
  echo $ac_n "checking for tparm in -lncurses""... $ac_c" 1>&6
! echo "configure:4436: checking for tparm in -lncurses" >&5
  ac_lib_var=`echo ncurses'_'tparm | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 4574,4580 ----
  # It's better to believe a function is not available
  # than to expect to find it in ncurses.
  echo $ac_n "checking for tparm in -lncurses""... $ac_c" 1>&6
! echo "configure:4578: checking for tparm in -lncurses" >&5
  ac_lib_var=`echo ncurses'_'tparm | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 4440,4446 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lncurses  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4444 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 4582,4588 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lncurses  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4586 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 4451,4457 ****
  tparm()
  ; return 0; }
  EOF
! if { (eval echo configure:4455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 4593,4599 ----
  tparm()
  ; return 0; }
  EOF
! if { (eval echo configure:4597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 4482,4488 ****
  # Solaris requires -lintl if you want strerror (which calls dgettext)
  # to return localized messages.
  echo $ac_n "checking for dgettext in -lintl""... $ac_c" 1>&6
! echo "configure:4486: checking for dgettext in -lintl" >&5
  ac_lib_var=`echo intl'_'dgettext | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 4624,4630 ----
  # Solaris requires -lintl if you want strerror (which calls dgettext)
  # to return localized messages.
  echo $ac_n "checking for dgettext in -lintl""... $ac_c" 1>&6
! echo "configure:4628: checking for dgettext in -lintl" >&5
  ac_lib_var=`echo intl'_'dgettext | sed 'y%./+-%__p_%'`
  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
***************
*** 4490,4496 ****
    ac_save_LIBS="$LIBS"
  LIBS="-lintl  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4494 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
--- 4632,4638 ----
    ac_save_LIBS="$LIBS"
  LIBS="-lintl  $LIBS"
  cat > conftest.$ac_ext <<EOF
! #line 4636 "configure"
  #include "confdefs.h"
  /* Override any gcc2 internal prototype to avoid an error.  */
  /* We use char because int might match the return type of a gcc2
***************
*** 4501,4507 ****
  dgettext()
  ; return 0; }
  EOF
! if { (eval echo configure:4505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
--- 4643,4649 ----
  dgettext()
  ; return 0; }
  EOF
! if { (eval echo configure:4647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_lib_$ac_lib_var=yes"
  else
***************
*** 4530,4536 ****
  
  
  echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
! echo "configure:4534: checking whether localtime caches TZ" >&5
  if eval "test \"`echo '$''{'emacs_cv_localtime_cache'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
--- 4672,4678 ----
  
  
  echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
! echo "configure:4676: checking whether localtime caches TZ" >&5
  if eval "test \"`echo '$''{'emacs_cv_localtime_cache'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
***************
*** 4540,4546 ****
  emacs_cv_localtime_cache=yes
  else
    cat > conftest.$ac_ext <<EOF
! #line 4544 "configure"
  #include "confdefs.h"
  #include <time.h>
  #if STDC_HEADERS
--- 4682,4688 ----
  emacs_cv_localtime_cache=yes
  else
    cat > conftest.$ac_ext <<EOF
! #line 4686 "configure"
  #include "confdefs.h"
  #include <time.h>
  #if STDC_HEADERS
***************
*** 4575,4581 ****
    exit (0);
  }
  EOF
! if { (eval echo configure:4579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    emacs_cv_localtime_cache=no
  else
--- 4717,4723 ----
    exit (0);
  }
  EOF
! if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    emacs_cv_localtime_cache=no
  else
***************
*** 4603,4614 ****
  
  if test "x$HAVE_TIMEVAL" = xyes; then
  echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6
! echo "configure:4607: checking whether gettimeofday can accept two arguments" >&5
  if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4612 "configure"
  #include "confdefs.h"
  
  #ifdef TIME_WITH_SYS_TIME
--- 4745,4756 ----
  
  if test "x$HAVE_TIMEVAL" = xyes; then
  echo $ac_n "checking whether gettimeofday can accept two arguments""... $ac_c" 1>&6
! echo "configure:4749: checking whether gettimeofday can accept two arguments" >&5
  if eval "test \"`echo '$''{'emacs_cv_gettimeofday_two_arguments'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4754 "configure"
  #include "confdefs.h"
  
  #ifdef TIME_WITH_SYS_TIME
***************
*** 4630,4636 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_gettimeofday_two_arguments=yes
  else
--- 4772,4778 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    emacs_cv_gettimeofday_two_arguments=yes
  else
***************
*** 4653,4664 ****
  
  ok_so_far=yes
  echo $ac_n "checking for socket""... $ac_c" 1>&6
! echo "configure:4657: checking for socket" >&5
  if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4662 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char socket(); below.  */
--- 4795,4806 ----
  
  ok_so_far=yes
  echo $ac_n "checking for socket""... $ac_c" 1>&6
! echo "configure:4799: checking for socket" >&5
  if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4804 "configure"
  #include "confdefs.h"
  /* System header to define __stub macros and hopefully few prototypes,
      which can conflict with char socket(); below.  */
***************
*** 4681,4687 ****
  
  ; return 0; }
  EOF
! if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_socket=yes"
  else
--- 4823,4829 ----
  
  ; return 0; }
  EOF
! if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    rm -rf conftest*
    eval "ac_cv_func_socket=yes"
  else
***************
*** 4704,4720 ****
  if test $ok_so_far = yes; then
    ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
! echo "configure:4708: checking for netinet/in.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4713 "configure"
  #include "confdefs.h"
  #include <netinet/in.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 4846,4862 ----
  if test $ok_so_far = yes; then
    ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
! echo "configure:4850: checking for netinet/in.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4855 "configure"
  #include "confdefs.h"
  #include <netinet/in.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 4740,4756 ****
  if test $ok_so_far = yes; then
    ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
! echo "configure:4744: checking for arpa/inet.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4749 "configure"
  #include "confdefs.h"
  #include <arpa/inet.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 4882,4898 ----
  if test $ok_so_far = yes; then
    ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
! echo "configure:4886: checking for arpa/inet.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 4891 "configure"
  #include "confdefs.h"
  #include <arpa/inet.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:4896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 4790,4798 ****
  # Set up the CFLAGS for real compilation, so we can substitute it.
  CFLAGS="$REAL_CFLAGS"
  
! #### Find out which version of Emacs this is.
  version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
  	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
  if test x"${version}" = x; then
    { echo "configure: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." 1>&2; exit 1; }
  fi
--- 4932,4942 ----
  # Set up the CFLAGS for real compilation, so we can substitute it.
  CFLAGS="$REAL_CFLAGS"
  
! #### Find out which version of Emacs and which version of Perlmacs this is.
  version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
  	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
+ perlmacs_version=`grep 'defconst[	 ]*perlmacs-version' ${srcdir}/lisp/version.el \
+ 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
  if test x"${version}" = x; then
    { echo "configure: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." 1>&2; exit 1; }
  fi
***************
*** 4830,4835 ****
--- 4974,4986 ----
  
  
  
+ 
+ 
+ 
+ 
+ 
+ 
+ 
  cat >> confdefs.h <<EOF
  #define EMACS_CONFIGURATION "${canonical}"
  EOF
***************
*** 4862,4867 ****
--- 5013,5022 ----
  #define UNEXEC_SRC ${UNEXEC_SRC}
  EOF
  
+ cat >> confdefs.h <<EOF
+ #define PERLMACS_VERSION "${perlmacs_version}"
+ EOF
+ 
  
  if test "${HAVE_X_WINDOWS}" = "yes" ; then
    cat >> confdefs.h <<\EOF
***************
*** 4917,4929 ****
  Configured for \`${canonical}'.
  
    Where should the build process find the source code?    ${srcdir}
!   What operating system and machine description files should Emacs use?
          \`${opsysfile}' and \`${machfile}'
!   What compiler should emacs be built with?               ${CC} ${CFLAGS}
!   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
!   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
!   What window system should Emacs use?                    ${window_system}
!   What toolkit should Emacs use?                          ${USE_X_TOOLKIT}"
  
  if test -n "${x_includes}"; then
  echo "  Where do we find X Windows header files?                ${x_includes}"
--- 5072,5085 ----
  Configured for \`${canonical}'.
  
    Where should the build process find the source code?    ${srcdir}
!   What operating system and machine description files should Perlmacs use?
          \`${opsysfile}' and \`${machfile}'
!   What compiler should perlmacs be built with?            ${CC} ${CFLAGS}
!   Should Perlmacs use the GNU version of malloc?          ${GNU_MALLOC}${GNU_MALLOC_reason}
!   Should Perlmacs use the relocating allocator for buffers?  ${REL_ALLOC}
!   Should the Perl interpreter be embedded?                ${ac_embed_perl}
!   What window system should Perlmacs use?                 ${window_system}
!   What toolkit should Perlmacs use?                       ${USE_X_TOOLKIT}"
  
  if test -n "${x_includes}"; then
  echo "  Where do we find X Windows header files?                ${x_includes}"
***************
*** 5047,5053 ****
  
  trap 'rm -fr `echo "Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
  	man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
! 	leim/Makefile src/config.h:src/config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  EOF
  cat >> $CONFIG_STATUS <<EOF
  
--- 5203,5209 ----
  
  trap 'rm -fr `echo "Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
  	man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
! 	leim/Makefile perl/Makefile.PL src/xs/perlxs.xs:src/xs/perlxs.in src/config.h:src/config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  EOF
  cat >> $CONFIG_STATUS <<EOF
  
***************
*** 5092,5099 ****
--- 5248,5257 ----
  s%@INSTALL_DATA@%$INSTALL_DATA%g
  s%@YACC@%$YACC%g
  s%@SET_MAKE@%$SET_MAKE%g
+ s%@PERL@%$PERL%g
  s%@ALLOCA@%$ALLOCA%g
  s%@version@%$version%g
+ s%@perlmacs_version@%$perlmacs_version%g
  s%@configuration@%$configuration%g
  s%@canonical@%$canonical%g
  s%@srcdir@%$srcdir%g
***************
*** 5104,5109 ****
--- 5262,5268 ----
  s%@etcdir@%$etcdir%g
  s%@archlibdir@%$archlibdir%g
  s%@docdir@%$docdir%g
+ s%@includepath@%$includepath%g
  s%@bitmapdir@%$bitmapdir%g
  s%@c_switch_system@%$c_switch_system%g
  s%@c_switch_machine@%$c_switch_machine%g
***************
*** 5114,5119 ****
--- 5273,5282 ----
  s%@machfile@%$machfile%g
  s%@opsysfile@%$opsysfile%g
  s%@RANLIB@%$RANLIB%g
+ s%@maybe_perl@%$maybe_perl%g
+ s%@PERL_CCOPTS@%$PERL_CCOPTS%g
+ s%@PERL_LDOPTS@%$PERL_LDOPTS%g
+ s%@EMBED_PERL@%$EMBED_PERL%g
  
  CEOF
  EOF
***************
*** 5157,5163 ****
  
  CONFIG_FILES=\${CONFIG_FILES-"Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
  	man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
! 	leim/Makefile"}
  EOF
  cat >> $CONFIG_STATUS <<\EOF
  for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
--- 5320,5326 ----
  
  CONFIG_FILES=\${CONFIG_FILES-"Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
  	man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
! 	leim/Makefile perl/Makefile.PL src/xs/perlxs.xs:src/xs/perlxs.in"}
  EOF
  cat >> $CONFIG_STATUS <<\EOF
  for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/configure.in perlmacs-0.16/configure.in
*** emacs-20.6/configure.in	Sat Feb 26 07:07:02 2000
--- perlmacs-0.16/configure.in	Thu May  4 23:05:19 2000
***************
*** 26,38 ****
  AC_INIT(src/lisp.h)
  AC_CONFIG_HEADER(src/config.h:src/config.in)
  
  lispdir='${datadir}/emacs/${version}/lisp'
  locallisppath='${datadir}/emacs/${version}/site-lisp:'\
  '${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
  lisppath='${locallisppath}:${lispdir}'
  etcdir='${datadir}/emacs/${version}/etc'
! archlibdir='${libexecdir}/emacs/${version}/${configuration}'
! docdir='${datadir}/emacs/${version}/etc'
  
  AC_ARG_WITH(gcc,
  [  --with-gcc              use GCC to compile Emacs])
--- 26,48 ----
  AC_INIT(src/lisp.h)
  AC_CONFIG_HEADER(src/config.h:src/config.in)
  
+ dnl  All Lisp files except for a couple of predump files (version.el,
+ dnl  startup.elc), are the same in Perlmacs as in Emacs, so install
+ dnl  them in the same place.  The same goes for distributed files in
+ dnl  etc/ (all but DOC*).
+ dnl  (hmmm, maybe ought to rename version and startup)
  lispdir='${datadir}/emacs/${version}/lisp'
  locallisppath='${datadir}/emacs/${version}/site-lisp:'\
  '${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
  lisppath='${locallisppath}:${lispdir}'
  etcdir='${datadir}/emacs/${version}/etc'
! 
! dnl  The rest of the installed files should not stomp on their Emacs
! dnl  counterparts.
! archlibdir='${libexecdir}/perlmacs/${perlmacs_version}/${configuration}'
! docdir='${datadir}/perlmacs/${perlmacs_version}/etc'
! includedir='${datadir}/perlmacs/${perlmacs_version}/include'
! includepath='${archlibdir}/include:${includedir}'
  
  AC_ARG_WITH(gcc,
  [  --with-gcc              use GCC to compile Emacs])
***************
*** 42,47 ****
--- 52,59 ----
  AC_ARG_WITH(hesiod,
  [  --with-hesiod           support Hesiod to get the POP server host],
  [AC_DEFINE(HESIOD)])
+ AC_ARG_ENABLE(perl,
+ [  --enable-perl           embed the Perl interpreter])
  dnl This should be the last --with option, because --with-x is
  dnl added later on when we find the path of X, and it's best to
  dnl keep them together visually.
***************
*** 1163,1168 ****
--- 1175,1205 ----
  dnl checks for operating system services
  AC_SYS_LONG_FILE_NAMES
  
+ dnl check for Perl and its version in the build environment
+ AC_PROG_PERL
+ 
+ #### Decide whether to embed Perl.
+ 
+ perl_version="$ac_cv_prog_perl_version"
+ if test "x$enable_perl" = xyes || \
+     ( test -n "$perl_version" && \
+ 	${PERL} -e 'use 5.005;' 2>/dev/null ); then
+   AC_EMBED_PERL
+   if test "x$ac_embed_perl" = xyes; then
+     AC_DEFINE(EMBED_PERL)
+     maybe_perl=perl
+     if ${PERL} -MConfig -e 'exit ($Config{usemymalloc} eq "y" ? 0 : 1)';
+     then
+       perl_malloc=yes
+       AC_DEFINE(PERL_MALLOC)
+     else
+       perl_malloc=no
+     fi
+   else
+     maybe_perl=
+   fi
+ fi
+ 
  #### Choose a window system.
  
  AC_PATH_X
***************
*** 1386,1391 ****
--- 1423,1436 ----
  # Assume not, until told otherwise.
  GNU_MALLOC=yes
  doug_lea_malloc=yes
+ 
+ if test "x$perl_malloc" = xyes; then
+   GNU_MALLOC=no
+   GNU_MALLOC_reason="
+     (Perl's malloc will be linked in.)"
+   doug_lea_malloc=no
+ fi
+ 
  AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no)
  AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no)
  AC_CACHE_CHECK(whether __after_morecore_hook exists,
***************
*** 1740,1748 ****
  CFLAGS="$REAL_CFLAGS"
  
  changequote(, )dnl
! #### Find out which version of Emacs this is.
  version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
  	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
  changequote([, ])dnl
  if test x"${version}" = x; then
    AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.)
--- 1785,1795 ----
  CFLAGS="$REAL_CFLAGS"
  
  changequote(, )dnl
! #### Find out which version of Emacs and which version of Perlmacs this is.
  version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
  	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
+ perlmacs_version=`grep 'defconst[	 ]*perlmacs-version' ${srcdir}/lisp/version.el \
+ 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
  changequote([, ])dnl
  if test x"${version}" = x; then
    AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.)
***************
*** 1751,1756 ****
--- 1798,1804 ----
  ### Specify what sort of things we'll be editing into Makefile and config.h.
  ### Use configuration here uncanonicalized to avoid exceeding size limits.
  AC_SUBST(version)
+ AC_SUBST(perlmacs_version)
  AC_SUBST(configuration)
  AC_SUBST(canonical)
  AC_SUBST(srcdir)
***************
*** 1769,1774 ****
--- 1817,1824 ----
  AC_SUBST(etcdir)
  AC_SUBST(archlibdir)
  AC_SUBST(docdir)
+ AC_SUBST(includepath)
+ AC_SUBST(includedir)
  AC_SUBST(bitmapdir)
  AC_SUBST(c_switch_system)
  AC_SUBST(c_switch_machine)
***************
*** 1780,1785 ****
--- 1830,1839 ----
  AC_SUBST(machfile)
  AC_SUBST(opsysfile)
  AC_SUBST(RANLIB)
+ AC_SUBST(maybe_perl)
+ AC_SUBST(PERL_CCOPTS)
+ AC_SUBST(PERL_LDOPTS)
+ AC_SUBST(EMBED_PERL)
  
  AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION,  "${canonical}")
  AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${ac_configure_args}")
***************
*** 1789,1794 ****
--- 1843,1849 ----
  AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX})
  AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE,  ${C_SWITCH_X_SITE})
  AC_DEFINE_UNQUOTED(UNEXEC_SRC,       ${UNEXEC_SRC})
+ AC_DEFINE_UNQUOTED(PERLMACS_VERSION, "${perlmacs_version}")
  
  if test "${HAVE_X_WINDOWS}" = "yes" ; then
    AC_DEFINE(HAVE_X_WINDOWS)
***************
*** 1820,1832 ****
  Configured for \`${canonical}'.
  
    Where should the build process find the source code?    ${srcdir}
!   What operating system and machine description files should Emacs use?
          \`${opsysfile}' and \`${machfile}'
!   What compiler should emacs be built with?               ${CC} ${CFLAGS}
!   Should Emacs use the GNU version of malloc?             ${GNU_MALLOC}${GNU_MALLOC_reason}
!   Should Emacs use the relocating allocator for buffers?  ${REL_ALLOC}
!   What window system should Emacs use?                    ${window_system}
!   What toolkit should Emacs use?                          ${USE_X_TOOLKIT}"
  
  if test -n "${x_includes}"; then
  echo "  Where do we find X Windows header files?                ${x_includes}"
--- 1875,1888 ----
  Configured for \`${canonical}'.
  
    Where should the build process find the source code?    ${srcdir}
!   What operating system and machine description files should Perlmacs use?
          \`${opsysfile}' and \`${machfile}'
!   What compiler should perlmacs be built with?            ${CC} ${CFLAGS}
!   Should Perlmacs use the GNU version of malloc?          ${GNU_MALLOC}${GNU_MALLOC_reason}
!   Should Perlmacs use the relocating allocator for buffers?  ${REL_ALLOC}
!   Should the Perl interpreter be embedded?                ${ac_embed_perl}
!   What window system should Perlmacs use?                 ${window_system}
!   What toolkit should Perlmacs use?                       ${USE_X_TOOLKIT}"
  
  if test -n "${x_includes}"; then
  echo "  Where do we find X Windows header files?                ${x_includes}"
***************
*** 1851,1857 ****
  
  AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
  	man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
! 	leim/Makefile, [
  
  ### Make the necessary directories, if they don't exist.
  for dir in etc lisp ; do
--- 1907,1913 ----
  
  AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
  	man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
! 	leim/Makefile perl/Makefile.PL src/xs/perlxs.xs:src/xs/perlxs.in, [
  
  ### Make the necessary directories, if they don't exist.
  for dir in etc lisp ; do
Only in perlmacs-0.16/lisp: .cvsignore
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/lisp/loadup.el perlmacs-0.16/lisp/loadup.el
*** emacs-20.6/lisp/loadup.el	Mon May 10 07:42:12 1999
--- perlmacs-0.16/lisp/loadup.el	Thu May  4 20:09:56 2000
***************
*** 118,123 ****
--- 118,126 ----
  (load "textmodes/fill")
  (message "%s" (garbage-collect))
  
+ (if (featurep 'perl-core)
+     (load "perl"))
+ 
  (load "replace")
  (if (eq system-type 'vax-vms)
      (progn
Only in perlmacs-0.16/lisp: perl-data.el
Only in perlmacs-0.16/lisp: perl-regex.el
Only in perlmacs-0.16/lisp: perl.el
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/lisp/startup.el perlmacs-0.16/lisp/startup.el
*** emacs-20.6/lisp/startup.el	Sun Aug  1 21:12:00 1999
--- perlmacs-0.16/lisp/startup.el	Thu May  4 23:02:46 2000
***************
*** 1,3 ****
--- 1,6 ----
+ ;;; Modified 28 March 1999 by John Tobey for Perlmacs.
+ ;;; Copyright (C) 1998-2000 John Tobey.
+ 
  ;;; startup.el --- process Emacs shell arguments
  
  ;; Copyright (C) 1985, 86, 92, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc.
***************
*** 120,126 ****
    "Non-nil once command line has been processed")
  
  (defgroup initialization nil
!   "Emacs start-up procedure"
    :group 'internal)
  
  (defcustom inhibit-startup-message nil
--- 123,129 ----
    "Non-nil once command line has been processed")
  
  (defgroup initialization nil
!   "Perlmacs start-up procedure"
    :group 'internal)
  
  (defcustom inhibit-startup-message nil
***************
*** 168,174 ****
  
  (defvar command-line-default-directory nil
    "Default directory to use for command line arguments.
! This is normally copied from `default-directory' when Emacs starts.")
  
  ;;; This is here, rather than in x-win.el, so that we can ignore these
  ;;; options when we are not using X.
--- 171,177 ----
  
  (defvar command-line-default-directory nil
    "Default directory to use for command line arguments.
! This is normally copied from `default-directory' when Perlmacs starts.")
  
  ;;; This is here, rather than in x-win.el, so that we can ignore these
  ;;; options when we are not using X.
***************
*** 243,249 ****
    "Normal hook run after loading terminal-specific Lisp code.
  It also follows `emacs-startup-hook'.  This hook exists for users to set,
  so as to override the definitions made by the terminal-specific file.
! Emacs never sets this variable itself.")
  
  (defvar keyboard-type nil
    "The brand of keyboard you are using.
--- 246,252 ----
    "Normal hook run after loading terminal-specific Lisp code.
  It also follows `emacs-startup-hook'.  This hook exists for users to set,
  so as to override the definitions made by the terminal-specific file.
! Perlmacs never sets this variable itself.")
  
  (defvar keyboard-type nil
    "The brand of keyboard you are using.
***************
*** 253,259 ****
  
  (defvar window-setup-hook nil
    "Normal hook run to initialize window system display.
! Emacs runs this hook after processing the command line arguments and loading
  the user's init file.")
  
  (defcustom initial-major-mode 'lisp-interaction-mode
--- 256,262 ----
  
  (defvar window-setup-hook nil
    "Normal hook run to initialize window system display.
! Perlmacs runs this hook after processing the command line arguments and loading
  the user's init file.")
  
  (defcustom initial-major-mode 'lisp-interaction-mode
***************
*** 274,280 ****
  evaluates to the name of the directory where the `.emacs' file was
  looked for.
  
! Setting `init-file-user' does not prevent Emacs from loading
  `site-start.el'.  The only way to do that is to use `--no-site-file'."
    :type '(choice (const :tag "none" nil) string)
    :group 'initialization)
--- 277,283 ----
  evaluates to the name of the directory where the `.emacs' file was
  looked for.
  
! Setting `init-file-user' does not prevent Perlmacs from loading
  `site-start.el'.  The only way to do that is to use `--no-site-file'."
    :type '(choice (const :tag "none" nil) string)
    :group 'initialization)
***************
*** 283,289 ****
    "File containing site-wide run-time initializations.
  This file is loaded at run-time before `~/.emacs'.  It contains inits
  that need to be in place for the entire site, but which, due to their
! higher incidence of change, don't make sense to load into emacs'
  dumped image.  Thus, the run-time load order is: 1. file described in
  this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.
  
--- 286,292 ----
    "File containing site-wide run-time initializations.
  This file is loaded at run-time before `~/.emacs'.  It contains inits
  that need to be in place for the entire site, but which, due to their
! higher incidence of change, don't make sense to load into perlmacs'
  dumped image.  Thus, the run-time load order is: 1. file described in
  this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.
  
***************
*** 323,329 ****
      "~/.saves-")
    "Prefix for generating `auto-save-list-file-name'.
  This is used after reading your `.emacs' file to initialize
! `auto-save-list-file-name', by appending Emacs's pid and the system name,
  if you have not already set `auto-save-list-file-name' yourself.
  Set this to nil if you want to prevent `auto-save-list-file-name'
  from being initialized."
--- 326,332 ----
      "~/.saves-")
    "Prefix for generating `auto-save-list-file-name'.
  This is used after reading your `.emacs' file to initialize
! `auto-save-list-file-name', by appending Perlmacs's pid and the system name,
  if you have not already set `auto-save-list-file-name' yourself.
  Set this to nil if you want to prevent `auto-save-list-file-name'
  from being initialized."
***************
*** 450,456 ****
  	    (and auto-save-list-file-prefix
  		 (setq auto-save-list-file-name
  		       ;; Under MS-DOS our PID is almost always reused between
! 		       ;; Emacs invocations.  We need something more unique.
  		       (if (eq system-type 'ms-dos)
  			   (concat 
  			    (make-temp-name
--- 453,459 ----
  	    (and auto-save-list-file-prefix
  		 (setq auto-save-list-file-name
  		       ;; Under MS-DOS our PID is almost always reused between
! 		       ;; Perlmacs invocations.  We need something more unique.
  		       (if (eq system-type 'ms-dos)
  			   (concat 
  			    (make-temp-name
***************
*** 804,810 ****
    (if noninteractive (kill-emacs t)))
  
  (defcustom initial-scratch-message "\
! This buffer is for notes you don't want to save, and for Lisp evaluation.
  If you want to create a file, visit that file with C-x C-f,
  then enter the text in that file's own buffer.
  
--- 807,813 ----
    (if noninteractive (kill-emacs t)))
  
  (defcustom initial-scratch-message "\
! This buffer is for notes you don't want to save, and for script evaluation.
  If you want to create a file, visit that file with C-x C-f,
  then enter the text in that file's own buffer.
  
***************
*** 882,908 ****
  		       ;; The convention for this piece of code is that
  		       ;; each piece of output starts with one or two newlines
  		       ;; and does not end with any newlines.
! 		       (insert "Welcome to GNU Emacs")
! 		       (if (eq system-type 'gnu/linux)
! 			   (insert ", one component of a Linux-based GNU system."))
! 		       (insert "\n")
  		       (if (assq 'display (frame-parameters))
  			   (progn
  			     (insert "\
  The menu bar and scroll bar are sufficient for basic editing with the mouse.
  
  Useful Files menu items:
! Exit Emacs		(or type Control-x followed by Control-c)
  Recover Session		recover files you were editing before a crash
  
  Important Help menu items:
  Emacs Tutorial		Learn-by-doing tutorial for using Emacs efficiently.
! \(Non)Warranty		GNU Emacs comes with ABSOLUTELY NO WARRANTY
! Copying Conditions	Conditions for redistributing and changing Emacs.
! Getting New Versions	How to obtain the latest version of Emacs.
  ")
  			     (insert "\n\n" (emacs-version)
  				     "
  Copyright (C) 1999 Free Software Foundation, Inc."))
  			 ;; If keys have their default meanings,
  			 ;; use precomputed string to save lots of time.
--- 885,908 ----
  		       ;; The convention for this piece of code is that
  		       ;; each piece of output starts with one or two newlines
  		       ;; and does not end with any newlines.
! 		       (insert "Welcome to Perlmacs, a derivative of GNU Emacs.\n")
  		       (if (assq 'display (frame-parameters))
  			   (progn
  			     (insert "\
  The menu bar and scroll bar are sufficient for basic editing with the mouse.
  
  Useful Files menu items:
! Exit Perlmacs		(or type Control-x followed by Control-c)
  Recover Session		recover files you were editing before a crash
  
  Important Help menu items:
  Emacs Tutorial		Learn-by-doing tutorial for using Emacs efficiently.
! \(Non)Warranty		Perlmacs comes with ABSOLUTELY NO WARRANTY
! Copying Conditions	Conditions for redistributing and changing Perlmacs.
  ")
  			     (insert "\n\n" (emacs-version)
  				     "
+ Copyright (C) 1998-2000 John Tobey
  Copyright (C) 1999 Free Software Foundation, Inc."))
  			 ;; If keys have their default meanings,
  			 ;; use precomputed string to save lots of time.
***************
*** 914,926 ****
  				  (eq (key-binding "\C-h\C-n") 'view-emacs-news))
  			     (insert "
  Get help	   C-h  (Hold down CTRL and press h)
! Undo changes	   C-x u       Exit Emacs		C-x C-c
  Get a tutorial	   C-h t       Use Info to read docs	C-h i")
  			   (insert (substitute-command-keys
  				    (format "\n
  Get help	   %s
  Undo changes	   \\[advertised-undo]
! Exit Emacs	   \\[save-buffers-kill-emacs]
  Get a tutorial	   \\[help-with-tutorial]
  Use Info to read docs	\\[info]"
  					    (let ((where (where-is-internal
--- 914,926 ----
  				  (eq (key-binding "\C-h\C-n") 'view-emacs-news))
  			     (insert "
  Get help	   C-h  (Hold down CTRL and press h)
! Undo changes	   C-x u       Exit Perlmacs		C-x C-c
  Get a tutorial	   C-h t       Use Info to read docs	C-h i")
  			   (insert (substitute-command-keys
  				    (format "\n
  Get help	   %s
  Undo changes	   \\[advertised-undo]
! Exit Perlmacs	   \\[save-buffers-kill-emacs]
  Get a tutorial	   \\[help-with-tutorial]
  Use Info to read docs	\\[info]"
  					    (let ((where (where-is-internal
***************
*** 954,980 ****
  				       (regexp-quote (file-name-nondirectory
  						      auto-save-list-file-prefix)))
  			       t)
! 			      (insert "\n\nIf an Emacs session crashed recently, "
  				      "type M-x recover-session RET\nto recover"
  				      " the files you were editing."))
  
  			 (insert "\n\n" (emacs-version)
  				 "
  Copyright (C) 1999 Free Software Foundation, Inc.")
  			 (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
  				  (eq (key-binding "\C-h\C-d") 'describe-distribution)
  				  (eq (key-binding "\C-h\C-w") 'describe-no-warranty))
  			     (insert 
  			      "\n
! GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.
! Emacs is Free Software--Free as in Freedom--so you can redistribute copies
! of Emacs and modify it; type C-h C-c to see the conditions.
! Type C-h C-d for information on getting the latest version.")
  			   (insert (substitute-command-keys
  				    "\n
! GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.
! Emacs is Free Software--Free as in Freedom--so you can redistribute copies
! of Emacs and modify it; type \\[describe-copying] to see the conditions.
  Type \\[describe-distribution] for information on getting the latest version."))))
  		       (goto-char (point-min))
  
--- 954,980 ----
  				       (regexp-quote (file-name-nondirectory
  						      auto-save-list-file-prefix)))
  			       t)
! 			      (insert "\n\nIf a Perlmacs session crashed recently, "
  				      "type M-x recover-session RET\nto recover"
  				      " the files you were editing."))
  
  			 (insert "\n\n" (emacs-version)
  				 "
+ Copyright (C) 1998-2000 John Tobey
  Copyright (C) 1999 Free Software Foundation, Inc.")
  			 (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
  				  (eq (key-binding "\C-h\C-d") 'describe-distribution)
  				  (eq (key-binding "\C-h\C-w") 'describe-no-warranty))
  			     (insert 
  			      "\n
! Perlmacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.
! Perlmacs is Free Software--Free as in Freedom--so you can redistribute copies
! of Perlmacs and modify it; type C-h C-c to see the conditions.")
  			   (insert (substitute-command-keys
  				    "\n
! Perlmacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.
! Perlmacs is Free Software--Free as in Freedom--so you can redistribute copies
! of Perlmacs and modify it; type \\[describe-copying] to see the conditions.
  Type \\[describe-distribution] for information on getting the latest version."))))
  		       (goto-char (point-min))
  
Only in perlmacs-0.16/lwlib: .cvsignore
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/lwlib/Makefile.in perlmacs-0.16/lwlib/Makefile.in
*** emacs-20.6/lwlib/Makefile.in	Sat Aug  1 20:27:59 1998
--- perlmacs-0.16/lwlib/Makefile.in	Thu May  4 20:09:56 2000
***************
*** 50,57 ****
  #If running ranlib fails, probably there is none.
  #That's ok.  So don't stop the build.
  
! # Depend on Makefile so that we recompile if TOOLKIT_DEFINES changes.
! lwlib.o:  $(srcdir)/lwlib.c  Makefile
  	$(CC) -c $(TOOLKIT_DEFINES) $(ALL_CFLAGS) $(srcdir)/lwlib.c
  
  xrdb-cpp.o:  $(srcdir)/xrdb-cpp.c
--- 50,62 ----
  #If running ranlib fails, probably there is none.
  #That's ok.  So don't stop the build.
  
! # FIXME: lwlib.o used to depend on Makefile.  The explanation was:
! #
! ### Depend on Makefile so that we recompile if TOOLKIT_DEFINES changes.
! #
! # This broke incremental builds by forcing emacs to be linked and dumped
! # whenever config.status changed (e.g. after an edit to any Makefile.in).
! lwlib.o:  $(srcdir)/lwlib.c
  	$(CC) -c $(TOOLKIT_DEFINES) $(ALL_CFLAGS) $(srcdir)/lwlib.c
  
  xrdb-cpp.o:  $(srcdir)/xrdb-cpp.c
Only in perlmacs-0.16/man: .cvsignore
Only in perlmacs-0.16: perl
Only in perlmacs-0.16/src: .cvsignore
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/.gdbinit perlmacs-0.16/src/.gdbinit
*** emacs-20.6/src/.gdbinit	Thu Feb 17 05:34:40 2000
--- perlmacs-0.16/src/.gdbinit	Thu May  4 23:05:20 2000
***************
*** 291,296 ****
--- 291,305 ----
  Print $ as a scrollbar pointer.
  end
  
+ define xforeign
+ print (struct Lisp_Foreign_Object *) (($ & $valmask) | gdb_data_seg_bits)
+ output/x *$
+ echo \n
+ end
+ document xforeign
+ Print $ assuming it is a lisp foreign object.
+ end
+ 
  define xprintsym
    set $sym = (struct Lisp_Symbol *) ((((int) $arg0) & $valmask) | gdb_data_seg_bits)
    output (char*)&$sym->name->data
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/Makefile.in perlmacs-0.16/src/Makefile.in
*** emacs-20.6/src/Makefile.in	Mon Apr 26 01:19:42 1999
--- perlmacs-0.16/src/Makefile.in	Thu May  4 23:09:09 2000
***************
*** 1,3 ****
--- 1,7 ----
+ # Modified 1 Jan 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+ # for use with embedded Perl.
+ 
+ 
  # Makefile for GNU Emacs.
  # Copyright (C) 1985, 87, 88, 93, 94, 95 Free Software Foundation, Inc.
  
***************
*** 18,23 ****
--- 22,29 ----
  # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  # Boston, MA 02111-1307, USA.
  
+ default: all
+ 
  # Here are the things that we expect ../configure to edit.
  # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
  srcdir=@srcdir@
***************
*** 28,33 ****
--- 34,42 ----
  CPPFLAGS=@CPPFLAGS@
  LDFLAGS=@LDFLAGS@
  LN_S=@LN_S@
+ PERL=@PERL@
+ PERL_CCOPTS=@PERL_CCOPTS@
+ PERL_LDOPTS=@PERL_LDOPTS@
  # Substitute an assignment for the MAKE variable, because
  # BSD doesn't have it as a default.
  @SET_MAKE@
***************
*** 277,282 ****
--- 286,314 ----
  .c.o:
  	$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
  
+ /* Perl has a header named config.h.  So do we.  Don't look in the Perl
+    include dir, except when necessary.  */
+ perlmacs.o: perlmacs.c perlmacs.h eval.h $(config_h)
+ 	$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(PERL_CCOPTS) ${srcdir}/perlmacs.c
+ perlxsi.o: perlxsi.c
+ 	$(CC) -c $(PERL_CCOPTS) perlxsi.c
+ perlxsi.c:
+ 	$(PERL) -MExtUtils::Embed -e xsinit -- -o $@
+ 
+ xs/Makefile.PL:
+ 	test -d xs || mkdir xs
+ 	echo 'use ExtUtils::MakeMaker; WriteMakefile' >$@
+ 
+ xs/Makefile: xs/Makefile.PL xs/perlxs.xs
+ 	cd xs && $(PERL) Makefile.PL NAME=XS VERSION=0.0
+ 
+ xs/perlxs.xs: $(srcdir)/xs/perlxs.in
+ 	cd .. && ./config.status
+ perlxs.c: xs/Makefile xs/perlxs.xs
+ 	cd xs && ${MAKE} ${MFLAGS} $@ && mv -f $@ ..
+ perlxs.o: perlxs.c perlmacs.h epaths.h
+ 	$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(PERL_CCOPTS) perlxs.c
+ 
  #ifndef LIBX10_MACHINE
  #define LIBX10_MACHINE
  #endif
***************
*** 382,387 ****
--- 414,423 ----
  #endif /* not HAVE_X11 */
  #endif /* not HAVE_X_WINDOWS */
  
+ #ifdef EMBED_PERL
+ PERLOBJ= perlmacs.o perlxsi.o perlxs.o
+ #endif /* EMBED_PERL */
+ 
  #ifndef ORDINARY_LINK
  /* Fix linking if compiled with GCC.  */
  #ifdef __GNUC__
***************
*** 521,527 ****
  	abbrev.o syntax.o UNEXEC mocklisp.o bytecode.o \
  	process.o callproc.o \
  	region-cache.o \
! 	doprnt.o strftime.o MKTIME_OBJ GETLOADAVG_OBJ MSDOS_OBJ
  
  /* Object files used on some machine or other.
     These go in the DOC file on all machines
--- 557,564 ----
  	abbrev.o syntax.o UNEXEC mocklisp.o bytecode.o \
  	process.o callproc.o \
  	region-cache.o \
! 	doprnt.o strftime.o $(PERLOBJ) \
! 	MKTIME_OBJ GETLOADAVG_OBJ MSDOS_OBJ
  
  /* Object files used on some machine or other.
     These go in the DOC file on all machines
***************
*** 628,633 ****
--- 665,676 ----
  #define WINNT_SUPPORT
  #endif
  
+ #ifdef EMBED_PERL
+ #define PERL_SUPPORT ${lispsource}perl.elc
+ #else
+ #define PERL_SUPPORT
+ #endif
+ 
  /* List of Lisp files loaded into the dumped Emacs.  It's arranged
     like this because it's easier to generate it semi-mechanically from
     loadup.el this way.
***************
*** 705,710 ****
--- 748,754 ----
  	WINNT_SUPPORT \
  	${lispsource}widget.elc \
  	${lispsource}window.elc \
+ 	PERL_SUPPORT \
  	${lispsource}version.el
  
  /* These are relative file names for the Lisp files
***************
*** 780,792 ****
    ${dotdot}/lisp/select.elc ${dotdot}/lisp/scroll-bar.elc \
    ${dotdot}/lisp/vmsproc.elc ${dotdot}/lisp/vms-patch.elc \
    ${dotdot}/lisp/ls-lisp.elc ${dotdot}/lisp/dos-fns.elc \
!   ${dotdot}/lisp/w32-fns.elc ${dotdot}/lisp/dos-w32.elc
  
  /* Construct full set of libraries to be linked.
     Note that SunOS needs -lm to come before -lc; otherwise, you get
     duplicated symbols.  If the standard libraries were compiled
     with GCC, we might need gnulib again after them.  */
! LIBES = $(LOADLIBES) $(LDLIBS) $(LIBX) LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
     LIBS_DEBUG $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR)
  
  /* Enable recompilation of certain other files depending on system type.  */
--- 824,838 ----
    ${dotdot}/lisp/select.elc ${dotdot}/lisp/scroll-bar.elc \
    ${dotdot}/lisp/vmsproc.elc ${dotdot}/lisp/vms-patch.elc \
    ${dotdot}/lisp/ls-lisp.elc ${dotdot}/lisp/dos-fns.elc \
!   ${dotdot}/lisp/w32-fns.elc ${dotdot}/lisp/dos-w32.elc \
!   ${dotdot}/lisp/perl.elc
  
  /* Construct full set of libraries to be linked.
     Note that SunOS needs -lm to come before -lc; otherwise, you get
     duplicated symbols.  If the standard libraries were compiled
     with GCC, we might need gnulib again after them.  */
! LIBES = $(LOADLIBES) $(LDLIBS) $(LIBX) $(PERL_LDOPTS) \
!    LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
     LIBS_DEBUG $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR)
  
  /* Enable recompilation of certain other files depending on system type.  */
***************
*** 804,810 ****
  #define OBJECTS_MACHINE
  #endif
  
! all: emacs OTHER_FILES
  
  emacs: temacs ${etc}DOC ${lisp}
  #ifdef CANNOT_DUMP
--- 850,856 ----
  #define OBJECTS_MACHINE
  #endif
  
! all: emacs perlmacs OTHER_FILES
  
  emacs: temacs ${etc}DOC ${lisp}
  #ifdef CANNOT_DUMP
***************
*** 819,824 ****
--- 865,874 ----
  #endif /* ! defined (CANNOT_DUMP) */
  	-./emacs -q -batch -f list-load-path-shadows
  
+ perlmacs: emacs
+ 	rm -f perlmacs
+ 	ln emacs perlmacs
+ 
  /* We run make-docfile twice because the command line may get too long
     on some systems.  */
  /* ${SOME_MACHINE_OBJECTS} comes before ${obj} because some files may
***************
*** 1108,1114 ****
   blockinput.h charset.h $(config_h) INTERVAL_SRC
  bytecode.o: bytecode.c buffer.h syntax.h charset.h $(config_h)
  data.o: data.c buffer.h puresize.h charset.h syssignal.h keyboard.h $(config_h)
! eval.o: eval.c commands.h keyboard.h blockinput.h $(config_h)
  floatfns.o: floatfns.c $(config_h)
  fns.o: fns.c commands.h $(config_h) frame.h buffer.h keyboard.h \
   frame.h window.h INTERVAL_SRC
--- 1158,1164 ----
   blockinput.h charset.h $(config_h) INTERVAL_SRC
  bytecode.o: bytecode.c buffer.h syntax.h charset.h $(config_h)
  data.o: data.c buffer.h puresize.h charset.h syssignal.h keyboard.h $(config_h)
! eval.o: eval.c eval.h commands.h keyboard.h blockinput.h $(config_h)
  floatfns.o: floatfns.c $(config_h)
  fns.o: fns.c commands.h $(config_h) frame.h buffer.h keyboard.h \
   frame.h window.h INTERVAL_SRC
***************
*** 1130,1137 ****
  ${libsrc}emacstool: ${libsrc}emacstool.c
  	cd ${libsrc}; ${MAKE} ${MFLAGS} emacstool
  mostlyclean:
! 	rm -f temacs prefix-args core \#* *.o libXMenu11.a liblw.a
! 	rm -f ../etc/DOC
  clean: mostlyclean
  	rm -f emacs-* emacs
  /**/# This is used in making a distribution.
--- 1180,1187 ----
  ${libsrc}emacstool: ${libsrc}emacstool.c
  	cd ${libsrc}; ${MAKE} ${MFLAGS} emacstool
  mostlyclean:
! 	rm -f temacs prefix-args core \#* *.o libXMenu11.a liblw.a perlxsi.c
! 	rm -f ../etc/DOC xs/Makefile* xs/*.c xs/*.xs
  clean: mostlyclean
  	rm -f emacs-* emacs
  /**/# This is used in making a distribution.
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/alloc.c perlmacs-0.16/src/alloc.c
*** emacs-20.6/src/alloc.c	Thu Sep 16 03:20:15 1999
--- perlmacs-0.16/src/alloc.c	Thu May  4 23:09:09 2000
***************
*** 1,3 ****
--- 1,6 ----
+ /* Modified 1 Jan 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+    for use with embedded Perl. */
+ 
  /* Storage allocation and gc for GNU Emacs Lisp interpreter.
     Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 1998
        Free Software Foundation, Inc.
***************
*** 104,109 ****
--- 107,118 ----
  /* Nonzero means display messages at beginning and end of GC.  */
  int garbage_collection_messages;
  
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ /* Recording which objects' destructors must be called after sweep.  */
+ static Lisp_Object *condemned_list;
+ static int condemned_max, condemned_ix;
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
+ 
  #ifndef VIRT_ADDR_VARIES
  extern
  #endif /* VIRT_ADDR_VARIES */
***************
*** 192,199 ****
  
  Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots;
  
! static void mark_object (), mark_buffer (), mark_kboards ();
! static void clear_marks (), gc_sweep ();
  static void compact_strings ();
  
  extern int message_enable_multibyte;
--- 201,209 ----
  
  Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots;
  
! static void mark_buffer (), mark_kboards ();
! static void clear_marks ();
! void gc_sweep ();
  static void compact_strings ();
  
  extern int message_enable_multibyte;
***************
*** 1078,1083 ****
--- 1088,1099 ----
    marker_block_index = 0;
    marker_free_list = 0;
    n_marker_blocks = 1;
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+   condemned_max = 50;
+   condemned_list = (Lisp_Object *) xmalloc (condemned_max
+ 					    * sizeof (Lisp_Object));
+   condemned_ix = 0;
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
  }
  
  /* Return a newly allocated Lisp_Misc object, with no substructure.  */
***************
*** 1110,1115 ****
--- 1126,1148 ----
    return val;
  }
  
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ Lisp_Object
+ new_foreign_object (vptr, data, lisp_data)
+      struct Lisp_Foreign_Object_VTable *vptr;
+      void *data;
+      Lisp_Object lisp_data;
+ {
+   Lisp_Object val = allocate_misc ();
+ 
+   XMISCTYPE (val) = Lisp_Misc_Foreign_Object;
+   XFOREIGN_OBJECT (val)->vptr = vptr;
+   XFOREIGN_OBJECT (val)->data = data;
+   XFOREIGN_OBJECT (val)->lisp_data = lisp_data;
+   return val;
+ }
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
+ 
  DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
    "Return a newly allocated marker which does not point at any place.")
    ()
***************
*** 1674,1680 ****
  
  struct gcpro *gcprolist;
  
! #define NSTATICS 768
  
  Lisp_Object *staticvec[NSTATICS] = {0};
  
--- 1707,1713 ----
  
  struct gcpro *gcprolist;
  
! #define NSTATICS 778
  
  Lisp_Object *staticvec[NSTATICS] = {0};
  
***************
*** 1691,1696 ****
--- 1724,1730 ----
      abort ();
  }
  
+ /* FIXME: These struct defs should be #included from eval.h  */
  struct catchtag
    {
      Lisp_Object tag;
***************
*** 1729,1734 ****
--- 1763,1789 ----
    return count;
  }
  
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ int
+ call_destructors ()
+ {
+   if (! condemned_ix)
+     return 0;
+   while (condemned_ix)
+     {
+       Lisp_Object obj = condemned_list [--condemned_ix];
+       void (*destroy) () = XFOREIGN_OBJECT (obj)->vptr->destroy;
+ 
+       (*destroy) (obj);
+       XMISC (obj)->u_marker.type = Lisp_Misc_Free;
+       XMISC (obj)->u_free.chain = marker_free_list;
+       marker_free_list = XMISC (obj);
+       total_free_markers++;
+     }
+   return 1;
+ }
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
+ 
  DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "",
    "Reclaim storage for Lisp objects no longer needed.\n\
  Returns info on amount of space in use:\n\
***************
*** 1751,1756 ****
--- 1806,1816 ----
    char stack_top_variable;
    register int i;
  
+ #ifdef DO_GLOBAL_DESTRUCTION
+   if (EQ (emacs_phase, Qdestructing))
+     return Qnil;
+ #endif
+ 
    /* In case user calls debug_print during GC,
       don't let that cause a recursive GC.  */
    consing_since_gc = 0;
***************
*** 1935,1940 ****
--- 1995,2004 ----
    if (gc_cons_threshold < 10000)
      gc_cons_threshold = 10000;
  
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+   call_destructors ();
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
+ 
    if (garbage_collection_messages)
      {
        if (omessage || minibuf_level > 0)
***************
*** 1968,2032 ****
  		       Qnil)))))));
  }
  
- #if 0
- static void
- clear_marks ()
- {
-   /* Clear marks on all conses */
-   {
-     register struct cons_block *cblk;
-     register int lim = cons_block_index;
-   
-     for (cblk = cons_block; cblk; cblk = cblk->next)
-       {
- 	register int i;
- 	for (i = 0; i < lim; i++)
- 	  XUNMARK (cblk->conses[i].car);
- 	lim = CONS_BLOCK_SIZE;
-       }
-   }
-   /* Clear marks on all symbols */
-   {
-     register struct symbol_block *sblk;
-     register int lim = symbol_block_index;
-   
-     for (sblk = symbol_block; sblk; sblk = sblk->next)
-       {
- 	register int i;
- 	for (i = 0; i < lim; i++)
- 	  {
- 	    XUNMARK (sblk->symbols[i].plist);
- 	  }
- 	lim = SYMBOL_BLOCK_SIZE;
-       }
-   }
-   /* Clear marks on all markers */
-   {
-     register struct marker_block *sblk;
-     register int lim = marker_block_index;
-   
-     for (sblk = marker_block; sblk; sblk = sblk->next)
-       {
- 	register int i;
- 	for (i = 0; i < lim; i++)
- 	  if (sblk->markers[i].u_marker.type == Lisp_Misc_Marker)
- 	    XUNMARK (sblk->markers[i].u_marker.chain);
- 	lim = MARKER_BLOCK_SIZE;
-       }
-   }
-   /* Clear mark bits on all buffers */
-   {
-     register struct buffer *nextb = all_buffers;
- 
-     while (nextb)
-       {
- 	XUNMARK (nextb->name);
- 	nextb = nextb->next;
-       }
-   }
- }
- #endif
- 
  /* Mark reference to a Lisp_Object.
    If the object referred to has not been seen yet, recursively mark
    all the references contained in it.
--- 2032,2037 ----
***************
*** 2041,2047 ****
  Lisp_Object *last_marked[LAST_MARKED_SIZE];
  int last_marked_index;
  
! static void
  mark_object (argptr)
       Lisp_Object *argptr;
  {
--- 2046,2052 ----
  Lisp_Object *last_marked[LAST_MARKED_SIZE];
  int last_marked_index;
  
! void
  mark_object (argptr)
       Lisp_Object *argptr;
  {
***************
*** 2268,2273 ****
--- 2273,2295 ----
  	  }
  	  break;
  
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ 	case Lisp_Misc_Foreign_Object:
+ 	  {
+ 	    struct Lisp_Foreign_Object *ptr = XFOREIGN_OBJECT (obj);
+ 	    if (!XMARKBIT (ptr->lisp_data))
+ 	      {
+ 		void (*mark) () = ptr->vptr->mark;
+ 		XMARK (ptr->lisp_data);
+ 		if (mark)
+ 		  (*mark) (obj);
+ 		objptr = &ptr->lisp_data;
+ 		goto loop;
+ 	      }
+ 	  }
+ 	  break;
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
+ 
  	default:
  	  abort ();
  	}
***************
*** 2413,2419 ****
  
  /* Sweep: find all structures not marked, and free them. */
  
! static void
  gc_sweep ()
  {
    total_string_size = 0;
--- 2435,2441 ----
  
  /* Sweep: find all structures not marked, and free them. */
  
! void
  gc_sweep ()
  {
    total_string_size = 0;
***************
*** 2648,2653 ****
--- 2670,2680 ----
  	      case Lisp_Misc_Overlay:
  		markword = &mblk->markers[i].u_overlay.plist;
  		break;
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ 	      case Lisp_Misc_Foreign_Object:
+ 		markword = &mblk->markers[i].u_foreign_object.lisp_data;
+ 		break;
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
  	      case Lisp_Misc_Free:
  		/* If the object was already free, keep it
  		   on the free list.  */
***************
*** 2667,2672 ****
--- 2694,2722 ----
  		    XSETMARKER (tem, tem1);
  		    unchain_marker (tem);
  		  }
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ 		else if (mblk->markers[i].u_marker.type
+ 			 == Lisp_Misc_Foreign_Object)
+ 		  {
+ 		    struct Lisp_Foreign_Object *ptr
+ 		      = &mblk->markers[i].u_foreign_object;
+ 
+ 		    XSETFOREIGN_OBJECT (tem, ptr);
+ 
+ 		    if (ptr->vptr->destroy)
+ 		      {
+ 			/* Condemn object to destruction following sweep.  */
+ 			if (condemned_ix == condemned_max)
+ 			  {
+ 			    condemned_list = (Lisp_Object *)
+ 			      xrealloc (condemned_list, (condemned_max *= 2)
+ 					* sizeof (Lisp_Object));
+ 			  }
+ 			condemned_list [condemned_ix++] = tem;
+ 			continue;
+ 		      }
+ 		  }
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
  		/* Set the type of the freed object to Lisp_Misc_Free.
  		   We could leave the type alone, since nobody checks it,
  		   but this might catch bugs faster.  */
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/callproc.c perlmacs-0.16/src/callproc.c
*** emacs-20.6/src/callproc.c	Wed Jul  7 18:38:56 1999
--- perlmacs-0.16/src/callproc.c	Thu May  4 23:09:09 2000
***************
*** 1,3 ****
--- 1,6 ----
+ /* Modified 3 Mar 1999 by John Tobey <jtobey@john-edwin-tobey.org>
+    for use with embedded Perl.  Added include-directory.  */
+ 
  /* Synchronous subprocess invocation for GNU Emacs.
     Copyright (C) 1985, 86, 87, 88, 93, 94, 95 Free Software Foundation, Inc.
  
***************
*** 91,97 ****
  #define max(a, b) ((a) > (b) ? (a) : (b))
  
  Lisp_Object Vexec_path, Vexec_directory, Vdata_directory, Vdoc_directory;
! Lisp_Object Vconfigure_info_directory;
  Lisp_Object Vtemp_file_name_pattern;
  
  Lisp_Object Vshell_file_name;
--- 94,100 ----
  #define max(a, b) ((a) > (b) ? (a) : (b))
  
  Lisp_Object Vexec_path, Vexec_directory, Vdata_directory, Vdoc_directory;
! Lisp_Object Vinclude_directory, Vinclude_path, Vconfigure_info_directory;
  Lisp_Object Vtemp_file_name_pattern;
  
  Lisp_Object Vshell_file_name;
***************
*** 1266,1271 ****
--- 1269,1282 ----
    Vexec_path = decode_env_path ("EMACSPATH", PATH_EXEC);
    Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path));
    Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
+ 
+   /* Don't bother with environment variables, since include-directory
+      is not used when running interactively.
+      In fact, this variable might be purifiable.  Hmmm.  */
+   Vinclude_path = build_string (PATH_INCLUDESEARCH);
+ 
+   /* This is for backward compatibility and will go away.  */
+   Vinclude_directory = build_string (PATH_INCLUDEDIR);
  }
  
  /* This is run after init_cmdargs, when Vinstallation_directory is valid.  */
***************
*** 1393,1409 ****
  Each element is a string (directory name) or nil (try default directory).");
  
    DEFVAR_LISP ("exec-directory", &Vexec_directory,
!     "Directory for executables for Emacs to invoke.\n\
  More generally, this includes any architecture-dependent files\n\
  that are built and installed from the Emacs distribution.");
  
    DEFVAR_LISP ("data-directory", &Vdata_directory,
!     "Directory of machine-independent files that come with GNU Emacs.\n\
  These are files intended for Emacs to use while it runs.");
  
    DEFVAR_LISP ("doc-directory", &Vdoc_directory,
!     "Directory containing the DOC file that comes with GNU Emacs.\n\
  This is usually the same as data-directory.");
  
    DEFVAR_LISP ("configure-info-directory", &Vconfigure_info_directory,
      "For internal use by the build procedure only.\n\
--- 1404,1430 ----
  Each element is a string (directory name) or nil (try default directory).");
  
    DEFVAR_LISP ("exec-directory", &Vexec_directory,
!     "Directory for executables for Perlmacs to invoke.\n\
  More generally, this includes any architecture-dependent files\n\
  that are built and installed from the Emacs distribution.");
  
    DEFVAR_LISP ("data-directory", &Vdata_directory,
!     "Directory of machine-independent files that come with Perlmacs.\n\
  These are files intended for Emacs to use while it runs.");
  
    DEFVAR_LISP ("doc-directory", &Vdoc_directory,
!     "Directory containing the DOC file that comes with Perlmacs.\n\
  This is usually the same as data-directory.");
+ 
+   DEFVAR_LISP ("include-directory", &Vinclude_directory,
+     "Deprecated in favor of `include-path'.\n\
+ For internal use by Makefile.PL only.  Directory containing the C\n\
+ header files that come with Perlmacs.");
+ 
+   DEFVAR_LISP ("include-path", &Vinclude_path,
+     "For internal use by Makefile.PL only.\n\
+ Colon-separated list of directories containing C header files for\n\
+ compiling external modules.");
  
    DEFVAR_LISP ("configure-info-directory", &Vconfigure_info_directory,
      "For internal use by the build procedure only.\n\
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/config.in perlmacs-0.16/src/config.in
*** emacs-20.6/src/config.in	Mon Apr 26 01:19:44 1999
--- perlmacs-0.16/src/config.in	Thu May  4 20:09:56 2000
***************
*** 41,47 ****
  /* Define REL_ALLOC if you want to use the relocating allocator for
     buffer space. */
  #undef REL_ALLOC
!   
  /* Define HAVE_X_WINDOWS if you want to use the X window system.  */
  #undef HAVE_X_WINDOWS
  
--- 41,68 ----
  /* Define REL_ALLOC if you want to use the relocating allocator for
     buffer space. */
  #undef REL_ALLOC
! 
! /* Define EMBED_PERL to embed the Perl interpreter in Emacs.  */
! #undef EMBED_PERL
! 
! /* Consequences of Perl embedding.  */
! #ifdef EMBED_PERL
! #define LISP_FOREIGN_OBJECT_TYPE 1
! #define DO_GLOBAL_DESTRUCTION 1
! #undef PERLMACS_VERSION
! #endif
! 
! /* Define PERL_MALLOC when embedding a version of Perl with its own
!    malloc routines.  */
! #undef PERL_MALLOC
! 
! /* Perl's malloc looks like a system malloc to Emacs.  */
! #ifdef PERL_MALLOC
! #ifndef SYSTEM_MALLOC
! #define SYSTEM_MALLOC
! #endif
! #endif
! 
  /* Define HAVE_X_WINDOWS if you want to use the X window system.  */
  #undef HAVE_X_WINDOWS
  
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/data.c perlmacs-0.16/src/data.c
*** emacs-20.6/src/data.c	Sat Oct 31 18:30:59 1998
--- perlmacs-0.16/src/data.c	Thu May  4 23:09:09 2000
***************
*** 1,3 ****
--- 1,6 ----
+ /* Modified 1 Jan 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+    for use with embedded Perl. */
+ 
  /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
     Copyright (C) 1985,86,88,93,94,95,97, 1998 Free Software Foundation, Inc.
  
***************
*** 103,108 ****
--- 106,114 ----
  Lisp_Object Qprocess;
  static Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector;
  static Lisp_Object Qchar_table, Qbool_vector;
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ static Lisp_Object Qforeign_object;
+ #endif  /* LISP_FOREIGN_OBJECT_TYPE */
  
  static Lisp_Object swap_in_symval_forwarding ();
  
***************
*** 226,231 ****
--- 232,246 ----
  	  return Qoverlay;
  	case Lisp_Misc_Float:
  	  return Qfloat;
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ 	case Lisp_Misc_Foreign_Object:
+ 	  {
+ 	    Lisp_Object (*type_of)() = XFOREIGN_OBJECT (object)->vptr->type_of;
+ 	    if (type_of)
+ 	      return (*type_of) (object);
+ 	  }
+ 	  return Qforeign_object;
+ #endif  /* LISP_FOREIGN_OBJECT_TYPE */
  	}
        abort ();
  
***************
*** 499,504 ****
--- 514,531 ----
    return Qnil;
  }
  #endif /* LISP_FLOAT_TYPE */
+ 
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ DEFUN ("foreign-object-p", Fforeign_object_p, Sforeign_object_p, 1, 1, 0,
+        "Return t if OBJECT is not of a built-in Lisp type.")
+   (object)
+      Lisp_Object object;
+ {
+   if (FOREIGN_OBJECTP (object))
+     return Qt;
+   return Qnil;
+ }
+ #endif  /* LISP_FOREIGN_OBJECT_TYPE */
  
  /* Extract and set components of lists */
  
***************
*** 2842,2847 ****
--- 2869,2877 ----
    Qvector = intern ("vector");
    Qchar_table = intern ("char-table");
    Qbool_vector = intern ("bool-vector");
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+   Qforeign_object = intern ("foreign-object");
+ #endif  /* LISP_FOREIGN_OBJECT_TYPE */
  
    staticpro (&Qinteger);
    staticpro (&Qsymbol);
***************
*** 2860,2865 ****
--- 2890,2898 ----
    staticpro (&Qvector);
    staticpro (&Qchar_table);
    staticpro (&Qbool_vector);
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+   staticpro (&Qforeign_object);
+ #endif  /* LISP_FOREIGN_OBJECT_TYPE */
  
    DEFVAR_BOOL ("keyword-symbols-constant-flag", &keyword_symbols_constant_flag,
      "Non-nil means it is an error to set a keyword symbol.\n\
***************
*** 2895,2900 ****
--- 2928,2936 ----
    defsubr (&Ssubrp);
    defsubr (&Sbyte_code_function_p);
    defsubr (&Schar_or_string_p);
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+   defsubr (&Sforeign_object_p);
+ #endif  /* LISP_FOREIGN_OBJECT_TYPE */
    defsubr (&Scar);
    defsubr (&Scdr);
    defsubr (&Scar_safe);
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/emacs.c perlmacs-0.16/src/emacs.c
*** emacs-20.6/src/emacs.c	Wed Dec  1 07:03:43 1999
--- perlmacs-0.16/src/emacs.c	Thu May  4 23:09:09 2000
***************
*** 1,3 ****
--- 1,6 ----
+ /* Modified 1 Jan 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+    for use with embedded Perl. */
+ 
  /* Fully extensible Emacs, running on Unix, intended for GNU.
     Copyright (C) 1985,86,87,93,94,95,97,1998 Free Software Foundation, Inc.
  
***************
*** 76,81 ****
--- 79,89 ----
     nil means get them only from PATH_LOADSEARCH.  */
  Lisp_Object Vinstallation_directory;
  
+ #ifdef DO_GLOBAL_DESTRUCTION
+ /* How to tell whether Emacs is starting, running, or shutting down.  */
+ Lisp_Object emacs_phase, Qrunning, Qdestructing;
+ #endif 
+ 
  /* Hook run by `kill-emacs' before it does really anything.  */
  Lisp_Object Vkill_emacs_hook;
  
***************
*** 282,288 ****
  
  /* Code for dealing with Lisp access to the Unix command line */
  
! static void
  init_cmdargs (argc, argv, skip_args)
       int argc;
       char **argv;
--- 290,296 ----
  
  /* Code for dealing with Lisp access to the Unix command line */
  
! void
  init_cmdargs (argc, argv, skip_args)
       int argc;
       char **argv;
***************
*** 593,607 ****
       char **argv;
       char **envp;
  {
-   char stack_bottom_variable;
-   int skip_args = 0;
-   extern int errno;
-   extern int sys_nerr;
- #ifdef HAVE_SETRLIMIT
-   struct rlimit rlim;
- #endif
-   int no_loadup = 0;
- 
  #ifdef LINUX_SBRK_BUG
    __sbrk (1);
  #endif
--- 601,606 ----
***************
*** 611,616 ****
--- 610,682 ----
      run_time_remap (argv[0]);
  #endif
  
+ #ifdef EMBED_PERL
+   {
+     /* Find out whether to behave like standard Emacs or standard Perl.
+        FIXME: Being Perl could lead to disaster if (!initialized).
+ 
+        argmatch() would be too flexible for my liking.
+        Let there be only one way to do this until all ways have been
+        well thought out.  */
+     int i;
+     int be_perl;
+     char *exe;
+ 
+     /* Check the executable file name for an occurence of the string "perl".
+        If found, default to Perl.
+        FIXME: This code assumes '/' is the path separator and the program
+        name is case-sensitive.  */
+ 
+     exe = strrchr (argv [0], '/');
+     if (! exe)
+       exe = argv [0];
+ 
+     be_perl = (strstr (exe, "perl") != 0);
+ 
+     /* Regardless of the program name, the command line can override.  */
+ 
+     for (i = 1; i < argc; i++)
+       {
+ 	if (! strcmp (argv [i], "--perl"))
+ 	  be_perl = 1;
+ 	else if (!strcmp (argv [i], "--emacs"))
+ 	  be_perl = 0;
+ 	else
+ 	  break;
+       }
+     i--;
+     if (i)
+       {
+ 	/* Both Emacs' and Perl's command line parsers
+ 	   would be confused by the --perl and --emacs arguments,
+ 	   so make it look as if they weren't there.  */
+ 	argv [i] = argv [0];
+ 	argv += i;
+ 	argc -= i;
+       }
+     if (be_perl)
+       return perlmacs_main (argc, argv, envp);
+   }
+ #endif /* EMBED_PERL */
+ 
+   return emacs_main (argc, argv, envp);
+ }
+ 
+ /* ARGSUSED */
+ int
+ emacs_main (argc, argv, envp)
+      int argc;
+      char **argv;
+      char **envp;
+ {
+   char stack_bottom_variable;
+   int skip_args = 0;
+   extern int errno;
+   extern int sys_nerr;
+ #ifdef HAVE_SETRLIMIT
+   struct rlimit rlim;
+ #endif
+ 
    sort_args (argc, argv);
    argc = 0;
    while (argv[argc]) argc++;
***************
*** 620,641 ****
           So ignore --version otherwise.  */
        && initialized)
      {
!       Lisp_Object tem;
!       tem = Fsymbol_value (intern ("emacs-version"));
!       if (!STRINGP (tem))
  	{
  	  fprintf (stderr, "Invalid value of `emacs-version'\n");
  	  exit (1);
  	}
        else
  	{
! 	  printf ("GNU Emacs %s\n", XSTRING (tem)->data);
  	  printf ("Copyright (C) 1999 Free Software Foundation, Inc.\n");
! 	  printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
! 	  printf ("You may redistribute copies of Emacs\n");
  	  printf ("under the terms of the GNU General Public License.\n");
  	  printf ("For more information about these matters, ");
! 	  printf ("see the file named COPYING.\n");
  	  exit (0);
  	}
      }
--- 686,727 ----
           So ignore --version otherwise.  */
        && initialized)
      {
!       Lisp_Object emv, pmv;
!       emv = Fsymbol_value (intern ("emacs-version"));
!       pmv = Fsymbol_value (intern ("perlmacs-version"));
!       if (!STRINGP (emv))
  	{
  	  fprintf (stderr, "Invalid value of `emacs-version'\n");
  	  exit (1);
  	}
+       else if (!STRINGP (pmv))
+ 	{
+ 	  fprintf (stderr, "Invalid value of `perlmacs-version'\n");
+ 	  exit (1);
+ 	}
        else
  	{
! 	  printf ("Perlmacs %s (GNU Emacs %s)\n",
! 		  XSTRING (pmv)->data, XSTRING (emv)->data);
! 	  printf ("Copyright (C) 1998-2000 John Tobey.\n");
  	  printf ("Copyright (C) 1999 Free Software Foundation, Inc.\n");
! #ifdef EMBED_PERL
! #ifdef CANNOT_DUMP
! 	  printf ("Copyright 1987-2000, Larry Wall\n");
! #else
! 	  printf ("Type `%s --perl -v' for Perl's copyright information.\n",
! 		  argv [0]);
! #endif
! #else
! 	  printf ("Perl support disabled.\n");
! #endif
! 	  printf ("Perlmacs comes with ABSOLUTELY NO WARRANTY.\n");
! 	  printf ("You may redistribute copies of Perlmacs\n");
  	  printf ("under the terms of the GNU General Public License.\n");
  	  printf ("For more information about these matters, ");
! 	  printf ("see the file named COPYING.\n\n");
! 	  printf ("For the latest version, check\n");
! 	  printf ("http://john-edwin-tobey.org/perlmacs/ .\n");
  	  exit (0);
  	}
      }
***************
*** 831,839 ****
        [-q] [--no-init-file]  [-u user] [--user user]  [--debug-init]\n\
        [--unibyte] [--multibyte] [--version] [--no-site-file]\n\
        [-f func] [--funcall func]  [-l file] [--load file]  [--eval expr]\n\
!       [--insert file] [+linenum] file-to-visit  [--kill]\n\
! Report bugs to bug-gnu-emacs@gnu.org.  First, please see\n\
! the Bugs section of the Emacs manual or the file BUGS.\n", argv[0]);
        exit (0);
      }
  
--- 917,923 ----
        [-q] [--no-init-file]  [-u user] [--user user]  [--debug-init]\n\
        [--unibyte] [--multibyte] [--version] [--no-site-file]\n\
        [-f func] [--funcall func]  [-l file] [--load file]  [--eval expr]\n\
!       [--insert file] [+linenum] file-to-visit  [--kill]\n", argv[0]);
        exit (0);
      }
  
***************
*** 956,961 ****
--- 1040,1263 ----
  
    noninteractive1 = noninteractive;
  
+ #ifdef EMBED_PERL
+   perlmacs_init_lisp (argc, argv, skip_args);
+ #else
+   init_lisp (argc, argv, skip_args);
+ #endif
+ 
+   /* Intern the names of all standard functions and variables;
+      define standard keys.  */
+ 
+   if (!initialized)
+     {
+       /* The basic levels of Lisp must come first */
+       /* And data must come first of all
+ 	 for the sake of symbols like error-message */
+       syms_of_data ();
+       syms_of_alloc ();
+       syms_of_lread ();
+       syms_of_print ();
+       syms_of_eval ();
+       syms_of_fns ();
+       syms_of_floatfns ();
+ 
+       syms_of_abbrev ();
+       syms_of_buffer ();
+       syms_of_bytecode ();
+       syms_of_callint ();
+       syms_of_casefiddle ();
+       syms_of_casetab ();
+       syms_of_callproc ();
+       syms_of_category ();
+       syms_of_ccl ();
+       syms_of_charset ();
+       syms_of_cmds ();
+ #ifndef NO_DIR_LIBRARY
+       syms_of_dired ();
+ #endif /* not NO_DIR_LIBRARY */
+       syms_of_display ();
+       syms_of_doc ();
+       syms_of_editfns ();
+       syms_of_emacs ();
+       syms_of_fileio ();
+       syms_of_coding ();	/* This should be after syms_of_fileio.  */
+ #ifdef CLASH_DETECTION
+       syms_of_filelock ();
+ #endif /* CLASH_DETECTION */
+       syms_of_indent ();
+       syms_of_insdel ();
+       syms_of_keyboard ();
+       syms_of_keymap ();
+       syms_of_macros ();
+       syms_of_marker ();
+       syms_of_minibuf ();
+       syms_of_mocklisp ();
+       syms_of_process ();
+       syms_of_search ();
+       syms_of_frame ();
+       syms_of_syntax ();
+       syms_of_term ();
+       syms_of_undo ();
+ 
+       /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
+       syms_of_textprop ();
+ #ifdef VMS
+       syms_of_vmsproc ();
+ #endif /* VMS */
+ #ifdef WINDOWSNT
+       syms_of_ntproc ();
+ #endif /* WINDOWSNT */
+       syms_of_window ();
+       syms_of_xdisp ();
+ #ifdef HAVE_X_WINDOWS
+       syms_of_xterm ();
+       syms_of_xfns ();
+       syms_of_fontset ();
+ #ifdef HAVE_X11
+       syms_of_xselect ();
+ #endif
+ #endif /* HAVE_X_WINDOWS */
+ 
+ #ifndef HAVE_NTGUI
+       syms_of_xfaces ();
+       syms_of_xmenu ();
+ #endif
+ 
+ #ifdef HAVE_NTGUI
+       syms_of_w32term ();
+       syms_of_w32fns ();
+       syms_of_w32faces ();
+       syms_of_w32select ();
+       syms_of_w32menu ();
+       syms_of_fontset ();
+ #endif /* HAVE_NTGUI */
+ 
+ #ifdef EMBED_PERL
+       syms_of_perlmacs ();
+ #endif /* EMBED_PERL */
+ 
+ #ifdef SYMS_SYSTEM
+       SYMS_SYSTEM;
+ #endif
+ 
+ #ifdef SYMS_MACHINE
+       SYMS_MACHINE;
+ #endif
+ 
+       keys_of_casefiddle ();
+       keys_of_cmds ();
+       keys_of_buffer ();
+       keys_of_keyboard ();
+       keys_of_keymap ();
+       keys_of_macros ();
+       keys_of_minibuf ();
+       keys_of_window ();
+       keys_of_frame ();
+     }
+ 
+   if (!noninteractive)
+     {
+ #ifdef VMS
+       init_vms_input ();/* init_display calls get_frame_size, that needs this */
+ #endif /* VMS */
+       init_display ();	/* Determine terminal type.  init_sys_modes uses results */
+     }
+   init_keyboard ();	/* This too must precede init_sys_modes */
+ #ifdef VMS
+   init_vmsproc ();	/* And this too. */
+ #endif /* VMS */
+   init_sys_modes ();	/* Init system terminal modes (RAW or CBREAK, etc.) */
+   init_xdisp ();
+ 
+   if (!initialized)
+     {
+       char *file;
+       /* Handle -l loadup, args passed by Makefile. */
+       if (argmatch (argv, argc, "-l", "--load", 3, &file, &skip_args))
+ 	Vtop_level = Fcons (intern ("load"),
+ 			    Fcons (build_string (file), Qnil));
+ #ifdef CANNOT_DUMP
+       /* Unless next switch is -nl, load "loadup.el" first thing.  */
+       if (! no_loadup)
+ 	Vtop_level = Fcons (intern ("load"),
+ 			    Fcons (build_string ("loadup.el"), Qnil));
+ #endif /* CANNOT_DUMP */
+     }
+ 
+   if (initialized)
+     {
+ #ifdef HAVE_TZSET
+       {
+ 	/* If the execution TZ happens to be the same as the dump TZ,
+ 	   change it to some other value and then change it back,
+ 	   to force the underlying implementation to reload the TZ info.
+ 	   This is needed on implementations that load TZ info from files,
+ 	   since the TZ file contents may differ between dump and execution.  */
+ 	char *tz = getenv ("TZ");
+ 	if (tz && !strcmp (tz, dump_tz))
+ 	  {
+ 	    ++*tz;
+ 	    tzset ();
+ 	    --*tz;
+ 	  }
+       }
+ #endif
+     }
+ 
+   /* Gerd Moellmann <gerd@acm.org> says this makes profiling work on
+      FreeBSD.  It might work on some other systems too.
+      Give it a try and tell me if it works on your system.  */
+ #ifdef __FreeBSD__
+ #ifdef PROFILING
+   if (initialized)
+     {
+       extern void _mcleanup ();       
+       extern char etext;
+       extern Lisp_Object Fredraw_frame ();
+       atexit (_mcleanup);
+       /* This uses Fredraw_frame because that function
+ 	 comes first in the Emacs executable.
+ 	 It might be better to use something that gives
+ 	 the start of the text segment, but start_of_text
+ 	 is not defined on all systems now.  */
+       monstartup (Fredraw_frame, &etext);
+     }
+   else
+     moncontrol (0);
+ #endif
+ #endif
+ 
+   initialized = 1;
+ 
+ #ifdef LOCALTIME_CACHE
+   /* Some versions of localtime have a bug.  They cache the value of the time
+      zone rather than looking it up every time.  Since localtime() is
+      called to bolt the undumping time into the undumped emacs, this
+      results in localtime ignoring the TZ environment variable.
+      This flushes the new TZ value into localtime. */
+   tzset ();
+ #endif /* defined (LOCALTIME_CACHE) */
+ 
+ #ifdef DO_GLOBAL_DESTRUCTION
+   emacs_phase = Qrunning;
+ #endif
+ 
+   /* Enter editor command loop.  This never returns.  */
+   Frecursive_edit ();
+   /* NOTREACHED */
+ }
+ 
+ /* Perform basic initializations (not merely interning symbols) */
+ 
+ void
+ init_lisp (argc, argv, skip_args)
+      int argc;
+      char **argv;
+      int skip_args;
+ {
+   int no_loadup = 0;
+ 
  /* Perform basic initializations (not merely interning symbols) */
  
    if (!initialized)
***************
*** 976,981 ****
--- 1278,1287 ----
        init_fileio_once ();	/* Must precede any path manipulation.  */
      }
  
+ #ifdef DO_GLOBAL_DESTRUCTION
+   emacs_phase = Qnil;
+ #endif
+ 
    init_alloc ();
    init_eval ();
    init_coding ();
***************
*** 1153,1277 ****
    init_callproc ();	/* Must follow init_cmdargs but not init_sys_modes.  */
    init_lread ();
  
-   /* Intern the names of all standard functions and variables;
-      define standard keys.  */
- 
-   if (!initialized)
-     {
-       /* The basic levels of Lisp must come first */
-       /* And data must come first of all
- 	 for the sake of symbols like error-message */
-       syms_of_data ();
-       syms_of_alloc ();
-       syms_of_lread ();
-       syms_of_print ();
-       syms_of_eval ();
-       syms_of_fns ();
-       syms_of_floatfns ();
- 
-       syms_of_abbrev ();
-       syms_of_buffer ();
-       syms_of_bytecode ();
-       syms_of_callint ();
-       syms_of_casefiddle ();
-       syms_of_casetab ();
-       syms_of_callproc ();
-       syms_of_category ();
-       syms_of_ccl ();
-       syms_of_charset ();
-       syms_of_cmds ();
- #ifndef NO_DIR_LIBRARY
-       syms_of_dired ();
- #endif /* not NO_DIR_LIBRARY */
-       syms_of_display ();
-       syms_of_doc ();
-       syms_of_editfns ();
-       syms_of_emacs ();
-       syms_of_fileio ();
-       syms_of_coding ();	/* This should be after syms_of_fileio.  */
- #ifdef CLASH_DETECTION
-       syms_of_filelock ();
- #endif /* CLASH_DETECTION */
-       syms_of_indent ();
-       syms_of_insdel ();
-       syms_of_keyboard ();
-       syms_of_keymap ();
-       syms_of_macros ();
-       syms_of_marker ();
-       syms_of_minibuf ();
-       syms_of_mocklisp ();
-       syms_of_process ();
-       syms_of_search ();
-       syms_of_frame ();
-       syms_of_syntax ();
-       syms_of_term ();
-       syms_of_undo ();
- 
-       /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
-       syms_of_textprop ();
- #ifdef VMS
-       syms_of_vmsproc ();
- #endif /* VMS */
- #ifdef WINDOWSNT
-       syms_of_ntproc ();
- #endif /* WINDOWSNT */
-       syms_of_window ();
-       syms_of_xdisp ();
- #ifdef HAVE_X_WINDOWS
-       syms_of_xterm ();
-       syms_of_xfns ();
-       syms_of_fontset ();
- #ifdef HAVE_X11
-       syms_of_xselect ();
- #endif
- #endif /* HAVE_X_WINDOWS */
- 
- #ifndef HAVE_NTGUI
-       syms_of_xfaces ();
-       syms_of_xmenu ();
- #endif
- 
- #ifdef HAVE_NTGUI
-       syms_of_w32term ();
-       syms_of_w32fns ();
-       syms_of_w32faces ();
-       syms_of_w32select ();
-       syms_of_w32menu ();
-       syms_of_fontset ();
- #endif /* HAVE_NTGUI */
- 
- #ifdef SYMS_SYSTEM
-       SYMS_SYSTEM;
- #endif
- 
- #ifdef SYMS_MACHINE
-       SYMS_MACHINE;
- #endif
- 
-       keys_of_casefiddle ();
-       keys_of_cmds ();
-       keys_of_buffer ();
-       keys_of_keyboard ();
-       keys_of_keymap ();
-       keys_of_macros ();
-       keys_of_minibuf ();
-       keys_of_window ();
-       keys_of_frame ();
-     }
- 
-   if (!noninteractive)
-     {
- #ifdef VMS
-       init_vms_input ();/* init_display calls get_frame_size, that needs this */
- #endif /* VMS */
-       init_display ();	/* Determine terminal type.  init_sys_modes uses results */
-     }
-   init_keyboard ();	/* This too must precede init_sys_modes */
- #ifdef VMS
-   init_vmsproc ();	/* And this too. */
- #endif /* VMS */
-   init_sys_modes ();	/* Init system terminal modes (RAW or CBREAK, etc.) */
-   init_xdisp ();
    init_macros ();
    init_editfns ();
  #ifdef LISP_FLOAT_TYPE
--- 1459,1464 ----
***************
*** 1281,1359 ****
    init_vmsfns ();
  #endif /* VMS */
    init_process ();
- 
-   if (!initialized)
-     {
-       char *file;
-       /* Handle -l loadup, args passed by Makefile. */
-       if (argmatch (argv, argc, "-l", "--load", 3, &file, &skip_args))
- 	Vtop_level = Fcons (intern ("load"),
- 			    Fcons (build_string (file), Qnil));
- #ifdef CANNOT_DUMP
-       /* Unless next switch is -nl, load "loadup.el" first thing.  */
-       if (! no_loadup)
- 	Vtop_level = Fcons (intern ("load"),
- 			    Fcons (build_string ("loadup.el"), Qnil));
- #endif /* CANNOT_DUMP */
-     }
- 
-   if (initialized)
-     {
- #ifdef HAVE_TZSET
-       {
- 	/* If the execution TZ happens to be the same as the dump TZ,
- 	   change it to some other value and then change it back,
- 	   to force the underlying implementation to reload the TZ info.
- 	   This is needed on implementations that load TZ info from files,
- 	   since the TZ file contents may differ between dump and execution.  */
- 	char *tz = getenv ("TZ");
- 	if (tz && !strcmp (tz, dump_tz))
- 	  {
- 	    ++*tz;
- 	    tzset ();
- 	    --*tz;
- 	  }
-       }
- #endif
-     }
- 
-   /* Gerd Moellmann <gerd@acm.org> says this makes profiling work on
-      FreeBSD.  It might work on some other systems too.
-      Give it a try and tell me if it works on your system.  */
- #ifdef __FreeBSD__
- #ifdef PROFILING
-   if (initialized)
-     {
-       extern void _mcleanup ();       
-       extern char etext;
-       extern Lisp_Object Fredraw_frame ();
-       atexit (_mcleanup);
-       /* This uses Fredraw_frame because that function
- 	 comes first in the Emacs executable.
- 	 It might be better to use something that gives
- 	 the start of the text segment, but start_of_text
- 	 is not defined on all systems now.  */
-       monstartup (Fredraw_frame, &etext);
-     }
-   else
-     moncontrol (0);
- #endif
- #endif
- 
-   initialized = 1;
- 
- #ifdef LOCALTIME_CACHE
-   /* Some versions of localtime have a bug.  They cache the value of the time
-      zone rather than looking it up every time.  Since localtime() is
-      called to bolt the undumping time into the undumped emacs, this
-      results in localtime ignoring the TZ environment variable.
-      This flushes the new TZ value into localtime. */
-   tzset ();
- #endif /* defined (LOCALTIME_CACHE) */
- 
-   /* Enter editor command loop.  This never returns.  */
-   Frecursive_edit ();
-   /* NOTREACHED */
  }
  
  /* Sort the args so we can find the most important ones
--- 1468,1473 ----
***************
*** 1608,1614 ****
       Lisp_Object arg;
  {
    Lisp_Object hook, hook1;
!   int i;
    struct gcpro gcpro1;
  
    GCPRO1 (arg);
--- 1722,1728 ----
       Lisp_Object arg;
  {
    Lisp_Object hook, hook1;
!   int status;
    struct gcpro gcpro1;
  
    GCPRO1 (arg);
***************
*** 1627,1632 ****
--- 1741,1751 ----
    stop_vms_input ();
   #endif  */
  
+ #ifdef DO_GLOBAL_DESTRUCTION
+   consing_since_gc = 0;
+   shutdown_eval ();
+ #endif /* DO_GLOBAL_DESTRUCTION */
+ 
    shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil);
  
    /* If we have an auto-save list file,
***************
*** 1635,1647 ****
    if (STRINGP (Vauto_save_list_file_name))
      unlink (XSTRING (Vauto_save_list_file_name)->data);
  
!   exit (INTEGERP (arg) ? XINT (arg)
  #ifdef VMS
! 	: 1
  #else
! 	: 0
  #endif
- 	);
    /* NOTREACHED */
  }
  
--- 1754,1797 ----
    if (STRINGP (Vauto_save_list_file_name))
      unlink (XSTRING (Vauto_save_list_file_name)->data);
  
!   status = INTEGERP (arg) ? XINT (arg)
  #ifdef VMS
! 	: 1;
  #else
! 	: 0;
! #endif
! 
! #ifdef DO_GLOBAL_DESTRUCTION
!   {
!     int i;
! 
!     emacs_phase = Qdestructing;
!     for (i = 20; i; i--)
!       {
! 	consing_since_gc = 0;
! 	gc_sweep ();
! 	if (! call_destructors () && specpdl_ptr == specpdl)
! 	  break;
! 	shutdown_eval ();
!       }
! 
!     /* FIXME: More needs to be done, like freeing any remaining
!        data blocks and closing X connections.  */
! 
!     if (i == 0)
!       fprintf (stderr, "Warning: Perlmacs failed to free some data.\n\
! specpdl index: %d\n\
! total_markers: %d\n", specpdl_ptr - specpdl, total_markers);
!     else
!       emacs_phase = Qnil;
!   }
! #endif /* DO_GLOBAL_DESTRUCTION */
! 
! #ifdef EMBED_PERL
!   perlmacs_exit (status);
! #else
!   exit (status);
  #endif
    /* NOTREACHED */
  }
  
***************
*** 1698,1714 ****
    kill_vms_processes ();
  #endif
  
- #if 0 /* This triggers a bug in XCloseDisplay and is not needed.  */
- #ifdef HAVE_X_WINDOWS
-   /* It's not safe to call intern here.  Maybe we are crashing.  */
-   if (!noninteractive && SYMBOLP (Vwindow_system)
-       && XSYMBOL (Vwindow_system)->name->size == 1
-       && XSYMBOL (Vwindow_system)->name->data[0] == 'x'
-       && ! no_x)
-     Fx_close_current_connection ();
- #endif /* HAVE_X_WINDOWS */
- #endif
- 
  #ifdef SIGIO
    /* There is a tendency for a SIGIO signal to arrive within exit,
       and cause a SIGHUP because the input descriptor is already closed.  */
--- 1848,1853 ----
***************
*** 1898,1903 ****
--- 2037,2049 ----
  {
    Qfile_name_handler_alist = intern ("file-name-handler-alist");
    staticpro (&Qfile_name_handler_alist);
+ 
+ #ifdef DO_GLOBAL_DESTRUCTION
+   Qrunning = intern ("running");
+   staticpro (&Qrunning);
+   Qdestructing = intern ("destructing");
+   staticpro (&Qdestructing);
+ #endif
  
  #ifndef CANNOT_DUMP
  #ifdef HAVE_SHM
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/epaths.in perlmacs-0.16/src/epaths.in
*** emacs-20.6/src/epaths.in	Sat Aug 16 14:29:06 1997
--- perlmacs-0.16/src/epaths.in	Thu May  4 20:12:14 2000
***************
*** 30,35 ****
--- 30,41 ----
     doc-directory is set to this value.  */
  #define PATH_DOC "/usr/local/lib/emacs/data"
  
+ /* Where Makefile.PL should look for the Emacs header files.  */
+ #define PATH_INCLUDESEARCH "/usr/local/lib/emacs/include:/usr/local/include"
+ 
+ /* Old version of PATH_INCLUDESEARCH used for Emacs::Lisp 0.83-0.87.  */
+ #define PATH_INCLUDEDIR "/usr/local/include"
+ 
  /* Where the configuration process believes the info tree lives.  The
     lisp variable configure-info-directory gets its value from this
     macro, and is then used to set the Info-default-directory-list.  */
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/eval.c perlmacs-0.16/src/eval.c
*** emacs-20.6/src/eval.c	Fri Aug 13 22:29:01 1999
--- perlmacs-0.16/src/eval.c	Thu May  4 23:09:09 2000
***************
*** 1,3 ****
--- 1,6 ----
+ /* Modified 7 Feb 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+    for use with embedded Perl. */
+ 
  /* Evaluator for GNU Emacs Lisp interpreter.
     Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995 Free Software Foundation, Inc.
  
***************
*** 34,92 ****
  #else
  #define INTERACTIVE 1
  #endif
- 
  #include <setjmp.h>
! 
! /* This definition is duplicated in alloc.c and keyboard.c */
! /* Putting it in lisp.h makes cc bomb out! */
! 
! struct backtrace
!   {
!     struct backtrace *next;
!     Lisp_Object *function;
!     Lisp_Object *args;	/* Points to vector of args. */
!     int nargs;		/* Length of vector.
! 			   If nargs is UNEVALLED, args points to slot holding
! 			   list of unevalled args */
!     char evalargs;
!     /* Nonzero means call value of debugger when done with this operation. */
!     char debug_on_exit;
!   };
  
  struct backtrace *backtrace_list;
  
- /* This structure helps implement the `catch' and `throw' control
-    structure.  A struct catchtag contains all the information needed
-    to restore the state of the interpreter after a non-local jump.
- 
-    Handlers for error conditions (represented by `struct handler'
-    structures) just point to a catch tag to do the cleanup required
-    for their jumps.
- 
-    catchtag structures are chained together in the C calling stack;
-    the `next' member points to the next outer catchtag.
- 
-    A call like (throw TAG VAL) searches for a catchtag whose `tag'
-    member is TAG, and then unbinds to it.  The `val' member is used to
-    hold VAL while the stack is unwound; `val' is returned as the value
-    of the catch form.
- 
-    All the other members are concerned with restoring the interpreter
-    state.  */
- struct catchtag
-   {
-     Lisp_Object tag;
-     Lisp_Object val;
-     struct catchtag *next;
-     struct gcpro *gcpro;
-     jmp_buf jmp;
-     struct backtrace *backlist;
-     struct handler *handlerlist;
-     int lisp_eval_depth;
-     int pdlcount;
-     int poll_suppress_count;
-   };
- 
  struct catchtag *catchlist;
  
  Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
--- 37,47 ----
  #else
  #define INTERACTIVE 1
  #endif
  #include <setjmp.h>
! #include "eval.h"
  
  struct backtrace *backtrace_list;
  
  struct catchtag *catchlist;
  
  Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
***************
*** 193,198 ****
--- 148,166 ----
    when_entered_debugger = -1;
  }
  
+ #ifdef DO_GLOBAL_DESTRUCTION
+ shutdown_eval ()
+ {
+   while (catchlist)
+     {
+       unbind_to (catchlist->pdlcount, Qnil);
+       handlerlist = catchlist->handlerlist;
+       catchlist = catchlist->next;
+     }
+   unbind_to (0, Qnil);
+ }
+ #endif /* DO_GLOBAL_DESTRUCTION */
+ 
  Lisp_Object
  call_debugger (arg)
       Lisp_Object arg;
***************
*** 945,951 ****
  
     This is used for correct unwinding in Fthrow and Fsignal.  */
  
! static void
  unwind_to_catch (catch, value)
       struct catchtag *catch;
       Lisp_Object value;
--- 913,919 ----
  
     This is used for correct unwinding in Fthrow and Fsignal.  */
  
! void
  unwind_to_catch (catch, value)
       struct catchtag *catch;
       Lisp_Object value;
***************
*** 1153,1159 ****
    return val;
  }
  
! /* Like internal_condition_case but call HFUN with ARG as its argument.  */
  
  Lisp_Object
  internal_condition_case_1 (bfun, arg, handlers, hfun)
--- 1121,1127 ----
    return val;
  }
  
! /* Like internal_condition_case but call BFUN with ARG as its argument.  */
  
  Lisp_Object
  internal_condition_case_1 (bfun, arg, handlers, hfun)
***************
*** 1693,1698 ****
--- 1661,1667 ----
  {
    Lisp_Object fun, val, original_fun, original_args;
    Lisp_Object funcar;
+   Lisp_Object args_left, numargs, *vals;
    struct backtrace backtrace;
    struct gcpro gcpro1, gcpro2, gcpro3;
  
***************
*** 1745,1755 ****
   retry:
    fun = Findirect_function (original_fun);
  
    if (SUBRP (fun))
      {
-       Lisp_Object numargs;
        Lisp_Object argvals[8];
-       Lisp_Object args_left;
        register int i, maxargs;
  
        args_left = original_args;
--- 1714,1762 ----
   retry:
    fun = Findirect_function (original_fun);
  
+   if ((SUBRP (fun) && XSUBR (fun)->max_args == MANY)
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+       || (FOREIGN_OBJECTP (fun) && XFOREIGN_OBJECT (fun)->vptr->call)
+ #endif
+       )
+     {
+       /* Pass a vector of evaluated arguments */
+       register int argnum = 0;
+ 
+       args_left = original_args;
+       numargs = Flength (args_left);
+       vals = (Lisp_Object *) alloca (XINT (numargs) * sizeof (Lisp_Object));
+ 
+       GCPRO3 (args_left, fun, fun);
+       gcpro3.var = vals;
+       gcpro3.nvars = 0;
+ 
+       while (!NILP (args_left))
+ 	{
+ 	  vals[argnum++] = Feval (Fcar (args_left));
+ 	  args_left = Fcdr (args_left);
+ 	  gcpro3.nvars = argnum;
+ 	}
+ 
+       backtrace.args = vals;
+       backtrace.nargs = XINT (numargs);
+ 
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+       if (FOREIGN_OBJECTP (fun))
+ 	{
+ 	  Lisp_Object (*call) () = XFOREIGN_OBJECT (fun)->vptr->call;
+ 	  val = (*call) (fun, XINT (numargs), vals);
+ 	}
+       else
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
+       val = (*XSUBR (fun)->function) (XINT (numargs), vals);
+       UNGCPRO;
+       goto done;
+     }
+ 
    if (SUBRP (fun))
      {
        Lisp_Object argvals[8];
        register int i, maxargs;
  
        args_left = original_args;
***************
*** 1766,1798 ****
  	  goto done;
  	}
  
-       if (XSUBR (fun)->max_args == MANY)
- 	{
- 	  /* Pass a vector of evaluated arguments */
- 	  Lisp_Object *vals;
- 	  register int argnum = 0;
- 
- 	  vals = (Lisp_Object *) alloca (XINT (numargs) * sizeof (Lisp_Object));
- 
- 	  GCPRO3 (args_left, fun, fun);
- 	  gcpro3.var = vals;
- 	  gcpro3.nvars = 0;
- 
- 	  while (!NILP (args_left))
- 	    {
- 	      vals[argnum++] = Feval (Fcar (args_left));
- 	      args_left = Fcdr (args_left);
- 	      gcpro3.nvars = argnum;
- 	    }
- 
- 	  backtrace.args = vals;
- 	  backtrace.nargs = XINT (numargs);
- 
- 	  val = (*XSUBR (fun)->function) (XINT (numargs), vals);
- 	  UNGCPRO;
- 	  goto done;
- 	}
- 
        GCPRO3 (args_left, fun, fun);
        gcpro3.var = argvals;
        gcpro3.nvars = 0;
--- 1773,1778 ----
***************
*** 2507,2512 ****
--- 2487,2501 ----
    if (COMPILEDP (fun))
      val = funcall_lambda (fun, numargs, args + 1);
    else
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+     if (FOREIGN_OBJECTP (fun))
+       {
+ 	Lisp_Object (*call) () = XFOREIGN_OBJECT (fun)->vptr->call;
+ 	if (call)
+ 	  val = (*call) (fun, numargs, args + 1);
+       }
+   else
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
      {
        if (!CONSP (fun))
  	return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
Only in perlmacs-0.16/src: eval.h
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/fns.c perlmacs-0.16/src/fns.c
*** emacs-20.6/src/fns.c	Thu Oct 14 19:34:03 1999
--- perlmacs-0.16/src/fns.c	Thu May  4 23:09:09 2000
***************
*** 1,3 ****
--- 1,6 ----
+ /* Modified 1 Jan 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+    for use with embedded Perl. */
+ 
  /* Random utility Lisp functions.
     Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 98, 1999 Free Software Foundation, Inc.
  
***************
*** 62,69 ****
  
  extern Lisp_Object Qinput_method_function;
  
- static int internal_equal ();
- 
  extern long get_random ();
  extern void seed_random ();
  
--- 65,70 ----
***************
*** 1651,1661 ****
    (o1, o2)
       register Lisp_Object o1, o2;
  {
!   return internal_equal (o1, o2, 0) ? Qt : Qnil;
  }
  
! static int
! internal_equal (o1, o2, depth)
       register Lisp_Object o1, o2;
       int depth;
  {
--- 1652,1662 ----
    (o1, o2)
       register Lisp_Object o1, o2;
  {
!   return recursive_equal (o1, o2, 0) ? Qt : Qnil;
  }
  
! int
! recursive_equal (o1, o2, depth)
       register Lisp_Object o1, o2;
       int depth;
  {
***************
*** 1677,1683 ****
  #endif
  
      case Lisp_Cons:
!       if (!internal_equal (XCONS (o1)->car, XCONS (o2)->car, depth + 1))
  	return 0;
        o1 = XCONS (o1)->cdr;
        o2 = XCONS (o2)->cdr;
--- 1678,1684 ----
  #endif
  
      case Lisp_Cons:
!       if (!recursive_equal (XCONS (o1)->car, XCONS (o2)->car, depth + 1))
  	return 0;
        o1 = XCONS (o1)->cdr;
        o2 = XCONS (o2)->cdr;
***************
*** 1688,1696 ****
  	return 0;
        if (OVERLAYP (o1))
  	{
! 	  if (!internal_equal (OVERLAY_START (o1), OVERLAY_START (o2),
  			       depth + 1)
! 	      || !internal_equal (OVERLAY_END (o1), OVERLAY_END (o2),
  				  depth + 1))
  	    return 0;
  	  o1 = XOVERLAY (o1)->plist;
--- 1689,1697 ----
  	return 0;
        if (OVERLAYP (o1))
  	{
! 	  if (!recursive_equal (OVERLAY_START (o1), OVERLAY_START (o2),
  			       depth + 1)
! 	      || !recursive_equal (OVERLAY_END (o1), OVERLAY_END (o2),
  				  depth + 1))
  	    return 0;
  	  o1 = XOVERLAY (o1)->plist;
***************
*** 1703,1708 ****
--- 1704,1721 ----
  		  && (XMARKER (o1)->buffer == 0
  		      || XMARKER (o1)->bytepos == XMARKER (o2)->bytepos));
  	}
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+       if (FOREIGN_OBJECTP (o1))
+ 	{
+ 	  struct Lisp_Foreign_Object *ptr = XFOREIGN_OBJECT (o1);
+ 	  int (*equal) () = ptr->vptr->equal;
+ 
+ 	  if (!recursive_equal (Ftype_of (o1), Ftype_of (o2), depth + 1))
+ 	    return 0;
+ 	  return (ptr->data == XFOREIGN_OBJECT (o2)->data
+ 		  || (equal && (*equal) (o1, o2, depth + 1)));
+ 	}
+ #endif  /* LISP_FOREIGN_OBJECT_TYPE */
        break;
  
      case Lisp_Vectorlike:
***************
*** 1743,1749 ****
  	    Lisp_Object v1, v2;
  	    v1 = XVECTOR (o1)->contents [i];
  	    v2 = XVECTOR (o2)->contents [i];
! 	    if (!internal_equal (v1, v2, depth + 1))
  	      return 0;
  	  }
  	return 1;
--- 1756,1762 ----
  	    Lisp_Object v1, v2;
  	    v1 = XVECTOR (o1)->contents [i];
  	    v2 = XVECTOR (o2)->contents [i];
! 	    if (!recursive_equal (v1, v2, depth + 1))
  	      return 0;
  	  }
  	return 1;
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/lisp.h perlmacs-0.16/src/lisp.h
*** emacs-20.6/src/lisp.h	Sun Jan  3 11:31:23 1999
--- perlmacs-0.16/src/lisp.h	Thu May  4 23:09:10 2000
***************
*** 1,3 ****
--- 1,8 ----
+ /* Modified 1 Jan 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+    for use with embedded Perl.
+    Copyright (C) 1998,1999,2000 John Tobey
+ */
+ 
  /* Fundamental definitions for GNU Emacs Lisp interpreter.
     Copyright (C) 1985,86,87,93,94,95,97,1998 Free Software Foundation, Inc.
  
***************
*** 28,33 ****
--- 33,45 ----
  #define EMACS_UINT unsigned int
  #endif
  
+ /* Declare the prototype for a general external function.  */
+ #ifdef __STDC__
+ #define P_(proto) proto
+ #else
+ #define P_(proto) ()
+ #endif
+ 
  /* Define the fundamental Lisp data structures.  */
  
  /* This is the set of Lisp data types.  */
***************
*** 85,90 ****
--- 97,103 ----
      /* Currently floats are not a misc type,
         but let's define this in case we want to change that.  */
      Lisp_Misc_Float,
+     Lisp_Misc_Foreign_Object,
      /* This is not a type code.  It is for range checking.  */
      Lisp_Misc_Limit
    };
***************
*** 404,409 ****
--- 417,423 ----
  #define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value))
  #define XOVERLAY(a) (&(XMISC(a)->u_overlay))
  #define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd))
+ #define XFOREIGN_OBJECT(a) (&(XMISC(a)->u_foreign_object))
  
  /* Pseudovector types.  */
  #define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a))
***************
*** 426,431 ****
--- 440,447 ----
  /* Misc types.  */
  #define XSETMISC(a, b) XSET (a, Lisp_Misc, b)
  #define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker)
+ #define XSETFOREIGN_OBJECT(a, b) \
+   (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Foreign_Object)
  
  /* Pseudovector types.  */
  #define XSETPSEUDOVECTOR(a, b, code) \
***************
*** 877,882 ****
--- 893,957 ----
      int offset;
    };
  
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ /* struct Lisp_Foreign_Object can hold arbitrary binary data not directly
+    managed by Lisp.  The VPTR points to a table of object methods that
+    are called at various times.
+ 
+    The TYPE-OF method is called by Ftype_of() and must return the same
+    (`equal') object each time it is called with a given argument.
+ 
+    DESTROY is called after the sweep phase of garbage collection, when
+    the object is to be freed.
+ 
+    The MARK method is called during the mark phase of garbage
+    collection.  MARK must recursively call mark_object() on all
+    contained Lisp objects.
+ 
+    TO_STRING is used by the printer and must return a string.  All
+    foreign objects are printed in hash notation.
+ 
+    FIXME: should probably replace to_string with a stream-printing method.
+ 
+    EQUAL is used in the recursive equality tester.  It should pass its
+    DEPTH argument to recursive_equal() when comparing subobjects, to
+    guard against circularity.  EQUAL may assume that the `type-of' both
+    args is the same (`equal', not `eq').  (Under the current
+    implementation, the VPTRs will be the same, too.)  EQUAL must return
+    a boolean value indicating whether its first two arguments are `equal'.
+ 
+    The CALL method is called when our object appears in functional
+    position.
+ 
+    Any of the function pointers may be 0, in which case a default behavior
+    will be used.
+ 
+    Each of the methods corresponds to and is called only from within one
+    enumeration of complex Lisp data types.  (Typically a switch
+    statement in C code.)  The "foreign" object type effectively extends
+    these enumerations, and thus the typespace, ad infinitum.  */
+ 
+ struct Lisp_Foreign_Object_VTable
+   {
+     Lisp_Object (*type_of)   P_ ((Lisp_Object self));
+     void        (*destroy)   P_ ((Lisp_Object self));
+     void        (*mark)      P_ ((Lisp_Object self));
+     Lisp_Object (*to_string) P_ ((Lisp_Object self));
+     int         (*equal) P_ ((Lisp_Object self, Lisp_Object other, int depth));
+     Lisp_Object (*call) P_ ((Lisp_Object self, int nargs, Lisp_Object *args));
+   };
+ 
+ struct Lisp_Foreign_Object
+   {
+     int type : 16;	/* = Lisp_Misc_Foreign_Object */
+     int spacer : 16;
+     struct Lisp_Foreign_Object_VTable *vptr;
+     void *data;
+     Lisp_Object lisp_data;
+   };
+ 
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
+ 
  
  /* To get the type field of a union Lisp_Misc, use XMISCTYPE.
     It uses one of these struct subtypes to get the type field.  */
***************
*** 892,897 ****
--- 967,975 ----
      struct Lisp_Buffer_Local_Value u_buffer_local_value;
      struct Lisp_Overlay u_overlay;
      struct Lisp_Kboard_Objfwd u_kboard_objfwd;
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+     struct Lisp_Foreign_Object u_foreign_object;
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
    };
  
  #ifdef LISP_FLOAT_TYPE
***************
*** 1058,1063 ****
--- 1136,1143 ----
  #define GC_VECTORP(x) (GC_VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
  #define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
  #define GC_OVERLAYP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
+ #define FOREIGN_OBJECTP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Foreign_Object)
+ #define GC_FOREIGN_OBJECTP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Foreign_Object)
  #define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
  #define GC_MARKERP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
  #define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
***************
*** 1268,1280 ****
  			 Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)
  #endif
  
- /* Declare the prototype for a general external function.  */
- #if defined (__STDC__) || defined (WINDOWSNT)
- #define P_(proto) proto
- #else
- #define P_(proto) ()
- #endif
- 
  /* defsubr (Sname);
   is how we define the symbol for function `name' at start-up time.  */
  extern void defsubr P_ ((struct Lisp_Subr *));
--- 1348,1353 ----
***************
*** 1731,1736 ****
--- 1804,1810 ----
  EXFUN (Fstring_equal, 2);
  EXFUN (Fcompare_strings, 7);
  EXFUN (Fstring_lessp, 2);
+ extern int recursive_equal P_ ((Lisp_Object o1, Lisp_Object o2, int depth));
  extern int char_table_translate P_ ((Lisp_Object, int));
  extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object, Lisp_Object),
  				Lisp_Object, Lisp_Object, Lisp_Object, int,
***************
*** 1854,1859 ****
--- 1928,1940 ----
  #ifdef LISP_FLOAT_TYPE
  extern Lisp_Object make_float P_ ((double));
  #endif /* LISP_FLOAT_TYPE */
+ extern int total_markers;
+ extern void mark_object P_ ((Lisp_Object *));
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ extern Lisp_Object new_foreign_object P_ ((struct Lisp_Foreign_Object_VTable *,
+ 					   void *, Lisp_Object));
+ extern Lisp_Object Qfree;
+ #endif /* LISP_FOREIGN_OBJECT_TYPE */
  extern void display_malloc_warning P_ ((void));
  extern int inhibit_garbage_collection P_ ((void));
  extern void free_marker P_ ((Lisp_Object));
***************
*** 1982,1987 ****
--- 2063,2069 ----
  extern void do_autoload P_ ((Lisp_Object, Lisp_Object));
  extern Lisp_Object un_autoload P_ ((Lisp_Object));
  EXFUN (Ffetch_bytecode, 1);
+ extern int lisp_eval_depth;
  extern void init_eval_once P_ ((void));
  extern void init_eval P_ ((void));
  extern void syms_of_eval P_ ((void));
***************
*** 2312,2319 ****
  
  /* defined in emacs.c */
  extern Lisp_Object decode_env_path P_ ((char *, char *));
! extern Lisp_Object Vinvocation_name, Vinvocation_directory;
! extern Lisp_Object Vinstallation_directory;
  EXFUN (Fkill_emacs, 1);
  void shut_down_emacs P_ ((int, int, Lisp_Object));
  /* Nonzero means don't do interactive redisplay and don't change tty modes */
--- 2394,2404 ----
  
  /* defined in emacs.c */
  extern Lisp_Object decode_env_path P_ ((char *, char *));
! extern Lisp_Object Vcommand_line_args, Vinvocation_name, Vinvocation_directory;
! extern Lisp_Object Vinstallation_directory, Vkill_emacs_hook;
! extern Lisp_Object emacs_phase, Qrunning, Qdestructing;
! extern void init_cmdargs P_ ((int, char **, int));
! extern void init_lisp P_ ((int, char **, int));
  EXFUN (Fkill_emacs, 1);
  void shut_down_emacs P_ ((int, int, Lisp_Object));
  /* Nonzero means don't do interactive redisplay and don't change tty modes */
Only in perlmacs-0.16/src: perlmacs.c
Only in perlmacs-0.16/src: perlmacs.h
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/print.c perlmacs-0.16/src/print.c
*** emacs-20.6/src/print.c	Sun Feb 21 14:48:55 1999
--- perlmacs-0.16/src/print.c	Thu May  4 23:09:09 2000
***************
*** 1,3 ****
--- 1,6 ----
+ /* Modified 1 Jan 1998 by John Tobey <jtobey@john-edwin-tobey.org>
+    for use with embedded Perl. */
+ 
  /* Lisp object printing and output streams.
     Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 1998
  	Free Software Foundation, Inc.
***************
*** 1723,1728 ****
--- 1726,1754 ----
  	    }
  	  PRINTCHAR ('>');
  	  break;
+ 
+ #ifdef LISP_FOREIGN_OBJECT_TYPE
+ 	case Lisp_Misc_Foreign_Object:
+ 	  {
+ 	    Lisp_Object (*to_string) ()
+ 	      = XFOREIGN_OBJECT (obj)->vptr->to_string;
+ 
+ 	    PRINTCHAR ('#');
+ 	    PRINTCHAR ('<');
+ 	    print (Ftype_of (obj), printcharfun, escapeflag);
+ 	    PRINTCHAR (' ');
+ 	    if (to_string)
+ 	      print ((*to_string) (obj), printcharfun, escapeflag);
+ 	    else
+ 	      {
+ 		sprintf (buf, "0x%lx",
+ 			 (unsigned long) XFOREIGN_OBJECT (obj)->data);
+ 		strout (buf, -1, -1, printcharfun);
+ 	      }
+ 	    PRINTCHAR ('>');
+ 	  }
+ 	  break;
+ #endif  /* LISP_FOREIGN_OBJECT_TYPE */
  
        /* Remaining cases shouldn't happen in normal usage, but let's print
  	 them anyway for the benefit of the debugger.  */
diff -cr --exclude=build --exclude=*.elc --exclude=version.el --exclude=CVS --exclude=README* --exclude=BUGS emacs-20.6/src/unexelf.c perlmacs-0.16/src/unexelf.c
*** emacs-20.6/src/unexelf.c	Fri Dec  3 04:09:21 1999
--- perlmacs-0.16/src/unexelf.c	Thu May  4 23:02:50 2000
***************
*** 926,934 ****
  	      >= OLD_SECTION_H (old_bss_index-1).sh_offset)
  	    NEW_SECTION_H (nn).sh_offset += new_data2_size;
  #else
! 	  if (round_up (NEW_SECTION_H (nn).sh_offset,
  			OLD_SECTION_H (old_bss_index).sh_addralign)
! 	      >= new_data2_offset)
  	    NEW_SECTION_H (nn).sh_offset += new_data2_size;
  #endif
  	  /* Any section that was originally placed after the section
--- 926,940 ----
  	      >= OLD_SECTION_H (old_bss_index-1).sh_offset)
  	    NEW_SECTION_H (nn).sh_offset += new_data2_size;
  #else
! 	  /* The idea of this is that the bss section's sh_offset
! 	     may need rounding up to compare with new_data2_offset.
! 	     So we cannot simply compare the sh_offset.
! 	     However, another small section could exist just before
! 	     the bss section, and we need to know that is before.  */
! 	  if (round_up (NEW_SECTION_H (nn).sh_offset
! 			+ NEW_SECTION_H (nn).sh_size,
  			OLD_SECTION_H (old_bss_index).sh_addralign)
! 	      > new_data2_offset)
  	    NEW_SECTION_H (nn).sh_offset += new_data2_size;
  #endif
  	  /* Any section that was originally placed after the section
Only in perlmacs-0.16/src: xs