[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Possible bug - AC_PROG_CC
From: |
Michael Ambrus |
Subject: |
Possible bug - AC_PROG_CC |
Date: |
Thu, 7 Dec 2006 17:18:05 +0100 |
It seems that AC_PROG_CC misbehaves if used inside a if-case, in which it
doesn't detects whether or not we try to use a cross compiler (and
$cross_compiling is not set to "yes"). In the example below, $USECPLUSPLUS
is "no" in both cases which is intentional.
#AC_PROG_CC
if test $USECPLUSPLUS != no; then
dnl Tries to use g++ as instructed. Should fall back on gcc if c++
is not available
AC_PROG_CXX
AC_PROG_CC(g++)
AC_LANG_CPLUSPLUS
dnl The TK_CPLUSPLUS macro in config.h will be set accordingly to
the result
AC_DEFINE_UNQUOTED([ESC_CPLUSPLUS],$GXX)
else
dnl Use gcc
AC_PROG_CC
AC_PROG_CC(gcc)
AC_LANG_C
fi
Case 1)
Verbatin as above the output will be the following:
...
install-sh exists... good!
checking for powerpc-eabisim-gcc... powerpc-eabisim-gcc
checking whether we are using the GNU C compiler... no
checking whether powerpc-eabisim-gcc accepts -g... no
checking for powerpc-eabisim-gcc option to accept ANSI C... none needed
checking for powerpc-eabisim-gcc... (cached) powerpc-eabisim-gcc
checking whether we are using the GNU C compiler... (cached) no
checking whether powerpc-eabisim-gcc accepts -g... (cached) no
checking for powerpc-eabisim-gcc option to accept ANSI C... (cached) none
needed
checking build system type... i686-pc-linux-gnu
checking host system type... powerpc-unknown-eabisim
checking target system type... powerpc-unknown-eabisim
configure: Build system CPU: i686
...
Case 2)
If the remark is removed (i.e. AC_PROG_CC is tested outside of the if-case),
It works OK:
...
install-sh exists... good!
checking for powerpc-eabisim-gcc... powerpc-eabisim-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether powerpc-eabisim-gcc accepts -g... yes
checking for powerpc-eabisim-gcc option to accept ANSI C... none needed
checking for powerpc-eabisim-gcc... (cached) powerpc-eabisim-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether powerpc-eabisim-gcc accepts -g... (cached) yes
checking for powerpc-eabisim-gcc option to accept ANSI C... (cached) none
needed
checking for powerpc-eabisim-gcc... (cached) powerpc-eabisim-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether powerpc-eabisim-gcc accepts -g... (cached) yes
checking for powerpc-eabisim-gcc option to accept ANSI C... (cached) none
needed
checking build system type... i686-pc-linux-gnu
...
The script containing the example above was called as follows: ./configure
--host=powerpc-eabisim
I'm not certain which version of autoconf is used since both autoconf2.13and
autoconf2.50 are installed on my system.
configure.in contains AC_PREREQ([2.59]), but if I try to set this to 2.13 I
get all sorts of other errors. Setting it to 2.50 produces the same as
mentioned above.
'autoconf -V' will respond 2.50 however...
Regards
/Michael
- Possible bug - AC_PROG_CC,
Michael Ambrus <=