[GiNaC-list] GiNaC vs readline [Was: Problems]
Sheplyakov Alexei
varg at theor.jinr.ru
Tue Jan 30 14:14:49 CET 2007
On Mon, Jan 29, 2007 at 11:17:34PM -0500, David Fang wrote:
> The reason the above is happening is because your configure found
> /usr/include/readline and /usr/lib/libreadline which (on Mac OS X) is
> actually the BSD editline or histedit wrapper library (almost readline).
> See the symlink from /usr/lib/libreadline.dylib to /usr/lib/libedit.dylib.
> The "wrapper" token comes from the version string rl_library_version,
> which is something like "EditLine wrapper", and is picked up by the
> autoconf test GINAC_LIB_READLINE_VERSION (in ginac.m4).
Thank you very much for investigation.
> (This happens to me with my projects too. :D ) And since it is
> AC_DEFINE_UNQUOTED, it looks like the tokens: EditLine wrapper.
> Solution: if you just want to get going, hand-edit the
> generated "config.h" on the lines with *_RL_* with fake readline version
> numbers like major.minor = 5.0 or 4.3.
> A real solution requires accommodating the possibility of
> non-numeric version string in the config.h header or re-writing the test
> so that it is not a problem.
Here is really dumb patch which does this:
[PATCH] Fix libreadline version detection.
Some vendor-supplied readline equivalents (e.g. one on Mac OS X)
return non-numeric rl_library_version. Let's check for such
an ill-formed version string. For now I assume that such a library
is compatible with GNU readline 4.2.
---
acinclude.m4 | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index 4ab1387..c6f4d5d 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -24,7 +24,16 @@ int main()
fprintf(fd, "%s\n", rl_library_version);
fclose(fd);
return 0;
-}], ginac_cv_rlversion=`cat 'conftest.out'`, ginac_cv_rlversion='unknown', ginac_cv_rlversion='4.2')])
+}],
+ dnl Some vendor-supplied readline libraries (e.g. one on Mac OS X)
+ dnl return non-numeric versions. Grrr!
+ dnl Pretend that such versions are compatible with GNU readline 4.2
+ [ginac_cv_rlversion=`sed -e 's/[^0-9.]//g' 'conftest.out'`
+ if test -z "$ginac_cv_rlversion"; then
+ ginac_cv_rlversion='4.2'
+ fi],
+ [ginac_cv_rlversion='unknown'],
+ [ginac_cv_rlversion='4.2'])])
if test "x${ginac_cv_rlversion}" != "xunknown"; then
RL_VERSION_MAJOR=`echo ${ginac_cv_rlversion} | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
AC_DEFINE_UNQUOTED(GINAC_RL_VERSION_MAJOR, $RL_VERSION_MAJOR, [Major version of installed readline library.])
--
1.4.4.3
--
All science is either physics or stamp collecting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-list/attachments/20070130/ba39829a/attachment.pgp
More information about the GiNaC-list
mailing list