diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-02 11:05:13 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-02 11:05:13 +0000 |
commit | 14ac914460d95cc284b41bd11403d1ef2f7f5bf5 (patch) | |
tree | 474f34608ab902f9ddc5b7629c88676c03a26731 /config | |
parent | fcb13283797f0f8a65311110397396613ab9a93b (diff) | |
download | gcc-14ac914460d95cc284b41bd11403d1ef2f7f5bf5.tar.gz |
Introduce and use config/gcc-version.m4.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91625 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'config')
-rw-r--r-- | config/ChangeLog | 4 | ||||
-rw-r--r-- | config/gcc-version.m4 | 28 |
2 files changed, 32 insertions, 0 deletions
diff --git a/config/ChangeLog b/config/ChangeLog index 5e417bdd259..f560a9f8fcf 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2004-12-02 Richard Sandiford <rsandifo@redhat.com> + + * config/gcc-version.m4: New file. + 2004-09-24 Zack Weinberg <zack@codesourcery.com> * warnings.m4: New file. diff --git a/config/gcc-version.m4 b/config/gcc-version.m4 new file mode 100644 index 00000000000..8de74bb2a63 --- /dev/null +++ b/config/gcc-version.m4 @@ -0,0 +1,28 @@ +dnl Usage: TL_AC_GCC_VERSION(TOPSRCDIR) +dnl +dnl Set up the variables: +dnl +dnl gcc_version_trigger: pathname of gcc's version.c, if available +dnl gcc_version_full: full gcc version string +dnl gcc_version: the first "word" in $gcc_version_full +dnl +dnl TOPSRCDIR is the top-level source directory. +AC_DEFUN([TL_AC_GCC_VERSION], +[ +changequote(,)dnl +if test "${with_gcc_version_trigger+set}" = set; then + gcc_version_trigger=$with_gcc_version_trigger +else + gcc_version_trigger=$1/gcc/version.c +fi +if test -f "${gcc_version_trigger}"; then + gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'` +else + gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'` +fi +gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` +changequote([,])dnl +AC_SUBST(gcc_version_trigger) +AC_SUBST(gcc_version_full) +AC_SUBST(gcc_version) +])dnl |