NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item4220: Native search on Solaris

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Low New Engine SEARCH, NativeSearchContrib TWiki:Main.AaronPeterson
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 SEARCH, NativeSearchContrib
Priority Low
CurrentState New
WaitingFor TWiki:Main.AaronPeterson
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r5 - 14 Mar 2011, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads