From: David Sterba <dsterba@suse.cz>
To: Naohiro Aota <naota@elisp.net>
Cc: David Sterba <dsterba@suse.cz>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: set include path relatively
Date: Fri, 13 Oct 2017 20:10:12 +0200 [thread overview]
Message-ID: <20171013181012.GF3521@twin.jikos.cz> (raw)
In-Reply-To: <CAEe67=-YoRnbBAQt=d49W0rBVDw+znTXB1Vu6rAcdNSVr+mCaQ@mail.gmail.com>
On Fri, Oct 13, 2017 at 04:01:31PM +0900, Naohiro Aota wrote:
> 2017-10-12 21:38 GMT+09:00 David Sterba <dsterba@suse.cz>:
> > On Thu, Oct 12, 2017 at 11:22:24AM +0900, Naohiro Aota wrote:
> >> Currently, gcc is passed the include directory with full path. As a result,
> >> dependency files (*.o.d) also record the full path at the build time. Such
> >> full path dependency is annoying for sharing the source between multiple
> >> machines, containers, or anything the path differ.
> >>
> >> And this is the same way what other program using autotools e.g. e2fsprogs
> >> is doing:
> >>
> >> $ grep top_builddir Makefile
> >> top_builddir = .
> >> CPPFLAGS = -I. -I$(top_builddir)/lib -I$(top_srcdir)/lib
> >> BUILD_CFLAGS = -g -O2 -I. -I$(top_builddir)/lib -I$(top_srcdir)/lib -DHAVE_CONFIG_H
> >> <snip>
> >
> > Makes sense for the header files. TOPDIR is also used for linking, can
> > it cause similar problems, where the library search path is set as -L$(TOPDIR) ?
>
> Since both "TOPDIR := $(shell pwd)" and -L$(TOPDIR) is evaluated at
> the build time,
> it never cause problem on linking itself. What the problem with
> dependency files is persisting
> the full path into the dep files. We generate the dep files only for
> objects (%.o.d rule)
>
> Well, it's ok to use "-L." here, and it's the same way with autotools does.
>
> > I wonder if we should do the same as in the example above and set
> > default value of TOPDIR to '.', instead of `pwd`.
>
> TOPDIR is also used by library-test{,.static}. They run gcc in a
> temporary directory.
> Thus, TOPDIR here should be absolute.
I've added another variable with absolute path to make library-test work
and updated your patch so we can use TOPDIR = .
prev parent reply other threads:[~2017-10-14 16:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-12 2:22 [PATCH] btrfs-progs: set include path relatively Naohiro Aota
2017-10-12 12:38 ` [PATCH] btrfs: " David Sterba
2017-10-13 7:01 ` Naohiro Aota
2017-10-13 18:10 ` David Sterba [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171013181012.GF3521@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=naota@elisp.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).