Commit Graph

74 Commits

Author SHA1 Message Date
Julien Fischer
f54fe5f846 Update references to the IL backend.
browser/Mmakefile:
compiler/options.m:
library/array.m:
    As above.
2018-06-15 07:48:56 -04:00
Zoltan Somogyi
310048037c Try to guard against future bitrot.
tools/bootcheck:
    Build the dependencies for auxiliary programs, and the programs themselves,
    in the browser and profiler directories.

Mmakefile:
    Provide targets for bootcheck to use to make dependencies for the
    auxiliary programs in the browser and profiler directories.

browser/Mmakefile:
    Take the two aux programs in this directory out of the "all" target.
    Due to past bitrot, one gets errors during compilation, the other
    during linking. (The "all" target is not used by default, which is why
    this has not been a problem.)

    Add depend_aux and aux targets that should build these programs
    if they are ever fixed. The aux target is empty for now; the depend_aux
    target does make dependencies for both aux programs (since that still
    works, and we want to keep it that way).

profiler/Mmakefile:
    Add depend_aux and aux targets that build the one auxiliary program
    in this directory that works now. Add a comment about the other program
    that doesn't.
2018-01-09 01:05:42 +11:00
Zoltan Somogyi
5a7809b69c Document some bitrot.
browse_test.m:
    Fix all compilation errors in this test program. Some link errors
    remain.

declarative_test.m:
    Fix some compilation errors in this test program. (I don't know what
    the right fix is for the remaining errors.)

Mmakefile:
    Document the fact that neither program compiles cleanly anymore.
2017-12-30 15:18:37 +11:00
Julien Fischer
ba24a880fe Add targets for building stage 3 C# source files.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    Add the 'css' target for building the C# source files.
2017-10-22 06:38:07 -04:00
Julien Fischer
345bdfff55 Add targets for building the Java source files only.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/mdbcmp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    As above (required for stage 3).

    Delete residual references to the IL backend.
2017-10-21 21:36:40 -04:00
Peter Wang
13bd996453 Only pass -install_name option on Darwin.
The -install_name option broke building with mmake --use-mmake-make on
other operating systems.

browser/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
    As above.
2016-09-29 12:23:22 +10:00
Julien Fischer
1b17ed4d6c Fix a problem on OS X when building using --use-mmc-make.
The install names for Mercury shared libraries in the system were not being set
when building using --use-mmc-make.  The existing code in the Mmakefiles that
does this only works for mmake, not mmc --make.

browser/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
    When using --use-mmc-make set up the options to set the dylib install
    names in such a way that mmc --make can see them.

    Don't hardcode the library names in the definitions that set the
    library install names.
2016-01-08 23:58:25 +11:00
Zoltan Somogyi
2f6d49a1fc Delete more stuff needed only for the IL backend. 2015-09-23 11:13:00 +10:00
Julien Fischer
3dd02876a5 Delete the MLDS->IL backend.
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.
2015-09-21 11:34:46 +10:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Julien Fischer
6bf42c061e Remove unused targets from Mmakefiles.
browser/Mmakefile:
compiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
	Delete .ss and .pic_ss targets.
	These were only required for the GCC backend.
2013-02-20 16:38:52 +11:00
Julien Fischer
e6f59c08cc Fix problems that prevent Mercury from building on Mac OS X
Branches: main, 11.07

Fix problems that prevent Mercury from building on Mac OS X
PowerPC machines.
(This should fix bug #255, although I don't have a machine
running Mac OS 10.4 so I can't check that.)

browser/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
	Older versions of make (such as that shipped with
	Mac OS X 10.3) only support conditionals with at
	most one else branch: avoid using conditionals with
	multiple else branches.

configure.in:
runtime/mercury_conf.h.in:
	Define a macro if the header file sys/resource.h.

mdbcomp/shared_utilities.m:
	Conditionally include sys/resource.h.  It contains
	declarations required by setrlimit on older versions
	of Mac OS X.
2012-05-19 13:24:33 +00:00
Julien Fischer
efba79f074 A step towards getting the compiler to build in the java (and other non-C)
Branches: main, 11.01

A step towards getting the compiler to build in the java (and other non-C)
grade(s).

library/Mmakefile:
	Don't make lib_std depend on Native.so (which is currently
	unused) in the java grade.

	The lib_std target for the java grade *does* need to be
	defined if mmake --use-mmc-make is being used; not the
	other way round.

browser/Mmakefile:
	There is no "jars" target (and in any case the standard
	top-level in this directory works.)

compiler/Mmakefile:
	Bump the heap size for javac since the default is not
	sufficient.

compiler/make.util.m:
compiler/md4.m:
compiler/pickle.m:
compiler/process_util.m:
compiler/prog_events.m:
	Provide definitions of some predicates for the non-C backends.
2011-01-19 01:47:59 +00:00
Peter Wang
91b78d6738 Make it possible to install and use the csharp.ssdebug grade.
Branches: main

Make it possible to install and use the csharp.ssdebug grade.

Mmake.workspace:
        Never try to link with `mer_rt' in C# grades.

browser/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
        Use `mmc --make' to install these libraries in `csharp' grades.

        Don't add C libraries to MLLIBS in non-C or asm grades.

browser/Mercury.options:
ssdb/Mercury.options:
        "EXTRA_LIBRARIES-libname" doesn't actually work with `mmc --make',
        but "LIBRARIES-name" does.

library/exception.m:
ssdb/ssdb.m:
        Handle EXCP events in C# grades.

        Trap SIGINT when running ssdb in C# grades.

        Add `exit_process' implementation.

browser/declarative_execution.m:
browser/listing.m:
        Add stubs for C#.

README.CSharp:
        Document the C# backend.

README.DotNet:
        Add a pointer to README.CSharp.

README.Erlang:
README.Java:
        Remove a non-sensical paragraph.

.INSTALL.in:
configure.in:
        Add `--enable-csharp-grade' option.

        Make `configure --enable-ssdebug-grades' add `csharp.ssdebug'
        to the list of library grades.
2010-10-26 04:59:10 +00:00
Peter Wang
fd76da59ff Add support for the csharp' grade to mmc --make', and make it possible to
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.
2010-09-30 07:23:36 +00:00
Peter Ross
1f52e32b10 Use the Mmake.rules targets to install the browser, mdbcomp and ssdb
Estimated hours taken: 5
Branches: main, 10.04

Use the Mmake.rules targets to install the browser, mdbcomp and ssdb
directories so that the inteface and header files are all installed
correctly.

This replaces the previous ad-hoc method of just calling some of
Mmake.rules targets.

browser/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
	Make the install_library call the underlying install_library
	install_hdrs and install_ints targets.
	These targets come from the rule lib%.install, we can't use target
	because it calls install_grades, which we don't want to do.

	This implies removing the install_ints, install_hdrs and install_dirs
	targets as these are no longer needed.
2010-05-04 02:05:49 +00:00
Peter Wang
254a45937c Use mmc --make to install Java grades. The makefile rules in library/Mmakefile
Branches: main

Use mmc --make to install Java grades.  The makefile rules in library/Mmakefile
did not install .opt files into <prefix>/lib/mercury/ints/java.  When
intermodule optimisation was enabled with a Java grade, the Mercury compiler
would read the .opt files from <prefix>/lib/mercury/ints, which could be from
*any* grade (they are only installed to work around problems with Mmake).

Mmakefile:
        Force mmc --make to be used to install Java grades.

browser/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
        Delete rules for building libraries in the Java grade with Mmake.

        Move --no-libgrade options to *_FLAGS files.

library/Mmakefile:
        Create the jmercury -> ../java symlink at the `mmake depend' step.

        Pass -sourcepath . to javac so it can find the jmercury/runtime/*.java
        files.

browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
ssdb/SSDB_FLAGS.in:
        Add --no-libgrade options so that mmc --make libFOO.install only
        installs the main grade.

        Add --no-java-classpath so that the .jar files from the installed
        compiler aren't used.

        Tell the Java compiler about .jar files that each directory depends on.

README.Java:
        Remove a mention of Mmake with the java grade.
2009-10-20 04:07:25 +00:00
Zoltan Somogyi
16ce96291e Fix an old bug. The action for the target "tags_file_exists", which is
Estimated hours taken: 0.2
Branches: main

compiler/Mmakefile:
	Fix an old bug. The action for the target "tags_file_exists", which is
	implicitly remade whenever we rebuild the compiler, used to always
	touch .compiler_tags. This led the "tags" target to believe that
	the tags file (whose logical timestamp .compiler_tags represents)
	is at least as new as all the .m files, causing it to not actually
	remake the tags file, even when it should have.

	We now touch .compiler_tags only when rebuilding the tags file.

*/Mmakefile:
	Make the actions for tags follow the scheme in compiler/Mmakefile
	where needed.
2009-09-22 04:37:12 +00:00
Ian MacLarty
23d6d4a392 Get the java.ssdebug grade installing and compiling hello world.
Estimated hours taken: 2
Branches: main

Get the java.ssdebug grade installing and compiling hello world.
Note that currently the jars for the java.ssdebug grade are installed in the
same location as the non-ssdebug jars.  That's not a problem for now,
because the standard library currently has the ssdebug transformations
turned off when it's compiled in the ssdebug grade, so the java.ssdebug
jars are the same as the java jars.  Changing it so that the java.ssdebug
jars are installed in a different location requires getting mmc to
adjust the classpath depending on the grade, which doesn't seem worth
it at this stage.

Also note that the interface files for the ssdb, browser and mdbcomp
libraries need to be installed in the ssdebug grade otherwise mmc
complains that it cannot find files like ssdb.m when compiling
a program.  These interface files are currently only installed
when there is an ssdebug grade.

browser/MDB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
ssdb/SSDB_FLAGS.in:
    Generate .module_dep files (needed to compile ssdebug transformed
    programs).

browser/Mmakefile:
    Build and install mer_browser.jar.
    Install the interface files when in an ssdebug grade.

browser/browse.m:
    Avoid a determinism warning.

browser/cterm.m:
browser/declarative_execution.m:
browser/listing.m:
    Get this code compiling in java grades.
    The "if (1 == 1)" before throwing an exception is to avoid
    "unreachable code" errors from the Java compiler.

library/Mmakefile:
    Mention that the ssdebug jars are installed in the
    same spot as the non-ssdebug jars.

mdbcomp/Mmakefile:
    Build and install mer_mdbcomp.jar.
    Install the interface files when in an ssdebug grade.

mdbcomp/rtti_access.m:
    Get this code compiling in Java grades.

scripts/Mercury.config.in:
    Add the ssdb, mdbcomp and browser jars to the classpath.
    If they are not installed they will just be ignored.

ssdb/Mmakefile:
    Build and install mer_ssdb.jar.
    Install the interface files when in an ssdebug grade.

ssdb/ssdb.m:
    Get this code compiling in java grades.
    Flush the output buffers after displaying the prompt so that
    it's always displayed.
2009-09-14 05:58:23 +00:00
Peter Wang
d795f6bb55 Don't delete mercury directories as the Java backend no longer uses
Branches: main

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
        Don't delete mercury directories as the Java backend no longer uses
        them.
2009-06-22 02:58:56 +00:00
Julien Fischer
1ba64033d6 Clean up the mercury subdirectories used by the Java backend.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
	Delete any mercury directories.
2009-06-12 11:52:48 +00:00
Peter Ross
22c5b49792 Initial checkin which is all the scaffolding needed to
Estimated hours taken: 4
Branches: main

Initial checkin which is all the scaffolding needed to
support the new source to source mercury debugger (ssdb).

The main addition in this change is the ssdb directory,
which will contain the mer_ssdb library.

Mmake.workspace:
Mmakefile:
configure.in:
	Handle the new ssdb directory.

compiler/options.m:
	Add the --ssdb and --source-to-source-debug options.

compiler/mercury_compile.m:
	Add the ssdb pass (it does nothing at the moment).

compiler/modules.m:
	Implicitly import ssdb_builtin when compiling with --ssdb.

mdbcomp/prim_data.m:
	Handle the ssdb module.

ssdb/Mercury.options:
ssdb/Mmakefile:
ssdb/SSDB_FLAGS.in:
ssdb/.mgnuc_copts:
ssdb/.mgnuc_opts:
ssdb/RESERVED_MACRO_NAMES:
	Build system for ssdb directory.

ssdb/mer_ssdb.m:
ssdb/ssdb.m:
	The operations which are needed by the source to source
	debugger.

tools/bootcheck:
	Changes to the bootcheck script to handle the new ssdb module.



browser/Mmakefile:
bytecode/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
runtime/Mmakefile:
trace/Mmakefile:
	Add the ALLOW_SSDB_PREFIX rules.
2007-10-03 12:11:59 +00:00
Peter Wang
7fa0dff1b5 Add more documentation for the Erlang backend.
Estimated hours taken: 6
Branches: main

Add more documentation for the Erlang backend.

Make it possible to configure and install the Erlang backend without too
much manual tweaking.

NEWS:
	Mention the Erlang backend.

README.Erlang:
	Add installation and other notes for Erlang.

doc/reference_manual.texi:
doc/user_guide.texi:
	Add documentation for Erlang.

aclocal.m4:
configure.in:
	Check that the bootstrap compiler knows about the
	builtin_compound_{eq,lt} builtins, and understands
	--erlang-native-code.

	Make configure check for Erlang tools.

	Add configure --enable-erlang-grade option.  Erlang support
	is disabled by default.

scripts/Mercury.config.in:
	Add `--erlang-compiler <erl>' and `--erlang-interpreter <erlc>'
	options to be set by configure.

analysis/ANALYSIS_FLAGS.in:
compiler/COMP_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
	Add `--erlang-include-directory <dir>/Mercury/hrls' options so that
	the compiler can find Erlang header files from other subdirectories.

compiler/Mercury.options:
library/Mercury.options:
	Work around bugs in the HiPE compiler when compiling two modules.

	Delete the workaround that was necessary while bootstrapping
	builtin_compound_{eq,lt}.

compiler/options.m:
	Add notes that two options to check that the compiler is recent enough
	won't be recognised because they begin "no-" prefixes, and we have
	to use "--no-no-" instead.

compiler/options_file.m:
	Support ERLANG_FLAGS, EXTRA_ERLANG_FLAGS variables in options files to
	be the same as passing --erlang-flags.

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
trace/Mmakefile:
	Make the build system do the same things in the Erlang grade as for
	the IL and Java grades.

scripts/final_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	Make these scripts know about the erlang grade so that parts of the
	build system won't abort on seeing it.
2007-07-20 01:22:06 +00:00
Peter Wang
742c919c64 Fix problem installing grade libraries with `mmake --use-mmc-make'.
Estimated hours taken: 1
Branches: main

browser/Mmakefile:
mdbcomp/Mmakefile:
	Fix problem installing grade libraries with `mmake --use-mmc-make'.
	`mmc --make' only makes `.init' files as a side-effect of building
	libraries so move library dependencies before init file dependencies
	in install targets.  Also we need to use lib<name> targets instead of
	separate lib<name>.$A and lib<name>.$(EXT_FOR_SHARED_LIB) targets.

	Don't install mer_mdbcomp.init to non-grade specific directory.

library/Mmakefile:
	Remove `install_init' rule that installed mer_std.init to
	non-grade specific directory.
2007-01-08 07:07:04 +00:00
Julien Fischer
26de67a4c4 Remove support for non-grade specific .init files.
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.
2006-12-04 01:33:29 +00:00
Julien Fischer
3ace02fd26 A side effect of the introduction of trace goals is that .init files are
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.
2006-11-23 04:08:55 +00:00
Peter Wang
964ffbb950 These changes allow the compiler to be built with `mmake --use-mmc-make'.
Estimated hours taken: 2
Branches: main

These changes allow the compiler to be built with `mmake --use-mmc-make'.

*/Mmakefile:
	Add dummy rules for optional `Mmake.*.params' files so that
	`mmc --make' is not asked to make them.

library/INTER_FLAGS_MMC_MAKE:
library/Mmakefile:
	Add a version of the `library/INTER_FLAGS' file to be used when
	`mmc --make' is being used.

library/LIB_FLAGS.in:
	Add `--c-include-directory ../robdd' so that `mmc --make' can find
	the included C files for `robdd.m'.

tools/bootcheck:
	Make `bootcheck --use-mmc-make' imply `bootcheck --use-subdirs'.

	Copy `INTER_FLAGS_MMC_MAKE' to stage 2 and stage 3 directories.

	Manually make `*_FLAGS' files in the stage 2 directory if
	`--use-mmc-make' is in effect.
2005-12-16 05:49:40 +00:00
Zoltan Somogyi
d124cad510 Reduce the amount of clutter on mgnuc command lines by moving arguments that
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.
2005-05-20 06:15:28 +00:00
Zoltan Somogyi
d56de30e9d Remove most of the junk from the command lines executed by make when building
Estimated hours taken: 12
Branches: main

Remove most of the junk from the command lines executed by make when building
the compiler and by bootcheck when building test cases. We do this by moving
the junk into files consulted via the --flags option.

After this change, it is actually possible to see in a glance not just which
files are being compiled but also with which options. The size of the output
(measured in bytes) from a bootcheck is now only about 40% of what is was
before.

configure.in:
	Remember the path to the bootstrap compiler and the flags it should be
	invoked with separately. Put the flags into the FLAGS files in various
	directories.

	Test whether the default install directory actually exists, so that
	the -L and -R linker options referring to this directory are passed
	to the C compiler only if it does.

Mmake.common.in:
	Comment out a bunch of additions of MCFLAGS, the ones whose contents
	are now in FLAGS files.

	Conform to the changes in configure.in.

	Add a template rule for the dependencies of the FLAGS files.

Mmake.workspace:
	Comment out a bunch of additions of MCFLAGS, the ones whose contents
	are now in FLAGS files. In some cases, add references to the FLAGS
	files.

Mmakefile:
	When rebuilding Mmake.common, rebuild only Mmake.common, not all files
	created by configure.

analysis/ANALYSIS_FLAGS.in:
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/PROF_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
profiler/DEEP_FLAGS.in:
slice/SLICE_FLAGS.in:
tests/TESTS_FLAGS.in:
	Add these files, which each contain the junk flags (the flags which are
	the same on every invocation and mostly just clutter up compiler
	command lines) that are needed on each compiler invocation in the
	relevant directory. Besides the results of configuration (word size
	etc), and the paths to other parts of the system, these files mostly
	control which warnings are enabled.

	Restrict the list of directories in -I options to what is sensible;
	for example, don't specify -I../analysis in the deep_profiler
	directory.

*/.nocopyright:
	Don't require copyright notices in FLAGS files, since that would make
	them invalid.

library/INTER_FLAGS:
	Add this file, which contains the flags enabled with intermodule
	optimization.

tests/WS_FLAGS.ws:
	Add this file. Unlike the .in files, which processed by config.status
	based on the results of autoconfiguration, this one is processed to
	specify the location of the workspace being tested.

analysis/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
tests/Mmakefile:
	Include the relevant directory's FLAGS file on the command line, to
	replace all the additions to MCFLAGS in ../Mmake.common and in
	../Mmake.workspace, and in some cases, the directory-specific Mmakefile
	itself.

	Build the directory's FLAGS file before executing the depend target,
	since most compiler options beyond --generate-dependencies come from
	there.

	Delete the FLAGS files generated by config.status when doing "make
	clean".

tests/Mmakefile:
	Allow the environment to define DIFF_OPTS.

runtime/Mmakefile:
	Use an option to tell config.status what to rebuild, not some
	environment variables.

tests/invalid/Mercury.options:
	For two test cases, reset an option that is set in tests/WS_FLAGS,
	to match the options the affected tests were compiled with before.

tests/invalid/*.err2:
	Update these expected files to account for the use of error_util
	in error messages by previous changes to the compiler. These expected
	output files are used only with --use-subdirs.

tests/warnings/Mmakefile:
	For all test cases, reset an option that is set in tests/WS_FLAGS,
	to match the options the tests were compiled with before.

scripts/prepare_tmp_dir_grade_part
	Copy the flags files when creating the subdirectories of tmp_dir.

scripts/mgnuc.in:
	Provide a mechanism, a per-directory .mgnuc_opts file, for specifying
	the options that are required for every C file in a directory. The
	intention is to use this for -I../library etc, but this is not done
	yet; one thing at a time.

tools/bootcheck:
	Copy the FLAGS files when creating stage2 and stage3.

	Don't specify the compiler options that are now in FLAGS files.

	Fill in the location of the workspace in tests/WS_FLAGS before running
	the tests.

	Provide a mechanism (a file ~/.bootcheck_diff_opts) to allow the user
	to specify what options to invoke diff with.

	Move the setting of MMAKE_USE_SUBDIRS and MMAKE_USE_MMC_MAKE after
	we have built stage1, and always copy the profilers if --use-subdirs
	is set. The old ways of doing things caused problems if bootcheck
	was given --use-subdirs but stage1 doesn't use subdirs: the bootcheck
	modified the stage1 slice, profiler and deep_profiler directories.
2005-05-06 08:42:37 +00:00
Ian MacLarty
a492e2b90d Pass the grade options to mmc whenever it is called, even when it's just
Estimated hours taken: 3
Branches: main

Pass the grade options to mmc whenever it is called, even when it's just
building dependencies.  Previously compiling the compiler with tracing
enabled, where the compiler's default grade for applications was hlc.gc,
resulted in an error message like "debugging only allowed for low-level C
grades"; even when the GRADE=reg.gc option was set in Mmake.params.

browser/Mmakefile:
compiler/Mmakefile:
mdbcomp/Mmakefile:
	Pass the grade flags event when just running mmc with the
	--generate-source-file-mapping option.

compiler/modules.m:
	Pass the grade flags everytime mmc is invoked in the .d files.
2005-03-27 14:02:23 +00:00
Zoltan Somogyi
6b0fb566ce Move the mdbcomp library to its own directory.
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.
2005-01-28 07:12:05 +00:00
Zoltan Somogyi
38cf98fb2f Allow users to ensure that tags files always exist in the relevant directories
Estimated hours taken: 1
Branches: main

Allow users to ensure that tags files always exist in the relevant directories
by setting the environment variable ALWAYS_MMAKE_TAGS_FILE.

runtime/Mmakefile:
trace/Mmakefile:
library/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
	If TAGS_FILE_EXISTS is set to tags_file_exists, then make the default
	action ensure the existence of the tags file. It would be too
	expensive to remake the tags file every time mmake is run, but
	just testing for its existence is cheap enough.

	Fix the formatting of some rules.

Mmake.common.in:
	Set TAGS_FILE_EXISTS to tags_file_exists if the environment variable
	ALWAYS_MMAKE_TAGS_FILE is set.

	Fix some documentation.
2005-01-14 05:53:47 +00:00
Ian MacLarty
5d2b07416c Fix shared libs on Mac OS X for the source distribution.
Estimated hours taken: 8
Branches: main

Fix shared libs on Mac OS X for the source distribution.  The problem is that
the source distribution is generated on a Linux PC, so the Darwin-specific
-install_name linker option is not passed to the linker in the .dep files.

The fix is to instead pass the -install_name linker option in the Mmakefiles.
However this means that the -install_name linker option will be passed twice
(which is not allowed by the linker) if the .dep files are generated on a
Darwin system, so we disable the --shlib-linker-use-install-name mmc flag so
that the -install_name linker option is not passed in the .dep files.

Also change the default install-name path to the value of
FINAL_INSTALL_MERC_LIB_DIR, instead of just INSTALL_MERC_LIB_DIR in case the
install directory is different from the final install directory.

Makefile
	Remove .dylib files when cleaning.

browser/Mmakefile
library/Mmakefile
	Pass -install_name linker option when building .dylib targets.
	Disable --shlib-linker-use-install-name mmc option.

compiler/options.m
	Change default value of --shlib-linker-install-name-path to the value
	of FINAL_INSTALL_MERC_LIB_DIR, instead of INSTALL_MERC_LIB_DIR.
2004-11-01 04:46:20 +00:00
Ian MacLarty
ea43cd038d Changes to get shared libraries to work on Mac OS X (Darwin).
Estimated hours taken: 20
Branches: main

Changes to get shared libraries to work on Mac OS X (Darwin).

This is phase 2 of 2.  Phase 1 added the compiler options described below.
Phase 2 uses these compiler options in the configuration scripts.

Darwin shared libraries have the extension `dylib' instead of `so'.  Also
objects that link to a shared library on Darwin don't need to be told the
runtime path in which they should look for the libraries, instead the
shared libraries themselves remember where they will be eventually installed
(called the install-name) and any object which links in the shared library will
get the install-name from the shared library at link time.  When a shared
library is built it has to be told where it will be installed which is what
the libtool -install_name option is used for on Darwin.

This diff only enables shared libraries on Darwin, not "bundles" which are
shared objects that can be loaded dynamically at runtime using something like
dlopen.  Therefore the interactive query tool in the debugger still doesn't
work on Mac OS X.

Added three new compiler options :

--shlib-linker-use-install-name :
	A boolean flag to tell the compiler to use the -install_name option
	when building shared libraries.  When this flag is set the following
	options have no effect: --linker-rpath-flag, --linker-rpath-separator,
	--shlib-linker-rpath-flag, --shlib-linker-rpath-separator.

--shlib-linker-install-name-flag :
	The flag name to use ("-install_name" for Darwin).

--shlib-linker-install-name-path :
	The path where the shared library will eventually end up, excluding the
	file name.  The file name is appended to the end before the option
	is passed on to the linker.

Mmake.common.in
	Added variables used for install-name on/off switch and flag name.

NEWS
	Mentioned shared libs working now on Mac OS X.

README.MacOS
	Removed bit about shared libs not working in Mac OS X.

configure.in
	Make shared libs the default when on Darwin and the compiler is gcc.

boehm_gc/Makefile
boehm_gc/Makefile.direct
	Added rule to make libgc.dylib and set the install-name correctly.

boehm_gc/Mmakefile
	Set variable used in boehm_gc/Makefile to get the final install path
	of the gc shared lib.

browser/Mercury.options
	Added mer_mdbcomp library for target libmer_browser.dylib.

browser/Mmakefile
	Added --shlib-linker-install-name-path option to MC options.

doc/user_guide.texi
	Documented the --shlib-linker-install-name-path option.  The other
	options will be automatically set by the configure script and
	should never need to be set by the user, so they're not documented in
	the user guide.

runtime/Mmakefile
	Added rule to make the Darwin shared library.

scripts/Mercury.config.bootstrap.in
	Added default values for --shlib-linker-use-install-name and
	--shlib-linker-install-name-flag.

scripts/Mercury.config.in
	Added default values for --shlib-linker-use-install-name and
	--shlib-linker-install-name-flag.

trace/Mmakefile
	Added rule to make the Darwin shared library.
2004-10-19 06:01:38 +00:00
Fergus Henderson
d0228c4489 Some work towards getting the "browser" directory to build in grade java.
Estimated hours taken: 24
Branches: main

Some work towards getting the "browser" directory to build in grade java.

In particular, this is a step towards fixing a problem in the Java
back-end with sub-modules.  When compiling code that uses sub-modules,
we run up against a Java restriction that a class which is in a package
is not allowed to have the same name as the package.  The work-around
is to use names starting with an uppercase letter for Java class names,
and names starting with a lower-case letter for Java package names.

XXX This diff is a partial step: it uses names starting with an
uppercase letter for Java class names that correspond to Mercury types.
It does not yet use an uppercase letter for Java classes that correspond
to Mercury modules.

XXX With this diff, we just flip the case of the initial letter,
which just works around the problem by avoiding the clashing cases,
rather than eliminating them.  We should use a more complicated mangling
that eliminates the problem completely, e.g. map lowercase Mercury names
to uppercase, map uppercase Mercury names to "U_" followed by the name.

compiler/mlds_to_java.m:
	Output type names with an initial uppercase letter.

compiler/mlds.m:
	Add a new enumeration type qual_kind, with values type_qual
	and module_qual.
	Add a qual_kind field to the fully_qualified_type type.
	Add a qual_kind argument to the append_class_qualifier function,
	and if the qual_kind is module_qual, adjust the case of the
	qualifier appropriately for the back-end.

compiler/ml*.m:
compiler/rtti_to_mlds.m:
	Fill in the new qual_kind field, and pass qual_kind to
	append_class_qualifier.

library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
library/io.m:
library/rtti_implementation.m:
	Use type names with an initial uppercase letter.

browser/Mmakefile:
	Work around problems where Java compilers don't like the file names
	generated by mmc for code using sub-modules.

	For IL and Java, build with --allow-stubs --no-warn-stubs.

browser/declarative_execution.m:
	Give a Java definition for the "proc_layout" type.
	This is needed to avoid compilation errors in grade java.
2004-08-02 08:30:17 +00:00
Fergus Henderson
f81fd43151 Add yet more missing dependencies, which caused problems when
Estimated hours taken: 0.5
Branches: main

browser/Mmakefile:
	Add yet more missing dependencies, which caused problems when
	bootstrapping with intermodule optimization enabled.
2004-02-17 23:44:52 +00:00
Fergus Henderson
ade1a43631 Add some more missing dependencies, which caused problems when building
Estimated hours taken: 0.25
Branches: main

browser/Mmakefile:
	Add some more missing dependencies, which caused problems when building
	with intermodule optimization enabled.
2004-02-09 12:05:17 +00:00
Fergus Henderson
e324ed42ba Add a missing dependency, which caused problems when building
Estimated hours taken: 0.5
Branches: main

browser/Mmakefile:
	Add a missing dependency, which caused problems when building
	with intermodule optimization enabled.
2004-02-05 15:30:14 +00:00
Fergus Henderson
899353ce88 Fix a bug in Zoltan's recent change: it was depending on
Estimated hours taken: 0.5
Branches: main

browser/Mmakefile:
	Fix a bug in Zoltan's recent change: it was depending on
	"libmer_browser.int" instead of "libmer_browser.ints"
	(and likewise for libmdbcomp).                     ^
2003-12-15 15:14:18 +00:00
Fergus Henderson
9b087fcc36 Ensure that we create libmer_mdbcomp.so before trying to build
Estimated hours taken: 0.1
Branches: main

browser/Mmakefile:
	Ensure that we create libmer_mdbcomp.so before trying to build
	libmer_browser.so.
2003-12-11 00:02:39 +00:00
Fergus Henderson
3f7c562053 Work around a problem where the mdbcomp library was being
Estimated hours taken: 1
Branches: main

browser/Mmakefile:
	Work around a problem where the mdbcomp library was being
	included in the mer_browser library, rather than just being
	referenced from it.
2003-12-10 23:56:35 +00:00
Fergus Henderson
8020bfed3c Some Mmakefile tweaks for grade java.
Estimated hours taken: 0.5
Branches: main

Some Mmakefile tweaks for grade java.

boehm_gc/Mmakefile:
browser/Mmakefile:
trace/Mmakefile:
	Don't try to build the boehm_gc, browser, or trace directories
	in grade java.

compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
	Avoid dependencies on *.$A files in grade java.
2003-12-09 14:57:57 +00:00
Fergus Henderson
4a76e32c47 Fix a typo: s/MDCOMP/MDBCOMP/g
Estimated hours taken: 0.25
Branches: main

browser/Mmakefile:
	Fix a typo: s/MDCOMP/MDBCOMP/g
2003-11-05 08:05:55 +00:00
Zoltan Somogyi
ecdc285bc7 Split the existing browser library into two libraries, by making the
Estimated hours taken: 10
Branches: main

Split the existing browser library into two libraries, by making the
program_representation module into its own library. This is useful because
the compiler refers to program_representation.m, whose code thus needs to be
linked into compiler executables even if the compiler isn't compiled with
debugging enabled. By creating a new library for this module, we avoid any
chance of the linker dragging in the rest of the modules in the browser
library. (This is a problem with an upcoming diff.).

The name of the new library is "mdbcomp", because the intention is that it
contain code that is shared between the debugger and the compiler. This means
mostly the definitions of data structures that the compiler generates for the
debugger, and the predicates that operate on them.

Mmake.common.in:
	Allow MDB_COMP_ as a prefix for symbol names in the browser directory.

Mmake.workspace:
	Add a make variable holding for the name of the new library, and
	add the name to the relevant lists of libraries.

	Avoid duplicating the lists of filenames that need to be updated
	when adding new libraries or changing their names.

Mmakefile:
	Use make variables to refer to library names.

browser/mdbcomp.m:
browser/mer_mdbcomp.m:
	Add these files as the top modules of the new library.

browser/program_representation.m:
	Make program_representation.m a submodule of mdbcomp, not mdb.

browser/program_representation.m:
browser/browser_info.m:
	Move a predicate from program_representation.m to browser_info.m
	to avoid the mdbcomp library depend on the browser library, since
	this would negate the point of the exercise.

browser/mdb.m:
	Delete program_representation.m from the list of submodules.

browser/Mmakefile:
	Update this file to handle the new module.

browser/Mercury.options:
	Mention the new module.

browser/*.m:
	Update the lists of imported modules. Import only one browser module
	per line.

compiler/notes/overall_design.html:
	Document the new library.

compiler/compile_target_code.m:
	Add the mdbcomp library to the list of libraries we need to link with.

compiler/prog_rep.m:
trace/mercury_trace_internal.c:
	Import program_representation.m by its new name.

scripts/c2init.in:
	Centralize knowledge about which files need to be updated when the list
	of libraries changes here.

scripts/c2init.in:
scripts/ml.in:
tools/binary:
tools/binary_step:
tools/bootcheck:
tools/linear:
tools/lml:
	Update the list of libraries programs are linked with.
2003-10-27 06:00:50 +00:00
Zoltan Somogyi
7c57ab785e Include Mmake.browser.params, if it exists.
Estimated hours taken: 0.1
Branches: main

browser/Mmakefile:
	Include Mmake.browser.params, if it exists.
2003-05-26 06:07:20 +00:00
Simon Taylor
ceaa856013 Move the setting of configuration options from mmc.in to
Estimated hours taken: 20
Branches: main

Move the setting of configuration options from mmc.in to
an options file Mercury.config. This has a few advantages:
- reduces the duplication between mmc and mercury.bat
- reduces the chance of running out of environment space
  on crappy operating systems (although we probably exceed
  the command line length limits on those systems anyway).
- makes it easier to bootstrap changes which add new
  configuration options.

Always read the options files, even without `--make',
to avoid inconsistent behaviour.

scripts/Mercury.config.in:
	New file containing the configuration code from mmc.in.

configure.in:
	Create scripts/Mercury.config.

bindist/Mmakefile:
	Make sure Mercury.config.in goes in the binary distribution.

Mmakefile:
bindist/Mmakefile:
Mmake.common.in:
	Make sure we get the correct setting of INSTALL_PREFIX
	when building the binary distribution.

scripts/Mmakefile:
scripts/mercury_config.in:
bindist/bindist.Mmakefile.in:
	Install Mercury.config.

compiler/options.m:
doc/user_guide.texi:
	Add documentation for the `--config-file' option, which gives
	the name of the configuration file to read.

	Add an option `read-config-file-2003-03-01' which will be
	used in configure.in to test whether the compiler is up
	to date after the configuration code is removed from mmc.in
	(after this change is installed everywhere).

	Add `--mercury-config-dir' as an abbreviation for
	`--mercury-configuration-directory'.

Mmake.workspace:
	Use the configuration file in scripts/Mercury.config.

browser/Mmakefile:
compiler/Mmakefile:
scripts/Mmake.vars.in:
	Always pass ALL_MCFLAGS to mmc so that mmc will
	use the configuration file specified in the options.

compiler/handle_options.m:
	Handle the default value of `--config-file'.

compiler/mercury_compile.m:
	Read the configuration file.

	Always read the options files, even without `--make',
	to avoid inconsistent behaviour.

compiler/make.m:
	Pass the variable settings from the configuration file
	to make__process_args.

	The options files have already been read in mercury_compile.m,
	so don't read them again here.

compiler/make.util.m:
	Add a version of build_with_module_options which doesn't
	need a make_info, for use by mercury_compile.m.

compiler/options_file.m:
	Export a predicate to read a single options file.

	Make the predicates to read options files add to an initial
	options_variables map, rather than always creating a new one.

	Allow MERCURY_STDLIB_DIR and MERCURY_CONFIG_DIR
	to be set in the options file or environment.

scripts/mmc.in:
	Set MERCURY_STDLIB_DIR and MERCURY_CONFIG_DIR in
	mercury_compile's environment.
2003-03-01 06:35:17 +00:00
Fergus Henderson
e132bebac7 Add `ils' target, for use by tools/bootcheck.
Estimated hours taken: 1
Branches: main

analysis/Mmakefile:
compiler/Mmakefile:
browser/Mmakefile:
profiler/Mmakefile:
	Add `ils' target, for use by tools/bootcheck.

library/Mmakefile:
	Add a missing dependency to ensure that we build all of the
	`.int*' files for the `il' grade (it was forgetting to build
	`library.int3').
	Also, add a target to build the library as an executable,
	so that you can run PEverify on it (PEverify doesn't
	work properly on multi-file assemblies unless they
	are executables).
2003-02-19 06:31:22 +00:00
Simon Taylor
4b49b1f019 Implement the ml and c2init scripts in the compiler to
Estimated hours taken: 25
Branches: main

Implement the ml and c2init scripts in the compiler to
reduce dependencies on Cygwin.

compiler/compile_target_code.m:
	Implement the functionality of ml and c2init, rather than
	calling those scripts.

	Handle all compiler dependencies using options, rather than
	testing for particular compilers here.

compiler/options.m:
NEWS:
doc/user_guide.texi:
	Add options which implement functionality which is part
	of ml, c2init or mgnuc when using Mmake:
	--warn-target-code, --output-link-command,
	--output-shared-lib-link-command, --ansi-c,
	--no-strip, --no-demangle, --no-main,
	--allow-undefined, --use-readline, --runtime-flags,
	--extra-inits.

	Add options to describe the C compiler and linker, for
	use by configure/mmc.

	The `--ml-flags' (`--link-flags') option has been removed.

compiler/options_file.m:
	Remove the MLFLAGS variable.

compiler/handle_options.m:
	`--target-debug' implies `--no-strip'.

	Add the path to the GC libraries to the library search paths.

compiler/mercury_compile.m:
	Handle --output-link-command and --output-shared-lib-link-command.

compiler/passes_aux.m:
	Add a variant of invoke_shell_command which takes a second
	command to process the first command's output. This is used
	by compile_target_code.m to invoke the demangler.

configure.in:
scripts/mmc.in:
	Handle extra default options.

scripts/c2init.in:
scripts/ml.in:
	Document that the code here is duplicated in
	compiler/compile_target_code.m.

Mmake.workspace:
browser/Mmakefile:
compiler/Mercury.options:
compiler/Mmakefile:
library/Mmakefile:
	Pass `-R' options pointing to the installation directories
	to mmc, as we already do for ml.
2003-02-05 14:41:20 +00:00
Fergus Henderson
83c7eea7e7 "Oops, missed one."
Estimated hours taken: 0.25
Branches: main

"Oops, missed one."
Apply the same change as for the other */Mmakefile
files in my 2002/10/18 patch to browser/Mmakefile.

browser/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.
2002-10-20 11:59:41 +00:00
Zoltan Somogyi
b7e55aa8ad Enforce namespace cleanliness in the library and browser directories
Estimated hours taken: 6
Branches: main

Enforce namespace cleanliness in the library and browser directories
as well as in the runtime and trace directories.

Mmake.common.in:
	Move the rules check_namespace here (they used to be in the Mmakefiles
	of the runtime and trace directories), together with the variables they
	need. Generalize them to also handle the needs of the browser, library
	and bytecode directories. The former two in particular need the
	ability to check automatically generated .mh files.

	Make all the rules used by check_namespace conditional on a macro
	that is defined by the Makefiles in all the directories that are
	checked for namespace cleanliness.

trace/Mmakefile:
runtime/Mmakefile:
	Replace the old rules for check_namespace, which are now in
	../Mmake.common.in, with the macros needed to control their behavior.

bytecode/Mmakefile:
	Add the macros needed to control the behavior of the rules for
	check_namespace.

	Move the lists of files to the start, before the include of
	../Mmake.common.

browser/Mmakefile:
library/Mmakefile:
	Add the macros needed to control the behavior of the rules for
	check_namespace.

runtime/RESERVED_MACRO_NAMES:
	Update comments, and delete obsolete exceptions.

browser/RESERVED_MACRO_NAMES:
library/RESERVED_MACRO_NAMES:
	New files to contain the exceptions from the naming scheme.

tools/bootcheck:
	Invoke "mmake check_namespace" in the library and browser directories
	as well as the runtime and the trace directories. Perform the
	invocation before we delete the object files we are checking for
	cleanliness.

	Clean up object files in all stage2 directories, not just the library,
	as soon as we can.

library/array.m:
library/builtin.m:
library/io.m:
library/time.m:
	Fix namespace violations.
2002-09-24 06:55:36 +00:00