hanslub42 / rlwrap

A readline wrapper
GNU General Public License v2.0
2.59k stars 151 forks source link

rlwrap configuration fails: cannot run C compiled programs #151

Closed jmangum closed 2 years ago

jmangum commented 2 years ago

Hello,

Tried to install on Mac OSX 10.15.7 with gcc 4.8.5. Configure exits with error:

cerussite:rlwrap-0.45.2 jmangum$ ./configure
checking build system type... x86_64-apple-darwin19.6.0
checking host system type... x86_64-apple-darwin19.6.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make sets $(MAKE)... (cached) yes
checking whether build environment is sane... yes
checking whether make supports the include directive... yes (GNU style)
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... configure: error: in `/Users/jmangum/Downloads/rlwrap-0.45.2':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

config.log suggests that gcc is the problem:

gcc version 4.8.5 (GCC)
configure:3514: $? = 0
configure:3503: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3514: $? = 1
configure:3503: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3514: $? = 1
configure:3534: checking whether the C compiler works
configure:3556: gcc    conftest.c  >&5
configure:3560: $? = 0
configure:3608: result: yes
configure:3611: checking for C compiler default output file name
configure:3613: result: a.out
configure:3619: checking for suffix of executables
configure:3626: gcc -o conftest    conftest.c  >&5
configure:3630: $? = 0
configure:3652: result:
configure:3674: checking whether we are cross compiling
configure:3682: gcc -o conftest    conftest.c  >&5
conftest.c:11:19: fatal error: stdio.h: No such file or directory
 #include <stdio.h>
                   ^
compilation terminated.
configure:3686: $? = 1
configure:3693: ./conftest
./configure: line 3695: ./conftest: No such file or directory
configure:3697: $? = 127
configure:3704: error: in `/Users/jmangum/Downloads/rlwrap-0.45.2':
configure:3706: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

-- Jeff

hanslub42 commented 2 years ago
conftest.c:11:19: fatal error: stdio.h: No such file or directory

This is not a rlwrap-specific problem: your toolchain is probably not setup correctly.

Issuing a

$  echo "#include <bogus.h>" | gcc -v -x c -

.... will reveal where gcc is looking for its #included files.

I'm not a Mac person, so I'm only guessing, but this article could be useful.

Closing (as non-rlwrap-specific)