Compiling prce on Solaris

From EggeWiki

In attempting to install Perl Compatible Regular Expressions on Solaris I got this error:

<geshi> cc -xarch=generic64 -I/opt/tools/include -KPIC -xarch=generic64 -KPIC -o .libs/pcretest pcretest.o -L/opt/tools/lib ./.libs/libpcreposix.so /usrdev/imagined/src/pcre-7.9/.libs/libpcre.so -lreadline -R/opt/tools/lib Undefined first referenced

symbol                             in file

tgoto /opt/tools/lib/libreadline.so tputs /opt/tools/lib/libreadline.so tgetent /opt/tools/lib/libreadline.so tgetnum /opt/tools/lib/libreadline.so tgetstr /opt/tools/lib/libreadline.so tgetflag /opt/tools/lib/libreadline.so ld: fatal: Symbol referencing errors. No output written to .libs/pcretest

      • Error code 1

make: Fatal error: Command failed for target `pcretest' Current working directory /usr/dev/imagined/src/pcre-7.9

      • Error code 1

make: Fatal error: Command failed for target `all' </geshi>

This means it's having trouble finding ncurses. Compiling pcre w/ readline is requiring ncurses. It doesn't need readline of course, but I hate when tools don't have it compiled in. For example, irb w/o readline is very painful.

The fix is to let the linker know it needs to link to ncurses: <geshi> export CFLAGS="$CFLAGS -I/opt/tools/include/ncurses" export LDFLAGS="$LDFLAGS -lncurses" </geshi>