bugGNU Screen - Bugs: bug #66139, Building in a subdirectory fails

 
 

bug #66139: Building in a subdirectory fails

Submitter:  Rudi Heitbaum <heitbaum>
Submitted:  Thu 29 Aug 2024 10:06:47 AM UTC
   
 
Category:  Build/Install Severity:  3 - Normal
Priority:  * 1 - Later Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release:  5.0.0
Fixed Release:  None Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 29 Aug 2024 06:28:49 PM UTC, comment #9: 

These commands should reproduce the error

tar xvf screen-5.0.0.tar.gz
cd screen-5.0.0
mkdir .x86_64-libreelec-linux-gnu
cd .x86_64-libreelec-linux-gnu
../configure --host=x86_64-libreelec-linux-gnu --build=x86_64-linux-gnu --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var ac_cv_header_utempter_h=no --disable-pam --disable-telnet --disable-socket-dir
make

Rudi Heitbaum <heitbaum>
Thu 29 Aug 2024 06:26:49 PM UTC, comment #8: 

Here is the patch that allows the build in the subdirectory.

diff -Nu screen-5.0.0/display.c screen-5.0.0/display.c
--- screen-5.0.0/display.c      2024-08-28 19:55:03.000000000 +0000
+++ screen-5.0.0/display.c      2024-08-29 18:08:34.942979909 +0000
@@ -47,7 +47,7 @@
 #include "mark.h"
 #include "misc.h"
 #include "process.h"
-#include "pty.h"
+#include "screen-pty.h"
 #include "resize.h"
 #include "termcap.h"
 #include "tty.h"
diff -Nu screen-5.0.0/Makefile.in screen-5.0.0/Makefile.in
--- screen-5.0.0/Makefile.in    2024-08-28 19:55:03.000000000 +0000
+++ screen-5.0.0/Makefile.in    2024-08-29 18:10:05.120409357 +0000
@@ -66,7 +66,7 @@
        $(CC) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
 
 .c.o:
-       $(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
+       $(CC) -c -I$(srcdir) $(CPPFLAGS) $(CFLAGS) $< -o $@
 
 check: $(TESTBIN)
        for f in $(TESTBIN); do \
@@ -197,12 +197,12 @@
  logfile.h mark.h input.h
 tty.o: tty.c config.h screen.h os.h ansi.h sched.h acls.h comm.h layer.h \
  term.h image.h canvas.h display.h layout.h viewport.h window.h logfile.h \
- fileio.h misc.h pty.h telnet.h tty.h
+ fileio.h misc.h screen-pty.h telnet.h tty.h
 term.o: term.c term.h
 window.o: window.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
  layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
  logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h fileio.h help.h \
- input.h mark.h misc.h process.h pty.h resize.h telnet.h termcap.h tty.h \
+ input.h mark.h misc.h process.h screen-pty.h resize.h telnet.h termcap.h tty.h \
  utmp.h
 utmp.o: utmp.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
  layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
@@ -229,7 +229,7 @@
 display.o: display.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
  layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
  logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h encoding.h mark.h \
- misc.h process.h pty.h resize.h termcap.h tty.h
+ misc.h process.h screen-pty.h resize.h termcap.h tty.h
 comm.o: comm.c config.h os.h screen.h ansi.h sched.h acls.h comm.h \
  layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
  logfile.h
diff -Nu screen-5.0.0/pty.c screen-5.0.0/pty.c
--- screen-5.0.0/pty.c  2024-08-28 19:55:03.000000000 +0000
+++ screen-5.0.0/pty.c  2024-08-29 18:09:06.889919017 +0000
@@ -28,7 +28,7 @@
 
 #include "config.h"
 
-#include "pty.h"
+#include "screen-pty.h"
 
 #include <sys/ioctl.h>
 
diff -Nu screen-5.0.0/pty.h screen-5.0.0/pty.h
--- screen-5.0.0/pty.h  2024-08-28 19:55:03.000000000 +0000
+++ screen-5.0.0/pty.h  1970-01-01 00:00:00.000000000 +0000
@@ -1,11 +0,0 @@
-#ifndef SCREEN_PTY_H
-#define SCREEN_PTY_H
-
-int   OpenPTY (char **);
-int  ClosePTY (int);
-
-/* global variables */
-
-extern int pty_preopen;
-
-#endif /* SCREEN_PTY_H */
diff -Nu screen-5.0.0/screen-pty.h screen-5.0.0/screen-pty.h
--- screen-5.0.0/screen-pty.h   1970-01-01 00:00:00.000000000 +0000
+++ screen-5.0.0/screen-pty.h   2024-08-28 19:55:03.000000000 +0000
@@ -0,0 +1,11 @@
+#ifndef SCREEN_PTY_H
+#define SCREEN_PTY_H
+
+int   OpenPTY (char **);
+int  ClosePTY (int);
+
+/* global variables */
+
+extern int pty_preopen;
+
+#endif /* SCREEN_PTY_H */
diff -Nu screen-5.0.0/tty.c screen-5.0.0/tty.c
--- screen-5.0.0/tty.c  2024-08-28 19:55:03.000000000 +0000
+++ screen-5.0.0/tty.c  2024-08-29 18:09:19.073355563 +0000
@@ -44,7 +44,7 @@
 #include "screen.h"
 #include "fileio.h"
 #include "misc.h"
-#include "pty.h"
+#include "screen-pty.h"
 #include "telnet.h"
 #include "tty.h"
 
diff -Nu screen-5.0.0/window.c screen-5.0.0/window.c
--- screen-5.0.0/window.c       2024-08-28 19:55:03.000000000 +0000
+++ screen-5.0.0/window.c       2024-08-29 18:14:12.542433618 +0000
@@ -48,7 +48,7 @@
 #include "mark.h"
 #include "misc.h"
 #include "process.h"
-#include "pty.h"
+#include "screen-pty.h"
 #include "resize.h"
 #include "telnet.h"
 #include "termcap.h"

Rudi Heitbaum <heitbaum>
Thu 29 Aug 2024 06:12:25 PM UTC, comment #7: 


comment #6:

> Can you try please building from the .abc sub directory? I’m pretty sure you will have the same issue.


Ok, let's do it in this way: put the commands here and I will try to repeat it (reproduce it). If I will not be able to reproduce it, I will close this report.

Alexander Naumov <anaumov>
Group administrator
Thu 29 Aug 2024 06:04:26 PM UTC, comment #6: 

Can you try please building from the .abc sub directory? I’m pretty sure you will have the same issue.

I have compared the Makefile.in between 4.9.1 and 5.0.0 and found the difference,

-I. -I$(srcdir) has been removed from the .c.o target (so the “” includes are no longer found.) note there are other issues when adding this back to the Makefile.in - as pty.h conflicts with the /usr/include pty.h when -I. -I$(srcdir) is added back.

Rudi Heitbaum <heitbaum>
Thu 29 Aug 2024 05:36:54 PM UTC, comment #5: 

Sorry, Rudi, I don't understand why your /var/media/... PATH is broken. But I think the problem is not on source code of screen.

Alexander Naumov <anaumov>
Group administrator
Thu 29 Aug 2024 05:29:31 PM UTC, comment #4: 

The build for me works fine in the source directory for me too.
$ pwd
/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0
$ ./configure --host=x86_64-libreelec-linux-gnu --build=x86_64-linux-gnu --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var ac_cv_header_utempter_h=no --disable-pam --disable-telnet --disable-socket-dir
$ make
—> success

$ pwd
/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/.x86_64-libreelec-linux-gnu
$ ../configure --host=x86_64-libreelec-linux-gnu --build=x86_64-linux-gnu --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var ac_cv_header_utempter_h=no --disable-pam --disable-telnet --disable-socket-dir
$ make
—> fail


Here is the output of the build directory ** note: I edited comm.h and kmapdef.c to refer to ../ to allow the includes to work. And thus the compile completing. (Looking at the 4.9.1 code base - comm.h and kmapdef.c did not include .h files.)

$ pwd
/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/.x86_64-libreelec-linux-gnu

$ ls -la
total 1984
drwxr-xr-x  3 docker docker   4096 Aug 29 17:19 .
drwxr-xr-x 10 docker docker   4096 Aug 29 17:18 ..
-rw-r--r--  1 docker docker  16208 Aug 29 17:19 acls.o
-rw-r--r--  1 docker docker  61920 Aug 29 17:19 ansi.o
-rw-r--r--  1 docker docker  17192 Aug 29 17:19 attacher.o
-rw-r--r--  1 docker docker   4696 Aug 29 17:19 backtick.o
-rw-r--r--  1 docker docker  16672 Aug 29 17:19 canvas.o
-r--r--r--  1 docker docker   5772 Aug 29 17:19 comm.h
-rw-r--r--  1 docker docker  11664 Aug 29 17:19 comm.o
-rw-r--r--  1 docker docker   6699 Aug 29 17:18 config.h
-rw-r--r--  1 docker docker  46977 Aug 29 17:19 config.log
-rwxr-xr-x  1 docker docker  30154 Aug 29 17:19 config.status
-rwxr-xr-x  1 docker docker 179821 Aug 29 17:19 configure.lineno
-rw-r--r--  1 docker docker  86984 Aug 29 17:19 display.o
drwxr-xr-x  2 docker docker   4096 Aug 29 17:19 doc
-rw-r--r--  1 docker docker  26912 Aug 29 17:19 encoding.o
-rw-r--r--  1 docker docker  23048 Aug 29 17:19 fileio.o
-rw-r--r--  1 docker docker  14336 Aug 29 17:19 help.o
-rw-r--r--  1 docker docker  10488 Aug 29 17:19 input.o
-r--r--r--  1 docker docker   1126 Aug 29 17:19 kmapdef.c
-rw-r--r--  1 docker docker   4672 Aug 29 17:19 kmapdef.o
-rw-r--r--  1 docker docker  21912 Aug 29 17:19 layer.o
-rw-r--r--  1 docker docker   9464 Aug 29 17:19 layout.o
-rw-r--r--  1 docker docker   6112 Aug 29 17:19 list_display.o
-rw-r--r--  1 docker docker  12760 Aug 29 17:19 list_generic.o
-rw-r--r--  1 docker docker   5960 Aug 29 17:19 list_license.o
-rw-r--r--  1 docker docker  16456 Aug 29 17:19 list_window.o
-rw-r--r--  1 docker docker   5640 Aug 29 17:19 logfile.o
-rw-r--r--  1 docker docker  12430 Aug 29 17:19 Makefile
-rw-r--r--  1 docker docker  30336 Aug 29 17:19 mark.o
-rw-r--r--  1 docker docker   6400 Aug 29 17:19 misc.o
-rw-r--r--  1 docker docker 224696 Aug 29 17:19 process.o
-rw-r--r--  1 docker docker   1840 Aug 29 17:19 pty.o
-rw-r--r--  1 docker docker  20376 Aug 29 17:19 resize.o
-rw-r--r--  1 docker docker   4440 Aug 29 17:19 sched.o
-rwxr-xr-x  1 docker docker 712576 Aug 29 17:19 screen
-rw-r--r--  1 docker docker  65256 Aug 29 17:19 screen.o
-rw-r--r--  1 docker docker   7912 Aug 29 17:19 search.o
-rw-r--r--  1 docker docker  38992 Aug 29 17:19 socket.o
-rw-r--r--  1 docker docker    928 Aug 29 17:19 telnet.o
-rw-r--r--  1 docker docker  40448 Aug 29 17:19 termcap.o
-r--r--r--  1 docker docker   7250 Aug 29 17:18 term.h
-rw-r--r--  1 docker docker   9896 Aug 29 17:19 term.o
-rw-r--r--  1 docker docker  17352 Aug 29 17:19 tty.o
-rw-r--r--  1 docker docker   1496 Aug 29 17:19 utmp.o
-rw-r--r--  1 docker docker   1880 Aug 29 17:19 viewport.o
-rw-r--r--  1 docker docker  43496 Aug 29 17:19 window.o
-rw-r--r--  1 docker docker   5448 Aug 29 17:19 winmsgbuf.o
-rw-r--r--  1 docker docker   1952 Aug 29 17:19 winmsgcond.o



Rudi Heitbaum <heitbaum>
Thu 29 Aug 2024 11:36:40 AM UTC, comment #3: 

comment #2:

> The build is on Ubuntu 24.04 - these steps should be able to reproduce the errors.
>
> mkdir .x86_64-libreelec-linux-gnu
> cd .x86_64-libreelec-linux-gnu
> ../configure --host=x86_64-libreelec-linux-gnu --build=x86_64-linux-gnu --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var ac_cv_header_utempter_h=no --disable-pam --disable-telnet --disable-socket-dir
> make
>


% ./configure --host=x86_64-libreelec-linux-gnu --build=x86_64-linux-gnu --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var ac_cv_header_utempter_h=no --disable-pam --disable-telnet --disable-socket-dir
checking for x86_64-libreelec-linux-gnu-gcc... no
checking for gcc... gcc
configure: WARNING: using cross tools not prefixed with host triplet
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for x86_64-libreelec-linux-gnu-gcc... gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking for gawk... gawk
checking for a BSD-compatible install... /usr/bin/install -c
checking for execvpe... yes
checking for seteuid... yes
checking for setegid... yes
checking for setreuid... yes
checking for setresuid... yes
checking for library containing tgetent... -lcurses
checking for library containing crypt... -lcrypt
checking for pty.h... yes
checking for util.h... no
checking for libutil.h... no
checking for library containing openpty... none required
checking for library containing socket... none required
checking for langinfo.h... yes
checking for dirent.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating config.h

Configuration:

 PAM support: .............................. no
 telnet support: ........................... no
 utmp support: ............................. no
 global socket directory: .................. no

 system screenrc location: ................. /etc/screenrc
 pty mode: ................................. 0622
 pty group: ................................ 5
 pty on read only file system: ............. no

!!! WARNING !!!
YOU ARE DISABLING PAM SUPPORT!
FOR screen TO WORK IT WILL NEED TO RUN AS SUID root BINARY
THIS CONFIGURATION IS _HIGHLY_ NOT RECOMMENDED!
!!! WARNING !!!

% make
...


% echo $?
0

% ls -la screen
-rwxrwxr-x 1 alex alex 1707048 Aug 29 13:30 screen


I have to take a close look, but right now it looks everything fine. I tested tarball, not the git version.
Can you try to build it without/outside docker?

Alexander Naumov <anaumov>
Group administrator
Thu 29 Aug 2024 11:10:58 AM UTC, comment #2: 

Thanks for taking a look.

The configure has been done in the subdirectory. Whilst the headers are in the srcdir (and an edit to the .h and .c file respectively added ../ to the lines does allow the compile to succeed.  For some reason make is not honouring the VPATH for these 2  headers.

The build is on Ubuntu 24.04 - these steps should be able to reproduce the errors.

mkdir .x86_64-libreelec-linux-gnu
cd .x86_64-libreelec-linux-gnu
../configure --host=x86_64-libreelec-linux-gnu --build=x86_64-linux-gnu --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var ac_cv_header_utempter_h=no --disable-pam --disable-telnet --disable-socket-dir
make

==

$ pwd
/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/.x86_64-libreelec-linux-gnu

$ ls -la
total 312
drwxr-xr-x  3 docker docker   4096 Aug 29 10:52 .
drwxr-xr-x 10 docker docker   4096 Aug 29 10:39 ..
-r--r--r--  1 docker docker   5769 Aug 29 10:39 comm.h
-rw-r--r--  1 docker docker   6699 Aug 29 10:39 config.h
-rw-r--r--  1 docker docker  46977 Aug 29 10:52 config.log
-rwxr-xr-x  1 docker docker  30154 Aug 29 10:52 config.status
-rwxr-xr-x  1 docker docker 179821 Aug 29 10:52 configure.lineno
drwxr-xr-x  2 docker docker   4096 Aug 29 10:52 doc
-r--r--r--  1 docker docker   1123 Aug 29 10:39 kmapdef.c
-rw-r--r--  1 docker docker  12430 Aug 29 10:52 Makefile
-r--r--r--  1 docker docker   7250 Aug 29 10:39 term.h

$ head config.log �������������������������������������������������������������������������������������������������������
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU Screen configure 5.0.0, which was
generated by GNU Autoconf 2.72.  Invocation command line was

   $ /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/configure --host=x86_64-libreelec-linux-gnu --build=x86_64-linux-gnu --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var ac_cv_header_utempter_h=no --disable-pam --disable-telnet --disable-socket-dir

## --------- ##
## Platform. ##

$ head Makefile
#
# Makefile template for screen
#
# See machine dependant config.h for more configuration options.
#

srcdir = /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0
VPATH = /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0

DESTDIR =

Rudi Heitbaum <heitbaum>
Thu 29 Aug 2024 10:25:14 AM UTC, comment #1: 

Thanks for reporting.

What OS do you use? How exactly do you try to build/install it. Add commands you did (step-by-step flow).

Both headers should be in tarball.

Alexander Naumov <anaumov>
Group administrator
Thu 29 Aug 2024 10:06:47 AM UTC, original submission:  

When building in a subdirectory - the build of 5.0.0 fails to find the following 2 headers

/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc -c -iquote. -DSCREENENCODINGS='"/usr/share/screen/utf8encodings"' -DBUILD_DATE='"2024-08-29 09:08:40"' -march=x86-64-v3 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -Wall -Wextra -std=c17 /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/screen.c -o screen.o
In file included from /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/display.h:36,
                 from /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/window.h:42,
                 from /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/screen.h:72,
                 from /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/screen-5.0.0/screen.c:33:
./comm.h:8:10: fatal error: acls.h: No such file or directory
    8 | #include "acls.h"
      |          ^~~~~~~~


/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc -c -iquote. -DSCREENENCODINGS='"/usr/share/screen/utf8encodings"' -DBUILD_DATE='"2024-08-29 09:08:43"' -march=x86-64-v3 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -Wall -Wextra -std=c17 kmapdef.c -o kmapdef.o
kmapdef.c:5:10: fatal error: kmapdef.h: No such file or directory
    5 | #include "kmapdef.h"
      |          ^~~~~~~~~~~

Rudi Heitbaum <heitbaum>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by anaumov (Posted a comment)
  • -email is unavailable- added by heitbaum (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-08-29 anaumov Priority5 - Normal 1 - Later
    2024-08-29 anaumov StatusNeed Info Works For Me
    2024-08-29 anaumov StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-5884.
    Corresponding source code