Replace a dummy pred_id in a trace goal.

compiler/polymorphism.m:
	Replace a dummy pred_id in a trace goal to that which was
	intended, judging by the preceding comment.
Fix inst for constant type_infos.

The inst for type_infos entered into the const_struct database did not
count the type_ctor_info argument, thus the cons_id arity was off by one.
Bug #297.

compiler/polymorphism.m:
        Account for the type_ctor_info when making the inst for a constant
        type_info.

tests/hard_coded/Mercury.options:
tests/hard_coded/Mmakefile:
tests/hard_coded/type_info_const_inst.exp:
tests/hard_coded/type_info_const_inst.m:
        Add test case.

NEWS:
        Announce the change.
Detection of standard library grades.

Currently, the set of installed standard library grades is hardcoded in
Mercury's configuration file (and some other spots, but they are not relevant
here).  This change modifies the compiler so it can scan the standard library
directory at runtime in order to determine what library grades are installed.
This removes the need for the set of library grades to be specified in the
configuration file at all.  Adding or removing grades from an existing
installation should now not require changes to any configuration files
(provided you don't use mmake -- see below).

In the case where the library grades are specified in the Mercury.config file
and library grade detection is also enabled, the detected grades will override
any --libgrade settings from the Mercury.config file.

Detection of library grades is not supported with mmake and I don't have any
plans to support it.  mmake will just use the set of grades with which the
installation was configured.

compiler/options.m:
	Add a new option `--detect-libgrades' that can be used to control
	the new feature.  For now, this is a developer-only option and is
	disabled by default -- I will document it properly when it is enabled
	by default.

compiler/mercury_compile.m:
	Scan the standard library directory to see what grades are installed
	and set the options necessary to make the set of library grades those
	that were detected.

compiler/options_file.m:
	Add a predicate for looking up the value of the MERCURY_STDLIB_DIR
	variable.
Workaround crashes in parallel grades with gcc 4.6+ (bug #294)

configure.ac:
    Test for and enable --fno-reorder-functions which works around this
    issue.
Merge branch 'version-13_05-branch'