Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 1995 18:25:52 -0800
From:      John Polstra <jdp@polstra.com>
To:        Gary.Jennejohn@munich.netsurf.de
Cc:        freebsd-current@freebsd.org
Subject:   Re: Where's the earth-shattering KABOOM?
Message-ID:  <199512290225.SAA23099@austin.polstra.com>

next in thread | raw e-mail | index | archive | help
Gary Jennejohn writes:
> Bill Paul writes:
> >This is a side effect of the new rpcgen: you need to rebuild
> >/usr/include/rpcsvc before rebuilding librpcsvc.{a.so}. And you
> >need to have the new rpcgen installed first, of course. :) This should
> >work correctly now that rpcgen has been added to the tools target in
> >the top level Makefile.
> >
> 
> I haven't tried it out, but I'll bet that this will fail miserably
> if you do "DESTDIR=/foo/bar make world", since the new rpcgen will
> not be used.

That is correct, as I painfully found out today.

It's the first day I've ever tried to do a "make world" from the
-current sources, and I've run into several problems.  I'm using
DESTDIR, because I don't want to wipe out my existing (working) system,
of course.  I'll report more details, once I get through it all.

> This also applies to things like as/cc/ld. There are already several
> places in the source which don't use the new includes in this
> situation. Seems like we need to somehow munge PATH in the case
> where DESTDIR is defined. Oh yeah, and also do an ldconfig.

And, don't forget that you have to make "cc" find its helper programs
(such as "cc1") in the right places.  And, "ld" has to look in the right
places for its libraries, and for crt0.o, etc.  And on and on.  There are
lots of problems.

I don't think an ldconfig will be necessary, as long as LD_LIBRARY_PATH
is set properly.

Here is a shell script I am working on that solves almost all of the
problems that I've encountered so far today.  (I also had to edit the
top-level Makefile.  It does something that requires c++rt0.o, before
that file has been built or installed.)  (Diffs at 11!)  I'm optimistic
that this approach will work, eventually.

-------------------------------------------------------------------------------
#! /bin/sh

topdir=/home/jdp/current
srcdir=${topdir}/src
dstdir=${topdir}/dst
makeargs="DESTDIR=${dstdir} SHARED=copies world"

# setpath ENV_VAR /dir1 /dir2 /dir3 ...
#
# This sets a PATH-style environment variable such that the appropriate
# directories under ${dstdir} are searched before the corresponding
# system directories.  For example,
#
# setpath COMPILER_PATH /usr/libexec /usr/bin
#
# has the same effect as:
#
# COMPILER_PATH=${dstdir}/usr/libexec:/usr/libexec:${dstdir}/usr/bin:/usr/bin
# export COMPILER_PATH

setpath() {
    local env_var
    local newpath
    local pathdir
    local basedir

    env_var=$1;  shift

    newpath=
    for pathdir; do
	for basedir in ${dstdir} ""; do
	    if [ -n "${newpath}" ]; then
		newpath="${newpath}:"
	    fi
	    newpath="${newpath}${basedir}${pathdir}"
	done
    done

    echo "Using: ${env_var}=${newpath}"
    eval ${env_var}=${newpath}
    export ${env_var}
}

date
echo "Building from ${srcdir}"
echo "Using: make ${makeargs}"

setpath COMPILER_PATH		/usr/libexec /usr/bin
setpath LIBRARY_PATH		/usr/lib
setpath LD_LIBRARY_PATH		/usr/lib
setpath C_INCLUDE_PATH		/usr/include
setpath CPLUS_INCLUDE_PATH	/usr/include/g++ /usr/include
setpath PATH			/sbin /usr/sbin /bin /usr/bin

test -d ${dstdir} || mkdir -p ${dstdir}

cd ${srcdir}
exec make ${makeargs}
-------------------------------------------------------------------------------

--
   John Polstra                                       jdp@polstra.com
   John D. Polstra & Co., Inc.                Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512290225.SAA23099>