1 dnl Usage: TL_AC_GCC_VERSION(TOPSRCDIR)
3 dnl Set up the variables:
5 dnl gcc_version_trigger: pathname of gcc's version.c, if available
6 dnl gcc_version_full: full gcc version string
7 dnl gcc_version: the first "word" in $gcc_version_full
9 dnl TOPSRCDIR is the top-level source directory.
10 AC_DEFUN([TL_AC_GCC_VERSION],
13 if test "${with_gcc_version_trigger+set}" = set; then
14 gcc_version_trigger=$with_gcc_version_trigger
16 gcc_version_trigger=$1/gcc/version.c
18 if test -f "${gcc_version_trigger}"; then
19 gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'`
21 gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'`
23 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
25 AC_SUBST(gcc_version_trigger)
26 AC_SUBST(gcc_version_full)