From: Han-Wen Nienhuys Date: Fri, 3 Nov 2006 01:05:21 +0000 (+0000) Subject: don't do -fPIC for mingw. Suppresses warning about unnecessary -fPIC X-Git-Tag: release/2.10.0-2~34^2~9^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fa60b01a20f21d6aff9c0923a0b76de9fe106c30;p=lilypond.git don't do -fPIC for mingw. Suppresses warning about unnecessary -fPIC don't use ASSIGN_EVENT_ONCE for Figured_bass_engraver. Fixes #128. minor cleanups change naming: print-page-number becomescreate-page-number-stencil. This avoids nameclash withprint-page-number boolean, and fixes page number printing. --- diff --git a/lily/figured-bass-engraver.cc b/lily/figured-bass-engraver.cc index 2c3ad0e9e1..025f7de6ed 100644 --- a/lily/figured-bass-engraver.cc +++ b/lily/figured-bass-engraver.cc @@ -142,7 +142,12 @@ Figured_bass_engraver::listen_rest (Stream_event *ev) if (to_boolean (get_property ("ignoreFiguredBassRest"))) { new_event_found_ = true; - ASSIGN_EVENT_ONCE (rest_event_, ev); + + /* + No ASSIGN_EVENT_ONCE() ; otherwise we get warnings about + polyphonic rests. + */ + rest_event_ = ev; } } diff --git a/lily/include/lily-lexer.hh b/lily/include/lily-lexer.hh index ff95d83b39..6a9107ee15 100644 --- a/lily/include/lily-lexer.hh +++ b/lily/include/lily-lexer.hh @@ -31,6 +31,7 @@ private: int identifier_type (SCM); char escaped_char (char) const; + Lily_parser *parser_; Keyword_table *keytable_; SCM scopes_; SCM start_module_; @@ -41,7 +42,7 @@ public: void *lexval; Input *lexloc; bool is_main_input_; - + Sources *sources_; /* Scheme hash tables with (oct name acc) values, and symbol keys. */ @@ -51,7 +52,7 @@ public: int error_level_; Input last_input_; - Lily_lexer (Sources *); + Lily_lexer (Sources *, Lily_parser *); Lily_lexer (Lily_lexer const &); int yylex (); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index b6ec74a729..cf1439e673 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -144,4 +144,13 @@ void add_translator (Translator *trans); Translator *get_translator (SCM s); Moment get_event_length (Stream_event *s); DECLARE_UNSMOB (Translator, translator); + + +/* + This helper is only meaningful inside listen_* methods. +*/ +extern bool internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const char *function); +#define ASSIGN_EVENT_ONCE(o,n) internal_event_assignment (&o, n, __FUNCTION__) + + #endif // TRANSLATOR_HH diff --git a/lily/include/translator.icc b/lily/include/translator.icc index 6eb9e10405..708089b30a 100644 --- a/lily/include/translator.icc +++ b/lily/include/translator.icc @@ -134,10 +134,4 @@ cl::_listen_scm_ ## m (SCM sev) \ listen_ ## m (ev); \ } -/* - This helper is only meaningful inside listen_* methods. -*/ -extern bool internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const char *function); -#define ASSIGN_EVENT_ONCE(o,n) internal_event_assignment (&o, n, __FUNCTION__) - #endif /* TRANSLATOR_ICC */ diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 2392f47b36..ef579dc7f0 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -21,6 +21,8 @@ using namespace std; #include "scm-hash.hh" #include "source-file.hh" #include "warn.hh" +#include "program-option.hh" +#include "lily-parser.hh" static Keyword_ent the_key_tab[] = { @@ -80,8 +82,9 @@ static Keyword_ent the_key_tab[] {0, 0} }; -Lily_lexer::Lily_lexer (Sources *sources) +Lily_lexer::Lily_lexer (Sources *sources, Lily_parser *parser) { + parser_ = parser; keytable_ = new Keyword_table (the_key_tab); chordmodifier_tab_ = SCM_EOL; pitchname_tab_stack_ = SCM_EOL; @@ -196,7 +199,10 @@ Lily_lexer::lookup_identifier (string name) void Lily_lexer::start_main_input () { - // yy_flex_debug = 1; + yy_flex_debug = get_program_option ("debug-lexer"); + parser_->set_yydebug (get_program_option ("debug-parser")); + + new_input (main_input_name_, sources_); /* Do not allow \include in --safe-mode */ @@ -297,6 +303,8 @@ Lily_lexer::mark_smob (SCM s) Lily_lexer *lexer = (Lily_lexer *) SCM_CELL_WORD_1 (s); scm_gc_mark (lexer->chordmodifier_tab_); + if (lexer->parser_) + scm_gc_mark (lexer->parser_->self_scm ()); scm_gc_mark (lexer->pitchname_tab_stack_); scm_gc_mark (lexer->start_module_); return lexer->scopes_; diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 1f073fb07a..8c5d43b202 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -36,7 +36,7 @@ Lily_parser::Lily_parser (Sources *sources) smobify_self (); - lexer_ = new Lily_lexer (sources_); + lexer_ = new Lily_lexer (sources_, this); lexer_->unprotect (); } @@ -95,7 +95,6 @@ Lily_parser::parse_file (string init, string name, string out_name) lexer_->main_input_name_ = name; message (_ ("Parsing...")); - // progress_indication ("\n"); set_yydebug (0); diff --git a/lily/translator.cc b/lily/translator.cc index 7e1518bdc1..b7a46d29b6 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -318,10 +318,11 @@ internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const ch new_ev->self_scm ()))) { /* extract event class from function name */ - const char *prefix = "listen_"; string ev_class = function; + /* This assertion fails if EVENT_ASSIGNMENT was called outside a translator listener. Don't do that. */ + const char *prefix = "listen_"; assert (0 == ev_class.find (prefix)); /* "listen_foo_bar" -> "foo-bar" */ @@ -340,7 +341,7 @@ internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const ch } ADD_TRANSLATOR (Translator, - "Base class. Unused", + "Base class. Not instantiated.", "", "", ""); diff --git a/ly/titling-init.ly b/ly/titling-init.ly index bae92af65b..30d3db57c6 100644 --- a/ly/titling-init.ly +++ b/ly/titling-init.ly @@ -70,9 +70,10 @@ scoreTitleMarkup = \markup { \column { } #(define (first-page layout props arg) - (if (= (chain-assoc-get 'page:page-number props -1) - (ly:output-def-lookup layout 'first-page-number)) (interpret-markup layout props arg) - empty-stencil)) + (if (= (chain-assoc-get 'page:page-number props -1) + (ly:output-def-lookup layout 'first-page-number)) + (interpret-markup layout props arg) + empty-stencil)) #(define (last-page layout props arg) (if (chain-assoc-get 'page:last? props #f) @@ -93,7 +94,7 @@ scoreTitleMarkup = \markup { \column { (interpret-markup layout props arg) empty-stencil)) -#(define (print-page-number layout props arg) +#(define (create-page-number-stencil layout props arg) (if (eq? (ly:output-def-lookup layout 'print-page-number) #t) (interpret-markup layout props arg) empty-stencil)) @@ -102,7 +103,7 @@ scoreTitleMarkup = \markup { \column { (if (or (not (= (chain-assoc-get 'page:page-number props -1) (ly:output-def-lookup layout 'first-page-number))) (eq? (ly:output-def-lookup layout 'print-first-page-number) #t)) - (print-page-number layout props arg) + (create-page-number-stencil layout props arg) empty-stencil)) oddHeaderMarkup = \markup diff --git a/scm/lily.scm b/scm/lily.scm index 807adcb485..edd99461d5 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -23,6 +23,9 @@ (debug-gc #f "dump memory debugging statistics") (debug-midi #f "generate human readable MIDI") + (debug-parser #f "debug the bison parser") + (debug-lexer #f "debug the flex lexer") + (debug-midi #f "generate human readable MIDI") (delete-intermediate-files #f "delete unusable PostScript files") (dump-signatures #f "dump output signatures of each system") diff --git a/stepmake/stepmake/compile-vars.make b/stepmake/stepmake/compile-vars.make index b39499b0dd..8fe1791edf 100644 --- a/stepmake/stepmake/compile-vars.make +++ b/stepmake/stepmake/compile-vars.make @@ -2,8 +2,8 @@ ARFLAGS = ru ALL_LDFLAGS = $(LDFLAGS) $(CONFIG_LDFLAGS) $($(PACKAGE)_LDFLAGS) $(MODULE_LDFLAGS) $(CONFIG_LDFLAGS) -PIC_FLAGS = -fpic -fPIC ifeq ($(MINGW_BUILD),) +PIC_FLAGS = -fpic -fPIC SHARED_FLAGS = -shared else SHARED_FLAGS = -mdll