compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_managed.m:
compiler/il_peephole.m:
compiler/ilasm.m:
compiler/ilds.m:
Delete the modules making up the MLDS->IL code generator.
compiler/globals.m:
compiler/prog_data.m:
Delete IL as a target and foreign language.
compiler/prog_io_pragma.m:
Delete the max_stack_size/1 foreign proc attribute. This was only
ever required by the IL backend.
compiler/options.m
Delete options used for the IL backend.
compiler/write_deps_file.m:
Don't generate mmake targets for .il files etc.
compiler/*.m:
Conform to the above changes.
compiler/notes/compiler_design.html
compiler/notes/work_in_progress.html
Conform to the above changes.
library/*.m:
Delete IL foreign_proc and foreign_export pragmas.
README.DotNet:
Delete this file.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
Conform the above changes.
configure.ac:
Don't check that IL is a supported foreign language when performing the
up-to-date check.
Delete the '--enable-dotnet-grades' option.
scripts/Mmake.vars.in:
Delete variables used for the IL backend (and in on case by the Aditi
backend).
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
scripts/Mmake.rules:
scripts/canonical_grade.sh-subr:
tools/bootcheck:
Delete stuff related to the 'il' and 'ilc' grades.
doc/reference_manual.texi:
Delete the documentation of the 'max_stack_size' option.
doc/user_guide.texi:
Delete stuff related to the IL backend.
tests/hard_coded/csharp_test.{m,exp}:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/valid/csharp_hello.m:
Delete these tests: they are no longer relevant.
tests/hard_coded/equality_pred_which_requires_boxing.m:
tests/hard_coded/foreign_import_module.m:
tests/hard_coded/foreign_import_module_2.m:
tests/hard_coded/foreign_type.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/foreign_type3.m:
tests/hard_coded/intermod_foreign_type2.m:
tests/hard_coded/lp.m:
tests/hard_coded/user_compare.m:
tests/invalid/foreign_type_2.m:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/invalid/foreign_type_visibility.m:
tests/invalid/illtyped_compare.{m,err_exp}:
tests/submodules/external_unification_pred.m
tests/valid/big_foreign_type.m
tests/valid/solver_type_bug.m
tests/valid_seq/foreign_type_spec.m
tests/valid_seq/intermod_impure2.m
Delete IL foreign_procs where necessary.
tests/hard_coded/Mmakefile
tests/invalid/Mercury.options
tests/invalid/Mmakefile
tests/submodules/Mmakefile
tests/valid/Mercury.options
tests/valid/Mmake.valid.common
tests/valid/Mmakefile
tests/valid_seq/Mmakefile
tests/valid_seq/Mercury.options
Conform to the above changes.
As discussed in the recent Mercury meeting, remove support for the GCC backend.
It was very much out of date and supporting it proprerly would means having to
track changes to GCC's internals. Furthermore, its presence complicates
building the compiler.
The main thing this change does not address is the fact that we invoke
the compiler through C code, e.g. main.c in the top-level of the source
tree. This was required by the GCC backend and can now be removed, but
I will do that as a separate change.
configure.ac:
Mmake.common.in:
scripts/Mmake.rules:
compiler/Mercury.options:
compiler/Mmakefile:
compiler/gcc.m:
compiler/maybe_mlds_to_gcc.pp:
compiler/mlds_to_gcc.m:
Delete the files containing the GCC backend.
compiler/options.m:
compiler/handle_options.m:
Delete support for `--target asm' and `--pic'.
(The latter was only used by the GCC backend.)
compiler/*.m:
doc/user_guide.texi:
compiler/notes/comiler_design.html:
compiler/notes/work_in_progress.m:
Conform to the above change.
README.gcc-backend.m:
Delete this file.
Branches: main, 10.04
Apply a patch from Keri Harris that fixes a problem with mmake --use-mmc-make
when using GNU make 3.82. The problem was that we were mixing normal and
implicit rules and GNU make no longer supports this (and officially never
did).
scripts/Mmake.rules:
Don't mix normal and implicit rules.
Branches: main
Add support for the `csharp' grade to `mmc --make', and make it possible to
install the `csharp' grade with `mmake install'.
Also some miscellaneous fixes.
configure.in:
Require a recent enough bootstrap compiler that recognises C# as a
language for `pragma foreign_type'.
Mmakefile:
Use `mmc --make' to install the standard library in csharp grade.
aclocal.m4:
Search for the Mono C# compiler `gmcs', which is required for generics
at this time. Prefer it over the DotGNU C# compiler, which I have not
tested.
Search for `mono'. If found, it will be used in shell scripts to
launch executables generated via the csharp backend.
Remove "MS_" prefixes on the variables MS_CSC and MS_ILASM, which are
not Microsoft-specific. More importantly, it should be less likely to
make the mistake of adding an extra underscore to CSCFLAGS and
ILASMFLAGS.
README.DotNet:
Conform to variable renamings.
compiler/compile_target_code.m:
Add new linked target types `csharp_executable', `java_launcher' and
`erlang_launcher', instead of overloading `executable'.
Link with `mer_std.dll' and other libraries when generating C#
executables. There is no `mer_rt.dll'.
Pass "/debug" to the C# compiler if `--target-debug' is set.
Create a shell script to launch the executable if necessary.
Delete an unused predicate `standard_library_directory_option'.
compiler/file_names.m:
`.cs' and `.cs_date' are grade-dependent.
compiler/handle_options.m:
Force `.exe' as the executable file extension in csharp grades.
Make the `erlang' grade component imply the same options as MLDS
grades.
compiler/make.m:
Classify executable target types based on the compilation target.
compiler/make.module_target.m:
Handle `mmc --grade csharp --make <target>.dll'.
compiler/make.program_target.m:
Install library DLLs in csharp grades.
Make clean targets remove files for csharp grades.
Conform to changes.
compiler/make.util.m:
Add a stub foreign type.
Conform to changes.
compiler/module_cmds.m:
Factor out code to generate the shell scripts which launch programs
compiled in Java, Erlang and C# grades.
compiler/options.m:
Add `cli_interpreter' option to remember the name of the program which
should be used to run CLI (.NET) programs.
Add C#-related options to the help message.
compiler/options_file.m:
Remove "MS_" prefixes on MS_ILASM_FLAGS and MS_CSC_FLAGS, and remove
the extra underscore before "FLAGS". In all uses of the variables,
they were spelt without the extra underscore.
doc/user_guide.texi:
Document options and file types related to the C# grade.
library/Mmakefile:
Pass `mercury_dotnet.cs' to the C# compiler when building the standard
library. Suppress some warnings.
Allow stubs in this directory for csharp grade.
Conform to variable renamings.
library/builtin.m:
Uncomment foreign language pragmas for C#.
Handle null values in C# implementation of `deep_copy'.
library/private_builtin.m:
library/string.m:
Compare strings by ordinals in C#, instead of culture-specific rules.
Although the latter is allowed according to the documentation, it is
likely to slower, and cause confusion when porting between backends.
Handle negative index in string.set_char.
library/rtti_implementation.m:
Uncomment foreign language pragmas for C#.
`System.Type.GetType' only searches the current executing assembly or
in mscorlib for a type. As we have to be able to find types in other
assemblies (e.g. mer_std.dll or user DLLs), explicitly search through
a list of assemblies.
library/thread.semaphore.m:
Uncomment foreign language pragmas for C#.
Fix missing class qualification.
library/array.m:
library/bitmap.m:
library/bool.m:
library/dir.m:
library/exception.m:
library/io.m:
library/mutvar.m:
library/par_builtin.m:
library/region_builtin.m:
library/store.m:
library/thread.m:
library/time.m:
library/univ.m:
library/version_array.m:
Uncomment foreign language pragmas for C#.
mdbcomp/rtti_access.m:
Add type and procedure stubs.
runtime/mercury_dotnet.cs.in:
Override `Equals(object)' methods in `TypeCtorInfo_Struct' and
`TypeInfo_Struct' classes. This requires we override `GetHashCode' as
well.
Handle nulls arguments to `Equals' methods as is the expected behaviour.
Override `ToString' in `TypeCtorInfo_Struct' to produce more useful
output during debugging.
scripts/Mercury.config.in:
Record the configured CLI_INTERPRETER and pass that to the compiler as
a flag.
Conform to variable renamings.
scripts/Mmake.vars.in:
Pass value of CSCFLAGS from Mmake through to `mmc --make'.
Conform to variable renamings.
scripts/Mercury.config.bootstrap.in:
scripts/Mmake.rules:
Conform to variable renaming.
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Canonicalise high-level code, high-level-data, C# target code to the
`csharp' grade.
Handle erlang grades like other grades.
scripts/prepare_install_dir.in:
Copy `.cs' files from the runtime directory when preparing an install
directory.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
trace/Mmakefile:
Do as other non-C grades in this directory.
Conform to variable renamings.
tests/hard_coded/foreign_enum_dummy.m:
tests/hard_coded/sub-modules/non_word_mutable.m:
tests/hard_coded/sub-modules/sm_exp_bug.m:
Make these tests work in C#.
tests/mmc_make/Mmakefile:
Update a regular expression to account for `mmc --make' writing
"Making rebuild.exe" on platforms where the .exe suffix is not normally
used.
tests/mmc_make/complex_test.exp2:
Add alternative output (minor difference in floating point precision).
tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
tests/general/structure_reuse/Mmakefile:
tests/hard_coded/Mmakefile:
tests/hard_coded/sub-modules/Mmakefile:
tests/par_conj/Mmakefile:
tests/stm/Mmakefile:
Disable some tests in the csharp grade.
tests/invalid/Mmakefile:
Disable some tests in the csharp grade.
Enable a test which should work in java grades.
tests/valid/Mmakefile:
Do as other non-C grades in this directory.
When testing the csharp grade in this directory, produce only the C#
target files for now.
tests/run_one_test:
Don't compress a failing test case executable when the executable is
actually only a shell script.
Branches: main
scripts/Mmake.rules:
Speed up `mmake --use-mmc-make clean' and `realclean' in the test
directories by calling `mmc --make' once for all the clean targets
instead of individually.
tests/hard_coded/Mmakefile:
Disable trans_intermod_user_equality test case when using mmc --make
as it requires --transitive-intermodule-optimisation.
Estimated hours taken: 3
Branches: main
Removed support for Managed C++ as a foreign language for the IL backend.
This is being removed for the following reasons:
* It is only supported by Microsoft, making it harder to use code
using it with other CIL platforms (e.g. Mono).
* It is not used in any of the standard library (only C# and IL are used).
* Removing it will simplify the dependencies and the build process.
* Microsoft have deprecated it in favour of C++/CLI.
NEWS:
Mentioned the change.
aclocal.m4:
Remove checks for the Microsoft.NET C++ compiler.
compiler/globals.m:
Delete Managed C++ from the set of supported languages.
compiler/mlds_to_managed.m:
Remove support for Managed C++ code generation.
compiler/*.m:
Remove all references to Managed C++.
runtime/Mmakefile:
runtime/mercury_mcpp.h:
Remove the Managed C++ part of the Mercury runtime.
runtime/mercury_il.il:
runtime/mercury_typeclass_info.h:
runtime/mercury_type_info.h:
Remove all references to Managed C++, including instructions to keep
certain parts in sync with Managed C++ part of the runtime.
doc/reference_manual.texi:
Remove the Managed C++ sections in the Foreign Language Interface
chapter.
doc/user_guide.texi:
Remove the documentation of Managed C++ related flags.
library/Mmakefile:
Remove Managed C++ flag settings.
library/io.m:
Remove commented out Managed C++ code.
library/list.m:
Change a comment referring to Managed C++ to refer to C# instead.
scripts/Mmake.rules:
scripts/Mmake.vars.in:
Remove all rules and variables for Managed C++ from mmake.
tests/hard_coded/foreign_import_module.m:
tests/hard_coded/foreign_import_module_2.m:
tests/hard_coded/foreign_proc_make.m:
tests/hard_coded/redoip_clobber.m:
Replace Managed C++ code with C# code in the relevant tests.
Estimated hours taken: 0.5
Branches: main
Remove support for non-grade specific .init files.
browser/Mmakefile:
runtime/Mmakefile:
scripts/Mmake.rules:
compiler/make.program_target.m:
Don't install the .init files in the non-grade specific location.
Estimated hours taken: 10
Branches: main
A side effect of the introduction of trace goals is that .init files are
now grade dependent. Consider a module that contains the following
trace goal:
trace [ compile_time(grade(debug)),
run_time(env("FOO"))
] (
...
),
In a debug grade the .init file for a library containing that module will
include the following directive:
ENVVAR FOO
In a non-debug grade it won't. At the moment which version of the .init
file is actually installed depends upon which grade was the first to
be built. This can result in linker errors if the wrong grade is used
with the wrong .init file.
There are two possible fixes. (1) always output ENVVAR directives
regardless of whether the compile time conditions of the trace goals to
which they are attached are true or not. (2) build grade specific .init
files and install them in grade specific locations.
The following diff implements the first stage of (2). For each grade in
which a library is to be installed we create a grade specific .init file
and then install it in a grade specific location, e.g.
`$(INSTALL_PREFIX)/lib/mercury/modules/<grade>'. (For bootstrapping
purposes .init files are currently still installed in the old location
as well.)
After this change has been installed on our machines I will add the
second part of this change which modifies the compiler to look for the
.init files in the new grade specific locations. The final part of the
change will then remove support for installing .init files in the old
location.)
scripts/Mmake.vars.in:
Add a variable that holds the name of a grade specific directory
in which to install .init files.
scripts/Mmake.rules:
Add a rule to install the .init files in a grade specific location.
browser/Mmakefile:
mdbcomp/Mmakefile:
runtime/Mmakefile:
Change the dependencies on the library installation targets so
that installing a library causes the .init files to be built and
installed.
(Currently this dependency is on the install target, which means
that the install_init rule is only invoked once, rather than
every time a grade is built.)
Install the .init files for these libraries in grade specific
locations. (For bootstrapping purposes they are currently also
installed in the old location.)
runtime/Mmakefile:
Remove the code that deletes runtime.init if it exists.
(Anyone who has a Mercury installation old enough for this to
be a problem is going to encounter more serious problems than
the runtime being initialized twice.)
Unrelated change: remove some duplicate entries from the list
of header files.
compiler/make.program_target.m:
Have mmc --make install the .init files in a grade specific location.
(They are also still installed in the old location.)
NOTE: the `XXX trace goal fix.' comments are placeholders for
things that need to be changed during the latter stages of this change.
Estimated hours taken: 1.5
Branches: main, release
Fix a bug in mmc --make's handling of ranlib.
configure.in:
Set the value of RANLIBFLAGS.
On most systems it will be empty; on Mac OS X it needs to be set
to "-c".
Check that the installed compiler supports the `--ranlib-flags'
option.
compiler/make.program_target.m:
Fix the problem with the quoting in the command line used to
invoke ranlib on Mac OS X by using the recently introduced
`--ranlib-flags' option.
Remove the workaround for this bug.
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
Set the default value of the `--ranlib-flags' option.
scripts/Mmake.vars.in:
scripts/Mmake.rules:
Have mmake conform to the new way of handling flags for
ranlib.
Estimated hours taken: 1.5
Branches: main
Remove residual parts of the Aditi backend that weren't deleted the other day.
configure.in:
Mmake.common.in:
Remove support for enabling the Aditi backend.
runtime/mercury_aditi.h:
Remove this file.
runtime/Mmakefile:
runtime/mercury.h:
runtime/mercury_imp.h:
runtime/mercury_ho_call.[ch]:
runtime/mercury_wrapper.[ch]:
Delete support for Aditi in the runtime.
scripts/Mmake.rules:
scripts/Mmake.vars.in:
scripts/c2init.in:
scripts/parse_ml_options.sh-subr.in:
Remove mmake support for building .rlo files, etc.
util/mkinit.c:
Remove Aditi specific code.
compiler/bytecode_data.m:
compiler/closure_analysis.m:
compiler/code_model.m:
compiler/compile_target_code.m:
compiler/det_analysis.m:
compiler/handle_options.m:
compiler/hlds_goal.m:
compiler/hlds_module.m:
compiler/make.dependencies.m:
compiler/make.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make.util.m:
compiler/make_hlds_error.m:
compiler/make_hlds_passes.m:
compiler/mercury_to_mercury.m:
compiler/mlds_to_gcc.m:
compiler/modecheck_call.m:
compiler/modules.m:
compiler/opt_debug.m:
compiler/options.m:
compiler/prog_data.m:
compiler/prog_foreign.m:
compiler/prog_mode.m:
compiler/prog_type.m:
compiler/rtti.m:
compiler/rtti_out.m:
compiler/rtti_to_mlds.m:
compiler/term_errors.m:
compiler/unify_proc.m:
mdbcomp/prim_data.m:
Remove residual support for Aditi.
library/ops.m:
Remove the 'aditi_bottom_up' and 'aditi_top_down' operators from the
ops table.
doc/reference_manual.texi:
doc/user_guide.texi:
Delete the sections on the Aditi interface.
extras/aditi/*:
Delete this.
Estimated hours taken: 1
Branches: main
Remove support for the --split-c-files option, since it hasn't worked in a
while, we haven't wanted to use it in a while, and the tradeoff of greatly
increased compilation time for a ~10% space gain is an increasingly bad one.
compiler/options.m:
doc/user_guide.texi:
Remove the option.
NEWS:
Mention the removal of the option.
compiler/modules.m:
Remove the references to .split executables and archives from the
generated .d files.
compiler/*.m:
Delete the code for handling --split-c-files=yes, and make whatever
simplifications this makes possible.
scripts/Mmake.*:
Remove the references to .split executables and archives.
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
Remove the references to the --split-c-files option.
tests/hard_coded/split_c_files.{m,split.exp}:
tests/hard_coded/mapped_module.split.exp:
Delete the test cases testing the deleted functionality.
tests/hard_coded/Mmakefile:
Don't test split C files.
Estimated hours taken: 4
Branches: main
Reduce the amount of clutter on mgnuc command lines by moving arguments that
are always the same for a given directory into a file that is always consulted
by mgnuc in the current directory.
scripts/mgnuc.in:
Always include as C compiler arguments the contents of a file named
.mgnuc_copts in the current directory, if it exists. (It is named
.mgnuc_copts instead of .mgnuc_opts because it may not contain
general mgnuc options, such as --no-mercury-stdlib-dir.)
Mmake.workspace:
Comment out the additions of search paths to CFLAGS.
*/Mmakefile:
Delete the additions of search paths to CFLAGS.
*/.mgnuc_copts:
New files containing the directory-specific search paths, and in some
cases the required macro definitions. These replace what was taken out
of Mmake.workspace and */Mmakefile. In some cases, the old search paths
included inappropriate directories; the .mgnuc_copt files don't.
tests/.mgnuc_copts.ws:
New files containing the directory-specific search paths; bootcheck
makes tests/.mgnuc_copts from it.
*/.nocopyright:
Don't require copyright notices in .mgnuc_copts files.
tools/bootcheck:
Copy the various .mgnuc_copts files from the stage1 to stages 2 and 3.
They aren't needed in stage3 right now, but that may change.
Create tests/.mgnuc_copts.
browser/util.m:
Delete an unused and inappropriate #include.
scripts/Mmake.rules:
Use a single invocation of mkdir -p to create all subdirectories
needed by Java. Update a piece of documentation.
scripts/Mmakefile:
Reorganize the process of invoking config.status to avoid invoking
it on inappropriate files, and to ensure the right permissions
on the files it is invoked on.
scripts/prepare_tmp_dir_grade_part:
Copy the .mgnuc_copts files when populating tmp_dir.
Estimated hours taken: 12
Branches: main
Move the mdbcomp library to its own directory. To make this change less painful
to test, improve the way we handle installs.
browser/mdbcomp.m:
browser/mer_mdbcomp.m:
browser/prim_data.m:
browser/program_representation.m:
browser/trace_counts.m:
Move these files to the mdbcomp directory.
browser/Mmakefile:
browser/Mercury.options:
mdbcomp/Mmakefile:
mdbcomp/Mercury.options:
Split the contents of the old Mmakefile and Mercury.options file
in the browser directory between these files as appropriate.
Simplify away the stuff not needed now that there is only one library
per directory. Make the browser directory see the relevant files
from the mdbcomp directory.
Mmake.common.in:
Separate out the prefixes allowed in the browser and the mdbcomp
directories.
Mmake.workspace:
Set up a make variable to refer to the mdbcomp directory.
Adjust references to the mdbcomp library to point to its new location.
Mmakefile:
Make invocations visit the mdbcomp library as necessary.
Improve the way we install grades. Making temporary backups of the
directories modified by the install process is unsatisfactory for two
reasons. First, if the install fails, the cleanup script, which is
necessary for user friendliness, destroys any evidence of the cause.
Second, the restore of the backup wasn't perfect, e.g. it left the
.d files modified to depend on .mih files, which don't exist in
LLDS grades, and also left altered timestamps.
This diff changes the install process to make a single tmp_dir
subdirectory of the workspace, with all the work of install_grade
being done inside tmp_dir. The original directories aren't touched
at all.
*/Mmakefile:
Adjust references to the browser directory to refer to the mdbcomp
directory instead or as well.
scripts/Mmake.rules:
*/Mmakefile:
Make it easier to debug Mmakefiles. Previously, creating a
Mmake.makefile with mmake -s and invoking "make -d" ignored the
most fundamental rules of mmake, because Mmake.rules was treating
an unset MMAKE_USE_MMC_MAKE as if it were set to "yes", simply because
it was different from "no". This diff changes it to treat an unset
MMAKE_USE_MMC_MAKE as if it were set to "no", which is a more
sensible default.
scripts/prepare_tmp_dir_fixed_part.in:
scripts/scripts/prepare_tmp_dir_grade_part:
Two new scripts that each do half the work of preparing tmp_dir for
the real work of the install_grade make target. The fixed_part script
prepares the parts of tmp_dir that are grade-independent, while the
grade_part scripts prepares the parts that are grade-dependent.
configure.in:
Test C files in the mdbcomp directory to see whether they need to
be recompiled after reconfiguration.
Create prepare_tmp_dir_fixed_part from prepare_tmp_dir_fixed_part.in.
compiler/*.m:
runtime/mercury_wrapper.c:
Update the references to the moved files.
compiler/notes/overall_design.html:
Mention the new directory.
Estimated hours taken: 0.25
Branches: main
compiler/modules.m:
Always pass ALL_GRADEFLAGS to mmc, even when building the
interface files. This avoids spurious "debugging is
available only in low-level C grades" errors when
the default grade is hlc.gc.
Zoltan did this for scripts/Mmake.rules but not modules.m.
scripts/Mmake.rules:
Pass ALL_GRADEFLAGS when errorchecking and converting to Mercury.
Estimated hours taken: 0.5
Branches: main
Clean up the handling of environment variables.
scripts/Mmake.rules:
scripts/c2init.in:
scripts/mgnuc.in:
scripts/ml.in:
scripts/mmc.in:
scripts/parse_ml_options.sh-subr.in:
scripts/binary_step.in:
Remove support for the environment variables which were
previously used to override the location of the standard
library (MERCURY_ALL_C_INCL_DIRS, MERCURY_ALL_MC_C_INCL_DIRS,
MERCURY_INT_DIR, MERCURY_C_LIB_DIR, MERCURY_MOD_LIB_MODS,
MERCURY_TRACE_LIB_MODS).
scripts/Mercury.config.in:
Fix syntax errors.
Set the DEFAULT_MERCURY_LINKAGE variable here rather
than in the mmc script.
scripts/mmc.in:
Setting DEFAULT_MCFLAGS is no longer required -- mmc
now reads its configuration information from the
Mercury.config file. This also fixes a bug which
caused failures in the `mmc --make' tests in
debugging grades on mundroo -- `mmc --make' wasn't
including /usr/local/lib and /usr/local/include in
the search paths for libraries and headers.
configure.in:
Check that the installed compiler is capable of
reading the Mercury.config file.
Bootstrap tag: bootstrap_20030413_read_config_file.
NEWS:
doc/user_guide.texi:
Document the change.
Estimated hours taken: 0.2
Branches: main
scripts/Mmake.rules:
Pass $(ALL_GRADEFLAGS) to all invocations of the compiler, since
the compiler now has sanity checks on option values that could be
tripped with the default grade that may not be tripped with the actual
desired grade.
library/Mmakefile:
Delete my previous "fix" for this problem, since it is not needed
anymore.
Estimated hours taken: 3
Branches: main
Make sure the Java back-end puts class files in the right place with
`--use-subdirs' and properly cleans up all generated .class files.
mercury/compiler/compile_target_code.m:
mercury/scripts/Mmake.rules:
Tell to Java compiler to put generated .class files in the
`Mercury/classs' directory.
mercury/compiler/modules.m:
Clean up all generated .class files.
Estimated hours taken: 1
Branches: main, release
scripts/Mmake.rules:
compiler/compile_target_code.m:
Be consistent about using `-' rather than `/' for options to cl.
Use `-o ' rather than `-link -out:'.
Ensure that `-o' comes before $(MS_CL_LIBS).
Resynchronize the release branch with the main branch.
Estimated hours taken: 0.5
Branches: main
Fix a bug in my previous change to fix a bug in fjh's previous change.
Revert back to using '/out:', and instead add the flag '/link' so that '/out:'
is passed to the linker instead to avoid problems compiling the library.
scripts/Mmake.rules:
compiler/compile_target_code.m:
Add '/link' before the '/out:'.
scripts/Mmake.rules:
Also add fjh's change for /LD to other rules building .dlls.
Estimated hours taken: 0.5
Branches: main
Fix a bug in fjh's previous change where we are passing the linker
flag for naming the output file to the C compiler, not the C compiler
flag.
scripts/Mmake.rules:
'-o' is the flag for naming the output file for the C compiler.
Estimated hours taken: 0.5
Branches: main
scripts/Mmake.rules:
When invoking $(MS_CL) to create DLLs, use the option "/LD" which
is documented in the help message, rather than the (undocumented?)
options "-link -noentry mscoree.lib -dll".
Estimated hours taken: 3
Branches: main
Fix a bug where `mercury.dll' was not being found by the C# compiler.
when you configured with a non-MS C compiler. This bug broke
tests/hard_coded/foreign_type in grade il.
configure.in:
bindist/bindist.build_vars.in:
Rename CYGPATH as FIX_PATH_FOR_CC.
scripts/Mmake.vars.in:
Rename CYGPATH as FIX_PATH_FOR_CC,
and add new variables FIX_PATH_FOR_CL and FIX_PATH_FOR_CSC.
The new variables are currently hard-wired as `cygpath -w',
since currently we only support the MS versions of CL and CSC.
Also, change the definition of MERC_DLL_DIR to use $(GRADE)
rather than hard-coding "ilc".
scripts/Mmake.rules:
Use the new variables, rather than $(CYGPATH).
Also, update various comments, and delete the unnecessary version
number from the MS_VC7_INCLUDES_DIR and MS_VC7_INCLUDES variable
names.
scripts/ml.in:
Use @FIX_PATH_FOR_CC@ rather than @CYGPATH@.
Estimated hours taken: 0.75
Branches: main
scripts/Mmake.rules:
boehm_gc/Mmakefile:
runtime/Mmakefile:
library/Mmakefile:
trace/Mmakefile:
Run $(RANLIB) on the installed libraries.
This is needed on MacOS 10.1, where the linker checks the date
stamp on the .a file, refusing to link if this date is greater
than the date when ranlib was run. Since installing the
libraries with `cp' updates their timestamp, we need to rerun ranlib.
scripts/Mmake.rules:
Change some hard-coded occurrences of `.a' to `.$A'. This is
probably needed to make things work properly when building with MSVC.
Estimated hours taken: 1
Branches: main
Change things so that LIBGRADES includes the default grade.
This fixes a bug that sometimes caused the libraries not to be
installed in the default grade, e.g. when $(GRADE) is set in Mmake.params.
configure.in:
Don't delete $(GRADE) from $(LIBGRADES).
Mmakefile:
scripts/Mmake.rules:
compiler/make.program_target.m:
Change the loops over $(ALL_LIBGRADES) so that they skip $(GRADE).
scripts/Mmake.vars.in:
Delete an bogus assignment setting LIBGRADES to empty, since it
wasn't being used (LIBGRADES was being assigned again below).
Update the documentation for LIBGRADES.
Branches: main
Estimated hours taken: 0.25
scripts/Mmake.rules:
scripts/Mmake.vars.in:
Define ERR_REDIRECT in Mmake.vars.in, rather than Mmake.rules,
so that it can be overridden by the user's Mmakefile.
Branches: main
Estimated hours taken: 1
scripts/Mmake.rules:
Make the redirection of errors into `.err' files configurable,
by abstracting out the code to redirect errors into a variable
ERR_REDIRECT. By default the behaviour remains the same, but if
you run `mmake ERR_REDIRECT=', then errors will not be redirected.
Estimated hours taken: 10
Branches: main
In the presence of foreign code the `.opt' and `.trans_opt' files
aren't grade independent, so install them in grade-dependent
directories.
scripts/Mmake.vars.in:
Define $(INSTALL_GRADE_INT_DIR), which holds `.opt'
and `.trans_opt' files.
Pass the extra libraries to mmc using `--ml' and `--mld'
(`--mercury-library' and `--mercury-library-directory')
options, rather than just a `-I' option. This is needed
so that $(INSTALL_GRADE_INT_DIR) is searched for `.opt'
files before $(INSTALL_INT_DIR)
Fix a bug -- the `-I' options for libraries should
go in CFLAGS, not MGNUCFLAGS.
scripts/Mmake.rules:
Create INSTALL_GRADE_INT_DIR in the install_grade_dirs target.
compiler/modules.m:
Install `.opt' and `.trans_opt' files in $(INSTALL_GRADE_INT_DIR).
`.int0' files are needed by `.opt' files for sub-modules, so
install them.
<module>.int0s now only contains the names of modules with sub-modules
(this is needed to avoid attempting to install nonexistent `.int0'
files).
compiler/handle_options.m:
Add $(INSTALL_GRADE_INT_DIR) for each `--mercury-library' option
to `--intermod-directories'.
Mmakefile:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
Simplify the code to copy/remove the grade dependent files
before building the libraries in a new grade when installing.
Copy/remove all grade-dependent files, including `.opt' files
and `.dv' files.
Estimated hours taken: 10
Branches: main
Library installation with `mmc --make'.
compiler/make.m:
compiler/make.program_target.m:
Handle `mmc --make lib<module>.install'.
compiler/options.m:
Add an option `--use-grade-subdirs', which causes
all grade-dependenent files to be placed in
`Mercury/<grade>/<ext>s' subdirectories, even
those files that are intended for use by the user.
`--use-grade-subdirs' is not documented because it
is only intended for use in library installation
with `mmc --make' (it doesn't work at all with Mmake).
Documenting it would require documenting (and setting
in stone) the layout of the `Mercury' directory, which
is probably a bad idea.
Mmake.workspace:
compiler/handle_options.m:
scripts/Mmake.rules:
Header files are now always searched for using the plain
file name (not Mercury/mihs/module.mih), so add a
`--c-include-directory' option to search Mercury/mihs
in the current directory.
compiler/modules.m:
compiler/intermod.m:
compiler/make.module_dep_file.m:
compiler/mercury_compile.m:
compiler/mlds_to_c.m:
compiler/trans_opt.m:
Handle `--use-grade-subdirs' in module_name_to_file_name.
Add module_name_to_search_file_name, which should be
used to generate the names of files that might be part
of an installed library. This is needed because installation
and local directory hierarchies have a different layout,
A better long-term fix would be to change things so that
the installation and local directory layouts are the same.
compiler/make.util.m:
compiler/make.dependencies.m:
compiler/make.module_target.m:
Add an extra argument to get_target_timestamp and
get_file_name to specify whether the file should
be searched for.
compiler/options_file.m:
scripts/Mmake.vars.in:
Handle the LIBGRADES and INSTALL_PREFIX make variables.
doc/user_guide.texi:
Remove the statement that library installation is
not supported with `mmc --make'.
Estimated hours taken: 0.2
Branches: main
scripts/Mmake.rules:
compiler/modules.m:
In the presence of foreign code the `.opt' and `.trans_opt' files
aren't grade independent, so pass $(ALL_GRADEFLAGS) to mmc
when creating them.
Estimated hours taken: 1.5
Branches: main
My change to fix the handling of target specific MCFLAGS
variables didn't work with `--split-c-files'.
compiler/modules.m:
Fix some bugs in the handling of `--split-c-files':
- Make `--split-c-files' work where the module name doesn't
match the file name.
- $(MCFLAGS-module) wasn't being passed to mmc when `module.dir/*.o'
were being rebuilt (it was being passed when the files were
being built from scratch).
scripts/Mmake.rules:
The pattern rule for `%.dir/*.o' is now redundant, so remove it.
Estimated hours taken: 5
Branches: main
Allow tools/bootcheck to be run using `mmake --use-mmc-make'.
The tests don't work yet.
compiler/make.m:
compiler/make.module_target.m:
Handle targets such as `<module>.cs' and `<module>.ints',
which are used when building stage 3.
Mmake.common.in:
*/Mmakefile:
*/Mercury.options:
Add Mercury.options files to pass module-specific flags to
`mmc --make'.
Avoid triggering the .DEFAULT rule introduced with `--use-mmc-make'
for optional files like Mmake.params.
compiler/modules.m:
Build the interface files when building a library in IL grades,
for consistency with C grades.
library/Mmakefile:
Improve performance by removing the dependency on the interface
files when building the library. The files are now always built
by the libmer_std target.
Pass the command to build libmer_std.init to `mmc --make'.
tools/bootcheck:
Add an option `--use-mmc-make'.
Copy the Mercury.options files into the stage2 and stage3 directories.
scripts/Mmake.rules:
Don't include the rules for `.dep' files with `--use-mmc-make'.
Include the rule for `--convert-to-mercury' even with `--use-mmc-make'.
compiler/Mmakefile:
tools/bootcheck:
tools/binary_step:
`mmc --make' doesn't handle `<module>_init.c' targets, so
don't make the `cs' target depend on `top_level_init.c'.
As far as I can tell, that dependency is only present so
that the stage2 and stage3 compilers have the same set of
C files. bootcheck and binary_step now only compare `.c'
files which are present in the stage3 directory.
Estimated hours taken: 0.5
Branches: main
scripts/Mmake.rules:
Avoid generating interface files for the library in
the compiler directory by stripping the directory
from the module name passed to mmc.
Estimated hours taken: 0.25
Branches: main
Fix a bug in my change to generate grade dependent header files.
The `.mih' files weren't being installed for the default grade.
scripts/Mmake.rules:
Run `lib<main_module>.install_grade_hdrs' for
all grades, including the default grade.
Mmakefile:
library/Mmakefile:
libmer_std.install_grade_hdrs is now run by
libmer_std.install_library, so it doesn't
need to be explicitly invoked here.
Estimated hours taken: 25
Branches: main
Fix problems with the compiler-generated header files:
1. the header files are grade dependent, but the header files
can only be installed for one grade.
2. the generated header files can clash with system headers.
To solve these problems, the compiler now generates a
grade dependent `.mih' file containing the declarations
needed when a module is imported in a high-level C code
grade, and a grade independent `.mh' file, which contains
the prototypes for `:- pragma export' declarations.
compiler/export.m:
Generate a `.mh' rather than a `.h' file for the `:- pragma export'
declarations.
Allow the header file generated by export.m to be used with
`--high-level-code'.
compiler/modules.m:
library/Mmakefile:
Add a module.install_grade_hdrs target to install the `.mih'
files in a grade-dependent directory.
compiler/arg_info.m:
compiler/hlds_out.m:
compiler/hlds_pred.m:
Make it easier to tell if the arg_info field of the proc_info
has been set.
compiler/mlds_to_c.m:
Include both the `.mh' and `.mih' files for imported modules.
The type used as the return value for a semidet procedure
exported to C is `MR_bool', not `MR_Word'.
compiler/mlds_to_c.m:
compiler/modules.m:
Don't add a `mercury.' prefix to the standard library
header file names. They can't clash with the system
headers any more.
compiler/mercury_compile.m:
compiler/mlds_to_c.m:
Use export.m to generate the header file for `:- pragma export'
declarations even in hlc grades.
compiler/mlds.m:
compiler/ml*.m:
Distinguish between the `.mh' and `.mih' files
in `mlds__import's.
compiler/handle_options.m:
scripts/Mmake.vars.in:
scripts/mgnuc.in:
Add C include directory options for the installed grade
dependent `.mih' files.
Mmakefile:
scripts/Mmake.rules:
s/h/mih/ in the commands to save the grade dependent
files when installing the library grades.
compiler/make.m:
compiler/make.dependencies.m:
compiler/make.module_target.m:
compiler/make.util.m:
Handle dependencies on `.mh' and `.mih' files.
NEWS:
doc/user_guide.texi:
Document the change.
Estimated hours taken: 5
Branches: main
More changes to make `mmc --make' work with mmake.
scripts/Mmake.vars.in:
Pass MCFLAGS, CFLAGS, MLFLAGS, etc. to mmc in an options file
on standard input.
Don't add options for EXTRA_LIBRARIES to CFLAGS and MLFLAGS
when compiling with `mmc --make'. mmc handles those options
itself.
compiler/options.m:
compiler/options_file.m:
doc/user_guide.texi:
`--options-file -' now makes the compiler read an options
file from standard input.
Make `--options-file' behave as a standard accumulating option
rather than attempting to copy the behaviour of make's `-f' option.
s/--link_object/--link-object/
Mmake.workspace:
Put the `.a' files for the libraries in MLOBJS, not MLLIBS.
`mmc --make' will now relink when they change.
compiler/modules.m:
Link MLOBS into `module.split'.
tests/debugger/Mmakefile:
Create a Mercury.options file for use in compiling
the queries in interactive.m test.
Estimated hours taken: 0.1
Branches: main
scripts/mmake.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
s/MC_MAKE_FILES/MC_BUILD_FILES/ as suggested by rafe.
Estimated hours taken: 2.5
Branches: main
Allow `mmc --make' to be used with Mmake.
scripts/mmake.in:
Add an option `--use-mmc-make', which tells mmake
to use `mmc --make' to build Mercury targets.
scripts/Mmake.vars.in:
Add a variable MC_MAKE_FILES, which should contain
files (e.g. generated header files) which should be
build with `mmc --make'.
Add a variable MERCURY_MAIN_MODULES which should
contain the top-level module names of the programs
or libraries in the directory. The targets for
the modules appearing in MERCURY_MAIN_MODULES
are added to MC_MAKE_FILES.
Add a variable MC_MAKE_FLAGS, which is like
MCFLAGS, but is only passed to `mmc --make'.
scripts/Mmake.rules:
Disable Mercury-specific rules when `--use-mmc-make'
is passed to mmake.
Use `mmc --make' for targets for which there are no
rules, or for targets appearing in MC_MAKE_FILES.
Estimated hours taken: 0.1
Branches: main
scripts/Mmake.rules:
Fix a bug with `--use-subdirs'. Mmake was looking for `.il' files
in the `Mercury/os' directory.
Estimated hours taken: 0.1
Branches: main
Fix bugs in my change to improve the handling of linking
with a non-installed standard library.
scripts/mmake.in:
Export MERCURY_STDLIB_DIR.
scripts/Mmake.rules:
Always set MERC_INT_DIR to avoid undefined variable warnings.
Estimated hours taken: 6
Branches: main
Allow alternative locations for the standard library files
to be specified using options to the various Mercury scripts
rather than environment variables. This change is necessary
to allow the compiler to be compiled using `mmc --make', because
`mmc --make' does not support the environment variables.
All of the Mercury scripts now accept an option
`--mercury-standard-library-directory' to specify the installed
library to use, or `--no-mercury-standard-library-directory' to
disable the use of the installed library. The location
of the alternate files to use can then be specified
using ordinary options to the scripts.
There is a new environment variable MERCURY_STDLIB_DIR, which has
the same effect as the `--mercury-standard-library-directory' option.
scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
scripts/mmc.in:
scripts/mmake.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
Handle MERCURY_STDLIB_DIR and `--mercury-standard-library-directory'.
Remove support for the MERCURY_C_INCL_DIR, MERCURY_MOD_LIB_DIRS
and MERCURY_TRACE_LIB_DIRS environment variables -- they aren't
used anywhere. MERCURY_C_INCL_DIR is being removed because the
assumption it makes (that all header files are installed into
a single directory) will not hold for much longer because the
generated header files for hl* grades are grade dependent.
compiler/options.m:
compiler/compile_target_code.m:
Add an option `--trace-init-file', used to specify `.init'
files which should only be used when tracing is enabled,
such as browser/mer_browse.init.
Allow `--mercury-stdlib-dir' as an abbreviation for
`--mercury-standard-library-directory'.
tools/lmc:
Use options rather than environment variables.
doc/user_guide.texi:
Document MERCURY_STDLIB_DIR, MERCURY_TRACE_LIB_MODS
and the `--trace-init-file' mmc option.
Remove documentation for the no longer used MERCURY_C_INCL_DIR,
MERCURY_MOD_LIB_DIRS, MERCURY_TRACE_LIB_DIRS and
MERCURY_NC_BUILTIN environment variables.
Estimated hours taken: 2
Branches: main
Add Mmake support for the Java back-end.
XXX TODO: Document it.
compiler/modules.m:
Add rules for generating `foo.javas' and `foo.classes' targets
and variables.
scripts/Mmake.rules:
compiler/modules.m:
Add rules for building .java, .java_date, and .class files.
scripts/Mmake.vars.in:
Add variables JAVAC, ALL_JAVACFLAGS, JAVACFLAGS, EXTRA_JAVACFLAGS,
TARGET_JAVACFLAGS, LIB_JAVACFLAGS, javas_subdir, java_dates_subdir,
and classes_subdir.
Also add some comments.
Estimated hours taken: 0.1
Branches: main
scripts/Mmake.rules:
Remove some unused code left over from an old method
of handling dependencies on MLOBJS.