[Unison-hackers] Help building OSX GUI

Benjamin Pierce bcpierce at cis.upenn.edu
Tue May 5 09:26:49 EDT 2009


I'm not an expert on compiling on OSX, so I'll leave it to you and  
Alan to sort out what's the best way to fix the makefiles.  I'll be  
glad to apply whatever patch you both agree on.

     - B



On May 5, 2009, at 9:14 AM, Martin von Gagern wrote:

> 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
> === modified file 'src/Makefile.OCaml'
> --- src/Makefile.OCaml	2009-05-05 08:28:15 +0000
> +++ src/Makefile.OCaml	2009-05-05 12:54:21 +0000
> @@ -157,6 +157,10 @@
> endif
>
> MINOSXVERSION=10.5
> +XCODEFLAGS=-sdk macosx$(MINOSXVERSION)
> +ifeq ($(OSARCH),osx)
> +  CAMLFLAGS+=-ccopt -mmacosx-version-min=$(MINOSXVERSION)
> +endif
>
> # NOTE: the OCAMLLIBDIR is not getting passed correctly?
> # The two cases for cltool are needed because Xcode 2.1+
> @@ -164,7 +168,7 @@
> .PHONY: macexecutable
> macexecutable: $(NAME)-blob.o
> #	sed -e's/@@VERSION@@/$(VERSION)/' $(UIMACDIR)/Info.plist.template  
> > $(UIMACDIR)/Info.plist
> -	(cd $(UIMACDIR); xcodebuild OCAMLLIBDIR="$(OCAMLLIBDIR)"  
> SYMROOT=build)
> +	(cd $(UIMACDIR); xcodebuild $(XCODEFLAGS) OCAMLLIBDIR="$ 
> (OCAMLLIBDIR)" SYMROOT=build)
> 	if [ -e $(UIMACDIR)/build/Default ]; then \
> 	  gcc -mmacosx-version-min=$(MINOSXVERSION) $(UIMACDIR)/cltool.c -o  
> $(UIMACDIR)/build/Default/Unison.app/Contents/MacOS/cltool - 
> framework Carbon; \
> 	else \
>
> _______________________________________________
> Unison-hackers mailing list
> Unison-hackers at lists.seas.upenn.edu
> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers



More information about the Unison-hackers mailing list