2003-04-13 Jan Nieuwenhuizen <janneke@gnu.org>
+ * flex-2.5.31 hits Debian/unstable. Fixes below.
+
+ * lily/lexer.ll (avoid_silly_flex_induced_gcc_warnings): Disable.
+
+ * lily/includable-lexer.cc [!HAVE_FLEXLEXER_YY_CURRENT_BUFFER]
+ (yy_current_buffer): New macro, compile hacks for flex 2.5.29.
+
+ * lily/include/includable-lexer.hh:
+ * lily/lexer.ll: Hack for multiple include of FlexLexer.h.
+
+ * config.hh.in (HAVE_FLEXLEXER_YY_CURRENT_BUFFER): Add.
+
+ * aclocal.m4: Regenerate.
+
+ * stepmake/aclocal.m4 (STEPMAKE_FLEXLEXER): Check for
+ yyFlexLexer.yy_current_buffer, which was removed in flex-2.5.29.
+
* scm/pdf.scm (use-modules): Include lily.
* scm/pdftex.scm (start-system): Bugfix: add closing brace (Beernd
dnl aclocal.m4 -*-shell-script-*-
dnl WARNING WARNING WARNING
-dnl do not edit! this is aclocal.m4, generated from /users/hanwen/usr/src/lilypond/stepmake/aclocal.m4
+dnl do not edit! this is aclocal.m4, generated from /home/janneke/lily/stepmake/aclocal.m4
dnl aclocal.m4 -*-shell-script-*-
dnl StepMake subroutines for configure.in
warn='FlexLexer.h (flex package)'
STEPMAKE_ADD_ENTRY($1, $warn)
fi
+ # check for yyFlexLexer.yy_current_buffer,
+ # in 2.5.4 <= flex < 2.5.29
+ AC_LANG_PUSH(C++)
+ AC_CACHE_CHECK([for yyFlexLexer.yy_current_buffer],
+ [stepmake_flexlexer_yy_current_buffer],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <FlexLexer.h>
+class yy_flex_lexer: public yyFlexLexer
+{
+ public:
+ yy_flex_lexer ()
+ {
+ yy_current_buffer = 0;
+ }
+};
+]])],
+ [stepmake_flexlexer_yy_current_buffer=yes],
+ [stepmake_flexlexer_yy_current_buffer=no]))
+ if test $stepmake_flexlexer_yy_current_buffer = yes; then
+ AC_DEFINE(HAVE_FLEXLEXER_YY_CURRENT_BUFFER, 1, [Define to 1 if yyFlexLexer has yy_current_buffer.])
+ fi
+ AC_LANG_POP(C++)
])
/* define if you have vsnprintf */
#define HAVE_VSNPRINTF 0
+/* define if you have yyFlexLexer.yy_current_buffer */
+#undef HAVE_FLEXLEXER_YY_CURRENT_BUFFER
+
/* define if you have gettext */
#define HAVE_GETTEXT 0
#define YYSTATE YY_START
#endif
+/* Flex >= 2.5.29 has include stack; but we don't use that yet. */
+#ifndef HAVE_FLEXLEXER_YY_CURRENT_BUFFER
+#define yy_current_buffer \
+ (yy_buffer_stack != 0 ? yy_buffer_stack[yy_buffer_stack_top] : 0)
+#endif
+
Includable_lexer::Includable_lexer ()
{
+#ifdef HAVE_FLEXLEXER_YY_CURRENT_BUFFER
yy_current_buffer = 0;
+#endif
allow_includes_b_ = true;
}
if (verbose_global_b)
progress_indication ("]");
yy_delete_buffer (yy_current_buffer);
+#ifdef HAVE_FLEXLEXER_YY_CURRENT_BUFFER
yy_current_buffer = 0;
+#endif
if (state_stack_.empty ())
{
+#ifdef HAVE_FLEXLEXER_YY_CURRENT_BUFFER
yy_current_buffer = 0;
+#endif
return false;
}
else
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-
#ifndef INCLUDABLE_LEXER_HH
#define INCLUDABLE_LEXER_HH
+#ifndef LEXER_CC
using namespace std;
#include <FlexLexer.h>
+#endif
#include "string.hh"
#include "parray.hh"
#ifndef LEXER_HH
#define LEXER_HH
-using namespace std;
-#include <FlexLexer.h>
+#include "includable-lexer.hh"
#include "input.hh"
#include "dictionary.hh"
#include "flower-proto.hh"
#include "array.hh"
#include "string.hh"
-#include "includable-lexer.hh"
#include "duration.hh"
#include "pitch.hh"
#include "protected-scm.hh"
%{ // -*-Fundamental-*-
/*
- lexer.l -- implement the Flex lexer
+ lexer.ll -- implement the Flex lexer
source file of the LilyPond music typesetter
#include <ctype.h>
#include <errno.h>
+/* Flex >= 2.5.29 fix; FlexLexer.h's multiple include bracing breaks
+ when building the actual lexer. */
+#define LEXER_CC
+
#include <iostream>
using namespace std;
return gh_cons (gh_int2scm (n), gh_int2scm (d));
}
+// Breaks for flex 2.5.31
+#if 0
/* avoid silly flex induced gcc warnings */
static void yy_push_state (int) {;}
static void yy_pop_state () {;}
yy_top_state ();
avoid_silly_flex_induced_gcc_warnings ();
}
+#endif
SCM
lookup_markup_command (String s)
warn='FlexLexer.h (flex package)'
STEPMAKE_ADD_ENTRY($1, $warn)
fi
+ # check for yyFlexLexer.yy_current_buffer,
+ # in 2.5.4 <= flex < 2.5.29
+ AC_LANG_PUSH(C++)
+ AC_CACHE_CHECK([for yyFlexLexer.yy_current_buffer],
+ [stepmake_flexlexer_yy_current_buffer],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <FlexLexer.h>
+class yy_flex_lexer: public yyFlexLexer
+{
+ public:
+ yy_flex_lexer ()
+ {
+ yy_current_buffer = 0;
+ }
+};
+]])],
+ [stepmake_flexlexer_yy_current_buffer=yes],
+ [stepmake_flexlexer_yy_current_buffer=no]))
+ if test $stepmake_flexlexer_yy_current_buffer = yes; then
+ AC_DEFINE(HAVE_FLEXLEXER_YY_CURRENT_BUFFER, 1, [Define to 1 if yyFlexLexer has yy_current_buffer.])
+ fi
+ AC_LANG_POP(C++)
])