Closed onimatrix81 closed 9 years ago
If you read the README, you'll notice that vdevfs depends on libpstat and fskit, but vdevd does not. So if you only need vdevd, you can just build it (and the default config).
vdevd does not depend on vdevfs.
Ah yeah, you are correct about that one. Although I think it's a bug in vdevfs then that pstat.h isn't where acl.h is trying to include it from.
pstat.h is supposed to be in /usr/include/pstat/libpstat.h or a similar location. It's a dependency. You install it before building vdevfs. It links into libpstat anyway, you need it and fskit in runtime too:
> ldd /usr/bin/vdevfs
libfskit.so.1 => /usr/lib/libfskit.so.1 (0x00007f8d0ff4d000)
libpstat.so.1 => /usr/lib/libpstat.so.1 (0x00007f8d0fd4c000)
I see the confusion.
The install
target for libpstat does not install headers by default. There's a separate headers-install
target for libpstat's headers, since the PREFIX
for them tends to be different. libpstat's libraries are installed to /lib by default (with PREFIX=/
), but its headers are usually installed to /usr/include (with PREFIX=/usr
).
I will update the libpstat README to clarify this.
Heh. Came here to comment on that as I've just hit that problem when building a newer version of the package :D
Is there a particular reason to make the headers a separate make target btw?
@fbt I'm not sure what the best way is to install the library and headers without having to include /usr
in the headers' installation path. I'm thinking of adding a HEADERS_PREFIX
variable to be used in place of PREFIX
that would let the user define where to install headers independently of the libraries as part of the install
target, but I'm not sure how well that would be received downstream (but I agree that headers-install
is confusing, and should be removed if possible).
INCLUDE_DIR works, no?
@fbt Sounds good. Pushed a fix.
One thing: PREFIX doesn't really work as it should. This is the result of setting DESTDIR to "${pkgdir}" (it's the 'home/fbt/git/pkg/libpstat-git' part) and PREFIX to /usr:
home/fbt/git/pkg/libpstat-git/pkg/libpstat-git/
home/fbt/git/pkg/libpstat-git/pkg/libpstat-git/usr/
home/fbt/git/pkg/libpstat-git/pkg/libpstat-git/usr/bin/
home/fbt/git/pkg/libpstat-git/pkg/libpstat-git/usr/lib/
home/fbt/git/pkg/libpstat-git/pkg/libpstat-git/usr/lib/libpstat.so.1
home/fbt/git/pkg/libpstat-git/pkg/libpstat-git/usr/lib/libpstat.so
home/fbt/git/pkg/libpstat-git/pkg/libpstat-git/usr/lib/libpstat.so.1.0.2
home/fbt/git/pkg/libpstat-git/pkg/libpstat-git/usr/bin/pstat
For some reason PREFIX then becomes 'pkg/libpstat-git/usr' and not just /usr. I can, of course, just use PREFIX in the build, it works then, but this is not how PREFIX usually behaves.
@fbt My goal is to be as least surprising as possible to downstream. My current understanding (which could be wrong) is that DESTDIR gets prepended to each installed target file (as per [1]), and PREFIX sets the root directory of the installation (as per [2]). For example, the formula for libpstat.so would be $(DESTDIR)/$(PREFIX)/lib/libpstat.so
.
I think you have more experience than me when it comes to packaging. Is this the right interpretation?
[1] https://www.gnu.org/prep/standards/html_node/DESTDIR.html [2] https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
Well yeah, that's the point. With DESTDIR=/some/path PREFIX=/usr, the result should be /some/path/usr, not /some/path/some/path/usr
Ah, I misunderstood what you were saying. My bad.
There was a bug in the Makefile. I just pushed a fix. Sorry about that!
Come to think of it, the same bug exists in fskit. Will fix that too.
(here was a stupid comment)
Wait, nevermind. There is INCLUDE_PREFIX. It could default to PREFIX though.
Agreed regarding INCLUDE_PREFIX; fixed.
@onimatrix81 Is it okay if I close this issue, or are you still having problems?
Go ahead =).
In file included from acl.c:22:0:
acl.h:26:28: fatal error: pstat/libpstat.h: No such file or directory
#include "pstat/libpstat.h"
^
compilation terminated.
This I fixed by making a vdev/pstat directory copying over the files from the pstat package, but shouldn't they be included in the vdev too so it'd compile per the instructions?