samples/c_interface/standalone_c/Makefile:
Fix grammar in a couple of spots.
Use ':=' in place of '=' in some assignments.
samples/c_interface/standalone_c/c_main.c:
Fix grammar in a couple of spots.
Do not say that access to Mercury mutables from C is currently
not thread safe; it will never be thread without the programmer
putting in their own synchronization.
Put .mh files into a Mercury/mhs subdirectory when --use-subdirs
or --use-grade-subdirs is used.
compiler/file_names.m:
Replace ext_cur_mh with ext_cur_ngs_max_cur_mh, in the new category
ext_cur_ngs_max_cur. The new category is similar to that for .mih
files, except that .mh files are never placed in grade-specific
subdirectories.
compiler/handle_options.m:
Add Mercury/mhs subdirs to list of C include directories
when --use-subdirs or --use-grade-subdirs is in effect.
compiler/write_deps_file.m:
Add $(mhs_subdir) prefix before %.mh patterns.
Create a Mercury/mhs -> .. symlink when installing.
This is required by mmc --make and mmake --use-subdirs.
Conform to the changes above.
compiler/export.m:
compiler/make.file_names.m:
compiler/make.program_target.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mlds_to_c_file.m:
Conform to the changes above.
scripts/Mmake.vars.in:
Define the variable mhs_subdir.
scripts/Mmake.rules:
Add -I option to find .mh files when --use-subdirs is used.
browser/.mgnuc_copts:
browser/MDB_FLAGS.in:
compiler/.mgnuc_copts:
compiler/COMP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/DEEP_FLAGS.in:
extras/EXTRAS_FLAGS.in:
grade_lib/.mgnuc_copts:
grade_lib/GRADE_LIB_FLAGS.in:
library/.mgnuc_copts:
mdbcomp/.mgnuc_copts:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/.mgnuc_copts:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/.mgnuc_copts:
profiler/PROF_FLAGS.in:
slice/.mgnuc_copts:
slice/SLICE_FLAGS.in:
ssdb/.mgnuc_copts:
ssdb/SSDB_FLAGS.in:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
trace/.mgnuc_copts:
tools/lmc.in:
Add -I options to find .mh files when the workspace is built
with mmake --use-subdirs.
samples/c_interface/standalone_c/Makefile:
Add option to let the C compiler find the .mh file.
NEWS.md:
Announce change.
Delete trailing whitespace.
samples/c_interface/cplusplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
As above.
samples/c_interface/*:
Replace left over references to the old c_header_code pragma.
Replace some uses of '__' as a module qualifier.
Replace tabs with spaces.
Add some missing words.
samples/c_interface/mercury_calls_fortran/Mmakefile:
g77 was replaced by gfortran in GCC 4.0, use the latter in
this example.
samples/c_interface/mercury_calls_fortran/fortran_main_int.m:
Replace a ':- pragma import' with an equivalent foreign_proc.
Describe the current gfortran name mangling scheme and delete
references to g77 command line options not supported by gfortran.
samples/c_interface/mercury_calls_fortran/mercury_main.m:
Replace tabs with spaces.
samples/java_interface/short_example.m:
A Java version of the short example.
samples/java_interface/README.md:
Add an entry for the new example.
samples/c_interface/README.md:
samples/csharp_interface/README.md:
Fix wording.
Remove old .cvsignore files, moving their contents to .gitignore files.
There are now no .cvsignore files in the repository.
I've also sorted some .gitignore files and avoided repeating a pattern in a
subdirectory's .gitignore file when it is already mentioned in the parent
.gitignore file.
samples/Mmakefile:
Add the beer program to list of targets.
samples/*.m:
Convert (C->T;E) to (if C then T else E).
Delete trailing whitespace.
Use predmode syntax instead of separate pred and mode
declarations.
samples/interpreter.m:
Fix up one predicate that had some clauses that used
DCGs and others that used state variables.
Don't use the name 'IO' for something that isn't the I/O state.
samples/diff/*.m:
samples/c_interface/c_calls_mercury/mercury_main.m:
samples/c_interface/short_example.m:
Delete trailing whitespace.
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.
samples/c_interface/standalone_c/Makefile:
samples/c_interface/standalone_c/c_main.c:
As above.
samples/c_interface/README:
s/C interface/foreign language interface/
boehm_gc/.gitignore:
Ignore .obj files
extras/xml/xml.dtd.m:
extras/xml/xml.parse.m:
Change the name of functor ('1') in the multiplicity/0 type
to one. The former name does not (yet) work with the C# grade.
samples/.gitignore:
Ignore library output and sample executables.
samples/c_interface/standalone_c/.gitignore:
Ignore mercury_lib_int output files.
samples/c_interface/standalone_c/Makefile:
chmod 0644.
samples/c_interface/.gitignore:
Ignore object files and executables.
samples/java_interface/.gitignore:
Ignore Java class files and executables.
samples/lazy_list/.gitignore:
samples/muz/.gitignore:
samples/rot13/.gitignore:
Ignore executables.
samples/rot13/rot13_concise.m:
Update call to index_det to use string.det_index.
Added comments to clarify type inference.
samples/solutions/.gitignore:
Ignore executables.
samples/solutions/all_solutions.m:
samples/solutions/n_solutions.m:
samples/solutions/one_solution.m:
samples/solutions/some_solutions.m:
chmod 0644.
samples/solver_types/.gitignore:
Ignore executables.
samples/solver_types/sudoku.m:
Output the solution in a 3x3 grid.
Branches: main
Add two new options to the compiler for querying what flags are passed to the
C compiler at a finer level of detail than that provided by --output-cflags.
The first new option, --output-grade-defines, prints the flags passed to the C
compiler to define the macros that specify the current compilation grade.
The second new option, --output-c-include-dir-flags, prints the flags passed
to C compiler that tell it where to search for C header files.
The rationale for the addition of the new options is that when compiling C++ or
Objective-C programs that call exported Mercury procedures via a standalone
interface we need both the flags for the grade defines and the include search
directories but other flags that we usually pass the C compiler may not be
appropriate for either a C++ or Objective-C compiler.
compiler/options.m:
Recognise the new options.
compiler/mercury_compile.m:
Handle the new options.
compiler/compile_target_code.m:
Separate out the code that generates the grade macro define
flags into a separate predicate.
Do likewise with the code that generates the flags for specifying
C compiler include search directories.
doc/use_guide.texi:
Document the new options.
samples/c_interface/standalone_c/Makefile:
Illustrate how to use the new options when compiling a program that
uses a standalone interface. Explain why it may not be appropriate
to use the output of --output-cflags when compiling code that calls
exported Mercury procedures.
Branches: main
samples/c_interface/standalone_c/Makefile:
Delete comments regarding the mgnuc and ml scripts.
The example was changed so that it doesn't rely on those
some time ago.
set of flags that it passes to the linker in order to link against a
selected set of Mercury libraries (the standard libraries plus any others
specified via the --ml option) in the current grade.
This removes the need for using the ml script with standalone interfaces.
(Which is useful on those systems that don't have a proper shell and can't
use that script!)
compiler/compiler_target_code.m:
Add a predicate that prints out the above information.
Refactor code in order to to avoid duplication between the new
functionality and the existing code for invoking the linker.
compiler/mercury_compile.m:
compiler/options.m:
Add the new option.
doc/user_guide.texi:
Add an entry for the new option.
samples/c_interface/standalone_c/Makefile:
Query the compiler directly about what flags to pass to the linker
rather than using the ml script.
Query the compiler about what flags to pass to the C compiler as
well. (This was implemented a while ago, but this example was
never updated.)
Extend this example to optionally work with shared libraries.
Estimated hours taken: 0.2
Branches: main
Make it easier to build the stand-alone interface example in different grades.
samples/c_interface/standalone_c/Makefile:
Add a variable to set the option for setting the grade to build
the example in.
Estimated hours taken: 8
Branches: main
Add an example of how to use a stand-alone interface to the samples.
samples/c_interface/standalone_c/Makefile:
samples/c_interface/standalone_c/c_main.c:
samples/c_interface/standalone_c/c_main.exp:
samples/c_interface/standalone_c/mercury_lib.m:
New files. An annotated example of how to use a stand-alone interface.
samples/c_interface/README:
Mention the new example.
Estimated hours taken: 1
Branches: main
Use `pragma foreign_export' in preference to `pragma export' throughout
the Mercury distribution.
Convert more of the extras distribution to four-space indentation and
other minor cleanups.
browser/*.m:
library/*.m:
samples/*:
extras/*:
As above.
Estimated hours taken: 0
Branches: main
samples/c_interface/simpler_c_calls_mercury/mercury_lib.m:
samples/c_interface/simpler_cplusplus_calls_mercury/mercury_lib.m:
Update these files to conform to the current version of the
standard library.
Estimatd hours taken: 0.5
Branches: main
samples/*.m:
Use '.' as the module qualifier instead of '__'.
Use the new foreign language interface.
Fix minor formatting issues.
Use state variables for passing the I/O state.
Estimated hours taken: 0.1
Branches: main
Get the simpler "C++ calls Mercury" sample working again.
samples/c_interface/simpler_cplusplus_calls_mercury/main.cc:
s/mercury_lib.h/mercury_lib.mh/
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
Link in -lstdc++, since recent versions of GNU C++ require this.
Delete most of the mentions of mercury_lib.h, since they
are now handled automatically by Mmake.
s/mercury_lib.h/mercury_lib.mh/
Estimated hours taken: 0.1
Branches: main
Get the simpler "C calls Mercury" sample working again.
samples/c_interface/simpler_c_calls_mercury/main.c:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
s/mercury_lib.h/mercury_lib.mh/
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Delete most of the mentions of mercury_lib.h, since they
are now handled automatically by Mmake.
Estimated hours taken: 0.1
Branches: main
Get the "C calls Mercury" sample working again.
samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/c_calls_mercury/Mmakefile:
s/mercury_lib.h/mercury_lib.mh/
samples/c_interface/c_calls_mercury/Mmakefile:
Delete most of the mentions of mercury_lib.h, since they
are now handled automatically by Mmake.
Estimated hours taken: 0.5
Branches: main
Get the "C++ calls Mercury" sample working again.
samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
s/mercury_lib.h/mercury_lib.mh/
samples/c_interface/cplusplus_calls_mercury/Mmakefile:
Link in -lstdc++, since recent versions of GNU C++ require this.
Delete most of the mentions of mercury_lib.h, since they
are now handled automatically by Mmake.
s/mercury_lib.h/mercury_lib.mh/
Estimated hours taken: 0.25
Branches: main
Fix a bug where the Mercury calls C++ sample was not linking with the
C++ library. This worked, because the sample didn't actually make use
of the C++ library, but failed as soon as users tried to extend the
sample to use with their real C++ programs.
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
Use the C++ standard library's stream I/O, rather than printf().
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
Make sure that we link with the C++ standard library.
Also, comment out the old hack that worked around a g++ 2.7 bug
which is fixed in g++ 2.95.
Estimated hours taken: 0.25
Branches: main
Fix a bug where the Mercury calls C++ sample was actually using C, not C++.
samples/c_interface/mercury_calls_cplusplus/cpp_main.c:
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
Rename cpp_main.c as cpp_main.cc, so that it gets compiled as C++
code rather than as C code. Add a dummy class declaration to its
source, to check that it is really C++ code.
Estimated hours taken: 0.25
Branches: main
Simplify the simpler_c_calls_mercury and
simpler_cplusplus_calls_mercury samples to
avoid explicit construction of the `ml' command line.
samples/c_interface/simpler_c_calls_mercury/c_main.c:
Renamed as main.c.
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
Renamed as main.cc.
samples/c_interface/simpler_c_calls_mercury/c_main.m:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.m:
Empty main modules, used to set the name executable
produced by mmake.
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Handle file renamings.
Remove explicit rules to build executables.
Remove unnecessary header file dependencies.
Estimated hours taken: 0.1
Branches: main, release
samples/c_interface/cpluscplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_c/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
Use MLOBJS, not MLLIBS, to hold the names of the
non-Mercury object files.
Estimated hours taken: 0.5
Branches: main
Remove the RM_C mmake variable, which controlled whether the intermediate
`.c' files were removed (now they never are).
The implementation was buggy (it didn't work with parallel makes), and
made it difficult to avoid always recompiling the `.c' file with smart
recompilation.
Mmake.common.in:
configure.in:
README.AIX:
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
compiler/modules.m:
tools/bootcheck:
tools/binary_step:
*/Mmakefile:
Remove references to RM_C, DEFAULT_RM_C and LIBRARY_RM_C.
compiler/modules.m:
The `.o' and `.pic_o' file now depends only on the `.c' file,
not on everthing the `.c' file depends on. The extra dependencies
were only needed because the intermediate `.c' file could
be removed by RM_C. This change is needed to avoid recompiling
unchanged `.c' files with smart recompilation.
Estimated hours taken: 2.5
Fix some failing test cases in samples/c_interface.
This fixes SourceForge bug report #131053.
samples/c_interface/cplusplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
Fix several bugs:
- use $(MGNUC) rather than hard-coding mgnuc
- pass $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) to mgnuc
- pass $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) to ml
- s/*_REGS_H/MR_MACHDEPS_*_REGS_H/, to match
the renaming that was done a fair while back
in the runtime/machdeps/*.h.
samples/tests/c_interface/c_calls_mercury/Mmakefile:
Add an explicit dependency to ensure that runtests makes
the dependencies for the extra Mercury library used in
this test case.
Estimated hours taken: 1
Fix some bugs in samples/c_interface/*/Mmakefile.
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Use $(mercury_lib.os) rather than hard-coding mercury_lib.o,
so that it works if we compile mercury_lib to more than one
object file, as we do for the `--target asm' case.
samples/c_interface/c_calls_mercury/Mmakefile:
Pass $(ALL_GRADEFLAGS) to $(ML).
Also use $(ALL_MLFLAGS) rather than $(MLFLAGS).
Estimated hours taken: 0.5
samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
samples/c_interface/simpler_c_calls_mercury/c_main.c:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
Update the samples to use MR_ types and MR_ macros for
creating lists.
Estimated hours taken: 15
Add a testing architecture for the samples directory.
The tests are in the "tests" subdirectory of the samples
directory. This keeps them close to the samples, but not close
enough to clutter up the samples.
It also means you don't have to worry about the issue of exactly where
the developer has checked out the CVS tests module.
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
Update this example to generate a .a file
instead of directly using $(mercury_lib.os)
samples/tests/*:
Test cases for all the samples.
Estimated hours taken: 1
Fix some problems in the samples.
samples/calculator.m:
Strip spaces from the input before using it.
I keep forgetting that spaces aren't allowed in the input
of this example, and I can only assume that new users get
confused over this.
samples/c_interface/c_calls_mercury/Mmakefile:
Use MLOBJS instead of MLLIBS for including .o files.
Add a missing dependency.
Remove an unnecessary dependency that MLOBJS takes care of.
samples/c_interface/mercury_calls_fortran/Mmakefile:
Use MLOBJS instead of MLLIBS for including .o files.
Use -lg2c instead of the old -lf2c for the fortran library.
(libf2c no longer exists)
Estimated hours taken: 0.5
samples/c_interface/cplusplus_calls_mercury/mercury_lib.m:
Add a missing import of module `list'. Previous versions
of the Mercury compiler didn't detect this error.
Estimated hours taken: 0.75
Mmakefile:
*/Mmakefile:
*/*/Mmakefile:
*/*/*/Mmakefile:
Use `clean_local' instead of `clean' and `realclean_local' instead
of `realclean' where appropriate. This is necessary now that
`realclean' does not depend on `clean'.
Estimated hours taken: 8
Add rot13 examples to the samples directory.
Note: Estimated time is time for contributors, mainly.
samples/README:
samples/c_interface/README:
Fix the README files, they were a little inaccurate in
describing some files and directories.