xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] OCaml tools: ask compiler for correct library path
@ 2011-06-07 17:28 Mike McClurg
  2011-06-07 20:21 ` Tim Deegan
  2011-06-21 17:03 ` Ian Jackson
  0 siblings, 2 replies; 8+ messages in thread
From: Mike McClurg @ 2011-06-07 17:28 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com; +Cc: Jonathan Ludlam

From: Mike McClurg <mike.mcclurg@citrix.com>

OCaml libraries will live in /usr/local/ if the user compiles OCaml from source. This patch asks the OCaml compiler where we should look for libraries.

NB: it may be that we should do the same thing for the NetBSD case, but I don't have a BSD box to test this out.

Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>


diff -r 37c77bacb52a -r ebc32e1f7f6f tools/ocaml/common.make
--- a/tools/ocaml/common.make   Mon May 23 17:38:28 2011 +0100
+++ b/tools/ocaml/common.make   Tue Jun 07 18:01:10 2011 +0100
@@ -9,7 +9,7 @@
  OCAMLYACC ?= ocamlyacc
  
  CFLAGS += -fPIC -Werror
-CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml
+CFLAGS-$(CONFIG_Linux) += -I$(shell ocamlc -where)
  CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
  
  OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OCaml tools: ask compiler for correct library path
  2011-06-07 17:28 [PATCH] OCaml tools: ask compiler for correct library path Mike McClurg
@ 2011-06-07 20:21 ` Tim Deegan
  2011-06-08 10:53   ` Mike McClurg
  2011-06-08 13:45   ` Vincent Hanquez
  2011-06-21 17:03 ` Ian Jackson
  1 sibling, 2 replies; 8+ messages in thread
From: Tim Deegan @ 2011-06-07 20:21 UTC (permalink / raw)
  To: Mike McClurg; +Cc: xen-devel@lists.xensource.com, Jonathan, Ludlam

Hi, 

At 18:28 +0100 on 07 Jun (1307471313), Mike McClurg wrote:
> From: Mike McClurg <mike.mcclurg@citrix.com>
> 
> OCaml libraries will live in /usr/local/ if the user compiles OCaml
> from source. This patch asks the OCaml compiler where we should look
> for libraries.

This patch edits the #include path, not the library path.  Are there
any ocaml support libraries that would require -L options to $(CC)?

Tim.

> NB: it may be that we should do the same thing for the NetBSD case,
> but I don't have a BSD box to test this out.
> 
> Signed-off-by: Mike McClurg <mike.mcclurg@citrix.com>
> 
> 
> diff -r 37c77bacb52a -r ebc32e1f7f6f tools/ocaml/common.make
> --- a/tools/ocaml/common.make   Mon May 23 17:38:28 2011 +0100
> +++ b/tools/ocaml/common.make   Tue Jun 07 18:01:10 2011 +0100
> @@ -9,7 +9,7 @@
>  OCAMLYACC ?= ocamlyacc
>  CFLAGS += -fPIC -Werror
> -CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml
> +CFLAGS-$(CONFIG_Linux) += -I$(shell ocamlc -where)
>  CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
>  OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OCaml tools: ask compiler for correct library path
  2011-06-07 20:21 ` Tim Deegan
@ 2011-06-08 10:53   ` Mike McClurg
  2011-06-08 13:45     ` Tim Deegan
  2011-06-08 13:45   ` Vincent Hanquez
  1 sibling, 1 reply; 8+ messages in thread
From: Mike McClurg @ 2011-06-08 10:53 UTC (permalink / raw)
  To: Tim Deegan; +Cc: xen-devel@lists.xensource.com, Jonathan, Ludlam

On 07/06/11 21:21, Tim Deegan wrote:
> Hi,
>
> At 18:28 +0100 on 07 Jun (1307471313), Mike McClurg wrote:
>> From: Mike McClurg<mike.mcclurg@citrix.com>
>>
>> OCaml libraries will live in /usr/local/ if the user compiles OCaml
>> from source. This patch asks the OCaml compiler where we should look
>> for libraries.
> This patch edits the #include path, not the library path.  Are there
> any ocaml support libraries that would require -L options to $(CC)?
>
> Tim.
Thank you for correcting me, I misspoke about the include path. No, 
there is no requirement to pass -L options on to $(CC). The -I option 
will be sufficient, and this patch removes hard coded file paths from 
the makefile.

Mike

>> NB: it may be that we should do the same thing for the NetBSD case,
>> but I don't have a BSD box to test this out.
>>
>> Signed-off-by: Mike McClurg<mike.mcclurg@citrix.com>
>>
>>
>> diff -r 37c77bacb52a -r ebc32e1f7f6f tools/ocaml/common.make
>> --- a/tools/ocaml/common.make   Mon May 23 17:38:28 2011 +0100
>> +++ b/tools/ocaml/common.make   Tue Jun 07 18:01:10 2011 +0100
>> @@ -9,7 +9,7 @@
>>   OCAMLYACC ?= ocamlyacc
>>   CFLAGS += -fPIC -Werror
>> -CFLAGS-$(CONFIG_Linux) += -I/usr/lib64/ocaml -I/usr/lib/ocaml
>> +CFLAGS-$(CONFIG_Linux) += -I$(shell ocamlc -where)
>>   CFLAGS-$(CONFIG_NetBSD) += -I/usr/pkg/lib/ocaml -fPIC
>>   OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OCaml tools: ask compiler for correct library path
  2011-06-07 20:21 ` Tim Deegan
  2011-06-08 10:53   ` Mike McClurg
@ 2011-06-08 13:45   ` Vincent Hanquez
  2011-06-08 13:46     ` Tim Deegan
  1 sibling, 1 reply; 8+ messages in thread
From: Vincent Hanquez @ 2011-06-08 13:45 UTC (permalink / raw)
  To: xen-devel; +Cc: Tim Deegan

On 06/07/2011 09:21 PM, Tim Deegan wrote:
> Hi,
>
> At 18:28 +0100 on 07 Jun (1307471313), Mike McClurg wrote:
>> From: Mike McClurg<mike.mcclurg@citrix.com>
>>
>> OCaml libraries will live in /usr/local/ if the user compiles OCaml
>> from source. This patch asks the OCaml compiler where we should look
>> for libraries.
> This patch edits the #include path, not the library path.  Are there
> any ocaml support libraries that would require -L options to $(CC)?
OCaml doesn't make the same distinction that C does.
as such -I is the search path for OCaml libraries.

-- 
Vincent

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OCaml tools: ask compiler for correct library path
  2011-06-08 10:53   ` Mike McClurg
@ 2011-06-08 13:45     ` Tim Deegan
  0 siblings, 0 replies; 8+ messages in thread
From: Tim Deegan @ 2011-06-08 13:45 UTC (permalink / raw)
  To: Mike McClurg; +Cc: xen-devel@lists.xensource.com, Jonathan, Ludlam

At 11:53 +0100 on 08 Jun (1307534032), Mike McClurg wrote:
> On 07/06/11 21:21, Tim Deegan wrote:
> >Hi,
> >
> >At 18:28 +0100 on 07 Jun (1307471313), Mike McClurg wrote:
> >>From: Mike McClurg<mike.mcclurg@citrix.com>
> >>
> >>OCaml libraries will live in /usr/local/ if the user compiles OCaml
> >>from source. This patch asks the OCaml compiler where we should look
> >>for libraries.
> >This patch edits the #include path, not the library path.  Are there
> >any ocaml support libraries that would require -L options to $(CC)?
> >
> >Tim.
> Thank you for correcting me, I misspoke about the include path. No,
> there is no requirement to pass -L options on to $(CC). The -I
> option will be sufficient, and this patch removes hard coded file
> paths from the makefile.

Righto.  Yes, the patch looks good to me. 

Tim.

-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OCaml tools: ask compiler for correct library path
  2011-06-08 13:45   ` Vincent Hanquez
@ 2011-06-08 13:46     ` Tim Deegan
  2011-06-08 14:00       ` Vincent Hanquez
  0 siblings, 1 reply; 8+ messages in thread
From: Tim Deegan @ 2011-06-08 13:46 UTC (permalink / raw)
  To: Vincent Hanquez; +Cc: xen-devel

At 14:45 +0100 on 08 Jun (1307544313), Vincent Hanquez wrote:
> On 06/07/2011 09:21 PM, Tim Deegan wrote:
> >Hi,
> >
> >At 18:28 +0100 on 07 Jun (1307471313), Mike McClurg wrote:
> >>From: Mike McClurg<mike.mcclurg@citrix.com>
> >>
> >>OCaml libraries will live in /usr/local/ if the user compiles OCaml
> >>from source. This patch asks the OCaml compiler where we should look
> >>for libraries.
> >This patch edits the #include path, not the library path.  Are there
> >any ocaml support libraries that would require -L options to $(CC)?
> 
> OCaml doesn't make the same distinction that C does.

The change is to C compiler flags. 

Tim.

-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OCaml tools: ask compiler for correct library path
  2011-06-08 13:46     ` Tim Deegan
@ 2011-06-08 14:00       ` Vincent Hanquez
  0 siblings, 0 replies; 8+ messages in thread
From: Vincent Hanquez @ 2011-06-08 14:00 UTC (permalink / raw)
  To: Tim Deegan; +Cc: xen-devel@lists.xensource.com

> At 14:45 +0100 on 08 Jun (1307544313), Vincent Hanquez wrote:
>> OCaml doesn't make the same distinction that C does.
> The change is to C compiler flags.
>
>
Ah yes, that'll show me to read the patch too quickly.

-- 
Vincent

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] OCaml tools: ask compiler for correct library path
  2011-06-07 17:28 [PATCH] OCaml tools: ask compiler for correct library path Mike McClurg
  2011-06-07 20:21 ` Tim Deegan
@ 2011-06-21 17:03 ` Ian Jackson
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Jackson @ 2011-06-21 17:03 UTC (permalink / raw)
  To: Mike McClurg
  Cc: Christoph Egger, xen-devel@lists.xensource.com, Jonathan, Ludlam

Mike McClurg writes ("[Xen-devel] [PATCH] OCaml tools: ask compiler for correct library path"):
> OCaml libraries will live in /usr/local/ if the user compiles OCaml
> from source. This patch asks the OCaml compiler where we should look
> for libraries.

Applied, thanks.  Something weird had happened to your email:
additional spaces had been inserted at the LHS of some of the patch
lines.  Perhaps you could look into this and make it not do it again
:-).  This time I've fixed it up.

> NB: it may be that we should do the same thing for the NetBSD case,
> but I don't have a BSD box to test this out.

CCing Christoph Egger, who will hopefully have an opinion about this.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-06-21 17:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-07 17:28 [PATCH] OCaml tools: ask compiler for correct library path Mike McClurg
2011-06-07 20:21 ` Tim Deegan
2011-06-08 10:53   ` Mike McClurg
2011-06-08 13:45     ` Tim Deegan
2011-06-08 13:45   ` Vincent Hanquez
2011-06-08 13:46     ` Tim Deegan
2011-06-08 14:00       ` Vincent Hanquez
2011-06-21 17:03 ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).