[m-rev.] for review: enable default use of MS Visual C runtime

Peter Ross pro at missioncriticalit.com
Fri Apr 2 19:34:01 AEST 2004


On Tue, Mar 23, 2004 at 04:40:43PM +0100, Peter Ross wrote:
> Hi,
> 
> 
> ===================================================================
> 
> 
> Estimated hours taken: 2
> Branches: main
> 
> Allow at configure time to build the compiler so that it uses the MS
> Visual C runtime by default.
> 
> This is needed here at MC to build some components which require
> linking against the MS Visual C runtime versus the standard C runtime.
> 
> configure.in:
> 	Add the option --enable-msvcrt so that the 
> 
> scripts/mgnuc.in:
> 	If we wish to use the MS Visual C runtime, then we need to
> 	define GC_NOT_DLL when we are not in a parallel grade, as
> 	otherwise the header files for boehm_gc decide the collector
> 	must've been built as a DLL, which isn't true.
> 
> scripts/ml.in:
> 	Pass /MD to the linker so that it links against the MS Visual C
> 	runtime, if required.
> 

===================================================================


Estimated hours taken: 0.5
Branches: main

scripts/mgnuc.in:
	When building using MS Visual C runtime, we also need to pass
	/MD at compile time (despite it being documented as a linker
	flag).


Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.100
diff -u -r1.100 mgnuc.in
--- scripts/mgnuc.in	2 Apr 2004 08:53:40 -0000	1.100
+++ scripts/mgnuc.in	2 Apr 2004 09:30:24 -0000
@@ -332,8 +332,13 @@
 use_msvcrt=@USE_MSVCRT@
 if test $use_msvcrt = "yes"; then
 	case $thread_safe in
-		true)	MSVCRT_OPTS="" ;;
-		false)	MSVCRT_OPTS="/DGC_NOT_DLL" ;;
+       # /MD states that we will use the MSVC runtime,
+       # the boehm_gc collector assumes that the collector
+       # has been built as a DLL if we are using the MSVC runtime
+       # so we need to define GC_NOT_DLL when the collector isn't
+       # built as a DLL.
+		true)	MSVCRT_OPTS="/MD" ;;
+		false)	MSVCRT_OPTS="/DGC_NOT_DLL /MD" ;;
 	esac
 else
 	MSVCRT_OPTS=""

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list