As compiled in BLFS as of 20060209, GPM doesn't provide console mouse support for mouse-aware applications that expect to get mouse input via NCurses. E.g., it is impossible to click on buttons in Dialog while working on linux text console. This issue can be avoided by compiling GPM and NCurses as recommended by NCurses maintainer:
- Compile GPM with the --without-curses option passed to the configure script
- Recompile NCurses-5.5 as the LFS/HLFS/CLFS book says
It is possible to compile GPM just before NCurses while building LFS, with the same end result. The official LFS LiveCD is built this way.
This, however, creates a problem where applications (e.g. W3m) expecting the Gpm_Wgetch() function to be present stop compiling. Distributions work around the problem by compiling GPM the second time after NCurses, without the --without-curses option and with patches similar to this one, but NCurses maintainer doesn't welcome this.
If GPM is compiled with curses, it has a bug in signal handling. This bug manifests itself, e.g., as a lockup sometimes happening in W3m after clicking on a link on Linux text console. This patch fixes the issue. It is not needed if GPM is compiled without curses, because the code modified by the patch is completely disabled in this configuration.
With LFS SVN, GPM cannot copy and paste non-ASCII characters when the console is in UTF-8 mode. If you are going to use a UTF-8 based locale and to do a lot of copying and pasting, it is recommended that you don't install GPM, and use X Window system instead.
With LFS-6.2, this problem does not exist, because a kernel patch is applied. However, the patch is conceptually wrong, and thus rejected by kernel developers.
if you get 'error: 'OPEN_MAX' undeclared (first use in this function)' try
sed -i 's/OPEN_MAX/NR_OPEN/' src/special.c && sed -i 's/OPEN_MAX/NR_OPEN/' src/prog/gpm-root.y
With gpm-1.20.1 and Glibc 2.8 from LFS 6.4, compile fails with this error:
gpm.c: In function 'processConn': gpm.c:813: error: storage size of 'sucred' isn't known gpm.c:814: error: invalid application of 'sizeof' to incomplete type 'struct ucred' gpm.c:813: warning: unused variable 'sucred'
Configure with CFLAGS="-D_GNU_SOURCE" ./configure --prefix=/usr --sysconfdir=/etc to fix.