bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

INSTALL.txt and 3.1 recipe


From: Karl Berry
Subject: INSTALL.txt and 3.1 recipe
Date: Mon, 26 Aug 2002 11:55:53 -0400

In Lilypond 1.6.0, there's a recipe for compiling with gcc 3.1 which
includes the line:

             CPPFLAGS=$(pwd)/lily/out-gcc-3.1 CC=gcc-3.1 CXX=g++-3.1 \
                 ./configure --enable-config=gcc-3.1

I believe this should be:

             CPPFLAGS=-I$(pwd)/lily/out-gcc-3.1 CC=gcc-3.1 CXX=g++-3.1 \
                 ./configure --enable-config=gcc-3.1

Otherwise, the $(pwd)/lily/out-gcc-3.1 is considered to be a file that
should be linked against, and since it is a directory, that doesn't work
too well.

I also suggest noting that this recipe assumes there are programs called
`gcc-3.1' and `g++-3.1' in one's path.  This is usually not the case in
my experience.


Meanwhile, unfortunately the purported fix did not work for me (redhat
7.3, i686, gcc 3.1).  I get a zillion compile errors on
includable-lexer.cc, here are the first few:

rm -f ./out-gcc-3.1/includable-lexer.dep; 
DEPENDENCIES_OUTPUT="./out-gcc-3.1/includable-lexer.dep 
./out-gcc-3.1/includable-lexer.o" g++-3.1 -c   -DHAVE_CONFIG_H  
-DSTRING_UTILS_INLINED -Iinclude -I./out-gcc-3.1 -I../flower/include 
-I../flower/./out-gcc-3.1 -I../flower/include -O2 -finline-functions -g 
-I/usr/local/gnu/src/lilypond-1.6.0/lily/out-gcc-3.1  -I/usr/local/gnu/include  
   -O2 -finline-functions -g 
-I/usr/local/gnu/src/lilypond-1.6.0/lily/out-gcc-3.1  -I/usr/local/gnu/include 
-Wall  -W -Wmissing-prototypes -Wconversion  -o out-gcc-3.1/includable-lexer.o 
includable-lexer.cc
cc1plus: warning: changing search order for system directory 
"/usr/local/gnu/include"
cc1plus: warning:   as it has already been specified as a non-system directory
In file included from include/includable-lexer.hh:13,
                 from includable-lexer.cc:13:
out-gcc-3.1/FlexLexer.h:64: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:64: `s' was not declared in this scope
out-gcc-3.1/FlexLexer.h:64: parse error before `)' token
...

That line 64 of FlexLexer.h is
                yy_create_buffer( std::std::istream* s, int size ) = 0;

I don't know what to make of this, but anyway, there's the report, for
what it's worth.  Off to try gcc 2.96 now ...

Thanks,
karl


P.S. Here are all the errors and the whole FlexLexer.h, just in case it
helps.

out-gcc-3.1/FlexLexer.h:64: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:64: `s' was not declared in this scope
out-gcc-3.1/FlexLexer.h:64: parse error before `)' token
out-gcc-3.1/FlexLexer.h:66: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:66: `s' was not declared in this scope
out-gcc-3.1/FlexLexer.h:66: virtual outside class declaration
out-gcc-3.1/FlexLexer.h:66: variable or field `yyrestart' declared void
out-gcc-3.1/FlexLexer.h:71: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:71: `new_in' was not declared in this scope
out-gcc-3.1/FlexLexer.h:71: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:71: `new_out' was not declared in this scope
out-gcc-3.1/FlexLexer.h:72: initializer list being treated as compound 
   expression
out-gcc-3.1/FlexLexer.h:72: syntax error before `{' token
out-gcc-3.1/FlexLexer.h: In member function `const char* FlexLexer::YYText()':
out-gcc-3.1/FlexLexer.h:58: `yytext' undeclared (first use this function)
out-gcc-3.1/FlexLexer.h:58: (Each undeclared identifier is reported only once 
   for each function it appears in.)
out-gcc-3.1/FlexLexer.h: In member function `int FlexLexer::YYLeng()':
out-gcc-3.1/FlexLexer.h:59: `yyleng' undeclared (first use this function)
out-gcc-3.1/FlexLexer.h: At global scope:
out-gcc-3.1/FlexLexer.h:79: warning: `virtual' is not at beginning of 
   declaration
out-gcc-3.1/FlexLexer.h:79: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:79: `new_in' was not declared in this scope
out-gcc-3.1/FlexLexer.h:80: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:80: `new_out' was not declared in this scope
out-gcc-3.1/FlexLexer.h:80: two or more data types in declaration of `
   switch_streams'
out-gcc-3.1/FlexLexer.h:80: virtual outside class declaration
out-gcc-3.1/FlexLexer.h:80: cannot declare variable `switch_streams' to be of 
   type `FlexLexer'
out-gcc-3.1/FlexLexer.h:80:   because the following virtual functions are 
   abstract:
out-gcc-3.1/FlexLexer.h:68:     virtual int FlexLexer::yylex()
out-gcc-3.1/FlexLexer.h:65:     virtual void 
   FlexLexer::yy_delete_buffer(yy_buffer_state*)
out-gcc-3.1/FlexLexer.h:64:     virtual yy_buffer_state* 
   FlexLexer::yy_create_buffer(...)
out-gcc-3.1/FlexLexer.h:62:     virtual void 
   FlexLexer::yy_switch_to_buffer(yy_buffer_state*)
out-gcc-3.1/FlexLexer.h:80: assignment (not initialization) in declaration
out-gcc-3.1/FlexLexer.h:82: non-member function `int lineno()' cannot have `
   const' method qualifier
out-gcc-3.1/FlexLexer.h: In function `int lineno()':
out-gcc-3.1/FlexLexer.h:82: `yylineno' undeclared (first use this function)
out-gcc-3.1/FlexLexer.h: At global scope:
out-gcc-3.1/FlexLexer.h:84: non-member function `int debug()' cannot have `
   const' method qualifier
out-gcc-3.1/FlexLexer.h: In function `int debug()':
out-gcc-3.1/FlexLexer.h:84: `yy_flex_debug' undeclared (first use this 
   function)
out-gcc-3.1/FlexLexer.h: At global scope:
out-gcc-3.1/FlexLexer.h:87: parse error before `protected'
out-gcc-3.1/FlexLexer.h:89: `int yyleng' used prior to declaration
out-gcc-3.1/FlexLexer.h:90: `int yylineno' used prior to declaration
out-gcc-3.1/FlexLexer.h:91: `int yy_flex_debug' used prior to declaration
out-gcc-3.1/FlexLexer.h:94: parse error before `}' token
out-gcc-3.1/FlexLexer.h:107: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:107: parse error before `*' token
out-gcc-3.1/FlexLexer.h:112: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:112: `s' was not declared in this scope
out-gcc-3.1/FlexLexer.h:112: parse error before `)' token
out-gcc-3.1/FlexLexer.h:114: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:114: `s' was not declared in this scope
out-gcc-3.1/FlexLexer.h:114: invalid data member initialization
out-gcc-3.1/FlexLexer.h:114: (use `=' to initialize static data members)
out-gcc-3.1/FlexLexer.h:114: variable or field `yyrestart' declared void
out-gcc-3.1/FlexLexer.h:117: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:117: `new_in' was not declared in this scope
out-gcc-3.1/FlexLexer.h:117: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:117: `new_out' was not declared in this scope
out-gcc-3.1/FlexLexer.h:117: invalid data member initialization
out-gcc-3.1/FlexLexer.h:117: variable or field `switch_streams' declared void
out-gcc-3.1/FlexLexer.h:117: `switch_streams' declared as a `virtual' field
out-gcc-3.1/FlexLexer.h:128: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:128: no type `istream' in `<type error>'
out-gcc-3.1/FlexLexer.h:128: parse error before `*' token
out-gcc-3.1/FlexLexer.h:143: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:143: syntax error before `*' token
out-gcc-3.1/FlexLexer.h:144: no class template named `std' in `std'
out-gcc-3.1/FlexLexer.h:144: syntax error before `*' token
make[1]: *** [out-gcc-3.1/includable-lexer.o] Error 1
make[1]: Leaving directory `/usr/local/gnu/src/lilypond-1.6.0/lily'
make: *** [all] Error 2

// $Header: /home/daffy/u0/vern/flex/RCS/FlexLexer.h,v 1.19 96/05/25 20:43:02 
vern Exp $

// FlexLexer.h -- define interfaces for lexical analyzer classes generated
//                by flex

// Copyright (c) 1993 The Regents of the University of California.
// All rights reserved.
//
// This code is derived from software contributed to Berkeley by
// Kent Williams and Tom Epperly.
//
// Redistribution and use in source and binary forms with or without
// modification are permitted provided that: (1) source distributions retain
// this entire copyright notice and comment, and (2) distributions including
// binaries display the following acknowledgement:  ``This product includes
// software developed by the University of California, Berkeley and its
// contributors'' in the documentation or other materials provided with the
// distribution and in all advertising materials mentioning features or use
// of this software.  Neither the name of the University nor the names of
// its contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.

// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

// This file defines FlexLexer, an abstract class which specifies the
// external interface provided to flex C++ lexer objects, and yyFlexLexer,
// which defines a particular lexer class.
//
// If you want to create multiple lexer classes, you use the -P flag
// to rename each yyFlexLexer to some other xxFlexLexer.  You then
// include <FlexLexer.h> in your other sources once per lexer class:
//
//      #undef yyFlexLexer
//      #define yyFlexLexer xxFlexLexer
//      #include <FlexLexer.h>
//
//      #undef yyFlexLexer
//      #define yyFlexLexer zzFlexLexer
//      #include <FlexLexer.h>
//      ...

#ifndef __FLEX_LEXER_H
// Never included before - need to define base class.
#define __FLEX_LEXER_H
#include <iostream>

extern "C++" {

struct yy_buffer_state;
typedef int yy_state_type;

class FlexLexer {
public:
        virtual ~FlexLexer()    { }

        const char* YYText()    { return yytext; }
        int YYLeng()            { return yyleng; }

        virtual void
                yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
        virtual struct yy_buffer_state*
                yy_create_buffer( std::std::istream* s, int size ) = 0;
        virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
        virtual void yyrestart( std::std::istream* s ) = 0;

        virtual int yylex() = 0;

        // Call yylex with new input/output sources.
        int yylex( std::std::istream* new_in, std::std::ostream* new_out = 0 )
                {
                switch_streams( new_in, new_out );
                return yylex();
                }

        // Switch to new input/output streams.  A nil stream pointer
        // indicates "keep the current one".
        virtual void switch_streams( std::std::istream* new_in = 0,
                                     std::std::ostream* new_out = 0 ) = 0;

        int lineno() const              { return yylineno; }

        int debug() const               { return yy_flex_debug; }
        void set_debug( int flag )      { yy_flex_debug = flag; }

protected:
        char* yytext;
        int yyleng;
        int yylineno;           // only maintained if you use %option yylineno
        int yy_flex_debug;      // only has effect with -d or "%option debug"
};

}
#endif

#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
// Either this is the first time through (yyFlexLexerOnce not defined),
// or this is a repeated include to define a different flavor of
// yyFlexLexer, as discussed in the flex man page.
#define yyFlexLexerOnce

class yyFlexLexer : public FlexLexer {
public:
        // arg_yyin and arg_yyout default to the cin and cout, but we
        // only make that assignment when initializing in yylex().
        yyFlexLexer( std::std::istream* arg_yyin = 0, std::std::ostream* 
arg_yyout = 0 );

        virtual ~yyFlexLexer();

        void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
        struct yy_buffer_state* yy_create_buffer( std::std::istream* s, int 
size );
        void yy_delete_buffer( struct yy_buffer_state* b );
        void yyrestart( std::std::istream* s );

        virtual int yylex();
        virtual void switch_streams( std::std::istream* new_in, 
std::std::ostream* new_out );

protected:
        virtual int LexerInput( char* buf, int max_size );
        virtual void LexerOutput( const char* buf, int size );
        virtual void LexerError( const char* msg );

        void yyunput( int c, char* buf_ptr );
        int yyinput();

        void yy_load_buffer_state();
        void yy_init_buffer( struct yy_buffer_state* b, std::std::istream* s );
        void yy_flush_buffer( struct yy_buffer_state* b );

        int yy_start_stack_ptr;
        int yy_start_stack_depth;
        int* yy_start_stack;

        void yy_push_state( int new_state );
        void yy_pop_state();
        int yy_top_state();

        yy_state_type yy_get_previous_state();
        yy_state_type yy_try_NUL_trans( yy_state_type current_state );
        int yy_get_next_buffer();

        std::std::istream* yyin;        // input source for default LexerInput
        std::std::ostream* yyout;       // output sink for default LexerOutput

        struct yy_buffer_state* yy_current_buffer;

        // yy_hold_char holds the character lost when yytext is formed.
        char yy_hold_char;

        // Number of characters read into yy_ch_buf.
        int yy_n_chars;

        // Points to current character in buffer.
        char* yy_c_buf_p;

        int yy_init;            // whether we need to initialize
        int yy_start;           // start state number

        // Flag which is used to allow yywrap()'s to do buffer switches
        // instead of setting up a fresh yyin.  A bit of a hack ...
        int yy_did_buffer_switch_on_eof;

        // The following are not always needed, but may be depending
        // on use of certain flex features (like REJECT or yymore()).

        yy_state_type yy_last_accepting_state;
        char* yy_last_accepting_cpos;

        yy_state_type* yy_state_buf;
        yy_state_type* yy_state_ptr;

        char* yy_full_match;
        int* yy_full_state;
        int yy_full_lp;

        int yy_lp;
        int yy_looking_for_trail_begin;

        int yy_more_flag;
        int yy_more_len;
        int yy_more_offset;
        int yy_prev_more_offset;
};

#endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]