Page 1 of 1

libzfs.dylib as XCode Build Target

PostPosted: Wed Feb 04, 2015 4:37 am
by mike0810
Hi,

I try to add the master branch of zfs as build dependency, I particularly need the libzfs.dylib and libzfs_core.dylib, but can not find the build target for those libraries. They exist in the DMG Packages however.

Can someone give me a quick hint?

Thanks,

Michael

Re: libzfs.dylib as XCode Build Target

PostPosted: Wed Feb 04, 2015 2:10 pm
by lundman
As we build with autoconf in cmdline, to fit with upstream, we do not have an XCode target. You will have to make one for libzfs yourself, or possibly ask XCode to call out to autoconf (I believe it can), or, simply linked against the dylib binary that you install from dmg.

Re: libzfs.dylib as XCode Build Target

PostPosted: Fri Feb 06, 2015 1:24 am
by mike0810
For now to link to the dylib from installer would be good, but there is also the header missing in /usr/include

Re: libzfs.dylib as XCode Build Target

PostPosted: Fri Feb 06, 2015 1:26 am
by ilovezfs
If you build from source and do sudo make install, it'll install the headers. I've not included the headers in the installer version. Is that something people want?

https://openzfsonosx.org/wiki/Install#I ... rom_source

Re: libzfs.dylib as XCode Build Target

PostPosted: Fri Feb 06, 2015 1:36 am
by mike0810
I´d like to seem them. But best way would be to create an xcode target for the dylibs and headers on the stable branch, especially for tools developers so to create a target dependency on the newest dylib including the headers.

Re: libzfs.dylib as XCode Build Target

PostPosted: Fri Feb 06, 2015 2:05 am
by ilovezfs
Since libzfs is not a stable interface, you may want to just exec the commands.

Re: libzfs.dylib as XCode Build Target

PostPosted: Sat Feb 07, 2015 12:07 am
by mike0810
You reccomend to use a cli wrapper in my cocoa gui app?

Re: libzfs.dylib as XCode Build Target

PostPosted: Sat Feb 07, 2015 12:16 am
by ilovezfs
That would be least likely to break, unless you were to limit yourself to libzfs_core.

Here's an example of what's entailed when linking to libzfs:
https://github.com/openzfsonosx/zfs/blo ... zfs_util.c

If you take a look at https://github.com/openzfsonosx/zfs/blo ... til.c#L202 and compare to https://github.com/openzfsonosx/zfs/blo ... in.c#L2077 you'll see how much of the mechanics of using libzfs is actually in the commands' code, which you will have to basically duplicate in order to make use of libzfs.

Re: libzfs.dylib as XCode Build Target

PostPosted: Wed Apr 15, 2015 6:14 am
by ilovezfs
@mike0810 An update regarding the status of a stable API: https://github.com/zfsonlinux/zfs/pull/3299