Subject: Re: How do I compile "THE" sources?
To: None <ram@cv.jinr.dubna.su>
From: Greg Earle <earle@isolar.Tujunga.CA.US>
List: current-users
Date: 09/19/1996 18:54:16
> I have compiled 14Sep -current on i386 and sparc platforms with domestic and
> DESTDIR set. I do this:
> 
> 	setenv DESTDIR <dir>
> 
> 	cd /usr/src
> 	make obj
> 	make beforeinstall
> 	make build
> 	make snapshot

I see several things amiss here.

For one, if you use $DESTDIR and don't want to overwrite anything that's 
already installed on the system directories, you should use the
"-m ${DESTDIR}/usr/share/mk" switch to "make" to use the mk files from within
the DESTDIR tree (after doing "cd /usr/src/share/mk ; make install" with
$DESTDIR already set first, to populate ${DESTDIR}/usr/share/mk).

Secondly, lots of the "make" steps need "make obj" steps.  I deal with this by
simply adding them to the default /usr/src/Makefile, calling the result
/usr/src/Makefile.build-current.  My diffs are as follows:

*** Makefile	Thu Apr 25 04:10:41 1996
--- Makefile.build-current	Wed May 22 14:00:55 1996
***************
*** 23 ****
! 	@(cd ${.CURDIR}/regress && ${MAKE} regress)
--- 23 ----
! 	@(cd ${.CURDIR}/regress && && ${MAKE} obj && ${MAKE} regress)
***************
*** 26 ****
--- 27 ----
+ .ifnmake build
***************
*** 31 ****
--- 33 ----
+ .endif
***************
*** 35 ****
! 	(cd ${.CURDIR}/share/man && ${MAKE} makedb)
--- 37 ----
! 	(cd ${.CURDIR}/share/man && ${MAKE} obj && ${MAKE} makedb)
***************
*** 39 ****
! 	(cd ${.CURDIR}/share/mk && ${MAKE} install)
--- 41,46 ----
! .ifndef DESTDIR
! 	(cd ${.CURDIR}/etc && ${MAKE} obj && ${MAKE} DESTDIR=/ distrib-dirs)
! .else
! 	(cd ${.CURDIR}/etc && ${MAKE} obj && ${MAKE} distrib-dirs)
! .endif
! 	(cd ${.CURDIR}/share/mk && ${MAKE} obj && ${MAKE} install)
***************
*** 42,43 ****
! 	(cd ${.CURDIR}/lib && ${MAKE} depend && ${MAKE} && ${MAKE} install)
! 	(cd ${.CURDIR}/gnu/lib && ${MAKE} depend && ${MAKE} && ${MAKE} install)
--- 49,50 ----
! 	(cd ${.CURDIR}/lib && ${MAKE} obj && ${MAKE} depend && ${MAKE} && ${MAKE} 
install)
! 	(cd ${.CURDIR}/gnu/lib && ${MAKE} obj && ${MAKE} depend && ${MAKE} && 
${MAKE} install)
***************
*** 46 ****
! 	(cd ${.CURDIR}/domestic/lib/libcrypt && ${MAKE} depend && ${MAKE} && \
--- 53 ----
! 	(cd ${.CURDIR}/domestic/lib/libcrypt && ${MAKE} obj && ${MAKE} depend && 
${MAKE} && \
***************
*** 49 ****
! 	${MAKE} depend && ${MAKE} && ${MAKE} install
--- 56 ----
! 	${MAKE} depend && ${MAKE} obj && ${MAKE} && ${MAKE} install

> Before compilation you must copy /usr/lib/crt0.o into <dir>/usr/lib
> (this is required to compile domestic).

Personally, I have never had to do this.  And I have built -current on both
the i386 and SPARC platforms in the past 2 weeks.  In my ${DESTDIR}/usr/lib
directories, I find that crt0.o is dated the oldest of anything in there
anyway ... (and dated well before the domestic libraries that are built there)

But meanwhile, let's ask the interesting question: How can someone in Russia
build the U.S. export-restricted "domestic" tree, hmmn?

> You must also change the line:
> 
> 	(cd ${.CURDIR}/domestic/lib/libcrypt && ${MAKE} depend && ${MAKE} && \
> to
> 	(cd ${.CURDIR}/domestic/lib && ${MAKE} depend && ${MAKE} && \
> 
> in the Makefile (I ftp it from /pub/NetBSD-current/src)

This isn't really necessary; the remaining directories in /usr/src/domestic/lib
get built by the general "${MAKE} depend && ${MAKE} && ${MAKE} install" line
that immediately follows it.  At least, they did on my two -current systems.

	- Greg