[Unison-hackers] Help building OSX GUI

Martin von Gagern Martin.vGagern at gmx.net
Tue May 5 09:14:15 EDT 2009


Hi!

I'm on using ocaml as built with fink, and rebuilding ocaml just to
allow developing unison doesn't sound too attractive. Without
modifications, I get this error:

Undefined symbols:
  "_chmod$UNIX2003", referenced from:
      _setFileInfos in unison-blob.o
      _setFileInfos in unison-blob.o

The reference to that symbol is present in osxsupport.o as well, so it's
the C compiler invoked by ocamlopt that's introducing this reference.
The symbol is part of the OS X 10.5 SDK, but not the 10.4 SDK.

Alan Schmitt wrote:
> Right now, everything is set to compile for both 10.4 and 10.5, but
> requires a specially built ocaml (which is simply a line to add in a
> configuration file in godi). The reason for this is that I don't have
> access to Tiger machines anymore and I want to provide a single binary
> for our users.

You shouldn't have to rebuild ocaml just to get a certain command line
argument passed on to the C compiler. The -ccopt flag does that. It
might be that code compiled from ocaml source files does introduce
additional dependencies if you don't rebuild ocaml, but as this hasn't
been a problem for me, I'll not worry about it here.

> We could try to do some tweaking to allow different compilation options,
> but I would first need to find out how to change the target SDK from the
> command line (right now I only know how to do it in XCode).

On my system there is a -sdk command line flag to xcodebuild. Specifying
a value like macos10.5 for it will select the corresponding SDK, falling
back to the project configured SDK if the selected one isn't available.

The attached patch takes care of both these approaches: specifying the
SDK to xcodebuild and passing -mmacosx-version-min to the C compiler.
Both are controlled using the single MINOSXVERSION variable in the
makefile. So in theory "make MINOSXVERSION=10.4" should give you a
binary ready to run anywhere, while "make MINOSXVERSION=10.5" will give
you a version making use of all the latest features, or whatever.

Both of these builds compile for me, while the unmodified build failed
with the unresolved reference quoted in the beginning. I would like to
see the patch included.

Greetings,
 Martin von Gagern
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: macbuild-264.patch
Url: http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20090505/3646fc1b/macbuild-264.txt


More information about the Unison-hackers mailing list