Subject: Re: xsrc make
To: Ignatios Souvatzis <is@jocelyn.rhein.de>
From: John Darrow <John.P.Darrow@wheaton.edu>
List: tech-toolchain
Date: 04/06/1999 21:01:37
> On Mon, Apr 05, 1999 at 09:32:06PM -0500, John Darrow wrote:
> > In article <19990405210313.D28342@jocelyn.rhein.de> you write:
> > >Hi,
> > >
> > >does make install in xsrc obey the NetBSD "DESTDIR" semantics?
> > >
> > >	-is
> > 
> > I don't believe it does.  This was one of the many things I addressed in
> > pr misc/7089, which has been sitting open for about a month now.
> 
> Yeah. You mixed in secr stuff, which makes it potentially untouchable for
> anybody but US residents in the US of A (and maybe Canadians).
> 
> [I know, not itself... but I am not allowed to extract a source tree where 
> the diff would cleanly apply, as far as I can guess.]
> 
> However, I'll try to extract your xsrc DESTDIR part and convince releng to
> accept it.
> 
> 	-is

I took another look at the diffs, and the xsrc DESTDIR stuff is pretty
separable from all the other stuff.  Basically it involves adding
"DESTDIR=${DESTDIR}" to the install-related targets in xsrc/Makefile
and xsrc/xc/Makefile.  However, as part of the bigger build changes,
I added distribution and distrib-dirs tags to xsrc/Makefile.  At the
moment, they're pretty simple, but if (for example) we wanted to move
things like xdm configuration into /etc, they could become more complicated.

Note that this only makes the installs use DESTDIR - I don't know enough
about imake to get it to use DESTDIR for the builds (e.g. adding the
-nostdinc -idirafter and -nostdlib -L${DESTDIR}/usr/lib stuff) which
would be part of the process of making X cross-compilable.

Another thing I encountered while working on this is an issue with
regard to when dependency lines are evaluated.  Note that the imake.proto
target in xsrc/xc/Makefile does a ${RM} ${DEPENDSRC}/Makefile.proto,
intended to then force the ${DEPENDSRC}/Makefile.proto target (which
follows it in the Makefile.boot dependency line) always run.  However,
if that file already exists (such as from a previous build on the same
xsrc), make skips the Makefile.proto target, thus causing the
depend.bootstrap target to fail due to Makefile.proto not existing.

I added a "rm -f xc/config/makedepend/Makefile.proto" command to
xsrc/Makefile to take care of this for a 'make build' or 'make all'
in xsrc.  It might be a better idea, though, to move the ${RM} from
the imake.proto target to the World target in xsrc/xc/Makefile, putting
it just before it runs the Makefile.boot target.

Anyway, a diff follows at the end of this message...

jdarrow

--
John Darrow
Computing Services, Wheaton College, Wheaton, IL
John.P.Darrow@wheaton.edu


Index: Makefile
===================================================================
RCS file: /source/cvs/netbsd/current/xsrc/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.10
diff -c -r1.1.1.1 -r1.10
*** Makefile	1999/01/17 15:28:17	1.1.1.1
--- Makefile	1999/03/24 19:26:20	1.10
***************
*** 3,8 ****
--- 3,9 ----
  # build and install xsrc
  
  all:
+ 	rm -f xc/config/makedepend/Makefile.proto
  	cd xc ; ${MAKE} World
  	${MAKE} all-contrib
  
***************
*** 17,26 ****
  install: install-xc install-contrib
  
  install-xc:
! 	cd xc; ${MAKE} install && ${MAKE} install.man
  
  install-contrib:
! 	cd contrib; ${MAKE} install && ${MAKE} install.man
  
  clean:
  	cd xc; ${MAKE} clean
--- 18,41 ----
  install: install-xc install-contrib
  
  install-xc:
! 	cd xc; ${MAKE} DESTDIR=${DESTDIR} install && \
! 	    ${MAKE} DESTDIR=${DESTDIR} install.man
  
  install-contrib:
! 	cd contrib; ${MAKE} DESTDIR=${DESTDIR} install && \
! 	    ${MAKE} DESTDIR=${DESTDIR} install.man
! 
! .ifndef DESTDIR
! distribution distrib-dirs:
! 	@echo setenv DESTDIR before doing that!
! 	@false
! .else
! distribution: distrib-dirs install
! 
! distrib-dirs:
! 	/usr/bin/install -d -o root -g wheel -m 755 ${DESTDIR}/
! 
! .endif	# DESTDIR check
  
  clean:
  	cd xc; ${MAKE} clean
Index: xc/Makefile
===================================================================
RCS file: /source/cvs/netbsd/current/xsrc/xc/Makefile,v
retrieving revision 1.1.1.2
retrieving revision 1.5
diff -c -r1.1.1.2 -r1.5
*** Makefile	1999/01/19 02:56:29	1.1.1.2
--- Makefile	1999/03/24 18:44:35	1.5
***************
*** 176,188 ****
  includes:
  	    $(MAKE_CMD) $@
  install.linkkit:
! 	    $(MAKE_CMD) $@
  install.ln:
! 	    $(MAKE_CMD) $@
  install.man:
! 	    $(MAKE_CMD) $@
  install:
! 	    $(MAKE_CMD) $@
  Makefiles:
  	    $(MAKE_CMD) $@
  man_keywords:
--- 176,188 ----
  includes:
  	    $(MAKE_CMD) $@
  install.linkkit:
! 	    $(MAKE_CMD) DESTDIR=$(DESTDIR) $@
  install.ln:
! 	    $(MAKE_CMD) DESTDIR=$(DESTDIR) $@
  install.man:
! 	    $(MAKE_CMD) DESTDIR=$(DESTDIR) $@
  install:
! 	    $(MAKE_CMD) DESTDIR=$(DESTDIR) $@
  Makefiles:
  	    $(MAKE_CMD) $@
  man_keywords: