On 7 Jun., 02:02, William Stein <wst...@gmail.com> wrote:
> On Sun, Jun 6, 2010 at 4:35 PM, leif <not.rea...@online.de> wrote:
> > I thought in this thread we were only talking about its build system,
> > not the source code or Singular's quality in general.
>
> > I cannot resist to give some excerpts from just src/Singular/
> > Makefile.in:
>
> > ##
> > ## various programs
> > ##
> > @SET_MAKE@
> > CC              = @CC@
> > LD              = @LD@
> > CXX             = @CXX@
> > LEX             = sh flexer.sh
>
> > PERL            = @PERL@
> > BISON           = bison
> > INSTALL         = @INSTALL@
> > INSTALL_PROGRAM = @INSTALL_PROGRAM@
> > INSTALL_DATA    = @INSTALL_DATA@
> > MKINSTALLDIRS   = ./mkinstalldirs
> > LN_S            = @LN_S@
>
> > ...
>
> > SOURCES=${CSOURCES} ${CXXSOURCES} \
> >        grammar.y scanner.l libparse.l \
> >        utils.cc utils.h \
> >        tesths.cc mpsr_Tok.cc claptmpl.cc
>
> > ...
>
> > ##
> > ## Build Targets
> > ##
> > .l.cc:
> >       �...@if test -r scanner.cc; then \
> >                touch scanner.cc ;\
> >        elif test "x${LEX}" = x; then \
> >                echo Error: no lex given, could not rebuilt scanner.cc;\
> >                exit 1; \
> >        fi
> >        ${LEX} -s -I -t $< > scanner.cc.lmp
> >        cp scanner.cc.lmp scanner.cc
>
> > .y.cc:
> >       �...@if test -r grammar.cc; then \
> >                touch grammar.cc ;\
> >        else \
> >        if test "x${BISON}" = x; then \
> >                echo Error: no bison given, could not rebuilt grammar.cc;\
> >                exit 1; \
> >        fi;\
> >        ${BISON} -d -t -o grammar.cc $<;\
> >        chmod +x testgh;\
> >        ./testgh;\
> >        fi
>
> > Note that these are all from the same file. You could also take a look
> > at flexer.sh...
>
> > -Leif
>
> To make your complaints clearer and more *constructive*, I wonder if
> you could explain roughly how you would rewrite the above code?

We agreed that we will only do the simple workaround at #9160 s.t. it
builds on Solaris (too) at the moment.
(By the way, I did not complain.)

There's of course room for another ticket.

What's wrong with the above snippets should be clear to everyone
interested... ;-)

First of all, if you use configure/autotools, don't hardcode lex and
yacc (in this case, actually bison and a shell script that just deals
with different versions of flex, and does not even test if or where
flex is present).
Less of a problem if up-to-date versions of the generated files are
shipped to "end users" (with correct m-times; as said before, in
general ordinary users shouldn't need "developer tools" like lex&yacc
or autotools).

The assumption that there is only one source file matching the .l.cc
rule is false.
That rule has a "misplaced" if-elif-fi.

Both rules assume that any present generated file is always up-to-
date.


-Leif

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to