• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: proper library versioning?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proper library versioning?


  • Subject: Re: proper library versioning?
  • From: Hauke Klein <email@hidden>
  • Date: Fri, 11 Apr 2008 11:07:09 +0200


On 10.04.2008, at 22:04, Shawn Protsman wrote:
I'm porting some libraries to OS X and am a little confused about library versioning. In linux, I'd simply do something like this:

$(CC) -shared -Wl,-O1 -Wl,-soname,$(PROG).so.$(VERSIONMAJOR)

The end result would be 'libprog.so.1.3.5'.

When using the command for the link, you can use a command like

$(CC) -dynamiclib -o $(PROG).$(MAJOR).$(MINOR).dylib
-compatibility_version $(MAJOR) -current_version $ (MAJOR).$(MINOR)
-install_name /usr/local/lib/$(PROG).$(MAJOR).$ (MINOR).dylib ...


for example. The versioning information is specified with the two - *_version options,
encoding it in the file name seems to be common but is not strictly necessary. The
ld manual page explains how these values are interpreted. The command above is
just an example, the arguments to the two version options do not need to be used
in the file name of the shared library.


I've moved my source into Xcode but have no idea where to get the dylib versioning setup, or if it is equivalent in the OS X world. When I look at /usr/local/lib MacFUSE libs I see this:

<snip>
lrwxr-xr-x 1 root wheel 15B Mar 13 21:06 libfuse.0.0.0.dylib@ - > libfuse.0.dylib
-rwxr-xr-x 1 root wheel 307K Jan 8 18:04 libfuse.0.dylib*


0.0.0? If anyone can point me to a doc that describes this and where to set "versioning" for my lib in Xcode I'd appreciate it. Or, if you just want to clue me that would be great too ;-).

To create a shared library, you should use the target type 'Dynamic Library' when creating
the target. Then select the target and click on the info button. This should show you an
inspector window for the target. In this window, select the tab labeled 'Build'. This will show
you a long list of build settings. Current and compatibility version are in the section 'Linking'
in this list (or just start to type version in the search field.) Of course, it is probably a good
idea to read the section about build settings in the Xcode documentation.


Hauke Klein
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >proper library versioning? (From: Shawn Protsman <email@hidden>)

  • Prev by Date: Custom code colouring
  • Next by Date: Re: SCM Preferences and Experiences
  • Previous by thread: proper library versioning?
  • Next by thread: IB 3 Doesn't Update Binsings on Key Change
  • Index(es):
    • Date
    • Thread