This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: configure with relative srcdir causing absolute pathname ingcc/Makefile
Hans-Peter Nilsson writes:
> On Thu, 30 May 2002, Doug Evans wrote:
> > When you configure with a relative srcdir, as in
> >
> > mkdir obj
> > cd obj
> > ../src/configure blah
> >
> > this is supposed to avoid absolute pathnames appearing in Makefiles.
> > This makes it easy to move the tree around.
> > [at least things used to work that way, dunno if this is a documented rule]
>
> Probably just a coincidence that it worked that way. I don't
> think a relative srcdir *should* differ from an absolute one.
> If you really think it should be that way, it needs to be
> written down *somewhere*.
Note that src/config-ml.in distinguishes 3 different cases of srcdir:
absolute, relative-not-dot, dot.
>From src/config-ml.in:
# Things are complicated because 6 separate cases must be handled:
# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6.
Also note that src/configure goes to the effort of preserving
the relativeness of srcdir.
>From src/configure:
### figure out what to do with srcdir
case "${srcdir}" in
".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place.
/* | [A-Za-z]:[\\/]* ) # absolute path
newsrcdir=${srcdir}/${cfg_dir}
srcdiroption="--srcdir=${newsrcdir}"
;;
*) # otherwise relative
newsrcdir=../${srcdir}/${cfg_dir}
srcdiroption="--srcdir=${newsrcdir}"
;;
esac