crigler / dtach

A simple program that emulates the detach feature of screen
GNU General Public License v2.0
476 stars 50 forks source link

Make issue: using -traditional without -E #4

Closed Jiehong closed 8 years ago

Jiehong commented 8 years ago

Hello,

Here, when trying to compile dtach, gcc conplains that -traditional no longer works without -E.

GCC version used is 4.3.2.

Here is the complete error message:

gcc -traditional -L/opt/Python-2.7/lib -L/opt/Python-2.7/lib  -W -Wall -I.   -c -o attach.o attach.c
gcc: GNU C no longer supports -traditional without -E
make: *** [attach.o] Error 1

Adding the option in Makefile solve this issue though.

But, then it won't compile with the following error:

gcc -traditional -E -L/opt/Python-2.7/lib -L/opt/Python-2.7/lib  -W -Wall -I.   -c -o attach.o attach.c
In file included from /usr/include/features.h:348,
                 from /usr/include/errno.h:30,
                 from dtach.h:25,
                 from attach.c:20:
/usr/include/sys/cdefs.h:32: error: #error "You need a ISO C conforming compiler to use the glibc headers"
In file included from dtach.h:26,
                 from attach.c:20:
/usr/include/fcntl.h:183: error: #else after #else
/usr/include/fcntl.h:175: error: the conditional began here
/usr/include/fcntl.h:204: error: #else after #else
/usr/include/fcntl.h:197: error: the conditional began here
/usr/include/fcntl.h:211: error: #endif without #if
/usr/include/fcntl.h:222: error: #endif without #if
attach.c:61: error: detected recursion whilst expanding macro "SOCK_STREAM"
make: *** [attach.o] Error 1

I'm unsure why this is failing though.

Jiehong commented 8 years ago

I forgot to add the version of dtach I'm trying to build: v0.9 (tag).

Jiehong commented 8 years ago

I'd like to attach the output of ./configure, as it may be useful.

checking for gcc... gcc
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... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /projects/secdelde/bin/ggrep
checking for egrep... /projects/secdelde/bin/ggrep -E
checking whether gcc needs -traditional... yes
checking for openpty in -lutil... no
checking for socket in -lsocket... no
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking fcntl.h usability... no
checking fcntl.h presence... yes
configure: WARNING: fcntl.h: present but cannot be compiled
configure: WARNING: fcntl.h:     check for missing prerequisite headers?
configure: WARNING: fcntl.h: see the Autoconf documentation
configure: WARNING: fcntl.h:     section "Present But Cannot Be Compiled"
configure: WARNING: fcntl.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for fcntl.h... no
checking sys/select.h usability... no
checking sys/select.h presence... yes
configure: WARNING: sys/select.h: present but cannot be compiled
configure: WARNING: sys/select.h:     check for missing prerequisite headers?
configure: WARNING: sys/select.h: see the Autoconf documentation
configure: WARNING: sys/select.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/select.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for sys/select.h... no
checking sys/socket.h usability... no
checking sys/socket.h presence... yes
configure: WARNING: sys/socket.h: present but cannot be compiled
configure: WARNING: sys/socket.h:     check for missing prerequisite headers?
configure: WARNING: sys/socket.h: see the Autoconf documentation
configure: WARNING: sys/socket.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/socket.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for sys/socket.h... no
checking sys/time.h usability... no
checking sys/time.h presence... yes
configure: WARNING: sys/time.h: present but cannot be compiled
configure: WARNING: sys/time.h:     check for missing prerequisite headers?
configure: WARNING: sys/time.h: see the Autoconf documentation
configure: WARNING: sys/time.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/time.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for sys/time.h... no
checking sys/ioctl.h usability... no
checking sys/ioctl.h presence... yes
configure: WARNING: sys/ioctl.h: present but cannot be compiled
configure: WARNING: sys/ioctl.h:     check for missing prerequisite headers?
configure: WARNING: sys/ioctl.h: see the Autoconf documentation
configure: WARNING: sys/ioctl.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/ioctl.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for sys/ioctl.h... no
checking sys/resource.h usability... no
checking sys/resource.h presence... yes
configure: WARNING: sys/resource.h: present but cannot be compiled
configure: WARNING: sys/resource.h:     check for missing prerequisite headers?
configure: WARNING: sys/resource.h: see the Autoconf documentation
configure: WARNING: sys/resource.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/resource.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for sys/resource.h... no
checking pty.h usability... no
checking pty.h presence... yes
configure: WARNING: pty.h: present but cannot be compiled
configure: WARNING: pty.h:     check for missing prerequisite headers?
configure: WARNING: pty.h: see the Autoconf documentation
configure: WARNING: pty.h:     section "Present But Cannot Be Compiled"
configure: WARNING: pty.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for pty.h... no
checking termios.h usability... no
checking termios.h presence... yes
configure: WARNING: termios.h: present but cannot be compiled
configure: WARNING: termios.h:     check for missing prerequisite headers?
configure: WARNING: termios.h: see the Autoconf documentation
configure: WARNING: termios.h:     section "Present But Cannot Be Compiled"
configure: WARNING: termios.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for termios.h... no
checking util.h usability... no
checking util.h presence... no
checking for util.h... no
checking libutil.h usability... no
checking libutil.h presence... no
checking for libutil.h... no
checking stropts.h usability... no
checking stropts.h presence... yes
configure: WARNING: stropts.h: present but cannot be compiled
configure: WARNING: stropts.h:     check for missing prerequisite headers?
configure: WARNING: stropts.h: see the Autoconf documentation
configure: WARNING: stropts.h:     section "Present But Cannot Be Compiled"
configure: WARNING: stropts.h: proceeding with the compiler's result
configure: WARNING:     ## -------------------------------------------- ##
configure: WARNING:     ## Report this to crigler@users.sourceforge.net ##
configure: WARNING:     ## -------------------------------------------- ##
checking for stropts.h... no
checking whether time.h and sys/time.h may both be included... no
checking for an ANSI C-conforming const... no
checking for pid_t... no
checking for ssize_t... no
checking return type of signal handlers... void
checking for atexit... no
checking for dup2... no
checking for memset... no
checking for select... no
checking for socket... no
checking for strerror... no
checking for openpty... no
checking for forkpty... no
checking for ptsname... no
checking for grantpt... no
checking for unlockpt... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
rdebath commented 8 years ago

Those -L/opt/Python-2.7/lib items are not normally there. But the odd ones are the use of ggrep most modern OSs have a good enough /usr/bin/grep. And the result of the 'Traditional' test; it should only fail on ancient Unix variants.

There will be a config.log file in the directory with lots of details; you'll need to upload that somewhere.

Jiehong commented 8 years ago

It's on a Suse Linux Enterprise Server 11 SP1, with Linux 2.6.32.23.

So, yeah, it isn't that new, but can't change that though.

ggrep is calling grep behind (version 2.5.2).

Here is my config.log file (cleaned a bit): https://framadrop.org/r/RzK-UvhQ6D#fgzfV8IKGN051vo7ejPtp5FdErco0CO8DNGiJJRSF4k=

Thank you for your kind help :)

rdebath commented 8 years ago

Oooo, is that ggrep a shell script? Is it preserving the exit status of grep correctly? Can you try ...

ac_cv_path_GREP=/bin/grep  ./configure
Jiehong commented 8 years ago

You are right. It does work with forcing the value of ac_cv_path_GREP.

Checking the shell script of ggrep confirms your hypothesis: the return status is not preserved.

I'm closing this ticket then.

Thanks a lot!