i want to use ginac as a lib under Mac OS X 10.4..8. I compiled cln 1.1.13 without problems. But compiling ginac 1.3.6 gave me the well known ginsh_parser.yy error:
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I./../ginac -I../ginac - DIN_GINAC -I/usr/local/include -g -O2 -MT ginsh_parser.o -MD -MP - MF ".deps/ginsh_parser.Tpo" -c -o ginsh_parser.o ginsh_parser.cc; \ then mv -f ".deps/ginsh_parser.Tpo" ".deps/ginsh_parser.Po"; else rm - f ".deps/ginsh_parser.Tpo"; exit 1; fi ginsh_parser.yy:50:6: error: missing binary operator before token "wrapper" ginsh_parser.yy:56:6: error: missing binary operator before token "wrapper" ginsh_parser.yy:860:6: error: missing binary operator before token "wrapper" ginsh_parser.yy:870:6: error: missing binary operator before token "wrapper" ginsh_parser.yy:922:6: error: missing binary operator before token "wrapper" ginsh_parser.yy: In function 'char** fcn_completion(const char*, int, int)': ginsh_parser.yy:859: error: invalid conversion from 'const char*' to 'char*' ginsh_parser.yy:869: error: invalid conversion from 'const char*' to 'char*' make[2]: *** [ginsh_parser.o] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
Just for kicks, I 'touched' the yacc file to force a rebuild using our version of bison, 2.3, and it still rebuilt fine for me. Can you give some more context on the failure? For example, what did your configure report about 'readline', since the line numbers referenced in your report are all related to readline configuration and the resulting preprocessor macros. (I'm using readline-5.0). You can find some _RL_ results in "config.h" too. Just a stab in the dark, does the problem go away if you wrap those conditionals in one more pair of enclosing parentheses?
Hi again... And I just answered my own question. 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). (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. Hope this sheds some light. Fang