libzfs.dylib as XCode Build Target

Developer discussions.

libzfs.dylib as XCode Build Target

Postby mike0810 » Wed Feb 04, 2015 4:37 am

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
mike0810
 
Posts: 55
Joined: Fri Jan 16, 2015 5:17 pm

Re: libzfs.dylib as XCode Build Target

Postby lundman » Wed Feb 04, 2015 2:10 pm

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.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: libzfs.dylib as XCode Build Target

Postby mike0810 » Fri Feb 06, 2015 1:24 am

For now to link to the dylib from installer would be good, but there is also the header missing in /usr/include
mike0810
 
Posts: 55
Joined: Fri Jan 16, 2015 5:17 pm

Re: libzfs.dylib as XCode Build Target

Postby ilovezfs » Fri Feb 06, 2015 1:26 am

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
ilovezfs
 
Posts: 232
Joined: Thu Mar 06, 2014 7:58 am

Re: libzfs.dylib as XCode Build Target

Postby mike0810 » Fri Feb 06, 2015 1:36 am

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.
mike0810
 
Posts: 55
Joined: Fri Jan 16, 2015 5:17 pm

Re: libzfs.dylib as XCode Build Target

Postby ilovezfs » Fri Feb 06, 2015 2:05 am

Since libzfs is not a stable interface, you may want to just exec the commands.
ilovezfs
 
Posts: 232
Joined: Thu Mar 06, 2014 7:58 am

Re: libzfs.dylib as XCode Build Target

Postby mike0810 » Sat Feb 07, 2015 12:07 am

You reccomend to use a cli wrapper in my cocoa gui app?
mike0810
 
Posts: 55
Joined: Fri Jan 16, 2015 5:17 pm

Re: libzfs.dylib as XCode Build Target

Postby ilovezfs » Sat Feb 07, 2015 12:16 am

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.
ilovezfs
 
Posts: 232
Joined: Thu Mar 06, 2014 7:58 am

Re: libzfs.dylib as XCode Build Target

Postby ilovezfs » Wed Apr 15, 2015 6:14 am

@mike0810 An update regarding the status of a stable API: https://github.com/zfsonlinux/zfs/pull/3299
ilovezfs
 
Posts: 232
Joined: Thu Mar 06, 2014 7:58 am


Return to OpenZFS on OS X Development

Who is online

Users browsing this forum: No registered users and 7 guests