* configure.ac: fixed detection of yylex_destroy availability

by checking the version number of flex


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1049 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Rene Liebscher 2012-01-30 20:47:26 +00:00
parent 0b92bf9a17
commit 0cbe3c4705
2 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-01-30 Rene Liebscher <R.Liebscher@gmx.de>
* configure.ac: fixed detection of yylex_destroy availability
by checking the version number of flex
2012-01-30 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* lexer.l: Replace the old, now-defunct #define YY_NO_UNPUT by

View File

@ -37,6 +37,7 @@ AM_CONFIG_HEADER(ac_cfg.h)
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_SED
AC_PROG_YACC
AC_PROG_LEX
AC_PROG_RANLIB
@ -44,7 +45,26 @@ AH_TEMPLATE([HAVE_YYLEX_DESTROY],
[Define if lex/flex has yylex_destroy])
# flex should have this
if test "x$LEX" == xflex; then
AC_MSG_CHECKING([whether yylex_destroy is generated by flex])
flex_version=`$LEX -V -v --version 2>/dev/null | $SED -e 's/^.* //'`
case $flex_version in
[[0-1].*)]
AC_MSG_RESULT([version $flex_version => no])
;;
[2.[0-4].*)]
AC_MSG_RESULT([version $flex_version => no])
;;
[2.5.[0-8])]
AC_MSG_RESULT([version $flex_version => no])
;;
[2.5.[0-8][A-Za-z]*)]
AC_MSG_RESULT([version $flex_version => no])
;;
*)
AC_MSG_RESULT([version $flex_version => yes])
AC_DEFINE([HAVE_YYLEX_DESTROY])
;;
esac
fi
dnl Makefile.am:77: compiling `config_gram.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'