Re: scope of header files

2008-03-12 Thread Duncan Coutts
On Tue, 2008-03-11 at 16:25 -0700, Simon Marlow wrote: > Duncan Coutts wrote: > > from: > > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mage-1.0 > > > > perhapsPbecause it's a pointer import it gets treated differently? > > I just tried this and couldn't reproduce the problem. >

RE: Understanding the undefine flags passed to gcc when linking

2008-03-12 Thread Bruce, Joseph R (Joe)
Thanks Simon. That is the best answer I've received to this question in many askings. I will try to go the shared library route. A question about you last comment: when you say link RTS and base, you mean extract the object files and package in a single .a? Am I going to run into namespace coll

Re: Understanding the undefine flags passed to gcc when linking

2008-03-12 Thread Simon Marlow
Bruce, Joseph R (Joe) wrote: When I run 'ghc -v ...', the linking is done via gcc->ld with a large list of -u flags passed in. I'm hoping to find a way to link my object files without those flags, but first I need to understand what they are doing. Can someone explain it to me? Or point me to

Re: scope of header files

2008-03-12 Thread Simon Marlow
John Meacham wrote: On Tue, Mar 11, 2008 at 02:47:37PM -0700, Simon Marlow wrote: Yeah, I'd like -fvia-C to be headerless. We talked about it a while back (on the haskell-prime list I think). The main issue is that GHC would have to generate prototypes based on the FFI declaration, and since

Understanding the undefine flags passed to gcc when linking

2008-03-12 Thread Bruce, Joseph R (Joe)
Hi, When I run 'ghc -v ...', the linking is done via gcc->ld with a large list of -u flags passed in. I'm hoping to find a way to link my object files without those flags, but first I need to understand what they are doing. Can someone explain it to me? Or point me to documentation that explain

Re: scope of header files

2008-03-12 Thread John Meacham
On Tue, Mar 11, 2008 at 02:47:37PM -0700, Simon Marlow wrote: > Yeah, I'd like -fvia-C to be headerless. We talked about it a while back > (on the haskell-prime list I think). The main issue is that GHC would have > to generate prototypes based on the FFI declaration, and since it can't > guar

Re: scope of header files

2008-03-12 Thread Simon Marlow
Duncan Coutts wrote: I was under the impression that with ghc, ffi import declarations like this do not escape the module: foreign import ccall unsafe "foo.h foo" foo :: IO () However it seems that this one does: foreign import ccall unsafe "curses.h & stdscr" stdscrp :: Ptr WINDOWptr from: h

Re: scope of header files

2008-03-12 Thread Simon Marlow
John Meacham wrote: On Thu, Mar 06, 2008 at 12:23:35AM +, Duncan Coutts wrote: Which is really annoying :-) I'd like greater control over it, in particular a way to limit headers to package scope so that dependent code does not need the headers. Ideally there would be no need for headers a