[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch to record GCC revision in config.log
From: |
Mo DeJong |
Subject: |
Re: Patch to record GCC revision in config.log |
Date: |
Sat, 31 Mar 2001 17:56:12 -0800 (PST) |
On 30 Mar 2001, Akim Demaille wrote:
> >>>>> "Mo" == Mo DeJong <address@hidden> writes:
>
> Mo> Hello. Here is a little patch that will record the revision of a
> Mo> GNU compiler if one is detected in _AC_LANG_COMPILER_GNU. It is
> Mo> common for a user to report a build problem and not include the
> Mo> rev of the compiler they are using. By recording this info in
> Mo> config.log, we save ourselves the hassle of tracking the user down
> Mo> and having them run "gcc -v" at the command line.
> Still, the implementation is bizarre:
>
> + for compiler in $ac_compile ; do
> + break
> + done
Yeah, that was just a hack because autoconf does not
seem to store that name of the compiler executable
in a variable.
m4_define([AC_LANG(C)],
[ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ext $
LIBS >&AS_MESSAGE_LOG_FD'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
])
Stores it in CC.
m4_define([AC_LANG(C++)],
[ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ex
t $LIBS >&AS_MESSAGE_LOG_FD'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
])
Stores it in CXX.
It seems like there should be a "general" variable
that will report the name of the compiler that
works with both CC and CXX.
Something like:
ac_compiler=$CXX
(or)
ac_compiler=$CC
So that later, you could write:
ac_compile='$ac_compiler ...'
Or simply run:
$ac_compiler --version >> config.log
Mo DeJong
Red Hat Inc