ugrep
ugrep copied to clipboard
Build failed on OpenIndiana
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.
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.
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?
cfmakeraw()
isn't available on Solaris:
https://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html
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.
Thanks! I just have compiled it.
Best regards