[Unison-hackers] Re: Bug in / patch for Unison 2.12.0's Makefile.OCaml

Benjamin Pierce bcpierce at cis.upenn.edu
Mon Jun 20 23:46:14 EDT 2005


Thanks for the suggestion, Nick.  I've made this change in the source.  
(If someone can try it out on Windows, that would be great.)

     - B

On Jun 16, 2005, at 12:52 PM, Nick Montfort wrote:

>
> Benjamin,
>
> In Makefile.OCaml there's a note:
>
> # NOTE: the OCAMLLIBDIR is not getting passed correctly?
>
> Indeed, it isn't, not for me on OS X 10.4, at least. It seems it isn't
> getting set correctly in the first place. Here's the problem:
>
> # The OCaml lib dir is used by all versions
> # It is extracted from 'ocamlc -v' and Windows '\' separators are 
> turned
> # to Unix '/' separators, and extraneous control-M's are deleted.
> # Unfortunately there is a literal control-M buried in this, I'd rather
> # get rid of it...
> OCAMLLIBDIR=$(shell ocamlc -v | tail -1 | sed -e 's/.* //g' | sed -e 
> 's/\\/\//g' | sed -e 's/
> //g')
>
> There are three problems here that I can see:
>
>  "tail -1" is obsolete on OS X 10.4, doesn't work, and should be "tail 
> -n
>  1", but "tail -1" is the only thing that works on Solaris. "sed -n 
> '$p'"
>  will do the right thing on all systems without your having to set up 
> two
>  different versions of the arguments for "tail".
>
>  "sed -e 's/.* //g'" seems like it will obliterate part of the library
>  path in the (perverse, but possible) case in which there is a space 
> in the
>  pathname.
>
>  The literal control-M can be represented by "\r".
>
> This seems to work for me on Ubuntu 5.04 and Solaris as well as OS X 
> 10.4:
>
> OCAMLLIBDIR=$(shell ocamlc -v | sed -n '$p' | sed -e 's/^Standard 
> library directory: //' | sed -e 's/\\/\//g' | sed -e 's/\r//g')
>
> I haven't tested it on Windows.
>
> The OS X GUI wouldn't compile before making that change; afterwards, I 
> was
> able to build it.
>
> -Nick Montfort  <mail> nickm at nickm.com  <web> http://nickm.com



More information about the Unison-hackers mailing list