[m-dev.] for review: build hlc.par.gc using MSVC

Peter Ross peter.ross at miscrit.be
Wed Sep 6 18:47:32 AEDT 2000


Anyone want to review this?

On Thu, Aug 31, 2000 at 04:43:15PM +0200, Peter Ross wrote:
> Hi,
> 
> For Fergus to review.
> 
> I have only one unresolved issue for this change.
> Where the hell do I install libpar_gc.dll?  It needs to reside in the
> users $PATH, so that there programs can run.
> 
> Pete
> 
> 
> ===================================================================
> 
> 
> Estimated hours taken: 32
> 
> Build the hlc.par.gc grade using MSVC.
> 
> boehm_gc/NT_MAKEFILE:
> 	Seperate the rules for building libpar_gc.lib and libgc.lib as
> 	they use different makefiles.
> 	Use gc.mak to build libpar_gc.dll
> 	Note the thread safe garbage collector must be built as a dll
> 	according to the README.win32 documentation.
> 
> boehm_gc/gc.mak:
> 	Change the name from gc.dll to libpar_gc.dll
> 	This gets built in the Release directory.
> 
> boehm_gc/Mmakefile:
> 	Remove the Release directory as well.
> 
> scripts/mgnuc.in:
> scripts/ml.in:
> 	Pass the appropiate flags to the c compiler and the linker to
> 	build in hlc.par.gc grade.
> 
> util/mkinit.c:
> 	Delete a duplicate reference to GC_stackbottom.
> 
> Index: boehm_gc/Mmakefile
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/boehm_gc/Mmakefile,v
> retrieving revision 1.12
> diff -u -r1.12 Mmakefile
> --- boehm_gc/Mmakefile	2000/08/17 05:30:52	1.12
> +++ boehm_gc/Mmakefile	2000/08/31 14:32:06
> @@ -45,7 +45,8 @@
>  clean_local:
>  	MAKEFLAGS=""; export MAKEFLAGS; \
>  	$(MAKE) $(BOEHMGC_MAKEFILE) $(MMAKEFLAGS) clean
> -	rm -f libgc.$A libgc.so
> +	rm -rf Release
> +	rm -f libgc.$A libgc.so libpar_gc.$A libpar_gc.dll
>  
>  #-----------------------------------------------------------------------------#
>  
> @@ -92,5 +93,9 @@
>  install_lib: lib$(GC_GRADE).$A lib$(GC_GRADE).$(EXT_FOR_SHARED_LIB) install_dirs
>  	cp `vpath_find lib$(GC_GRADE).$A lib$(GC_GRADE).$(EXT_FOR_SHARED_LIB)` \
>  		$(INSTALL_MERC_GC_LIB_DIR)
> +
> +.PHONY: install_dll
> +install_dll:
> +	[ -f libpar_gc.dll ] && cp `vpath_find libpar_gc.dll` $(INSTALL_MERC_BIN_DIR)
>  
>  #-----------------------------------------------------------------------------#
> Index: boehm_gc/NT_MAKEFILE
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/boehm_gc/NT_MAKEFILE,v
> retrieving revision 1.7
> diff -u -r1.7 NT_MAKEFILE
> --- boehm_gc/NT_MAKEFILE	2000/08/17 05:30:52	1.7
> +++ boehm_gc/NT_MAKEFILE	2000/08/31 14:32:06
> @@ -24,8 +24,13 @@
>  
>  all: gctest.exe cord\de.exe test_cpp.exe
>  
> -dll: lib$(GC_GRADE)d$(DLL_DEF_LIB).dll
> -lib$(GC_GRADE)$(DLL_DEF_LIB).dll: libgcd.dll
> +libpar_gc.lib:
> +	MAKEFLAGS="" nmake /F gc.mak
> +	cp Release/libpar_gc.lib ./libpar_gc.lib
> +	cp Release/libpar_gc.dll ./libpar_gc.dll
> +
> +dll: libgcd$(DLL_DEF_LIB).dll
> +libgc$(DLL_DEF_LIB).dll: libgcd.dll
>  # had -DSMALL_CONFIG
>  %.obj:%.c
>  	$(cc) $(cdebug) $(CFLAGS) $(cvars)  -DSILENT -DLARGE_CONFIG -DALL_INTERIOR_POINTERS -D__STDC__  /c /Fo$*.obj $*.c
> @@ -38,16 +43,16 @@
>  gc.lib: $(OBJS)
>  	lib /MACHINE:i386 /out:gc.lib $(OBJS)
>  # a .def defining exports should be made....
> -lib$(GC_GRADE)d$(DLL_DEF_LIB).dll: $(OBJS)
> -#	$(link) /MACHINE:i386 /DLL /out:lib$(GC_GRADE)d.dll $(OBJS)
> +libgcd$(DLL_DEF_LIB).dll: $(OBJS)
> +#	$(link) /MACHINE:i386 /DLL /out:libgcd.dll $(OBJS)
>  
>  # The original NT SDK used lib32 instead of lib
>  
>  
> -lib$(GC_GRADE)$(DLL_DEF_LIB).lib: gc.lib
> -	rm -f lib$(GC_GRADE)$(DLL_DEF_LIB).lib
> +libgc$(DLL_DEF_LIB).lib: gc.lib
> +	rm -f libgc$(DLL_DEF_LIB).lib
>  	# `ln -s' here doesn't work with gnu-win32, so we use `cp' instead
> -	cp gc.lib lib$(GC_GRADE)$(DLL_DEF_LIB).lib
> +	cp gc.lib libgc$(DLL_DEF_LIB).lib
>  
>  gctest.exe: test.obj libgc.lib
>  #	The following works for win32 debugging.  For win32s debugging use debugtype:coff
> @@ -86,6 +91,7 @@
>  .PHONY: clean
>  clean:
>  	-rm -f *.lib *.dll *.obj 
> +	-rm -rf Release
>  
>  # The Mmakefile invokes `make $(EXT_FOR_SHARED_LIB)',
>  # so we need targets `a', `so', and `dll'.
> Index: boehm_gc/gc.mak
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/boehm_gc/gc.mak,v
> retrieving revision 1.1.1.2
> diff -u -r1.1.1.2 gc.mak
> --- boehm_gc/gc.mak	1999/07/14 23:47:19	1.1.1.2
> +++ boehm_gc/gc.mak	2000/08/31 14:32:06
> @@ -54,7 +54,7 @@
>  OUTDIR=.\Release
>  INTDIR=.\Release
>  
> -ALL : ".\Release\gc.dll" ".\Release\gc.bsc"
> +ALL : ".\Release\libpar_gc.dll" ".\Release\libpar_gc.bsc"
>  
>  CLEAN : 
>  	- at erase ".\Release\allchblk.obj"
> @@ -71,10 +71,10 @@
>  	- at erase ".\Release\dyn_load.sbr"
>  	- at erase ".\Release\finalize.obj"
>  	- at erase ".\Release\finalize.sbr"
> -	- at erase ".\Release\gc.bsc"
> -	- at erase ".\Release\gc.dll"
> -	- at erase ".\Release\gc.exp"
> -	- at erase ".\Release\gc.lib"
> +	- at erase ".\Release\libpar_gc.bsc"
> +	- at erase ".\Release\libpar_gc.dll"
> +	- at erase ".\Release\libpar_gc.exp"
> +	- at erase ".\Release\libpar_gc.lib"
>  	- at erase ".\Release\headers.obj"
>  	- at erase ".\Release\headers.sbr"
>  	- at erase ".\Release\mach_dep.obj"
> @@ -171,7 +171,7 @@
>  	".\Release\typd_mlc.sbr" \
>  	".\Release\win32_threads.sbr"
>  
> -".\Release\gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
> +".\Release\libpar_gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
>      $(BSC32) @<<
>    $(BSC32_FLAGS) $(BSC32_SBRS)
>  <<
> @@ -182,8 +182,8 @@
>  LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
>   advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
>   odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\
> - /pdb:"$(OUTDIR)/gc.pdb" /machine:I386 /out:"$(OUTDIR)/gc.dll"\
> - /implib:"$(OUTDIR)/gc.lib" 
> + /pdb:"$(OUTDIR)/libpar_gc.pdb" /machine:I386 /out:"$(OUTDIR)/libpar_gc.dll"\
> + /implib:"$(OUTDIR)/libpar_gc.lib" 
>  LINK32_OBJS= \
>  	".\Release\allchblk.obj" \
>  	".\Release\alloc.obj" \
> @@ -208,7 +208,7 @@
>  	".\Release\typd_mlc.obj" \
>  	".\Release\win32_threads.obj"
>  
> -".\Release\gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
> +".\Release\libpar_gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
>      $(LINK32) @<<
>    $(LINK32_FLAGS) $(LINK32_OBJS)
>  <<
> @@ -228,7 +228,7 @@
>  OUTDIR=.\Debug
>  INTDIR=.\Debug
>  
> -ALL : ".\Debug\gc.dll" ".\Debug\gc.bsc"
> +ALL : ".\Debug\libpar_gc.dll" ".\Debug\libpar_gc.bsc"
>  
>  CLEAN : 
>  	- at erase ".\Debug\allchblk.obj"
> @@ -245,12 +245,12 @@
>  	- at erase ".\Debug\dyn_load.sbr"
>  	- at erase ".\Debug\finalize.obj"
>  	- at erase ".\Debug\finalize.sbr"
> -	- at erase ".\Debug\gc.bsc"
> -	- at erase ".\Debug\gc.dll"
> -	- at erase ".\Debug\gc.exp"
> -	- at erase ".\Debug\gc.lib"
> -	- at erase ".\Debug\gc.map"
> -	- at erase ".\Debug\gc.pdb"
> +	- at erase ".\Debug\libpar_gc.bsc"
> +	- at erase ".\Debug\libpar_gc.dll"
> +	- at erase ".\Debug\libpar_gc.exp"
> +	- at erase ".\Debug\libpar_gc.lib"
> +	- at erase ".\Debug\libpar_gc.map"
> +	- at erase ".\Debug\libpar_gc.pdb"
>  	- at erase ".\Debug\headers.obj"
>  	- at erase ".\Debug\headers.sbr"
>  	- at erase ".\Debug\mach_dep.obj"
> @@ -350,7 +350,7 @@
>  	".\Debug\typd_mlc.sbr" \
>  	".\Debug\win32_threads.sbr"
>  
> -".\Debug\gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
> +".\Debug\libpar_gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
>      $(BSC32) @<<
>    $(BSC32_FLAGS) $(BSC32_SBRS)
>  <<
> @@ -361,8 +361,8 @@
>  LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
>   advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
>   odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\
> - /pdb:"$(OUTDIR)/gc.pdb" /map:"$(INTDIR)/gc.map" /debug /machine:I386\
> - /out:"$(OUTDIR)/gc.dll" /implib:"$(OUTDIR)/gc.lib" 
> + /pdb:"$(OUTDIR)/libpar_gc.pdb" /map:"$(INTDIR)/libpar_gc.map" /debug /machine:I386\
> + /out:"$(OUTDIR)/libpar_gc.dll" /implib:"$(OUTDIR)/libpar_gc.lib" 
>  LINK32_OBJS= \
>  	".\Debug\allchblk.obj" \
>  	".\Debug\alloc.obj" \
> @@ -387,7 +387,7 @@
>  	".\Debug\typd_mlc.obj" \
>  	".\Debug\win32_threads.obj"
>  
> -".\Debug\gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
> +".\Debug\libpar_gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
>      $(LINK32) @<<
>    $(LINK32_FLAGS) $(LINK32_OBJS)
>  <<
> @@ -465,7 +465,7 @@
>   /pdb:"$(OUTDIR)/gctest.pdb" /machine:I386 /out:"Release/gctest.exe" 
>  LINK32_OBJS= \
>  	".\gctest\Release\test.obj" \
> -	".\Release\gc.lib"
> +	".\Release\libpar_gc.lib"
>  
>  ".\Release\gctest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
>      $(LINK32) @<<
> @@ -557,7 +557,7 @@
>   /pdb:"$(OUTDIR)/gctest.pdb" /map:"$(INTDIR)/gctest.map" /debug /machine:I386\
>   /out:"Debug/gctest.exe" 
>  LINK32_OBJS= \
> -	".\Debug\gc.lib" \
> +	".\Debug\libpar_gc.lib" \
>  	".\gctest\Debug\test.obj"
>  
>  ".\Debug\gctest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
> @@ -646,7 +646,7 @@
>  	".\cord\Release\de.obj" \
>  	".\cord\Release\de_win.obj" \
>  	".\cord\Release\de_win.res" \
> -	".\Release\gc.lib"
> +	".\Release\libpar_gc.lib"
>  
>  ".\Release\de.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
>      $(LINK32) @<<
> @@ -739,7 +739,7 @@
>  	".\cord\Debug\de.obj" \
>  	".\cord\Debug\de_win.obj" \
>  	".\cord\Debug\de_win.res" \
> -	".\Debug\gc.lib"
> +	".\Debug\libpar_gc.lib"
>  
>  ".\Debug\de.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
>      $(LINK32) @<<
> Index: scripts/mgnuc.in
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/scripts/mgnuc.in,v
> retrieving revision 1.70
> diff -u -r1.70 mgnuc.in
> --- scripts/mgnuc.in	2000/06/14 14:54:09	1.70
> +++ scripts/mgnuc.in	2000/08/31 14:32:13
> @@ -57,6 +57,12 @@
>  	OPT_OPTS=""
>  	COMPILER=lcc
>  	;;
> +    *cl* | *CL*)
> +	ANSI_OPTS=""
> +	CHECK_OPTS=""
> +	OPT_OPTS=""
> +	COMPILER=cl
> +	;;
>      *)
>  	ANSI_OPTS=
>  	CHECK_OPTS=
> @@ -264,6 +270,12 @@
>  			ANSI_OPTS=""
>  			;;
>  
> +		*cygwin32*)
> +			case $COMPILER in
> +				cl) THREAD_OPTS="-DMR_THREAD_SAFE /MD"
> +				;;
> +			esac
> +			;;
>  		*)		THREAD_OPTS=""
>  			;;
>  	esac ;;
> Index: scripts/ml.in
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/scripts/ml.in,v
> retrieving revision 1.80
> diff -u -r1.80 ml.in
> --- scripts/ml.in	2000/08/25 14:19:35	1.80
> +++ scripts/ml.in	2000/08/31 14:32:13
> @@ -41,6 +41,21 @@
>  LINK=/stack:10485760	# 10 Mb
>  export LINK
>  
> +case "$CC" in
> +    *gcc*)
> +	COMPILER=gcc
> +	;;
> +    *lcc*)
> +	COMPILER=lcc
> +	;;
> +    *cl* | *CL*)
> +	COMPILER=cl
> +	;;
> +    *)
> +	COMPILER=unknown
> +	;;
> +esac
> +
>  # On some systems (Solaris for exemple), we need libraries to be able to 
>  # use sockets. The name of the needed libraries is determined by autoconf
>  # and passed through this variable.
> @@ -543,6 +558,13 @@
>   		*-osf*)		THREAD_LIBS="-lpthreads -lmach -lc_r" ;;
>  		*-linux*)	THREAD_LIBS="-lpthread" ;;
>  		*-solaris*)	THREAD_LIBS="-lpthread -ldl" ;;
> +		*cygwin*)
> +			case $COMPILER in
> +				cl)	ARCH_OPTS="/MD"
> +					;;
> +
> +			esac
> +			;;
>  		*)		echo "$0: warning: don't know which" \
>  					"library to use for pthreads" 1>&2
>  				THREAD_LIBS=""
> Index: util/mkinit.c
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/util/mkinit.c,v
> retrieving revision 1.65
> diff -u -r1.65 mkinit.c
> --- util/mkinit.c	2000/08/26 04:34:36	1.65
> +++ util/mkinit.c	2000/08/31 14:32:14
> @@ -124,10 +124,6 @@
>  	"  Declare_entry(%s);\n"
>  	"#endif\n"
>  	"\n"
> -	"#ifdef CONSERVATIVE_GC\n"
> -	"  extern char *GC_stackbottom;\n"
> -	"#endif\n"
> -	"\n"
>  	"#if defined(USE_DLLS)\n"
>  	"  #if !defined(libmer_DEFINE_DLL)\n"
>  	"       #define libmer_impure_ptr \\\n"
> 
> --------------------------------------------------------------------------
> mercury-developers mailing list
> Post messages to:       mercury-developers at cs.mu.oz.au
> Administrative Queries: owner-mercury-developers at cs.mu.oz.au
> Subscriptions:          mercury-developers-request at cs.mu.oz.au
> --------------------------------------------------------------------------
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list