[m-rev.] diff: csc path names fix
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Oct 24 16:50:34 AEST 2002
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.
Workspace: /c/fjh/ws/2/mercury
Index: bindist/bindist.build_vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/bindist/bindist.build_vars.in,v
retrieving revision 1.19
diff -u -d -r1.19 bindist.build_vars.in
--- bindist/bindist.build_vars.in 8 Sep 2002 17:09:44 -0000 1.19
+++ bindist/bindist.build_vars.in 24 Oct 2002 06:52:19 -0000
@@ -51,7 +51,7 @@
LIB_LIBPATH="@LIB_LIBPATH@"
LINK_LIB="@LINK_LIB@"
LINK_OPT_SEP="@LINK_OPT_SEP@"
-CYGPATH="@CYGPATH@"
+FIX_PATH_FOR_CC="@FIX_PATH_FOR_CC@"
MATH_LIB="@MATH_LIB@"
CGIDIR="@CGIDIR@"
ENABLE_DEEP_PROFILER="@ENABLE_DEEP_PROFILER@"
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.325
diff -u -d -r1.325 configure.in
--- configure.in 14 Oct 2002 08:01:27 -0000 1.325
+++ configure.in 24 Oct 2002 06:52:27 -0000
@@ -381,7 +381,7 @@
AC_CHECK_LIB(m, sin, [MATH_LIB=-lm], [MATH_LIB=])
AC_SUBST(MATH_LIB)
#-----------------------------------------------------------------------------#
-AC_MSG_CHECKING(for use of a Microsoft compiler)
+AC_MSG_CHECKING(for use of a Microsoft C compiler)
AC_EGREP_CPP(yes,
[
#ifdef _MSC_VER
@@ -407,7 +407,7 @@
AR_LIBFILE_OPT="/OUT:"
BOEHMGC_MAKEFILE="-f NT_MAKEFILE"
- CYGPATH="cygpath -w"
+ FIX_PATH_FOR_CC="cygpath -w"
# MS doesn't use a ranlib.
RANLIB="echo"
@@ -427,7 +427,7 @@
AR_LIBFILE_OPT=""
BOEHMGC_MAKEFILE=""
- CYGPATH=echo
+ FIX_PATH_FOR_CC=echo
AC_PROG_RANLIB
fi
@@ -443,7 +443,7 @@
AC_SUBST(LIB_LIBPATH)
AC_SUBST(LINK_LIB)
AC_SUBST(LINK_OPT_SEP)
-AC_SUBST(CYGPATH)
+AC_SUBST(FIX_PATH_FOR_CC)
#-----------------------------------------------------------------------------#
# Microsoft.NET configuration
Index: scripts/Mmake.rules
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.rules,v
retrieving revision 1.134
diff -u -d -r1.134 Mmake.rules
--- scripts/Mmake.rules 15 Sep 2002 10:01:51 -0000 1.134
+++ scripts/Mmake.rules 24 Oct 2002 06:52:27 -0000
@@ -269,14 +269,14 @@
ifeq ($(findstring il,$(GRADE)),il)
$(os_subdir)%.dll : %.cpp
$(MS_CL) -CLR$(MS_CL_NOASM) $(ALL_MS_CLFLAGS) \
- -I`$(CYGPATH) $(MERC_C_INCL_DIR)` \
- -AI`$(CYGPATH) $(MERC_DLL_DIR)` $< \
+ -I`$(FIX_PATH_FOR_CL) $(MERC_C_INCL_DIR)` \
+ -AI`$(FIX_PATH_FOR_CL) $(MERC_DLL_DIR)` $< \
-link -noentry mscoree.lib -dll $(MS_CL_LIBS) -out:$@
rm -f $*.obj
$(os_subdir)%.dll : %.cs
- $(MS_CSC) /t:library /lib:`$(CYGPATH) $(MERC_DLL_DIR)` /out:$@ \
- $(CSHARP_ASSEMBLY_REFS-$*) $(ALL_MS_CSCFLAGS) $<
+ $(MS_CSC) /t:library /lib:`$(FIX_PATH_FOR_CSC) $(MERC_DLL_DIR)` \
+ /out:$@ $(CSHARP_ASSEMBLY_REFS-$*) $(ALL_MS_CSCFLAGS) $<
$(os_subdir)%.dll : %.il
$(MS_ILASM) $(ALL_MS_ILASMFLAGS) /dll /quiet /OUT=$@ $<
@@ -378,20 +378,20 @@
.cpp.dll:
$(MS_CL) -CLR$(MS_CL_NOASM) $(ALL_MS_CLFLAGS) \
- -I`$(CYGPATH) $(MERC_C_INCL_DIR)` \
- -AI`$(CYGPATH) $(MERC_DLL_DIR)` $< \
+ -I`$(FIX_PATH_FOR_CL) $(MERC_C_INCL_DIR)` \
+ -AI`$(FIX_PATH_FOR_CL) $(MERC_DLL_DIR)` $< \
-link -noentry mscoree.lib -dll $(MS_CL_LIBS) -out:$@
rm -f $*.obj
.cs.dll:
- $(MS_CSC) /t:library /lib:`$(CYGPATH) $(MERC_DLL_DIR)` /out:$@ \
- $(CSHARP_ASSEMBLY_REFS-$*) $(EXTRA_CSCFLAGS) $<
+ $(MS_CSC) /t:library /lib:`$(FIX_PATH_FOR_CSC) $(MERC_DLL_DIR)` \
+ /out:$@ $(CSHARP_ASSEMBLY_REFS-$*) $(EXTRA_CSCFLAGS) $<
.cpp.exe:
$(MS_CL) -CLR$(MS_CL_NOASM) -I$(MERCURY_LIBRARY_PATH) $< -link -entry:main $(MS_CL_LIBS) -out:$@
.cs.exe:
- $(MS_CSC) /lib:`$(CYGPATH) $(MERC_DLL_DIR)` /out:$@ \
+ $(MS_CSC) /lib:`$(FIX_PATH_FOR_CSC) $(MERC_DLL_DIR)` /out:$@ \
$(CSHARP_ASSEMBLY_REFS-$*) $(EXTRA_CSCFLAGS) $<
endif # $(findstring il,$(GRADE)) != ""
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.80
diff -u -d -r1.80 Mmake.vars.in
--- scripts/Mmake.vars.in 15 Sep 2002 10:01:51 -0000 1.80
+++ scripts/Mmake.vars.in 24 Oct 2002 06:52:27 -0000
@@ -186,6 +186,14 @@
# Stuff which is specific to the C back-ends
#
+# FIX_PATH_FOR_<foo> should be set to a script which converts path names
+# from Unix/Cygwin format into a format suitable for the <foo> command.
+# If <foo> is a Unix/Cygwin command that expects Unix-style path names,
+# FIX_PATH_FOR_<foo> should be set to "echo".
+# If <foo> is a Windows command that expects Windows-style path names,
+# FIX_PATH_FOR_<foo> should be set to "cygpath -w".
+FIX_PATH_FOR_CC = @FIX_PATH_FOR_CC@
+
MGNUC = mgnuc
ALL_MGNUCFLAGS = $(MGNUCFLAGS) $(EXTRA_MGNUCFLAGS) $(TARGET_MGNUCFLAGS) \
-- $(ALL_CFLAGS)
@@ -204,7 +212,7 @@
# MS_CL is the command line version of Microsoft Visual C++, which we
# use to compile Managed C++ code in the .NET backend.
-CYGPATH = @CYGPATH@
+FIX_PATH_FOR_CL = cygpath -w
MS_CL = @MS_CL@
MS_VISUALCPP_DIR = @MS_VISUALCPP_DIR@
ALL_MS_CLFLAGS = $(MS_CLFLAGS) $(EXTRA_MS_CLFLAGS) $(TARGET_MS_CLFLAGS) \
@@ -216,9 +224,9 @@
# will be single-quoted when passed to the shell via ECHO_MERCURY_OPTIONS
# to preserve possible double-quotes, so the command substitution won't
# be run then.
-MS_VC7_INCLUDE_DIR = $(shell echo `$(CYGPATH) "$(MS_VISUALCPP_DIR)/include"`)
-MS_VC7_INCLUDES = -I"$(MS_VC7_INCLUDE_DIR)"
-LIB_MS_CLFLAGS = $(MS_VC7_INCLUDES) $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS))
+MS_VC_INCLUDE_DIR = $(shell $(FIX_PATH_FOR_CL) "$(MS_VISUALCPP_DIR)/include")
+MS_VC_INCLUDES = -I"$(MS_VC_INCLUDE_DIR)"
+LIB_MS_CLFLAGS = $(MS_VC_INCLUDES) $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS))
# MS_CL_NOASM can be used to turn off assembly generation. Use
# MS_CL_NOASM=:noAssembly to turn it off, leave it blank to turn it on.
@@ -227,24 +235,31 @@
# The system libraries were once needed here, but are currently unnecessary.
MS_CL_LIBS =
-# XXX handle the case where MERCURY_STDLIB_DIR is not set.
+# MERCURY_STDLIB_DIR should be set by the `mmake' script.
MERC_C_INCL_DIR = $(MERCURY_STDLIB_DIR)/inc
-MERC_DLL_DIR = $(MERCURY_STDLIB_DIR)/lib/ilc/@FULLARCH@
+MERC_DLL_DIR = $(MERCURY_STDLIB_DIR)/lib/$(GRADE)/@FULLARCH@
# MS_ILASM is the Microsoft IL assembler, which turns IL assembly code
# into bytecode.
-MS_ILASM = @ILASM@
+# XXX we should also support the Portable.NET version of ILASM,
+# which has a different command-line interface.
+# (Is there a Mono ILASM too? What about Rotor?)
+MS_ILASM = @ILASM@
ALL_MS_ILASMFLAGS= $(MS_ILASMFLAGS) $(EXTRA_MS_ILASMFLAGS) \
$(TARGET_MS_ILASMFLAGS) $(LIB_MS_ILASMFLAGS) $(ILASM_KEYFLAG)
MS_ILASMFLAGS =
EXTRA_MS_ILASMFLAGS =
LIB_MS_ILASMFLAGS= $(patsubst %,-I %,$(EXTRA_C_INCL_DIRS))
-# MS_AL is the Microsoft assembly linker, which creates and installs
-# assemblies.
+# MS_AL is the Microsoft assembly linker, which creates assemblies.
MS_AL = al
# MS_CSC is the command line version of C# compiler
+# XXX we should also support the Portable.NET and Mono C# compilers,
+# which have a different command-line interface.
+# (What about Rotor?)
+
+FIX_PATH_FOR_CSC = cygpath -w
MS_CSC = csc
ALL_MS_CSCFLAGS = $(MS_CSCFLAGS) $(EXTRA_MS_CSCFLAGS) $(TARGET_MS_CSCFLAGS) \
$(LIB_MS_CSCFLAGS)
--------------------------------------------------------------------------
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