autoconf-archive-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AX_BUILD_CC_FOR_BUILD broken?


From: Éric Hoffman
Subject: AX_BUILD_CC_FOR_BUILD broken?
Date: Tue, 28 Mar 2017 21:36:14 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

Hello

I'm not sure if I'm using the right terms here, please excuse me, as my knowledge of the internals of autoconf scripts doesn't reach too far beyond typing './autogen.sh' which invoke autoconf and convert the configure.am file to configure... :-)

I'm currently debugging a 3rd party project, which I'm compiling under Windows MinGW. The project Makefile.am uses a few instances of 'EXEEXT' and 'BUILD_EXEEXT'. However, the 'BUILD_EXEEXT' variable always turned out empty (where it should be '.exe').

I started debugging, and found out about the script responsible to define the 'BUILD_EXEEXT' variable, which is in autoconf-archive 'ax_prog_cc_for_build.m4'. I understood that this script basically just pushdef some 'important' definitions, disable cross-compilation (for the following test), re-call AC_PROG_CC, extract the 'BUILD_EXEEXT' from the results, and restore the 'important' definitions.

So, the idea is neat and simple, however, it does not seem to work as intended because when AC_PROG_CC_FOR_BUILD invoke the autoconf's AC_PROG_CC, the AC_PROG_CC macro (defined in c.m4) invoke _AC_COMPILER_EXEEXT (defined in lang.m4) with m4_expand_once.

So, the evaluation of executable extension occur only once for the whole configure script (and is not re-evaluated for the native build).

Regards,
Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]