Bad control characters in GHCi 6.6 (Mac OS X PPC)

Deborah Goldsmith dgoldsmith at mac.com
Mon Oct 30 17:40:29 EST 2006


On Oct 23, 2006, at 8:59 AM, Björn Buckwalter wrote:

> On 10/19/06, Simon Marlow <simonmar at microsoft.com> wrote:
>> See this page that I just created:
>>
>> http://hackage.haskell.org/trac/ghc/wiki/Building/MacOSX
>
> I tried these instructions, first by using my existing (darwinports)
> readline in /opt/local, and when that failed by first installing
> readline in /usr/local per the instructions. Neither fixed the
> problem. I don't know why but perhaps I failed to remove the traces of
> my initial install completely. In the end I gave up and installed Greg
> Heartsfield's binary package which remedied my problems (thanks
> Greg!).

I think I have this partially figured out.

When I install version 5.1 of readline, rl_readline_version is  
defined as follows in <readline/readline.h>:

> /* **************************************************************** */
> /*                                                                  */
> /*                      Well Published Variables                    */
> /*                                                                  */
> /* **************************************************************** */
>
> /* The version of this incarnation of the readline library. */
> extern const char *rl_library_version;          /* e.g., "4.2" */
> extern int rl_readline_version;                 /* e.g., 0x0402 */
>

However, in ghc-6.6, libraries/readline/configure has the following:

> cat >>conftest.$ac_ext <<_ACEOF
> /* end confdefs.h.  */
>
> /* Override any gcc2 internal prototype to avoid an error.  */
> #ifdef __cplusplus
> extern "C"
> #endif
> /* We use char because int might match the return type of a gcc2
>    builtin and then its argument prototype would still apply.  */
> char rl_readline_version ();
> int
> main ()
> {
> rl_readline_version ();
>   ;
>   return 0;
> }
> _ACEOF
>

which is looking for rl_readline_version as a *function*. This fails  
(at the link stage on Darwin/Intel), even though GNU readline is  
installed, because the symbol type is wrong. The configure script  
concludes that libedit is being used, even though it's using GNU  
Readline v5.1.

Was rl_readline_version a function in earlier versions of GNU Readline?

Deborah



More information about the Glasgow-haskell-users mailing list