ugrep icon indicating copy to clipboard operation
ugrep copied to clipboard

Build failed on OpenIndiana

Open 3eka opened this issue 2 years ago • 1 comments

Hi, i am finding this tools very interesting and would like to try it on OpenIndiana OS (fork of OpenSolaris), but I am faced with compilation problems...

What are requirements for building? I have tried with GCC10 tool set:

:; ./configure --enable-hidden --enable-pager --enable-pretty --disable-mmap --disable-sse2 --disable-avx --disable-neon --prefix=/pz/SFW
...
<command-line>: note: this is the location of the previous definition
In file included from stats.hpp:49,
                 from stats.cpp:37:
ugrep.hpp:44: warning: "WITH_NO_MMAP" redefined
   44 | #define WITH_NO_MMAP
      |
<command-line>: note: this is the location of the previous definition
mv -f .deps/ugrep-glob.Tpo .deps/ugrep-glob.Po
mv -f .deps/ugrep-zopen.Tpo .deps/ugrep-zopen.Po
vkey.cpp: In static member function 'static bool VKey::setup(int)':
vkey.cpp:805:5: error: 'cfmakeraw' was not declared in this scope
  805 |     cfmakeraw(&newterm);
      |     ^~~~~~~~~
make[2]: *** [Makefile:558: ugrep-vkey.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/ugrep-stats.Tpo .deps/ugrep-stats.Po
mv -f .deps/ugrep-screen.Tpo .deps/ugrep-screen.Po
mv -f .deps/ugrep-cnf.Tpo .deps/ugrep-cnf.Po
mv -f .deps/ugrep-output.Tpo .deps/ugrep-output.Po
mv -f .deps/ugrep-query.Tpo .deps/ugrep-query.Po
mv -f .deps/ugrep-ugrep.Tpo .deps/ugrep-ugrep.Po
make[2]: Leaving directory '/nobackup/SFW_build/ugrep-3.9.2/src'
make[1]: *** [Makefile:464: all-recursive] Error 1
make[1]: Leaving directory '/nobackup/SFW_build/ugrep-3.9.2'
make: *** [Makefile:364: all] Error 2
Failed to build ugrep: please run the following two commands:
$ autoreconf -fi
$ ./build.sh

Complaints about WITH_NO_MMAP happens several times, and then that error... Do I have to adjust anything?

With best regards.

3eka avatar Sep 13 '22 13:09 3eka

Strange to see this error. WITH_NO_MMAP is defined in ugrep.hpp as you can see, but this file is included at most once (protected by the usual #IFDEF). No idea what could cause this.

genivia-inc avatar Sep 19 '22 01:09 genivia-inc

I really don't understand this problem and cannot replicate this problem either. Perhaps you found a workaround or got help from the OpenIndiana OS folks?

genivia-inc avatar Dec 07 '22 20:12 genivia-inc

cfmakeraw() isn't available on Solaris: https://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html

barsnick avatar Jan 02 '23 22:01 barsnick

Thanks for the link. I suppose the following change to src/vkey.cpp fixes the problem:

  if (mode == VKey::TTYRAW)
  {
#ifdef __sun
    newterm.c_iflag &= ~(IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
    newterm.c_oflag &= ~OPOST;
    newterm.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
    newterm.c_cflag &= ~(CSIZE|PARENB);
    newterm.c_cflag |= CS8;
#else
    cfmakeraw(&newterm);
#endif
  }
  else
  {
    newterm.c_lflag &= ~(ECHO | ICANON);
  }

Please confirm with a test build.

genivia-inc avatar Jan 03 '23 17:01 genivia-inc

Thanks! I just have compiled it.

Best regards

3eka avatar Jan 05 '23 08:01 3eka