
Hi Thorkil, On Nov 21, 2006, at 2:24 PM, Thorkil Naur wrote:
Hello,
I am trying to reproduce the problem reported as "#898: GHC compiles against Apple's readline, giving error". On my PPC Mac OS X 10.3 Panther, however, I have managed to build ghc-6.6 without running into this particular problem. Initially without gnu readline, the resulting GHCi is, of course, without readline support. And after installing readline 5.1 via Darwin/ MacPorts into /opt/local, I can re-build and this time get a GHCi with readline support, provided I "./configure --with-readline-includes=/opt/ local/include/ --with-readline-libraries=/opt/local/lib".
The reason for the error is stated as "The bug is really that Apple symlinks libreadline to libedit", but my system does not contain such a symlink. Is it possible to set up this masquerading on a Mac OS X 10.3? Or would I need to upgrade to 10.4? Or could something else again be required?
Libedit (and the symlink from /usr/lib/libreadline) were added in 10.4. 10.3 should not have this particular problem. The "./configure --with-readline-includes=<prefix>/include --with- readline-libraries=<prefix>/lib is what MacPorts uses internally to get ghc to use the readline installed by MacPorts. On 10.4, if you don't specify which readline to use by this method, the configuration process will grab /usr/lib/libreadline.dylib, which is really libedit. I submitted a patch to let configure determine if readline were libedit, and to reject it. This patch was applied for the 6.6 release. It evidently needs to be applied in more than one place. Best Wishes, Greg
Thanks and regards Thorkil
On Saturday 04 November 2006 00:14, Deborah Goldsmith wrote:
On Oct 30, 2006, at 2:40 PM, Deborah Goldsmith wrote:
I think I have this partially figured out.
The following patch to libraries/readline/configure.ac seems to do the trick for Darwin:
--- configure.ac.save 2006-10-10 12:09:04.000000000 -0700 +++ configure.ac 2006-11-02 17:32:50.000000000 -0800 @@ -43,7 +43,10 @@ dnl ** is our readline really readline, or is it BSD's libedit? if test x"$HaveLibReadline" = xYES ; then - AC_CHECK_LIB(readline, rl_readline_version, ReadlineIsLibedit=NO, ReadlineIsLibedit=YES) + AC_CHECK_DECL(rl_readline_version, ReadlineIsLibedit=NO, ReadlineIsLibedit=YES, +[#include
+#include +]) fi if test $HaveLibTermcap = YES && test x"$HaveLibReadline" = xYES && test x"$ReadlineIsLibedit" = xNO ; then @@ -56,9 +59,12 @@ AC_SUBST(READLINE_LIBS) if test x"$HaveLibReadline" = xYES && test x"$ReadlineIsLibedit" = xNO ; then - AC_CHECK_LIB(readline, rl_erase_empty_line, + AC_CHECK_DECL(rl_erase_empty_line, [AC_DEFINE([HAVE_READLINE_4], [1], [Define to 1 if readline has version >= 4.0.])], - [AC_DEFINE([HAVE_READLINE_4], [0], [Define to 1 if readline has version >= 4.0.])]) + [AC_DEFINE([HAVE_READLINE_4], [0], [Define to 1 if readline has version >= 4.0.])], +[#include +#include +]) AC_CHECK_LIB(readline, rl_free_undo_list, [AC_DEFINE([HAVE_READLINE_4_2], [1], [Define to 1 if readline has version >= 4.2.])], [AC_DEFINE([HAVE_READLINE_4_2], [0], [Define to 1 if readline has version >= 4.2.])]) When I build with this patch after configuring to look for GNU readline in /usr/local, everything works. I don't know if this particular patch will work well on other systems. Maybe folks could try it out?
Thanks, Deborah
_______________________________________________ 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