Commit Graph

617 Commits

Author SHA1 Message Date
Julien Fischer
698f8fa37b Install BEST_LLDS_BASE_GRADE.gc.trseg.stseg instead of
Branches: main, 12.08

configure.in:
	Install BEST_LLDS_BASE_GRADE.gc.trseg.stseg instead of
	BEST_LLDS_BASE_GRADE.gc.tr.stseg.
2012-09-10 13:46:56 +00:00
Zoltan Somogyi
269a7046e4 Record the set of library grades to install in a file named
Estimated hours taken: 0.1
Branches: main

configure.in:
	Record the set of library grades to install in a file named
	.configured_library_grades. This is useful when you want to know
	how many grades are still left to do during a "make install".
2012-06-14 03:03:15 +00:00
Julien Fischer
e3e1807984 Only use the __thread extension on Mac OS X when using GCC.
(In particular, do not use it when the C compiler is clang since that doesn't
support it on Mac OS X.)

configure.in:
	For some reason the configure test for the __thread extension
	is passing with clang on Mac OS X 10.7 even though it is
	not supported.  Don't allow __thread to be used if we are
	using clang.
2012-05-23 17:03:19 +00: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
1725f301c9 Avoid a warning from autoconf 2.6.1.
configure.in:
	Quote an argument to AC_DEFINE.
2012-04-03 05:33:11 +00:00
Julien Fischer
9cdeaadbf4 Do not attempt to use setrlimit on systems that do not support it.
Branches: main

Do not attempt to use setrlimit on systems that do not support it.

configure.in:
	Test for the presence of the setrlimit function

runtime/mercury_conf.h.in:
	Define the macro MR_HAVE_SETRLIMIT if setrlimit is
	present.

mdbcomp/shared_utilities.m:
	Only attempt to modify the stack limit if MR_HAVE_SETRLIMIT
	is defined.

	Use don't-care variables for the I/O state in the foreign_proc.
	(Avoids warnings from MSVC.)
2012-03-28 02:18:02 +00:00
Julien Fischer
668aaf1bf0 Set the host and target environment types at configuration time.
Branches: main, 11.07

Set the host and target environment types at configuration time.  By default,
they were both set to "posix" but that is no longer compatible with building
the csharp grade using the Microsoft compiler.

configure.in:
	Set the environment type to "cygwin" on Cygwin, to "msys" on MinGW
	and to "posix" otherwise.  (For Mercury installations that work with
	the Windows command interpreter, it will need to be manually set to
	"windows".)

scripts/Mercury.config.in:
	Set the environment type.  (We set the target and host separately
	so that is easier for installers to automatically modify this file.)

README.MS-VisualC:
	Conform to the above change.
2012-01-24 05:59:12 +00:00
Julien Fischer
0e095a1aab Don't make the choice of whether MR_THREAD_SAFE is defined in parallel grades
Branches: main

Don't make the choice of whether MR_THREAD_SAFE is defined in parallel grades
in the configure script.  There's no reason to do so and handling it
differently from the other grade component macros is just confusing.

compiler/compile_target_code.m:
scripts/mgnuc.in:
	If we are in a parallel grade then define MR_THREAD_SAFE.

configure.in:
	Don't include -DMR_THREAD_SAFE in the value of CFLAGS_FOR_THREADS.
2012-01-15 17:33:35 +00:00
Julien Fischer
83138474fe A step towards getting compilation with the MacPorts version of the MinGW cross
Branches: main

A step towards getting compilation with the MacPorts version of the MinGW cross
compiler working on Mac OS X.  It's not clear that this is terribly useful as
the version of mingw-gcc in MacPorts is ancient (3.4.5).  (I will also try
using the nognu port, maybe that is more recent.)

configure.in:
 	When checking whether the Mercury compiler is up-to-date, pass options
 	appropriate to the build compiler, not the host one.  This avoids
 	problems where the build Mercury compiler doesn't support --linkage
 	static but the host one does.

 	Use AC_CHECK_TOOL to check for ar in the non-MSVC case.  This means
 	the correct host type prefix will get attached when cross compiling.
         (The prefix is for MacPorts mingw-gcc is not a standard host triplet,
         it's simply i386-mingw.)
2012-01-09 15:02:04 +00:00
Peter Wang
6b1f89831e Let Mercury be built with a MinGW cross-compiler.
Branches: main

Let Mercury be built with a MinGW cross-compiler.

tools/configure_mingw_cross:
	Add shell script to prepare for cross-compilation.

README.MinGW-cross:
	Document how to use the shell script.

configure.in:
Mmake.common.in:
	Set a new variable CROSS_COMPILING.

	Set FULLARCH and BUILD_C_PROGS_FOR_BUILD_SYSTEM variables
	to be passed to the Boehm GC build system.

	Use $host-ar for AR when cross-compiling.

m4/mercury.m4:
	Determine gcc version with gcc -dumpversion instead of building
	a program and running it.

	Don't run test for mercury_cv_cc_type if set explicitly.

Mmake.workspace:
	Use the default c2init and mkinit when cross-compiling.
	The copies in the util directory would not be usable then.

boehm_gc/Mmakefile:
	Pass configured values of AR, RANLIB down to sub-make.

boehm_gc/Makefile.direct:
boehm_gc/build_atomic_ops.sh:
	Use configured value from Mmake.common for HOSTCC.

	Pass --host when configuring libatomic_ops.

util/Mmakefile:
	Make tools with .exe suffixes on Windows.

Mmakefile:
	Use the bootstrap compiler to build libgrades when cross-compiling.

	Conform to changed target names in the util directory.

compiler/Mmakefile:
deep_profiler/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	Conform to changed target names in the util directory.

Makefile:
	Clean .exe files on Windows.
2012-01-09 00:35:41 +00:00
Julien Fischer
93b0e2ce4d Avoid a dodgy GCC optimization on Mac OS X.
Branches: main, 11.07

Avoid a dodgy GCC optimization on Mac OS X.

configure.in:
	Disable GCC's -ftree-vrp optimization on Mac OS X with
	GCC 4.2 since it causes code in the hlc.gc grade to be
	miscompiled.
2011-12-20 03:15:00 +00:00
Paul Bone
719be44a59 By default configure installs both a low-level and high-level C parallel grade.
This change adds the stseg grade component to the low-level C parallel grade.

configure.in:
    As above.
2011-12-14 04:07:46 +00:00
Julien Fischer
d9bc06f56f Correct the message about finetuning installation to show the
Branches: main, 11.07

configure.in:
	Correct the message about finetuning installation to show the
	correct way to invoke parallel make.
2011-12-05 15:33:55 +00:00
Julien Fischer
13472609a2 The MinGW port of texi2dvi is now works.
Branches: main, 11.07

configure.in:
	The MinGW port of texi2dvi is now works.
	(The use of tex2dvi was disabled on MinGW six years ago because
	the then current version went into a loop.)
2011-11-23 11:51:00 +00:00
Julien Fischer
03d0ca4712 Improve and update documentation of the MSVC port.
Branches: 11.07, main

Improve and update documentation of the MSVC port.

Add batch files for invoking mdb and mprof; avoid problem with mercury.bat.

README.MS-VisualC:
	Rewrite this file, it was very much out-of-date.
	The major changes are:

	+ we now describe how to set up a Cygwin or MSYS shell
  	  with MSVC available.

	+ the source distribution now works with MSVC.

	+ a list of the limitations of the MSVC port has been added.

	+ a description of how to set up the compiler so that it
	  works from the Windows command prompt has been added.

scripts/mercury/mercury.bat.in:
	Delete support for the MERCURY_COMPILER and MERCURY_CONFIG_DIR
	enviorment variables; the handling of them in this batch file
	doesn't appear to be portable across different versions of
	Windows and it's more important that this file work in the
	normal case.  (Keeping it simple is the way to ensure this.)

scripts/mdb.bat.in:
scripts/mprof.bat.in:
	Templates for invoking mdb and mprof on Windows.
	(I'm not sure how to reproduce all the functionality of the mdb
	script in a batch file, so the command line options provided by
	the mdb script aren't currently replicated here.)

configure.in:
scripts/Mmakefile:
	Add the new batch files.

scripts/Mercury.config.in:
	Use the Windows-style installation prefix on Cygwin systems.

browser/util.m:
	Use the conventional name for the I/O state.

	Use don't-care variables for the I/O state in foreign procs.
	This avoids suprious warnings from MSVC.
2011-11-08 03:11:42 +00:00
Paul Bone
bc92fb14b1 Fix three hwloc related build system problems, these were raised in code
reviews.

The configure script now supports the --without-hwloc option to disable the use
of hwloc, even if it is installed.

configure.in:
    Allow the use of libhwloc to be disabled with the --without-hwloc option.

Distribute the autoconf macros for pkg-config with Mercury.

This allows mercury to be compiled from CVS on hosts that don't have these
macros in their autoconf installation.

acinclude.m4:
m4/mercury.m4:
    Moved acinclude.m4 to m4/mercury.m4.  This file contains mercury-specific
    macros.

m4/pkg.m4:
    Copied pkg.m4 from the autoconf installation on taura.  This file contains
    pkg-config macros.

INSTALL_CVS:
Mmakefile:
tools/test_mercury:
    When calling aclocal pass the -I m4 option.

tools/bootcheck:
    Create a link to the m4 directory when setting up stage directories.

Fix static linking with mmc --make and hwloc.

compiler/compile_target_code.m:
    Conform to changes in scripts/ml.in (where static linking and hwloc is
    already handled correctly).

compiler/options.m:
    Create new options so that Mercury.config can tell mmc what options are
    needed for linking to hwloc.

scripts/Mercury.config:
    Pass hwloc linking options to the compiler.
2011-11-08 02:22:42 +00:00
Julien Fischer
23b8ff8b7e Suppress the banner message when using the Microsoft lib and link
Branches: 11.07, main

Suppress the banner message when using the Microsoft lib and link
tools.

configure.in:
compiler/compile_target_code.m:
	As above.
2011-10-25 13:57:02 +00:00
Julien Fischer
c9a8cc57f7 Fix a typo in the configure script.
Branches: main, 11.07

Fix a typo in the configure script.

configure.in:
	When adding trailing grades, don't add the grade
	BEST_LLDS_BASE_GRADE.debug.gc since (1) this is not
	trailing grade and (2) the name is not canonical (and
	in fact duplicates a grade added elsewhere.)
2011-10-20 14:08:30 +00:00
Paul Bone
6fa900072c Make sure hwloc works with static linking.
configure.in:
scripts/ml.in:
    Determine and use the static linking options for hwloc when ml is invoked
    with --static.

    More robust detection of when to use the hwloc linking options is now used.
2011-10-14 00:25:06 +00:00
Paul Bone
a071eaba53 Improve thread pinning:
+ Now pins threads intelligently on SMT systems by balancing threads among
      cores.
    + performs fewer migrations when pinning threads (If a thread's current
      CPU is a valid CPU for pinning, then it is not migrated).
    + Handle cases where the user requests more threads than available CPUs.
    + Handle cases where the process is restricted to a subset of CPUs by its
      environment.  (for instance, Linux cpuset(7))

This is largely made possible by the hwloc library
http://www.open-mpi.org/projects/hwloc/  However, hwloc is not required and the
runtime system will fall back to sched_setaffinity(), it will simply be less
intelligent WRT SMT.

runtime/mercury_context.h:
runtime/mercury_context.c:
    Do thread pinning either via hwloc or sched_setaffinity.  Previously only
    sched_setaffinity was used.

    Update thread-pinning algorithm, this:

    Include the general thread pinning code only if MR_HAVE_THREAD_PINNING is
    defined.

    Use a combination of sysconf and sched_getaffinity to detect the number of
    processors when hwloc isn't available.  This makes the runtime compatible
    with Linux cpuset(7) when hwloc isn't available.

configure.in:
Mmake.common.in:
    Detect presence of the hwloc library.

configure.in:
    Detect sched_getaffinity()

aclocal.m4:
acinclude.m4:
    Move aclocal.m4 to acinclude.m4, the aclocal program will build aclocal.m4
    and retrieve macros from the system and the contents of acinclude.m4.

Mmakefile:
    Create a make target for aclocal.m4.

runtime/Mmakefile:
    Link the runtime with libhwloc in low-level C parallel grades.

    Include CFLAGS for libhwloc.

scripts/ml.in:
    Link programs and libraries with libhwloc in low-level C parallel grades.

runtime/mercury_conf.h.in:
    Define MR_HAVE_HWLOC when it is available.

    Define MR_HAVE_SCHED_GETAFFINITY when it is available.

runtime/mercury_conf_param.h:
    Define MR_HAVE_THREAD_PINNING if either hwloc or [sched_setaffinity and
    sched_getaffinity] are available.

runtime/mercury_thread.c:
runtime/mercury_wrapper.c:
    Only call MR_pin_thread and MR_pin_primordial_thread if
    MR_HAVE_THREAD_PINNING is defined.

runtime/mercury_thread.h:
runtime/mercury_context.h:
    Move the declaration of MR_pin_primordial_thread to mercury_context.h from
    mercury_thead.h since it's definition is in mercury_context.c.

    Require MR_HAVE_THREAD_PINNING for the declaration of
    MR_pin_primordial_thread.

runtime/mercury_wrapper.c:
    Conform to changes in mercury_context.h

INSTALL_CVS:
tools/test_mercury
    Run aclocal at the right times while testing Mercury.
2011-10-13 02:42:21 +00:00
Julien Fischer
320b83ba33 Suppress the MSVC banner message, e.g. pass -nologo to cl, by default.
Branches: main, 11.07

Suppress the MSVC banner message, e.g. pass -nologo to cl, by default.

configure.in:
	Do the above for mmc --make.

scripts/mgnuc.in:
	Do the above for mmake.

	Fix a couple of typos.
2011-10-11 13:48:39 +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
2cbc8864aa Don't disable the low-level C .par grades on MinGW since
Branches: main, 11.07

configure.in:
	Don't disable the low-level C .par grades on MinGW since
	they now work.
2011-10-03 12:22:20 +00:00
Julien Fischer
bd867e5b58 Only force -O0 for old versions of clang; more recent versions do not encounter
Branches: main, 11.07

Only force -O0 for old versions of clang; more recent versions do not encounter
problems when compiling Mercury generated C code.

configure.in:
scripts/mgnuc.in:
	As above.

README.clang:
	Conform to the above change.
2011-10-03 05:07:21 +00:00
Julien Fischer
776d5ce3ed More Visual C related stuff.
Branches: main, 11.07

More Visual C related stuff.

compiler/globals.m:
	Allow the C compiler type string for Visual C to have the form
	"msvc_<VERSION>" as well as "cl_<VERSION>".  Support for the
	latter form will eventually be dropped.

configure.in:
	Avoid pattern matching on the value of CC; it isn't a reliable
	way of telling what the C compiler is.

	Use the "-" form of options for MSVC in more places.

scripts/ml.in:
	Use the "-" form of options for MSVC.
2011-09-21 06:11:30 +00:00
Zoltan Somogyi
44e3c6d427 Don't leave temp files used during configuration lying around.
Estimated hours taken: 0.1
Branches: main

configure.in:
	Don't leave temp files used during configuration lying around.
2011-09-21 04:58:26 +00:00
Julien Fischer
a2e22530a0 Fix problems with mmc --make and Visual C.
Branches: 11.07, main

Fix problems with mmc --make and Visual C.

compiler/compiler_target_code.m:
	The "-o" option has been deprecated in Visual C, and we need to
	use "-Fe" to name executables.

	Fix an incomplete comment.

configure.in:
	Use the dash form for MS linker options rather than the forward
	slash form.  (The latter don't work with the MSYS shell.)
2011-09-15 16:14:34 +00:00
Julien Fischer
9e2b3c39de Fix a spot where we were incorrectly switching on
Branches: 11.07, main

configure.in:
	Fix a spot where we were incorrectly switching on
	the wrong variable.

	Delete an out-of-date comment.
2011-09-15 13:28:13 +00:00
Julien Fischer
6433812500 Make the low-level C .par grades work on MinGW.
Branches: main, 11.07

Make the low-level C .par grades work on MinGW.

configure.in:
	On MinGW set the target architecture to i686 in .par grades
	so that the GCC built-in atomic ops are available.
2011-09-14 04:39:24 +00:00
Julien Fischer
47a7aee96b Avoid warnings about functions that don't return in the runtime
Branches: main, 11.07

Avoid warnings about functions that don't return in the runtime
with MSVC.

Avoid a warning in the configure script with MSVC.

configure.in:
	The cygpath tool is only required with MSVC when using
	Cygwin as the build environment; don't emit an error message
	about this on other systems, e.g. MingGW.

runtime/mercury_std.h:
	Redefine MR_NO_RETURN so that it works with both GCC/Clang
	and Visual C.

runtime/mercury_misc.h:
runtime/mercury_engine.c:
	Conform to the above change to MR_NO_RETURN.

runtime/mercury_bootstrap.h:
	Delete the redefinition of NO_RETURN; any code that still
	uses is not going to work for a variety of other reasons.
2011-09-12 16:29:55 +00:00
Julien Fischer
ae33e13de7 Various fixes for MSVC.
Branches: main, 11.07

Various fixes for MSVC.

configure.in:
	Use -link instead of /link with MSVC since the latter
	form causes trouble for MSYS.

scripts/ml.in:
	As above, but for the -DEBUG option.

scripts/parse_ml_options.sh-subr.in:
	Don't strip executables on MinGW for the moment.
	(XXX We should re-enable this for the MinGW / GCC
	combination and probably also check what the current
	situation on Cygwin and Darwin is.)

library/store.m:
	Shut up a warning from MSVC about a local variable
	that is used without being initialised.
2011-09-09 19:29:44 +00:00
Julien Fischer
7201012038 Fix an XXX related to clang and shared libraries on Mac OS X.
Branches: main, 11.07

Fix an XXX related to clang and shared libraries on Mac OS X.

configure.in:
	Use clang not gcc on Mac OS X for building shared libraries when using
	clang as a C compiler.

	Delete support for using flat namespaces with dylibs.  This was
	only necessary for creating dylibs that would work on Mac OS X 10.2
	and before; now it's no longer worth maintaining the code in the
	configure script that allowed it.

README.MacOS:
	Conform to the above change.
2011-08-25 17:48:32 +00:00
Julien Fischer
d9965c6de4 Support static linking with clang on Linux.
Branches: main, 11.07

configure.in:
	Support static linking with clang on Linux.
2011-08-25 15:39:15 +00:00
Julien Fischer
96c68d4157 Support using clang as a C compiler with Mercury -- currently only
Branches: main, 11.07

Support using clang as a C compiler with Mercury -- currently only
tested on Mac OS X.

Clean up the handling of C compilers in the configure script.

configure.in:
	Improve this script's ability to distinguish between different
	types of C compiler.  In particular, ensure that a clear
	distinction is maintained between clang and gcc.

	Fix an old XXX: don't rely on pattern matching on the value
	of $CC to determine the C compiler type.  This is particularly
	error prone now since one compiler is named "clang" and another
	"cl".

	Set optimization and warning flags for clang.
	(XXX this is currently very conservative; we need to go through
	them and work out what good defaults might be.)

	Don't link against libgcc if we are using clang.
	(XXX I don't think this is really necessary for gcc either in
	the great majority of cases.)

	Mark spots that still need updating with "XXX CLANG"; I will
	look into these separately.

aclocal.m4:
	Add a new macro that determines the C compiler type based
	on what builtin macros are defined -- unlike AC_PROG_CC
	this macro correctly distinguishes between gcc and clang.

	Add two new macros that determine version information for
	clang and for Visual C.

scripts/mgnuc.in:
scripts/ml.in:
	Handle clang

README.MacOS:
	Mention that clang can be used with Mercury on Mac OS X.
2011-08-25 14:16:53 +00:00
Peter Wang
3b622bc6ba Fix check for `where type_is_abstract_enum'.
Branches: main

configure.in:
	Fix check for `where type_is_abstract_enum'.
2011-07-22 03:34:36 +00:00
Peter Wang
da169257e8 Check that the bootstrap compiler supports `where type_is_abstract_enum'
Branches: main

Check that the bootstrap compiler supports `where type_is_abstract_enum'
syntax, as that now shows up in ROTD snapshots.

configure.in:
	As above.
2011-07-22 01:18:14 +00:00
Julien Fischer
66bcbcf817 Improve support for building the Visual C port in MSYS.
Branches: main, 11.07

Improve support for building the Visual C port in MSYS.

configure.in:
scripts/mgnuc.in:
	Use the -OPT form for cl command line options
	instead of the /OPT form.  The latter confuses
	the MSYS shell.
2011-07-15 08:10:43 +00:00
Julien Fischer
131ec33151 Don't emit warnings about being unable to create named pipes on
Branches: main, 11.07

configure.in:
	Don't emit warnings about being unable to create named pipes on
	MinGW, since MinGW doens't currently provide (working) support
	for doing that.
2011-07-15 05:35:36 +00:00
Zoltan Somogyi
6066146d2b Fix typo.
Estimated hours taken: 0.1
Branches: 0.1

Fix typo.
2011-05-27 06:54:43 +00:00
Zoltan Somogyi
d4ea38d9cb Add a new option, --enable-additional-libgrades=grade1,grade2
Estimated hours taken: 2
Branches: main

configure.in:
	Add a new option, --enable-additional-libgrades=grade1,grade2
	that allows users to specify a list of grades to ADD to the
	automatically configured list, rather than replacing it.

	Print the list of grades to be installed at the end, where the user
	is much more likely to see it. Also move an associated warning.

	Print an estimate of the time required for installation (which can
	be a crude estimate only due to variations in machine speeds),
	along with a message about how it can be sped up.
2011-05-26 08:15:09 +00:00
Peter Wang
c0a89b58f6 Revert custom setting of HBLKSIZE in parallel grades on Linux.
Branches: main, 11.01

Revert custom setting of HBLKSIZE in parallel grades on Linux.
It was already reverted on other systems due to problems with it not working.
If Boehm GC is configured to use mmap/munmap, it aborts with the following
message when GC_free is called:

	Duplicate large block deallocation of 0x7f2769f10000

configure.in:
	As above.
2011-04-29 00:08:27 +00:00
Julien Fischer
2b0890e445 Disable installation of low-level C .par grades on MinGW.
Branches: main, 11.01

Disable installation of low-level C .par grades on MinGW.
The use of pthreads-win32 and gcc's __thread extension results in
linking problems.

configure.in:
	As above.
2011-04-27 02:02:48 +00:00
Julien Fischer
b3b4f26d84 Avoid a problem that was causing exception handlers to not work on MinGW /
Branches: main, 11.01

Avoid a problem that was causing exception handlers to not work on MinGW /
Windows XP in the hlc grades.

configure.in:
scripts/mgnuc.in:
	Avoid the use of gcc's -fomit-frame-pointer option on MinGW.
	It interferes with the correct operation of setjmp / longjmp.
	(It does *not* interfere with gcc's __builtin_{set,long}jmp, so
	maybe exceptions should be implemented using those where possible.)

library/backjump.m:
	Unrelated change: fix some broken debugging code.
2011-03-19 16:43:49 +00:00
Julien Fischer
b4d7509570 Only modify the value of Boehm GC HBLKSIZE macro on Linux.
Branches: main

Only modify the value of Boehm GC HBLKSIZE macro on Linux.
Attempting this modification on other system, e.g. Mac OS X and
MinGW, results in a system that doesn't work.

configure.in:
	Define a new configure variable, BOEHM_MISC_CFLAGS_FOR_THREADS,
	that can be used to pass C compiler flags to the Boehm collector
	in parallel grades on a system specific basis.

	On Linux, modify the value of HBLKSIZE when building the collector
	in parallel grades.

Mmake.common.in:
	Delete the hardcoded setting of HBLKSIZE and use the new configure
	variable.

	Fix a comment.
2010-12-17 11:59:02 +00:00
Julien Fischer
7d3903dfe9 Fix problems with the configure script if the absolute path of the source
Branches: main

Fix problems with the configure script if the absolute path of the source
directory contains spaces.

configure.in:
	As above.
2010-12-17 06:23:28 +00:00
Julien Fischer
b47354d211 Support the use of the pthreads-win32 library on MinGW systems.
Branches: main, 10.04

Support the use of the pthreads-win32 library on MinGW systems.
(This is based on the patch provided by Sergey Khorev.)
The main change is to remove the assumption in the runtime code
that POSIX thread handles are integers; in the pthreads-win32 library
they are not.

With this change the hlc.par.gc grade will work on Windows / MinGW.
(The low-level C parallel grades will require further work.)

configure.in:
	Configure the Boehm GC to use pthreads-win32 if that is being used
	to provide threads for the runtime on MinGW.

	Delete the --with-pthreads-win32 option; it is no longer needed.

	Add a new option --with-gc-pthreads-win32 that forces the Boehm GC
	to use pthreads-win32.  This is the default for MinGW anyway, the option
	is intended for use by developers using pthreads-win32 in other ways,
	e.g. with MSVC.

runtime/mercury_thread.h:
	Add a new macro / function (depending on the implementation of pthreads)
	that returns the "null" thread.

	Add a new macro MR_thread_equal() that tests two thread handles
	for equality.

runtime/mercury_thread.c:
	Provide implementations of MR_null_thread().

	Add a macro, for use within this module, that returns the id
	of a thread in a form suitable for use in debugging messages.

runtime/mercury_engine.c:
runtime/mercury_context.c:
runtime/mercury_wrapper.c:
runtime/mercury_thread.c:
	Use MR_null_thread() instead of NULL or 0.

	Use MR_thread_equal() instead of directly comparing thread handles.
2010-12-13 05:59:42 +00:00
Julien Fischer
81ca0a5572 Have configure check for the use of the pthreads-win32 library on MinGW.
Branches: main, 10.04

Have configure check for the use of the pthreads-win32 library on MinGW.  (In
the future we may also want to do this in the case where Cygwin is being used
to cross-compile a native Windows version of Mercury, although this change
doesn't handle that case.)

runtime/mercury_conf.h.in:
	Add a new configuration macro that is defined if the threads
	library is pthreads-win32.

configure.in:
	If POSIX threads are available and we are on MinGW check if we are
	using pthreads-win32 (which should be the case sice AFAIK there
	isn't a readily available alternative).

aclocal.m4:
	Add a new macro that checks if the threads library is
	pthreads-win32.
2010-12-09 06:14:15 +00:00
Zoltan Somogyi
56526e9cc3 When --enable-trail-grades is specified, ensure that the best
Estimated hours taken: 0.2
Branches: main

configure.in:
	When --enable-trail-grades is specified, ensure that the best
	LLDS debug grade with .trseg is also installed.

	Add the new option --disable-old-prof-grades, which disables
	the non-deep profiling grades (such as .prof and .memprof).

	Sort the list of installed libgrades, to make it easier to see
	how far an installation has gotten. Since this also allows the removal
	of any duplicate grades, the code that adds grades to the list doesn't
	have to be constructed specifically to rule out such duplicates.
2010-12-07 03:42:47 +00:00
Peter Wang
7b67c61894 Use mkstemp() to implement `io.make_temp' where possible.
Branches: main

Use mkstemp() to implement `io.make_temp' where possible.  The current
implementation generates highly predictable file names which is a problem for
security.  More importantly for us, the generated names are based on the
initial process ID only, so if the process forks a lot of child processes which
each want to make temporary files, this will lead to conflicts (e.g. mmc --make
with high enough number of jobs).

configure.in:
library/io.m:
        Check for mkstemp(), #defining MR_HAVE_MKSTEMP if it exists.

runtime/mercury_conf.h.in:
        Use mkstemp() to implement `io.make_temp' where possible.
2010-12-06 03:56:17 +00:00
Julien Fischer
a5d86789d0 Fix a configuration problem on Cygwin.
Branches: main, 10.04

Fix a configuration problem on Cygwin.
(Note this affects compilers that produce exectuables that rely on cygwin.dll,
no those that are just using Cygwin as environment for cross-compiling to
native Windows.)

configure.in:
	Don't pass `--linkage static' on Cygwin hosts when checking for
	an up-to-date mmc since the static version of libgcc_s may not
	be present.
2010-10-29 06:06:09 +00:00