You are here: Foswiki>Tasks Web>Item4220 (07 Jan 2015, GeorgeClark)Edit Attach

Item4220: Native search on Solaris

pencil
Priority: Low
Current State: Needs Developer
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: NativeSearchContrib, SEARCH, PlatformSolaris
Branches:
Reported By: TWiki:Main.AaronPeterson
Waiting For:
Last Change By: GeorgeClark
With modifications I got this working:
Platform Perl Version Accelerator Whodunnit
SunOS 5.10 5.8.7 mod_perl AaronPeterson

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

ItemTemplate edit

Summary Native search on Solaris
ReportedBy TWiki:Main.AaronPeterson
Codebase
SVN Range TWiki-4.1.2, Mon, 04 Jun 2007, build 14028
AppliesTo Engine
Component NativeSearchContrib, SEARCH, PlatformSolaris
Priority Low
CurrentState Needs Developer
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r6 - 07 Jan 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy