Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-21 Thread Christian Maeder
Simon Marlow wrote:
 Christian Maeder wrote:

 #!/bin/sh
 reldir=`dirname $0`
 topdir=`(cd $reldir; pwd)`
 
 There's no guarantee that $0 holds anything reasonable: you can set $0
 to whatever you like when calling exec*().

The above script simply does not work, if it is linked to from another
place. (I don't know if that's related to exec, but I see the problem now.)

Christian

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Christian Maeder
Ian Lynagh wrote:
 On Sat, Nov 17, 2007 at 03:02:55PM +, C.M.Brown wrote:
 Is there a way for GHC on OS X to find where it was run from, so that it
 can find package.conf?
 The command:

 ghc --print-libdir

 should do it.
 
 But the way that knows what to print on unix machines is that ghc is a
 shell script wrapper which passes -Blibdir to the real GHC binary. If
 you want to be able to move GHC around then the wrapper can't have the
 path hardcoded.

The wrapper could call `pwd` to find out the current path.

Christian
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Christian Maeder
Manuel M T Chakravarty wrote:
 this year are discharged (ie, in about two weeks).  Secondly, the really
 unsatisfactory thing about frameworks for readline and gmp is that it
 entails that programs compiled with GHC will also depend on at least the
 GMP framework.
 
 I'd really like to have a story that extends nicely to programs built
 with GHC.

In fact, that was our reason to create the GNUreadline framework in the
first place.

We found it easier to (ask our users to) copy such a framework into
their home directories than to update their libraries with root privileges.

Christian
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Simon Marlow

Christian Maeder wrote:

Ian Lynagh wrote:

On Sat, Nov 17, 2007 at 03:02:55PM +, C.M.Brown wrote:

Is there a way for GHC on OS X to find where it was run from, so that it
can find package.conf?

The command:

ghc --print-libdir

should do it.

But the way that knows what to print on unix machines is that ghc is a
shell script wrapper which passes -Blibdir to the real GHC binary. If
you want to be able to move GHC around then the wrapper can't have the
path hardcoded.


The wrapper could call `pwd` to find out the current path.


pwd gives you the directory that the script was invoked *from*, not the 
directory in which the script resides.  This is a common problem on Unix: 
there's no general way to find out the location of a binary.


Well that's not entirely true.  On Linux you have /proc/pid/exe, and on 
Solaris you have getexecname().  Does MacOS X have anything?


Cheers,
Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Christian Maeder
Simon Marlow wrote:
 Christian Maeder wrote:
 Ian Lynagh wrote:
 On Sat, Nov 17, 2007 at 03:02:55PM +, C.M.Brown wrote:
 Is there a way for GHC on OS X to find where it was run from, so
 that it
 can find package.conf?
 The command:

 ghc --print-libdir

 should do it.
 But the way that knows what to print on unix machines is that ghc is a
 shell script wrapper which passes -Blibdir to the real GHC binary. If
 you want to be able to move GHC around then the wrapper can't have the
 path hardcoded.

 The wrapper could call `pwd` to find out the current path.
 
 pwd gives you the directory that the script was invoked *from*, not the
 directory in which the script resides.  This is a common problem on
 Unix: there's no general way to find out the location of a binary.

Next attempt: How about  `dirname $0`?

Christian

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Alfonso Acosta
On Nov 19, 2007 10:35 AM, Simon Marlow [EMAIL PROTECTED] wrote:
 pwd gives you the directory that the script was invoked *from*, not the
 directory in which the script resides.  This is a common problem on Unix:
 there's no general way to find out the location of a binary.

Well, you can always combine the first argument of the script ($0) for
absolute paths and combine it with with pwd for relative ones.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Alfonso Acosta
On Nov 19, 2007 10:51 AM, Alfonso Acosta [EMAIL PROTECTED] wrote:
 Well, you can always combine the first argument of the script ($0) for
 absolute paths and combine it with with pwd for relative ones.

I meant _use_ the first argument of the script ($0) for absolute paths
and combine it with pwd for relative ones.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Christian Maeder
Alfonso Acosta wrote:
 On Nov 19, 2007 10:51 AM, Alfonso Acosta [EMAIL PROTECTED] wrote:
 Well, you can always combine the first argument of the script ($0) for
 absolute paths and combine it with with pwd for relative ones.
 
 I meant _use_ the first argument of the script ($0) for absolute paths
 and combine it with pwd for relative ones.

#!/bin/sh
reldir=`dirname $0`
topdir=`(cd $reldir; pwd)`

should do.

Christian
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Simon Marlow

Christian Maeder wrote:

Alfonso Acosta wrote:

On Nov 19, 2007 10:51 AM, Alfonso Acosta [EMAIL PROTECTED] wrote:

Well, you can always combine the first argument of the script ($0) for
absolute paths and combine it with with pwd for relative ones.

I meant _use_ the first argument of the script ($0) for absolute paths
and combine it with pwd for relative ones.


#!/bin/sh
reldir=`dirname $0`
topdir=`(cd $reldir; pwd)`


There's no guarantee that $0 holds anything reasonable: you can set $0 to 
whatever you like when calling exec*().


Cheers,
Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Alfonso Acosta
Simon, as usual, is right. It's been quite a while since I last
seriously coded in C. From the exec* man page:

The first argument, *by convention*, should point to the file name
associated with the file being executed.

However, if nothing better is found I guess it's better to rely on an
extended convention rather than hardcoding paths.

On Nov 19, 2007 11:40 AM, Simon Marlow [EMAIL PROTECTED] wrote:

 Christian Maeder wrote:
  Alfonso Acosta wrote:
  On Nov 19, 2007 10:51 AM, Alfonso Acosta [EMAIL PROTECTED] wrote:
  Well, you can always combine the first argument of the script ($0) for
  absolute paths and combine it with with pwd for relative ones.
  I meant _use_ the first argument of the script ($0) for absolute paths
  and combine it with pwd for relative ones.
 
  #!/bin/sh
  reldir=`dirname $0`
  topdir=`(cd $reldir; pwd)`

 There's no guarantee that $0 holds anything reasonable: you can set $0 to
 whatever you like when calling exec*().

 Cheers,
 Simon

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Christian Maeder
An additional sanity check of topdir makes sense then.

Christian

Alfonso Acosta wrote:
 Simon, as usual, is right. It's been quite a while since I last
 seriously coded in C. From the exec* man page:
 
 The first argument, *by convention*, should point to the file name
 associated with the file being executed.
 
 However, if nothing better is found I guess it's better to rely on an
 extended convention rather than hardcoding paths.
 
 On Nov 19, 2007 11:40 AM, Simon Marlow [EMAIL PROTECTED] wrote:
 Christian Maeder wrote:
 Alfonso Acosta wrote:
 On Nov 19, 2007 10:51 AM, Alfonso Acosta [EMAIL PROTECTED] wrote:
 Well, you can always combine the first argument of the script ($0) for
 absolute paths and combine it with with pwd for relative ones.
 I meant _use_ the first argument of the script ($0) for absolute paths
 and combine it with pwd for relative ones.
 #!/bin/sh
 reldir=`dirname $0`
 topdir=`(cd $reldir; pwd)`
 There's no guarantee that $0 holds anything reasonable: you can set $0 to
 whatever you like when calling exec*().

 Cheers,
 Simon

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


ghc/haskell tool registry (was: GHC 6.8.1 on Mac OS X 10.5 (Leopard))

2007-11-19 Thread Claus Reinke
may i suggest a different approach? most shells have commands 
to list programs in PATH beyond the first match, such as 
'whereis ssh', 'which -a ssh', or 'type -a ssh'. now, this won't

help directly because the ghc tool in question might not be on
the PATH.

but as this issue is so widespread, one could extend one of the
existing haskell package registries (ghc-pkg, cabal) to cover
haskell tools as well. every haskell tool would know how to
register itself with its current location, and how to query the 
haskell tool registry for the location of other tools (preferably 
from the same build/version). since we're on the ghc list:


   ghc-tools (un-)register path/ghcversion
   ghc-tools list ghcversion
   ghc-tools describe runhaskell
   ghc-tools field location ghc-6.9
   ghc-tools field user_guide ghc-6.9
   ..

pros:

   - knowing your version would be sufficient to find
   all the tools from your bundle
   - finding all available haskell tools would be easy

downsides: 


   - tools would have to register themselves after
   installation/relocation, and unregister during 
   uninstall

   - there is no single ghc-pkg/cabal instance to choose,
   but multiple versions..

the former is no worse than for packages, the latter
is a runhaskell-style issue: we want a single ghc-tools
in the path, but we don't care who provides it.

claus

- Original Message - 
From: Simon Marlow [EMAIL PROTECTED]

To: Christian Maeder [EMAIL PROTECTED]
Cc: Manuel M T Chakravarty [EMAIL PROTECTED]; GHC List 
glasgow-haskell-users@haskell.org
Sent: Monday, November 19, 2007 9:35 AM
Subject: Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)



Christian Maeder wrote:

Ian Lynagh wrote:

On Sat, Nov 17, 2007 at 03:02:55PM +, C.M.Brown wrote:

Is there a way for GHC on OS X to find where it was run from, so that it
can find package.conf?

The command:

ghc --print-libdir

should do it.

But the way that knows what to print on unix machines is that ghc is a
shell script wrapper which passes -Blibdir to the real GHC binary. If
you want to be able to move GHC around then the wrapper can't have the
path hardcoded.


The wrapper could call `pwd` to find out the current path.


pwd gives you the directory that the script was invoked *from*, not the 
directory in which the script resides.  This is a common problem on Unix: 
there's no general way to find out the location of a binary.


Well that's not entirely true.  On Linux you have /proc/pid/exe, and on 
Solaris you have getexecname().  Does MacOS X have anything?


Cheers,
Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Deborah Goldsmith
If you want to get the path to the main executable on Mac OS X, use  
_NSGetExecutablePath. See:


man 3 dyld

Deborah

On Nov 19, 2007, at 4:07 AM, Christian Maeder wrote:


An additional sanity check of topdir makes sense then.

Christian

Alfonso Acosta wrote:

Simon, as usual, is right. It's been quite a while since I last
seriously coded in C. From the exec* man page:

The first argument, *by convention*, should point to the file name
associated with the file being executed.

However, if nothing better is found I guess it's better to rely on an
extended convention rather than hardcoding paths.

On Nov 19, 2007 11:40 AM, Simon Marlow [EMAIL PROTECTED]  
wrote:

Christian Maeder wrote:

Alfonso Acosta wrote:
On Nov 19, 2007 10:51 AM, Alfonso Acosta  
[EMAIL PROTECTED] wrote:
Well, you can always combine the first argument of the script  
($0) for

absolute paths and combine it with with pwd for relative ones.
I meant _use_ the first argument of the script ($0) for absolute  
paths

and combine it with pwd for relative ones.

#!/bin/sh
reldir=`dirname $0`
topdir=`(cd $reldir; pwd)`
There's no guarantee that $0 holds anything reasonable: you can  
set $0 to

whatever you like when calling exec*().

Cheers,
   Simon


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-19 Thread Manuel M T Chakravarty

Deborah Goldsmith wrote,
If you want to get the path to the main executable on Mac OS X, use  
_NSGetExecutablePath. See:


man 3 dyld

That's exactly what we need.  The man page is on the web for those  
without a mac:


  
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/dyld.3.html

Thanks Deborah!

Manuel


On Nov 19, 2007, at 4:07 AM, Christian Maeder wrote:


An additional sanity check of topdir makes sense then.

Christian

Alfonso Acosta wrote:

Simon, as usual, is right. It's been quite a while since I last
seriously coded in C. From the exec* man page:

The first argument, *by convention*, should point to the file name
associated with the file being executed.

However, if nothing better is found I guess it's better to rely on  
an

extended convention rather than hardcoding paths.

On Nov 19, 2007 11:40 AM, Simon Marlow [EMAIL PROTECTED]  
wrote:

Christian Maeder wrote:

Alfonso Acosta wrote:
On Nov 19, 2007 10:51 AM, Alfonso Acosta [EMAIL PROTECTED] 
 wrote:
Well, you can always combine the first argument of the script  
($0) for

absolute paths and combine it with with pwd for relative ones.
I meant _use_ the first argument of the script ($0) for  
absolute paths

and combine it with pwd for relative ones.

#!/bin/sh
reldir=`dirname $0`
topdir=`(cd $reldir; pwd)`
There's no guarantee that $0 holds anything reasonable: you can  
set $0 to

whatever you like when calling exec*().

Cheers,
  Simon


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users




___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-18 Thread Manuel M T Chakravarty

Christian Maeder:

Manuel M T Chakravarty wrote:

I wasn't expecting any backwards compatibility from Leopard-built
software to Tiger, but then I am also a Mac-noob and maybe there are
ways to achieve that that I don't know of.  Any suggestions?


Could you, or someone else with Leopard, check if my Tiger binary
distribution is useable? (or what the problems are?)


I didn't try, but I guess, it would lead to the same problems as your  
GHC 6.6.1 distribution caused on Leopard (ie, linker error complaining  
about _environ).  The problem there was, I think, the GMP framework.




What we really need is a proper .mpkg, but at the moment, I don't  
have

time for that.


I've found that page
http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html

It would help if we could at least agree on using frameworks or dylibs
for readline and gmp. That'll be important for any installer.

Maybe ghc could also support private frameworks
(in conjunction with http://hackage.haskell.org/trac/ghc/ticket/1798).


The above binary first of all was meant to help
bootstrapping GHC for people who upgraded to Leopard and have  
problems

(which it seemed on irc, there were a few of).


Fair enough, but the current state under
http://www.haskell.org/ghc/download_ghc_681.html#macosxintel
is worse compared to version 6.6.1 when
http://hackage.haskell.org/trac/ghc/ticket/1540
was created.


I agree, we need to do something about that.  There are two reasons  
why I haven't done anything yet.  Firstly, I have been to busy with  
other things, but that hopefully changes when all my teaching  
obligations for this year are discharged (ie, in about two weeks).   
Secondly, the really unsatisfactory thing about frameworks for  
readline and gmp is that it entails that programs compiled with GHC  
will also depend on at least the GMP framework.


I'd really like to have a story that extends nicely to programs built  
with GHC.


Otherwise, if we produce a mpkg, I don't it doesn't matter much what  
the internal structure is.  An mpkg can contain sub-packages for  
frameworks internally (which will be automatically installed) if not  
yet present.


Manuel

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-18 Thread Manuel M T Chakravarty

Christian Maeder:

Manuel M T Chakravarty wrote:

What we really need is a proper .mpkg


How about a simple disk image (.dmg) that can be moved
around as long as the relative paths within the image remain the same?

This would require to allow relative paths in package.conf files  
(which
would be useful, anyway). The wrapper scripts for ghc, ghci and ghc- 
pkg

could be easily rewritten.

I'm not sure if ranlib needs to be called, whenever the archives are  
moved.


A dmg makes it potentially harder to deal with readline and gmp, as a  
mpkg can embed other sub-packages.  Secondly, if you look at the  
installation process of binary distributions, it does run code in  
order to re-locate GHC.  With an mpkg we can have a post-install script.


Manuel

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-17 Thread Ian Lynagh
On Fri, Nov 16, 2007 at 11:15:08AM +0100, Christian Maeder wrote:
 
 This would require to allow relative paths in package.conf files (which
 would be useful, anyway). The wrapper scripts for ghc, ghci and ghc-pkg
 could be easily rewritten.
 
 I'm not sure if ranlib needs to be called, whenever the archives are moved.
 
 Are there other problems?

Is there a way for GHC on OS X to find where it was run from, so that it
can find package.conf?


Thanks
Ian

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-17 Thread C.M.Brown
Ian,

 Is there a way for GHC on OS X to find where it was run from, so that it
 can find package.conf?

The command:

ghc --print-libdir

should do it.


Cheers,
Chris.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-17 Thread Ian Lynagh
On Sat, Nov 17, 2007 at 03:02:55PM +, C.M.Brown wrote:
 
  Is there a way for GHC on OS X to find where it was run from, so that it
  can find package.conf?
 
 The command:
 
 ghc --print-libdir
 
 should do it.

But the way that knows what to print on unix machines is that ghc is a
shell script wrapper which passes -Blibdir to the real GHC binary. If
you want to be able to move GHC around then the wrapper can't have the
path hardcoded.


Thanks
Ian

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-16 Thread Christian Maeder
Manuel M T Chakravarty wrote:
 What we really need is a proper .mpkg

How about a simple disk image (.dmg) that can be moved
around as long as the relative paths within the image remain the same?

This would require to allow relative paths in package.conf files (which
would be useful, anyway). The wrapper scripts for ghc, ghci and ghc-pkg
could be easily rewritten.

I'm not sure if ranlib needs to be called, whenever the archives are moved.

Are there other problems?

Cheers Christian
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-15 Thread Christian Maeder
Manuel M T Chakravarty wrote:
 I wasn't expecting any backwards compatibility from Leopard-built
 software to Tiger, but then I am also a Mac-noob and maybe there are
 ways to achieve that that I don't know of.  Any suggestions?

Could you, or someone else with Leopard, check if my Tiger binary
distribution is useable? (or what the problems are?)

 What we really need is a proper .mpkg, but at the moment, I don't have
 time for that.

I've found that page
http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html

It would help if we could at least agree on using frameworks or dylibs
for readline and gmp. That'll be important for any installer.

Maybe ghc could also support private frameworks
(in conjunction with http://hackage.haskell.org/trac/ghc/ticket/1798).

 The above binary first of all was meant to help
 bootstrapping GHC for people who upgraded to Leopard and have problems
 (which it seemed on irc, there were a few of).

Fair enough, but the current state under
http://www.haskell.org/ghc/download_ghc_681.html#macosxintel
is worse compared to version 6.6.1 when
http://hackage.haskell.org/trac/ghc/ticket/1540
was created.

Yes, again. Any suggestions?
Christian

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-15 Thread Deborah Goldsmith

On Nov 6, 2007, at 4:06 PM, Manuel M T Chakravarty wrote:
I wasn't expecting any backwards compatibility from Leopard-built  
software to Tiger, but then I am also a Mac-noob and maybe there are  
ways to achieve that that I don't know of.  Any suggestions?


Sorry, I missed this the first time around...

To build binaries on Leopard that are compatible with previous  
releases of Mac OS X, you need to use the appropriate SDK parameters  
when invoking gcc (for includes) and the linker (for libraries). This  
is described in the context of building a universal binary in:


http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html#/ 
/apple_ref/doc/uid/TP40002850-BAJCFEBA


but the same concepts (-isysroot for gcc and -Wl,-syslibroot for ld)  
apply to building against any SDK.


An SDK is basically a copy of the frameworks and libraries for a  
particular OS release, but the libraries are just stubs to link  
against. By pointing gcc and ld at an SDK, you use the correct headers  
and entry points for a particular release.


Caveat: I don't know how use of SDKs interacts with use of non-system  
libraries (e.g., in /opt/local or /Library/Frameworks).


Another approach is to set MAC_OS_X_VERSION_MIN_REQUIRED to  
MAC_OS_X_VERSION_10_4 (or whatever). You then have to be careful about  
how you use APIs that are new in Leopard. I would think the SDK  
approach would be easier for something like ghc.


If you don't do anything, by default binaries built on a particular  
Mac OS X release will only run on that release or later.


Deborah

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-12 Thread Manuel M T Chakravarty

Benedikt,


Manuel M T Chakravarty wrote:
A full binary distribution of GHC 6.8.1 for Mac OS X 10.5 (Leopard)  
is available from

http://www.cse.unsw.edu.au/~chak/haskell/ghc-6.8.1-i386-apple-darwin.tar.bz2


Thanks, it's great you provided a binary distribution, especially  
since macports' ghc seems to be broken on Leopard at the moment.


I had one little problem when linking with a dynamic library  though  
(darwin9 / i386):


ghc --make -O -hidir build/ifaces -odir build/objs Foreign/ 
YicesTest.hs -o bin/YicesTest -optl -fexceptions  -lstdc++ -lyices

Linking bin/YicesTest ...
ld: absolute addressing (perhaps -mdynamic-no-pic) used in  
___gmpn_divexact_1 from ghc-6.8.1-dir/lib/ghc-6.8.1/ 
libgmp.a(dive_1.o) not allowed in slidable image


I don't know if this is a known problem and what causes it, and I'm  
not sure what it means;
However, replacing the 'libgmp.a' you've distributed with a recently  
compiled one from macports  (gmp 4.2.2_0) resolved the problem for me.


I am sorry, but I am a bit out of my depth here.  Specifically, I  
don't know much about the mac linker.  Maybe somebody with some more  
experience in that area can shed light on this problem.


Manuel

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-11 Thread Ian Lynagh
On Tue, Nov 06, 2007 at 05:29:05PM +1100, Manuel M T Chakravarty wrote:
 A full binary distribution of GHC 6.8.1 for Mac OS X 10.5 (Leopard) is  
 available

Thanks Manuel! I've put it on the download page.


Ian

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-10 Thread Benedikt Huber

Manuel M T Chakravarty wrote:
A full binary distribution of GHC 6.8.1 for Mac OS X 10.5 (Leopard)  
is available from

http://www.cse.unsw.edu.au/~chak/haskell/ghc-6.8.1-i386-apple-darwin.tar.bz2


Thanks, it's great you provided a binary distribution, especially  
since macports' ghc seems to be broken on Leopard at the moment.


I had one little problem when linking with a dynamic library  though  
(darwin9 / i386):


ghc --make -O -hidir build/ifaces -odir build/objs Foreign/ 
YicesTest.hs -o bin/YicesTest -optl -fexceptions  -lstdc++ -lyices

Linking bin/YicesTest ...
ld: absolute addressing (perhaps -mdynamic-no-pic) used in  
___gmpn_divexact_1 from ghc-6.8.1-dir/lib/ghc-6.8.1/ 
libgmp.a(dive_1.o) not allowed in slidable image


I don't know if this is a known problem and what causes it, and I'm  
not sure what it means;
However, replacing the 'libgmp.a' you've distributed with a recently  
compiled one from macports  (gmp 4.2.2_0) resolved the problem for me.


Benedikt

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-08 Thread Simon Marlow

Don Stewart wrote:

It seems 10.5/PPC/6.8 is currently a lethal combination. (not x86
though, nor 10.4/ppc).

Here's the ticket, add yourself to the CC list.

http://hackage.haskell.org/trac/ghc/ticket/1843


We need a Mac hero (or heroes) who can diagnose and fix this problem.  Any 
takers?  You stand to earn the gratitude of the Mac/GHC community!


Cheers,
Simon


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-08 Thread Joel Reymont


On Nov 8, 2007, at 2:17 PM, Simon Marlow wrote:

We need a Mac hero (or heroes) who can diagnose and fix this  
problem.  Any takers?  You stand to earn the gratitude of the Mac/ 
GHC community!



My PPC Mac is thousands of miles away but if anyone can give me SSH  
access to their PPC/Leopard box, I could take a look.


--
http://wagerlabs.com





___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-06 Thread Joel Reymont


On Nov 6, 2007, at 12:43 PM, Christian Maeder wrote:


I've tried to install your package, but already configure failed with:



I successfully installed this package a few times on the same machine.


--
http://wagerlabs.com





___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-06 Thread Christian Maeder
Joel Reymont wrote:
 
 On Nov 6, 2007, at 12:43 PM, Christian Maeder wrote:
 
 I've tried to install your package, but already configure failed with:
 
 
 I successfully installed this package a few times on the same machine.

My failure was on a Tiger and your success with Leopard.

C.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-06 Thread kahl
  
  You do not perchance have one for powerpc, do you?  I attempted to
  bootstrap from GHC 6.6.1, but I keep getting errors about Illegal
  Instructions,

Try to force

./configure --build=powerpc-mac-darwin

or whatever is appropriate under MacOS ---
without it, ./configure will identify the target as
powerpc64-... --- just give it a try without the 64.
(This is what I need with 32bit userland under linux.)

Otherwise try adding

 GhcUnregisterised=YES
 SplitObjs=NO

to mk/build.mk.



Wolfram
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-06 Thread haskell
Brian P. O'Hanlon wrote:
 On Nov 6, 2007 1:29 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote:
 A full binary distribution of GHC 6.8.1 for Mac OS X 10.5 (Leopard) is
 available from


 http://www.cse.unsw.edu.au/~chak/haskell/ghc-6.8.1-i386-apple-darwin.tar.bz2
 
 You do not perchance have one for powerpc, do you?  I attempted to
 bootstrap from GHC 6.6.1, but I keep getting errors about Illegal
 Instructions, both using the native gcc 4.0 and my own 4.2 compiler.
 The error is like this:

I am also failing to compile ghc-6.8.1 for a powerpc (G4 powerbook).  I am
giving a try to leave out the extra src tarball to see if that avoids it dying
again while trying to compile parsec.  Of course, it takes many hours to try to
compile.

-- 
Chris
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-06 Thread Brian P. O'Hanlon
On Nov 6, 2007 1:29 AM, Manuel M T Chakravarty [EMAIL PROTECTED] wrote:
 A full binary distribution of GHC 6.8.1 for Mac OS X 10.5 (Leopard) is
 available from


 http://www.cse.unsw.edu.au/~chak/haskell/ghc-6.8.1-i386-apple-darwin.tar.bz2

You do not perchance have one for powerpc, do you?  I attempted to
bootstrap from GHC 6.6.1, but I keep getting errors about Illegal
Instructions, both using the native gcc 4.0 and my own 4.2 compiler.
The error is like this:

Creating main/Config.hs ...
done.
Creating stage1/ghc_boot_platform.h...
Done.
/usr/bin/gcc-4.0 -E  -undef -traditional -P -I../includes-x c
prelude/primops.txt.pp | \
grep -v '^#pragma GCC'  prelude/primops.txt
../utils/genprimopcode/genprimopcode --data-decl  
prelude/primops.txt  primop-data-decl.hs-incl
/bin/sh: line 1: 25386 Illegal instruction
../utils/genprimopcode/genprimopcode --data-decl  prelude/primops.txt
 primop-data-decl.hs-incl

It is rather odd... am I missing something?  Thanks a lot!
-Brian
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-06 Thread Manuel M T Chakravarty

Christian Maeder:

Manuel M T Chakravarty wrote:
A full binary distribution of GHC 6.8.1 for Mac OS X 10.5 (Leopard)  
is

available from


http://www.cse.unsw.edu.au/~chak/haskell/ghc-6.8.1-i386-apple-darwin.tar.bz2


The name of a binary distribution for Mac OS X 10.4 (Tiger) would be  
the

same.

I've tried to install your package, but already configure failed with:

checking build system type... i386-apple-darwin8.10.1
checking host system type... i386-apple-darwin8.10.1
checking target system type... i386-apple-darwin8.10.1
Which we'll further canonicalise into: i386-apple-darwin
checking for path to top of build tree... configure: error: cannot
determine current directory

because utils/pwd/pwd results in a Bus error


I wasn't expecting any backwards compatibility from Leopard-built  
software to Tiger, but then I am also a Mac-noob and maybe there are  
ways to achieve that that I don't know of.  Any suggestions?


As for the name of the file.  The GNU-style arch-vendor-os triples do  
generally not distinguish between OS versions (same deal on Linux).   
Hence, I added the version information as meta information in my email.


What we really need is a proper .mpkg, but at the moment, I don't have  
time for that.  The above binary first of all was meant to help  
bootstrapping GHC for people who upgraded to Leopard and have problems  
(which it seemed on irc, there were a few of).


Manuel

PS: Some people asked about a pcc binary.  I am sorry, but I only have  
got an x86 mac.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-06 Thread Manuel M T Chakravarty

[EMAIL PROTECTED]:

Brian P. O'Hanlon wrote:
On Nov 6, 2007 1:29 AM, Manuel M T Chakravarty  
[EMAIL PROTECTED] wrote:
A full binary distribution of GHC 6.8.1 for Mac OS X 10.5  
(Leopard) is

available from

  http://www.cse.unsw.edu.au/~chak/haskell/ghc-6.8.1-i386-apple-darwin.tar.bz2


You do not perchance have one for powerpc, do you?  I attempted to
bootstrap from GHC 6.6.1, but I keep getting errors about Illegal
Instructions, both using the native gcc 4.0 and my own 4.2 compiler.
The error is like this:


I am also failing to compile ghc-6.8.1 for a powerpc (G4  
powerbook).  I am
giving a try to leave out the extra src tarball to see if that  
avoids it dying
again while trying to compile parsec.  Of course, it takes many  
hours to try to

compile.


I have no experience with PPC.  In any case, trying to compile a  
minimal system (ie, no extra libs) seems a good idea.


Manuel

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


GHC 6.8.1 on Mac OS X 10.5 (Leopard)

2007-11-05 Thread Manuel M T Chakravarty
A full binary distribution of GHC 6.8.1 for Mac OS X 10.5 (Leopard) is  
available from


  http://www.cse.unsw.edu.au/~chak/haskell/ghc-6.8.1-i386-apple-darwin.tar.bz2

To use it, you need two other pieces of software installed:

  Xcode 3.0-- as available from the Leopard upgrade/install DVD  
or developer.apple.com

  readline 5.2 -- preferably installed via macports in /opt/local

Moreover, if you have the GMP.framework installed (a leftover from  
10.4), remove it first.


To install, follow the instructions at

  
http://www.haskell.org/ghc/docs/latest/html/users_guide/installing-bin-distrib.html#id3132713

Happy Haskell Hacking!
Manuel

-=-

GHC on Mac OS X 10.5 mini FAQ:

* When trying to compile GHC, I get a segv on Float.lhs (of the base  
package is compiled).  Why?


AFAIK this only happens if the GHC you try to bootstrap with is  
too old (eg, 6.6).


* With the binary distribution why do I get a link error complaining  
about _environ?


You still have the GMP framework installed.  It was linked  
against an old libc, which causes

the error.  Remove the GMP framework.

* What GMP library is used?

GHC 6.8.1 includes an embedded GMP library (ie, it's bundled with  
the source).  It is

compiled as a static library and placed into the GHC install tree.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users