Commit Graph

126 Commits

Author SHA1 Message Date
Julien Fischer
cf6aa853cb Delete an unused mmake variable.
scripts/Mmake.vars.in:
    Delete the definition of the variable GCCFLAGS_FOR_PIC.  This
    was only ever required by the GCC backend.
2015-12-10 11:11:25 +11:00
Julien Fischer
94535ec121 Fix spelling and formatting throughout the system.
configure.ac:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
library/*.m:
ssdb/*.m:
runtime/mercury_conf.h.in:
runtime/*.[ch]:
scripts/Mmake.vars.in:
trace/*.[ch]:
util/*.c:
	Fix spelling and doubled-up words.

	Delete trailing whitespace.

	Convert tabs into spaces (where appropriate).
2015-12-02 18:46:14 +11:00
Zoltan Somogyi
3447fbe8e5 Fix formatting. 2015-11-14 00:21:01 +11:00
Peter Wang
9bb1c8caa9 Delete variables for the deleted IL and gcc backends.
scripts/Mmake.vars.in:
tests/par_conj/Mmakefile:
tests/stm/Mmakefile:
tools/bootcheck:
	As above.
2015-09-30 15:06:29 +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
3a0401afec Fix some minor make annoyances. 2015-08-26 01:32:52 +10:00
Julien Fischer
9c85673c83 Fix problem with JAVAC_FLAGS_FOR_HEAP_SIZE and --restricted-command-line.
The default configuration of Mercury on Windows breaks when using the Java
grade due to the argument we pass to the Java compiler's '-J' option, in order
to set the maximum heap size, not being quoted in the @file we pass to the Java
compiler when '--restricted-command-line' is enabled.

What should be placed in the @file is:

   -J"-Xmx1024m"

What we currently put in it is:

   -J-Xmx1024m

The reason for this is that the setting of JAVAC_FLAGS_FOR_HEAP_SIZE in
scripts/Mercury.config does not escape the double quotes, consequently they do
not get passed through the Mercury compiler to the aforementioned @file.  This
problem was already correctly identified and documented in the comments
accompanying the MERCURY_CHECK_JAVAC_HEAP_SIZE macro in m4/mercury.m4, but the
actual behaviour of that macro is incorrect.  In particular, it fails to
account for the fact that the value of JAVAC_FLAGS_FOR_HEAP_SIZE should differ
depending on whether mmake or 'mmc --make' is using that value.  The current
value will work for mmake but not with 'mmc --make'
(and '--restricted-command-line').

The fix is to separate the handling of the mmake and 'mmc --make' cases and
correctly escape the version that is put in Mercury.config.

configure.ac:
m4/mercury.m4:
	Define separate configuration variables for mmake and 'mmc --make' to
	set the Java compiler's maximum heap size.

scripts/Mercury.config.in:
scripts/Mercury.config.bootstrap.in:
scripts/Mmake.vars.in:
	Conform to the above change.
2015-02-18 01:24:10 +11:00
Julien Fischer
fa33b08005 Delete residual support for the GCC backend.
scripts/Mmake.vars.in:
scripts/final_grade_option.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mmake.in:
scripts/parse_grade_options.sh-subr:
	As above.
2013-02-20 16:09:09 +11:00
Julien Fischer
9ef0e79bd6 Delete the long unused RM_C variable; the compiler hasn't
Branches: main, 11.07

scripts/Mmake.vars.in:
	Delete the long unused RM_C variable; the compiler hasn't
	generated references to it since 2001.
2011-10-11 12:53:22 +00:00
Julien Fischer
6a4c211a9d Don't use -o when creating executables with MSVC.
Branches: main, 11.07

Don't use -o when creating executables with MSVC.  (For some silly
reason its been deprecated and we have to use -Fe instead.)
Note that mmc --make already uses -Fe with MSVC, this change only
affects mmake.

configure.in:
scripts/Mmake.vars.in:
	Define a new variable, EXEFILE_OPT, whose variable gives the option
	used to name executables.

compiler/write_deps_file.m:
	Use the above variable instead of hardcoding the option to be
	"-o".
2011-10-04 02:37:57 +00:00
Julien Fischer
cb7ef8dfb7 Fix the man page installation directory.
Branches: main, 11.01

Fix the man page installation directory.

scripts/Mmake.vars.in:
	s/Man/man/
2010-12-20 16:29:08 +00:00
Paul Bone
0ee263a3fe Modify the documentation that discusses how to override INSTALL_PATH
Mmke.vars.in:
    Modify the documentation that discusses how to override INSTALL_PATH
    to describe setting of $DESTDIR instead.

    Don't add a slash before INSTALL_PATH if DESTDIR is empty since this
    breaks installation on Windows.  (This change has already been made
    in Mmake.common.in)

    Set more FINAL_INSTALL_ variables to support the new code in
    Mmakefile and bindist.Makefile.in.

Mmake.common.in:
    Improve the prose in a comment.

Mmakefile:
    Update installation message.

    Tell the user that their install is in $(DESTDIR) if applicable.

    Use FINAL_INSTALL variables rather than INSTALL variables.
2010-12-17 00:28:08 +00:00
Paul Bone
fd1459eccc Compatibility with Debian packaging.
Packaging Mercury for Debian requires creating some patches to make sure that
Mercury can be built under the control of dpkg-buildpackage.  It's recommended
that these patches are pushed upstream (into Mercury) so that everyone can
benefit from them, not just Debian packagers.

Mmake.common.in:
scripts/Mmake.vars.in:
    Install Mercury at $DESTDIR/@prefix@, $DESTDIR helps someone setup Mercury
    to run from @prefix@ while putting it in $DESTDIR.  $DESTDIR/* can easily
    be tared up and then deployed on other systems.

Mmakefile:
Makefile:
    Pass the $DESTDIR variable to make sub-processes.

scripts/Mercury.config.in:
scripts/Mercury.config.bootstrap.in:
    Remove the hash-bang line from these scripts since they are not executable.

    This change improves conformance with Debian packaging standards.
2010-12-14 07:01:55 +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 Wang
75acc7b514 Lift some assumptions that the only Java and Erlang grades are `java' and
Branches: main, 10.04

Lift some assumptions that the only Java and Erlang grades are `java' and
`erlang'.

Finally use `--force-disable-ssdebug' instead of `--no-ssdb' to disable the
source-to-source debugging tranformation where required.  The latter is
incorrect as it changes the grade, which disrupts the install path with `mmc
--make'.

library/Mmakefile:
scripts/Mercury.config.in:
scripts/Mmake.vars.in:
        Remove the variable `INSTALL_JAVA_LIBRARY_DIR' as it assumes only one
        Java grade is possible.

        Don't use default `--java-classpath' options to add Mercury standard
        libraries to the Java class path, for the same reason.

compiler/module_cmds.m:
        Add a predicate to return the Mercury standard libraries needed for a
        Java program as they are no longer listed in Mercury.config.

        Add the Mercury standard libraries when creating the shell script to
        launch Java programs.

compiler/compile_target_code.m:
        Add the Mercury standard libraries when calling the Java compiler.

compiler/make.program_target.m:
        Don't hard code `java' and `erlang' grades when installing library
        grade files.

browser/MDB_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
ssdb/SSDB_FLAGS.in:
        Use `--force-disable-ssdebug' to disable the transform.

compiler/module_imports.m:
        Don't implicitly import the `ssdb' module if `--force-disable-ssdebug'
        is enabled.

compiler/handle_options.m:
        Reset the `source_to_source_debug' option on encountering a `--grade'
        option.
2010-05-17 01:09:22 +00:00
Peter Wang
ff5715c766 Pass a flag to the Java compiler to increase the maximum heap size of the
Branches: main

Pass a flag to the Java compiler to increase the maximum heap size of the
JVM.  The default size (at least with Sun Java) is too small to build the
Mercury standard library on 32-bit JVMs.  We choose a heap size of 256 MB
currently.  (There doesn't seem to be an option to just switch off the
maximum.)

As the flag may not work with non-Sun compilers, we have to check during
configuration whether it's accepted by the detected Java compiler.

aclocal.m4:
        Add a function to check if the Java compiler accepts the option
        `-J-Xmx<n>'.

        Bump Java SDK requirement to 1.5 (this was raised previously without
        updating the check).

        Update some comments.

configure.in:
        Add the configure option `--enable-javac-flags-for-heap-size',
        enabled by default.

        Check if the Java compiler accepts the maximum heap size option.

        Substitute the option in scripts.

scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
scripts/Mmake.vars.in:
        Add @JAVAC_FLAGS_FOR_HEAP_SIZE@ to default javac flags.
2009-08-18 05:10:40 +00:00
Julien Fischer
f46d544a51 Conform to the deletion of mercury_cleanup_install.
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.rules:
scripts/Mmake.vars.in:
	Conform to the deletion of mercury_cleanup_install.
2008-02-26 15:21:17 +00:00
Peter Wang
ef81b66625 Move the intermodule analysis framework into the `compiler' directory, in
Estimated hours taken: 2
Branches: main

Move the intermodule analysis framework into the `compiler' directory, in
preparation for making it specific to the Mercury compiler, rather than having
it generic in case some fictional being might want to use it with a .NET
compiler one day.  This will make it easier to use and modify.

compiler/analysis.file.m:
compiler/analysis.m:
	Copy these files from the `analysis' directory.

compiler/top_level.m:
	Include analysis.m as a new package.

compiler/Mercury.options:
	Add a bug workaround line from analysis/Mercury.options.

analysis/Mercury.options:
analysis/Mmakefile:
analysis/analysis.file.m:
analysis/analysis.m:
analysis/mer_analysis.m:
	Replace the contents of these files with comments that the analysis
	framework is now in the `compiler' directory.  We don't actually
	delete them so their histories remain easily accessible.

analysis/README:
	Mention that the code has been moved.

compiler/notes/compiler_design.html:
compiler/notes/overall_design.html:
	Update documentation.

Mmake.workspace:
Mmakefile:
configure.in:
compiler/.mgnuc_copts:
compiler/COMP_FLAGS.in:
compiler/Mmakefile:
deep_profiler/.mgnuc_copts:
scripts/Mmake.vars.in:
scripts/c2init.in:
scripts/mercury_config.in:
scripts/prepare_tmp_dir_fixed_part.in:
tools/binary:
tools/binary_step:
tools/bootcheck:
tools/lmc.in:
tools/make_arena:
compiler/notes/coding_standards.html:
	Remove references to the `analysis' directory and `libmer_analysis'.
2008-02-20 03:10:00 +00:00
Peter Wang
f1956aa5ba Add $(MERCURY_MAIN_MODULES) to ALL_MC_BUILD_FILES only once if
Estimated hours taken: 0.2
Branches: main

scripts/Mmake.vars.in:
	Add $(MERCURY_MAIN_MODULES) to ALL_MC_BUILD_FILES only once if
	EXT_FOR_EXE is undefined, to get rid of warnings from `make' about
	duplicate rules when running `mmake --use-mmc-make' in the test
	directories.

tests/hard_coded/Mmakefile:
	Remove a couple of duplicate targets.
2007-09-05 01:33:28 +00:00
Jonathan Morgan
665ea0786c Removed support for Managed C++ as a foreign language for the IL backend.
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.
2007-07-14 02:33:27 +00:00
Julien Fischer
65bfb46299 Support user libraries and grade specific .init files with mmake.
Estimated hours taken: 1
Branches: main

scripts/Mmake.vars.in:
	Support user libraries and grade specific .init files with mmake.
2006-11-30 14:28: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
Julien Fischer
63d219d82d Fix a bug in mmc --make's handling of ranlib.
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.
2006-11-15 08:12:56 +00:00
Julien Fischer
faa18a15bd Fix the bug with initialisers/finalisers in libraries not being called ( and
Estimated hours taken: 7
Branches: main, release

Fix the bug with initialisers/finalisers in libraries not being called ( and
as consequence also fixes the bug with mutables not being given their correct
initial value).  The problem was that the directives necessary to call them
were not being included in the libraries' .init file.

The fix is to add a new mode of operation to mkinit that given a list of
.c files that make up some Mercury library, constructs the .init file for
that library.  In particular, it now constructs the .init file so that
it contains any REQUIRED_{INIT,FINAL} directives needed by the library.
The new mode of operation is invoked when mkinit is given the `-k' option.

Modify the build systems (i.e. mmake and mmc --make) to conform to the
above change.

compiler/modules.m:
	Change the rule mmake uses to build .init files so that it calls
	mkinit -k on all the .c files generated for the library.

scripts/Mmake.vars.in:
	Add a new mmake variable MKLIBINIT.  This is the program used to
	create .init files.  (It will nearly always be mkinit.)

compiler/compile_target_code.m:
	Change how .init files are built.  We now have to call mkinit -k to
	scan all of the .c files to write out the correct set of INIT,
	REQUIRED_INIT and REQUIRED_FINAL directives.  The code here is
	that used by mmc --make for creating the .init files.

compiler/make.program_target.m:
	Build the .init file after building the .c files, since building
	it before will no longer work.
2006-05-21 06:22:59 +00:00
Julien Fischer
9d8ca0ad37 Remove residual parts of the Aditi backend that weren't deleted the other day.
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.
2006-02-24 07:11:21 +00:00
Julien Fischer
c6d91ff386 Add some preliminary support for using the il grade with DotGNU.
Estimated hours taken: 1
Branches: main

aclocal.m4:
scripts/Mmake.vars.in:
	Add some preliminary support for using the il grade with DotGNU.

library/rtti_implementation.m:
	Avoid a warning.
2006-02-01 12:10:17 +00:00
Peter Wang
af878d04f9 Some work on the intermodule analysis framework.
Estimated hours taken: 45
Branches: main

Some work on the intermodule analysis framework.  The main changes are that
modules and analysis results have statuses associated with them, which are
saved in the `.analysis' files, and there is now code to handle intermodule
dependency graphs (that record which modules are dependent on a particular
analysis result).

Automatic recompilation of modules that use out of date or invalid analysis
results from other modules is not handled yet.

analysis/README:
analysis/analysis.m:
analysis/analysis.file.m:
	Remove the `FuncInfo' type variable everywhere.  This was originally
	designed to be used by analyses to store "extra" information that
	would be passed from an analysis implementation through the analysis
	framework, back to methods defined by the analysis implementation
	itself.

	The main problem was that `FuncInfo' made `Call' or `Answer' values
	hard to compare, as a `FuncInfo' value always had to be present for a
	comparison to be made (because the methods in the partial_order
	typeclass required FuncInfos).  One example of when this is hard to
	satisfy is when we are ready to write everything out to disk at the
	end of all analyses.  At this step there is much comparing of Call
	and Answer values, but this step is not invoked by any particular
	analysis pass.  To compare values we would need to get the FuncInfos
	from somewhere, which means we would have to store FuncInfos in the
	analysis_info maps as well.  And any time you have two FuncInfos, you
	need to choose one of the FuncInfos arbitrarily.

	Since FuncInfos would have to be read/written with every Call and
	Answer value, including IMDGs, I have changed it so that that any
	information which might be be stored in a `FuncInfo' should be stored
	in the corresponding `Call' value itself.

	Change the format of analysis result files to include an overall
	status for the module and a status for each analysis result.  The
	statuses record whether the module or analysis result could be
	improved by further compilation, or if the module or analysis result
	is no longer valid.

	Add code to read and write intermodule dependency graphs (IMDGs).  The
	IMDG file for module M records all the modules which depend on an
	analysis result for a procedure defined in M.

	Bump analysis file format version numbers as they are incompatible
	with earlier versions.

compiler/mercury_compile.m:
	Make `mercury_compile_after_front_end' use state variables for
	copies of the HLDS and update it to match changes in the intermodule
	analysis framework.

compiler/mmc_analysis.m:
	Add the trail usage analysis to the list of analyses to be used with
	the intermodule analysis framework.

	Update the entry for unused argument elimination.

	Add predicate `module_id_func_id'.

compiler/add_pragma.m:
compiler/hlds_module.m:
compiler/trailing_analysis.m:
	Make the trail usage analysis pass able to make use of the intermodule
	analysis framework.

	Associate each `trailing_status' in the `trailing_info' map with an
	`analysis_status', i.e. whether it is optimal or not.

compiler/unused_args.m:
	Update to match the removal of `FuncInfo' arguments and the
	addition of analysis statuses.

	Record the unused argument analysis result for a procedure even if
	all of the procedures arguments are used, so that callers of the
	procedure will know not to request more precise answers.

	Record the dependence of the current module on analysis results from
	other modules.

compiler/goal_util.m:
	Add predicate `pred_proc_ids_from_goal/2'.

compiler/make.m:
compiler/make.dependencies.m:
compiler/make.program_target.m:
compiler/make.util.m:
compiler/modules.m:
scripts/Mmake.vars.in:
	Make `mmc --make' and `mmake' realclean `.analysis', `.imdg' and
	`.request' files of non-library modules.  Files for imported library
	modules won't be deleted, but they probably shouldn't be generated in
	the first place.

NEWS:
library/list.m:
	Add a `list.map2_foldl2' predicate.

compiler/Mmakefile:
	Add the `analysis' directory to the list of directories to be
	processed by mtags.
2006-01-25 03:27:38 +00:00
Zoltan Somogyi
6d7b63df43 Remove support for the --split-c-files option, since it hasn't worked in a
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.
2005-11-28 02:30:36 +00:00
Peter Ross
e9c112bedc Implement support for writing Mmakefile in the style of
"Recursive make considered harmful".

This consists of two parts, giving mmake the optional ability to ignore
the .d files in the current directory.  The second part is adding
support to the compiler to write out just the .d file.

We may need to ignore the .d files in the current directory because we
may have included that file from another directory and we don't want to
define rules twice.

scripts/mmake.in:
scripts/Mmake.vars.in:
	If the mmake variable MMAKE_AUTO_INCLUDE_DS is set to no then
	don't include the rules defined in the .d files in the current
	directory.

compiler/mercury_compile.m:
	Add support for the --generate-dependency-file flag which just
	writes out the .d file for a module and then stops.

compiler/options.m:
	Add the generate_dependency_file option.

compiler/mercury_compile.m:
compiler/add_type.m:
compiler/handle_options.m:
	Make sure that generate_dependency_file implies that we don't
	need to build/link anything.

doc/user_guide.texi:
	Document the --generate-dependency-file flag.
2005-11-12 10:16:55 +00:00
Ian MacLarty
2e04ddc748 Remove the architecture string from the installed directory structure
Estimated hours taken: 1
Branches: main and 0.12

Remove the architecture string from the installed directory structure
and put the executables in $PREFIX/bin, instead of
$PREFIX/lib/mercury/bin/$FULLARCH.

The reason for this change is to reduce the need for unix shell scripts in
the top-level bin directory that call the actual programs in the
lib/mercury/bin/FULLARCH directory.  The unix scripts can't be run on Windows
without a unix emulation environment like Cygwin.

Because the executables are now in the top-level bin directory, we cannot
install multiple architectures under the same directory structure.  However
this is not a real loss, since the binaries for different architectures can
just be installed to different locations, as we currently do anyway on
mundula.cs.mu.oz.au.

The plan is to rename mercury_compile to mmc and do away with the mmc unix
script.  This will allow mmc to be run on Windows without Cygwin or MSYS.
This proposal replaces a previous proposal to implement a C version of the
mmc script.  That solution turned out to be quite complicated and
unreliable.

This diff will also mean mdice, mslice and mtc_union will be in the same
directory as mmc, so will be in the PATH as long as mmc is in the PATH.

configure.in:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
compiler/compile_target_code.m:
compiler/handle_options.m:
compiler/make.program_target.m:
debian/rules:
library/Mmakefile:
scripts/Mmake.vars.in:
scripts/mdprof.in:
scripts/mercury.bat.in:
scripts/mgnuc.in:
scripts/ml.in:
scripts/mmc.in:
scripts/mprof.in:
tools/run_all_tests_from_cron:
tools/test_mercury:
	Remove FULLARCH from the installed directory structure.
	Install executables to the top-level bin directory.
2005-10-25 10:17:29 +00:00
Ian MacLarty
ce245623ae Build pdf versions of the documentation and install them to the web site.
Estimated hours taken: 0.5
Branches: main and 0.12

Build pdf versions of the documentation and install them to the web site.

Mmake.common.in:
configure.in:
	Set PDFTEX to the location of the pdftex program.

doc/Mmakefile:
	Make and install the pdf documentation.

scripts/Mmake.vars.in:
	Set the install directory for pdf version of the documentation.
2005-08-16 15:51:30 +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
Peter Ross
71d3a6ce52 Fix a bug where we used windows paths which contain colons in the colon
seperated VPATH variable.

configure.in:
    Check for cygpath -u.

scripts/Mmake.vars.in:
    Use cygpath -u or echo to convert each of the directories in the
    VPATH into unix format.
2004-06-30 07:04:34 +00:00
James Goddard
75f3a934e7 Have the configure script decide whether to install the Java grade.
Estimated hours taken: 8
Branches: main

Have the configure script decide whether to install the Java grade.

configure.in:
	Add Java to the list of library grades to install by default,
	if the Java SDK is installed.
	Add the option to disable the Java grade.

aclocal.m4:
	Detect whether the Java SDK is installed.  Currently this is done
	by checking for javac, java and jar, then testing whether a program
	can be compiled which confirms the version is recent enough.

scripts/Mmake.vars.in:
	Add JAVAC, JAVA_INTERPRETER and JAR to the generated make variables.
	Add JAR_CREATE_FLAGS make variable, set as "cf"

scripts/Mercury.config.in:
scripts/Mercury.config.bootstrap.in:
	Define environmental variables MERCURY_JAVA_COMPILER and
	MERCURY_JAVA_INTERPRETER.
	Have the configure script set the default java compiler and interpreter
	as part of DEFAULT_MC_FLAGS.

library/Mmakefile:
	Use "$(JAR) $(JAR_CREATE_FLAGS)" instead of "jar cf"
2004-02-11 03:50:18 +00:00
James Goddard
f8541c230b New rules for installing the Mercury standard library in grade Java.
Estimated hours taken: 3
Branches: main

New rules for installing the Mercury standard library in grade Java.

library/Mmakefile:
	Added new target 'jars' which creates a jar file for the library
	classes and a jar file for the runtime classes.

	Modified target 'install_library' so that it adds these jar files to
	a new directory in the install path.

	To use these jar files, the CLASSPATH environment variable must be set
	to:

	<library_path>/mer_std.jar:<library_path>/mer_std.runtime.jar:.

scripts/Mmake.vars.in:
	Added variable INSTALL_JAVA_LIBRARY_DIR to define where the above jar
	files will be installed.
2004-01-27 00:20:35 +00:00
Simon Taylor
f0192eee15 Don't create symlinks when installing with a Win32 version
Estimated hours taken: 1
Branches: main

Don't create symlinks when installing with a Win32 version
of the compiler. The compiler won't know how to follow the
symlinks.

configure.in:
scripts/Mmake.vars.in:
scripts/Mercury.config.in:
compiler/modules.m:
	When using `gcc -mno-cygwin' or MS Visual C++ to
	build the compiler, don't create symlinks when installing.

compiler/options.m:
	Add an option `--no-use-symlinks'.
2003-05-22 03:57:13 +00:00
Simon Taylor
b235326b9f s/GRADE/GRADESTRING/ in a path name.
Estimated hours taken: 0.1
Branches: main, release

scripts/Mmake.vars.in:
	s/GRADE/GRADESTRING/ in a path name.
2003-05-19 03:21:35 +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
Simon Taylor
e51814b386 Don't pass MLFLAGS to `mmc --make' -- it's ignored
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.vars.in:
	Don't pass MLFLAGS to `mmc --make' -- it's ignored
	now that ml is implemented in the compiler.
2003-02-10 09:34:15 +00:00
Simon Taylor
d4ac368915 If $(EXT_FOR_EXE) is not empty, add a phony target
Estimated hours taken: 0.5
Branches: main

If $(EXT_FOR_EXE) is not empty, add a phony target
`main_module' which depends on `main_module'$(EXT_FOR_EXE)
With this change, the command used to build an executable
is consistent across platforms.

compiler/make.m:
	Assume that a target on the command line which doesn't match
	any other file type is an executable, even if $(EXT_FOR_EXE)
	is not empty.

compiler/modules.m:
	Add the rule.

scripts/Mmake.vars.in:
	Add the name of each of the $(MERCURY_MAIN_MODULES) to
	the list of targets which should be made by `mmc --make'
	if mmake was invoked wih `--use-mmc-make'.
2003-01-28 14:52:00 +00:00
Simon Taylor
7597ca1e80 Allow reconfiguration of existing installations, for example
Estimated hours taken: 20
Branches: main

Allow reconfiguration of existing installations, for example
to use a different C compiler. The reconfiguration works
by making a new copy of the scripts and mercury_conf.h,
and storing them in a partial installation directory tree
which uses the libraries and executables from the existing
installation.

Use this method to configure binary distributions, rather
than using a cut down version of the configuration script,
to avoid code duplication and to handle the case where the
C compiler in use on the installation machine is different
than that used to build the binary distribution.

This is more robust than the previous method of using a different
C compiler, which was to set the MERCURY_C_COMPILER variable and
hope the different C compilers were compatible enough.

Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
	Modify the `install' targets to store files needed to create
	a new configuration in $INSTALL_LIBDIR/reconf.

runtime/Mmakefile:
	Install mercury_conf.h in $INSTALL_LIBDIR/conf, rather than
	$INSTALL_LIBDIR/inc, so that it can be overridden by a
	different configuration.

scripts/mercury_config.in:
	Create a new configuration, by creating part of a Mercury
	source tree from the files stored in $INSTALL_LIBDIR/reconf,
	running configure, then copying the files into a partial
	installation tree.

scripts/Mmake.vars.in:
	Define ENABLE_DEEP_PROFILER, for use by bindist/bindist.Makefile.

	Define variables INSTALL_CONF_DIR (contains the files describing
	the configuration) and INSTALL_RECONF_DIR (contains files needed
	to reconfigure an installation).

configure.in:
	Add an option `--enable-reconfigure', for use by
	mercury_config.in.

	Don't look for runtime/mercury_wrapper.c when checking
	for the sources -- it isn't present when reconfiguring.
	Look for scripts/mmc.in instead.

	Look for the runtime headers in the installation hierarchy
	rather than the `runtime/' and `trace/' directories when
	reconfiguring.

	Output the help message for the `configure' script to
	`configure.help'.  This is included in the help message
	for `mercury_config'.

	Add new configuration variables CONFIG_PREFIX and CONFIG_LIBDIR,
	which are like PREFIX and LIBDIR except that they point
	to the configuration files, not the library files.
	In the normal case PREFIX and CONFIG_PREFIX will be the same.

bindist/bindist.INSTALL.in:
bindist/bindist.Makefile.in:
	Use mercury_config to configure binary distributions.

bindist/Mmakefile:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
	Remove bindist.configure.in and bindist.build_vars.in.

compiler/options.m:
scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
doc/user_guide.texi:
	Add an option `--mercury-config-dir', and an environment
	variable MERCURY_CONFIG_DIR, which tell the compiler and
	scripts where to find the configuration files for the
	installation.
	MERCURY_CONFIG_DIR is not documented because it should
	only be used by the scripts.

compiler/compile_target_code.m:
	Pass `--mercury-config-dir' to the scripts.

compiler/handle_options.m:
	Add `--c-include-directory $MERCURY_CONFIG_DIR/conf'.

library/getopt.m:
	Handle `maybe_string_special' options.

doc/user_guide.texi:
	Update the "Using a different C compiler" chapter.

NEWS:
	Document the changes.
2003-01-24 07:17:13 +00:00
Simon Taylor
886d2ae474 Make it easier to use shared libraries on x86 with
Estimated hours taken: 20
Branches: main

Make it easier to use shared libraries on x86 with
`mmc --make'.

There is now a third kind of object file, `.lpic_o'.
These files are compiled with `--pic-reg' but not with
CFLAGS_FOR_PIC, so they can be linked with shared Mercury
libraries.

On x86, executables which are linked with shared Mercury
libraries now depend on $(main_module.lpic_os), not
$(main_module.os).

This doesn't work with Mmake because ml doesn't know
which libraries are Mercury libraries, so it can't
link with the static versions of those libraries if
MERCURY_LINKAGE is set to "static".

configure.in:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
	Work out whether `.lpic_o' files are needed.

compiler/modules.m:
	Add `.lpic_o' to the list of grade or architecture
	dependent files.

NEWS:
README.Linux:
compiler/options.m:
doc/user_guide.texi:
	Document MERCURY_LINKAGE, LINKAGE, --linkage,
	--mercury-linkage and -R.

compiler/options_file.m:
compiler/make.program_target.m:
	Handle LINKAGE and MERCURY_LINKAGE variables.

	Allow LIBGRADES, LINKAGE and MERCURY_LINKAGE to be target-specific.

scripts/mmc.in:
	Set up the default linkage using the MERCURY_LINKAGE
	variable.

compiler/compile_target_code.m:
	Build `.lpic_o' files.

	Work out which type of object files to link with.

	When linking statically with Mercury libraries,
	find the absolute pathname for the `.a' file
	for each Mercury library, and pass that to ml,
	rather than just using `-lname'.

	Pass `-R' options to ml for each `-R' option to mmc.

compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/mercury_compile.m:
	Specify which type of object files to build.

compiler/make.program_target.m:
compiler/make.module_target.m:
	Make sure all generated object files are cleaned up.

compiler/prog_io.m:
	Add a better message for files which can't be found.

compiler/make.util.m:
	Add `.lpic_o' to the list of extensions.

compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
	Pass `--linkage shared' to mmc (`--shared' is in MLFLAGS).

tests/Mmakefile:
tests/mmc_make/Mmakefile:
tests/mmc_make/Mercury.options:
tests/mmc_make/complex_test.{m,exp}:
tests/mmc_make/hello.{m,exp}:
	Test `mmc --make'.

tests/lib/complex*.m:
	The complex numbers library from the extras distribution,
	for use in the mmc_make tests.
2003-01-23 00:24:20 +00:00
Simon Taylor
4b14085c72 A first implementation of the inter-module analysis framwork.
Estimated hours taken: 80
Branches: main

A first implementation of the inter-module analysis framwork.
Currently only unused argument analysis is supported.

The current inter-module analysis scheme using `.trans_opt' files
has some major limitations. The compilation dependencies introduced
by `.trans_opt' files are too complicated for Mmake without major
limitations on which modules can use the contents of which `.trans_opt'
files. Also, the `.trans_opt' file system only computes greatest fixpoints,
which is often too weak to find opportunities for optimization.
A better solution is to provide a library which manually handles
the dependencies introduced by inter-module analysis, and can deal with
the complications introduced by cyclic module dependencies.

TODO:
- support other analyses, e.g. termination, type specialization
- dependency tracking and invalidation after source modifications
- garbage collection of unused versions
- least fixpoint analyses

analysis/Mmakefile:
analysis/mer_analysis.m:
analysis/analysis.m:
analysis/analysis.file.m:
	The analysis library.

analysis/README:
	Description and design documentation.

Mmake.workspace:
Mmakefile:
compiler/Mmakefile:
tools/bootcheck:
	Link the analysis library into mercury_compile.

compiler/hlds_module.m:
	Store analysis information in the module_info.

compiler/options.m:
doc/user_guide.texi:
	Add an option `--intermodule-analysis'.

compiler/mercury_compile.m:
	Call the analysis library to write the gathered
	information at the end of a compilation.

compiler/unused_args.m:
	Call the analysis library to retrieve information
	about imported procedures. This replaces code which
	used the `.opt' files.

	Change the names created for unused arguments procedures
	to include the arguments removed, rather than a sequence
	number. I think Zoltan is working on a change to name
	mangling, so I haven't updated the demangler.

compiler/prog_util.m:
	Generate the new predicate names for unused_args.m.

library/std_util.m:
	Add a polymorphic version of unit, which is useful
	for binding type variables.

compiler/modules.m:
scripts/Mmake.vars.in:
	Clean up files created by the analysis framework
	in `mmake realclean'.

util/mdemangle.c:
profiler/demangle.m:
	Document the change in the name mangling of procedures with
	unused arguments.

configure.in:
	Check for state variables and fixes for some typeclass bugs.

tests/warnings/Mmakefile:
tests/warnings/unused_args_analysis.{m,exp}:
	Test case.
2003-01-02 06:54:03 +00:00
Simon Taylor
8687a17aea Fix "cygpath: command not found" errors with `mmake --use-mmc-make'.
Estimated hours taken: 0.25
Branches: main

Fix "cygpath: command not found" errors with `mmake --use-mmc-make'.

configure.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
	Check that `cygpath' exists, rather than hard-coding
	it in Mmake.vars.in.
2002-11-04 01:49:10 +00:00
Fergus Henderson
6d7c9629a4 Fix a bug where `mercury.dll' was not being found by the C# compiler.
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@.
2002-10-24 09:16:11 +00:00
Fergus Henderson
ffee30fa53 Change things so that LIBGRADES includes the default grade.
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.
2002-10-15 16:23:57 +00:00
Fergus Henderson
16cbea5ca7 Define ERR_REDIRECT in Mmake.vars.in, rather than Mmake.rules,
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.
2002-09-15 10:01:51 +00:00
Simon Taylor
a77d488245 In the presence of foreign code the .opt' and .trans_opt' files
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.
2002-08-22 02:34:21 +00:00
Simon Taylor
f93cb36f0f Add lib*.install to the list of targets that should
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.vars.in:
	Add lib*.install to the list of targets that should
	be handled by mmc with `--use-mmc-make'.
2002-08-16 02:05:12 +00:00
Simon Taylor
44ef4e118b Library installation with `mmc --make'.
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'.
2002-08-07 13:12:11 +00:00