From xemacs-m  Thu Jan 30 15:57:53 1997
Received: from black-ice.cc.vt.edu (root@black-ice.cc.vt.edu [128.173.14.71])
          by xemacs.org (8.8.4/8.8.4) with ESMTP
	  id PAA17749 for <xemacs-beta@xemacs.org>; Thu, 30 Jan 1997 15:57:46 -0600 (CST)
Received: from black-ice.cc.vt.edu (valdis@LOCALHOST [127.0.0.1])
	by black-ice.cc.vt.edu (8.8.5/8.8.5) with ESMTP id QAA15656
	for <xemacs-beta@xemacs.org>; Thu, 30 Jan 1997 16:57:39 -0500
Message-Id: <199701302157.QAA15656@black-ice.cc.vt.edu>
X-Mailer: exmh version 2.0gamma 1/27/96
To: xemacs-beta@xemacs.org
Subject: unexec(), 'make install', and semi-random flaming...
From: Valdis.Kletnieks@vt.edu
X-Url: http://black-ice.cc.vt.edu/~valdis/
Mime-Version: 1.0
Content-Type: multipart/signed; boundary="==_Exmh_-1486058476P";
	micalg=pgp-md5; protocol="application/pgp-signature"
Content-Transfer-Encoding: 7bit
Date: Thu, 30 Jan 1997 16:57:33 -0500

--==_Exmh_-1486058476P
Content-Type: text/plain; charset=us-ascii

Is anybody besides me bothered by the fact that unexec() in emacs.c
doesn't check the return code at all?

Scenario:  AIX 4.2, Xemacs 20.0-b93.  Due to a number of goofs on
my part (like having an old lib/xemacs-20.0b92/moby_disk_sucker lying
around ;) the disk filled up while trying to unexec() an xemacs from
the temacs.  Now, unfortunately, the particular way that unexec() died
left a 4 megabyte file *called* xemacs sitting there.  This made the
subsequent attempt to continue wiht a 'make all-elc' choke with:

Checking for Mule support...
/home/spd/valdis/src/xemacs-20.0-b92/src/lib-src/update-elc.sh[58]: 
/home/spd/va
ldis/src/xemacs-20.0-b92/src/src/xemacs:  not found
make: The error code from the last command is 127.

which is fair enough, I guess.  But it would have been just a
tad nicer if the unlink() call in unexaix.c wasn't commented out,
as that would bring the make to a screeching halt a lot sooner.

I dug around a bit trying to decypher the error handling, but never
*did* find any systematic cleanup of the wreckage after a failed unexec()
(such as removing the failed xemacs and so on).

Any ideas/comments on this?

I guess it wouldn't be quite so painful, except that in order to
deal with /usr/local being managed by the 'depot' package, I end up
runnng a script that looks like:

./configure --with-options
make beta
make install-arch-dep prefix=/my/staging/area
make install-arch-indep prefix=/my/staging/area

I believe that AFS with replication requires this as well.  You can't
just 'make install prefix=' because that will rebuild the paths.h
and point everything to the staging area (Not Good).  I'm of
2 minds here - on the one hand, it *is* nice to have accessible install
targets like this (doing the 'depot' install for GCC or That Other Emacsish
is *quite* the hassle), but it *would* be nice if it didn't blindly chug
along even if a 'make all' died - you should have SEEN the wreckage
after the install-arch-indep kept chugging even after the disk was
already full ;)

I *THINK* the following patch gives "best of both worlds" - it should
kill the installs if it didn't build, but still allows a "handle" to
use a different prefix= value for the build and the install (for
'depot' or AFS).

/Valdis

*** Makefile    Thu Jan 30 14:04:55 1997
--- Makefile.temp       Thu Jan 30 16:54:01 1997
***************
*** 348,354 ****

  install: all install-arch-dep install-arch-indep;

! install-arch-dep: mkdir
        (cd lib-src && \
          $(MAKE) install $(MFLAGS) prefix=${prefix} \
            exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
--- 348,354 ----

  install: all install-arch-dep install-arch-indep;

! install-arch-dep: mkdir ${MAKE_SUBDIR}
        (cd lib-src && \
          $(MAKE) install $(MFLAGS) prefix=${prefix} \
            exec_prefix=${exec_prefix} bindir=${bindir} libdir=${libdir} \
***************
*** 366,372 ****
        rm -f ${bindir}/xemacs
        (cd ${bindir} && ${LN_S} xemacs-${version} ./xemacs)

! install-arch-indep: mkdir
        -set ${COPYDESTS} ; \
         for dir in ${COPYDIR} ; do \
           if [ `(cd $$1 && pwd)` != `(cd $${dir} && pwd)` ] ; then \
--- 366,372 ----
        rm -f ${bindir}/xemacs
        (cd ${bindir} && ${LN_S} xemacs-${version} ./xemacs)

! install-arch-indep: mkdir ${MAKE_SUBDIR}
        -set ${COPYDESTS} ; \
         for dir in ${COPYDIR} ; do \
           if [ `(cd $$1 && pwd)` != `(cd $${dir} && pwd)` ] ; then \




--==_Exmh_-1486058476P
Content-Type: application/pgp-signature

-----BEGIN PGP MESSAGE-----
Version: 2.6.2

iQCVAwUBMvEZStQBOOoptg9JAQG5TQP/cLwlQMRpqaPPJub+cXNRTjAud3kr6mJJ
vnBgsE7MCpsThS53CBzKTossZ26kyaTx0rGwNF9P7BZvoNIxh4UQc6sw7DqDFr2z
v5FWboymZMrrRuiz+5UrX96PNFtIYN4CkGF4+syovUjV27pMvZMJhKrejpgiRkDo
9NKS+LG4ruM=
=ee98
-----END PGP MESSAGE-----

--==_Exmh_-1486058476P--

