Item4220: Native search on Solaris
Priority: Low
Current State: Needs Developer
Released In: n/a
Target Release: n/a
With modifications I got this working:
Sun's libc doesn't have getline like GNU's does, so I linked in the gettext library where I found one, as installed by
http://sunfreeware.com/programlistintel10.html#gettext. I added the
gettextlib
library to Makefile.PL:
LIBS => [ "-lgettextlib -lpcre" ],
...and needed a couple of cheap preprocessor stanzas in cgrep.c:
*** /home/ajp/t412/tools/native_search/cgrep.c Sat Mar 3 06:45:57 2007
--- cgrep.c Wed Jun 6 12:48:21 2007
***************
*** 5,10 ****
--- 5,13 ----
* limits on command-line length.
*/
#include <pcre.h>
+ #if OSNAME == solaris
+ #include "/usr/local/share/gettext/gettext.h"
+ #endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
***************
*** 121,127 ****
--- 124,134 ----
int ovec[30];
int matchResult;
int chc;
+ #if OSNAME == solaris
+ while ((chc = gnu_getline(&linebuf, &linebufsize, f)) > 0) {
+ #else
while ((chc = getline(&linebuf, &linebufsize, f)) > 0) {
+ #endif
matchResult = pcre_exec(pattern, study, linebuf,
chc, 0, 0, ovec, 30);
--
AaronPeterson - 06 Jun 2007
Good work, Aaron, thanks. But doesn't the addition of
-lgettextlib
to
Makefile.PL
mean that platforms that
do have
getline
are now going to require an unneccesary dependency, causing
ld
to barf unneccesarily if it's missing? It might be easier just to provide a version of getline in this source file.
--
CrawfordCurrie - 08 Jun 2007
the addition of libs that are not installed or needed only produce a warning when running
perl Makefile.PL
, otherwise are fine.
However, the
#if OSNAME =
solaris= seems to evaluate to true on my debian.
Worse, is this the only solution for
all solaris versions?
--
TWiki:Main.SvenDowideit - 02 Sep 2007
Obviously Aaron is not going to provide feedback.
Lowering to Low priority.
--
TWiki:Main.KennethLavrsen - 29 Jul 2008