[m-rev.] for review: extend configure to support an hlc source distribution

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Mar 2 15:30:27 AEDT 2010


On Tue, 2 Mar 2010, Peter Wang wrote:

> On 2010-03-02, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> >
> > configure.in:
> > 	If we don't have a (working) Mercury compiler from which to
> > 	bootstrap, but do have some pre-generated C files, then check
> > 	whether those files were generated with --highlevel-code
> > 	enabled.
> >
> > 	Force the bootstrap grade to be hlc.gc if we are compiling
> > 	the source distribution and the pre-generated C files were
> > 	created with --highlevel-code enabled.
> >
> > 	Abort early and emit an error message if we do not have
> > 	any pre-generated C files and we also do not have a bootstrap
> > 	Mercury compiler -- currently this situation is not checked
> > 	for, and compilation proceeds as far as the standard library.
> > 	(XXX Is this behaviour intended?)
>
> I can't see why.

Neither can I, but it seemed a fairly obvious omission, so I thought I
would ask.

> > @@ -399,6 +401,9 @@
> >              test -f $PREFIX/bin/mercury_compile ||
> >              test -f $PREFIX/bin/mercury_compile.exe
> >          then
> > +            # This variable is used to let the tests in the following section know
> > +            # that we are going to attempt to bootstrap with the compiler $PREFIX/bin.
> > +            bootstrap_from_prefix="yes"
> >              AC_MSG_WARN(
> >  [using $PREFIX/bin/mercury_compile to bootstrap])
> >          else
>
> the compiler in $PREFIX/bin

I think the existing message gives a better idea of what is happening.

> > +#-----------------------------------------------------------------------------#
> > +
> > +if test "$BOOTSTRAP_MC" = ""
> > +then
> > +    # If we do not have a working boostrap Mercury compiler, then work out
> > +    # whether any .c files we do have were compiled with --highlevel code or
> > +    # not.  At this point we only check a single file -- this is enough to
> > +    # allow us to determine a value for BOOTSTRAP_GRADE below -- we check
> > +    # any other pre-generated .c files as part of the call to
> > +    # mercury_check_c_files() later on.
> > +    #
> > +    if test -f compiler/top_level.c
> > +    then
> > +        highlevel_code=`grep "HIGHLEVEL_CODE\=.*" compiler/top_level.c`
> > +    else
> > +        if test -f compiler/Mercury/cs/top_level.c
> > +        then
> > +            highlevel_code=`grep "HIGHLEVEL_CODE\=.*" compiler/Mercury/cs/top_level.c`
>
> The regex can be simplified to "HIGHLEVEL_CODE="

Done.

> > +        else
> > +            # If we are going to attempt to bootstrap from a compiler in
> > +            # $PREFIX/bin (see the above section), the it is ok if we don't
> > +            # have any pre-generated .c files; if not, then we cannot continue.
>
> then it is

Fixed.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list