• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4220: Native search on Solaris

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Low New TWiki:Main.AaronPeterson n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


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

Summary Native search on Solaris
ReportedBy TWiki:Main.AaronPeterson
Codebase 4.1.2
SVN Range TWiki-4.1.2, Mon, 04 Jun 2007, build 14028
AppliesTo Engine

Priority Low
CurrentState New
WaitingFor TWiki:Main.AaronPeterson

TargetRelease n/a

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2008-07-29 - KennethLavrsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback