Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 8 Nov 2015 03:16:30 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: Support for out-of-tree build

* Rich Felker <dalias@...c.org> [2015-11-07 19:43:23 -0500]:
> On Sat, Nov 07, 2015 at 02:05:37PM +0100, Szabolcs Nagy wrote:
> > * Petr Hosek <phosek@...omium.org> [2015-11-06 23:40:48 +0000]:
> > > +ifneq ($(srcdir),.)
> > > +VPATH = $(srcdir)
> > > +$(ALL_TOOLS): tools/.dirstamp
> > > +$(ALL_LIBS): lib/.dirstamp
> > > +$(CRT_LIBS:lib/%=crt/%): crt/.dirstamp
> > > +$(OBJS) $(LOBJS): $(patsubst %/,%/.dirstamp,$(sort $(dir $(OBJS))))
> > > +$(GENH): arch/$(ARCH)/bits/.dirstamp
> > > +include/bits: include/.dirstamp
> > > +src/internal/version.h: src/internal/.dirstamp
> > > +%/.dirstamp:
> > > +	mkdir -p $*
> > > +	touch $@
> > > +endif
> > > +
> > 
> > i guess this works without the ifneq, just
> > litters the source dir with .dirstamps in
> > case of an in-tree build.
> 
> What is the motive for having these .dirstamps at all?
> 

have to create the directories out-of-tree

but directories cannot be properr make dependencies
because make works with file mtime

..and directory mtime changes whenever something
happens in the directory, triggering a rebuild
all the time

> > > +Configuration:
> > > +  --srcdir=DIR            source directory [detected]
> > > +
> 
> Does this match standard configure behavior?
> 

i think so, official configure help is:

http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob;f=lib/autoconf/general.m4;h=a7f143960de44182a0139f9ab302fd652aaebc32;hb=HEAD#l1033

> > > +# Get the musl source dir for out-of-tree builds
> > > +#
> > > +if test -z "$srcdir" ; then
> > > +srcdir="${0%/configure}"
> > > +stripdir srcdir
> > > +fi
> > > +abs_builddir="$(pwd)" || fail "$0: cannot determine working directory"
> > > +abs_srcdir="$(cd $srcdir && pwd)" || fail "$0: invalid source directory $srcdir"
> > > +test "$abs_srcdir" = "$abs_builddir" && srcdir=.
> > > +ln -sf $srcdir/Makefile .
> 
> Is it possible to get a relative path for the srcdir rather than an
> absolute one here? I really don't like configurations that are not
> relocatable in the filesystem.

srcdir is whatever the user used for configure,
the abs path is only used to make sure we are
out-of-tree.

so building with ../musl/configure the srcdir is
../musl, i guess it ends up in the debug info,
to avoid that more complex setup is necessary
i think

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.