Hi all:

I am using the following Autoconf project:

https://github.com/rdiez/DebugDue/blob/master/Project/configure.ac

AC_NO_EXECUTABLES is still not documented, so I wanted to avoid it if possible, 
in case it changes or goes away in the future. Another reason is that I am 
expanding configure.ac to optionally build an executable for the Linux host, in 
order to run the test suite on the faster host, instead of on the slower ARM 
embedded target. When building for the host, AC_NO_EXECUTABLES is unnecessary, 
and probably undesirable.

I discovered that, if I pass -nostartfiles to my self-built toolchain 
(arm-none-eabi-gcc, the toolchain makefile is in the same GitHub project), then 
GCC builds executables which do not actually work for my target, but which are 
enough for the Autoconf probing, and AC_NO_EXECUTABLES is no longer required.

In order to implement this properly in configure.ac, I would have to pass 
-nostartfiles just for the probing in AC_PROG_CC, but not when building later 
on. This is not so easy, or perhaps I am only confused.

AC_PROG_CC seems to ignore CFLAGS when probing the compiler. I would have to set CC beforehand to 
"arm-none-eabi-gcc -nostartfiles", but then AC_PROG_CC is the one which finds out the 
right compiler to use (arm-none-eabi-gcc) based on the ./configure flag 
"--host=arm-none-eabi". So I do not have the compiler beforehand, in order to set CC 
accordingly.

Then there is the question about removing "-nostartfiles" from CC after the 
probing but before compilation.

Can anybody help?

The next thing I tried is to call AC_CANONICAL_HOST early, and then call 
AC_NO_EXECUTABLES depending on the value of $cross_compiling. The aim is to 
call AC_NO_EXECUTABLES when cross-compiling, but not when compiling for the 
host. But that did not work. Allegedly, AC_NO_EXECUTABLES is a macro which 
alters how AC_PROG_CC is expanded, so you cannot implement that kind logic in 
configure.ac . Is that right?

Thanks in advance,
  rdiez

Reply via email to