[m-rev.] for review: config file variable substition fix

Simon Taylor stayl at cs.mu.OZ.AU
Wed May 7 14:19:20 AEST 2003


On 02-May-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> Estimated hours taken: 5
> Branches: main
> 
> Fix a bug where the config file was being incorrectly parsed for
> similar fragments to the one following.
> 
> MERCURY_C_COMPILER="gcc -no-cpp-precomp"
> DEFAULT_MCFLAGS=--cc "$(MERCURY_C_COMPILER)"
> 
> The final string to be parsed for the above fragment was
> DEFAULT_MCFLAGS=--cc ""gcc -no-cpp-precomp""
> which ended up as
>   ["-cc", "gcc", "-no-cpp-precomp"]
> instead of 
>   ["-cc", "gcc -no-cpp-precomp"]
> 
> This is because we incorrectly include the \" characters from
> MERCURY_C_COMPILER when substituting the value of the variable.
> 
> compiler/options_file.m:
> 	The charlist representing the variable value shouldn't have
> 	any of the quoting characters in them.
 
This isn't the right fix.


Estimated hours taken: 0.2
Branches: main

scripts/Mercury.config.in:
	Remove quotes which caused problems if the configured
	C compiler command consisted of multiple words,
	e.g. gcc --no-cpp-precomp.

Index: Mercury.config.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mercury.config.in,v
retrieving revision 1.3
diff -u -u -r1.3 Mercury.config.in
--- Mercury.config.in	15 Apr 2003 08:34:30 -0000	1.3
+++ Mercury.config.in	7 May 2003 01:29:10 -0000
@@ -17,8 +17,8 @@
 MERCURY_STDLIB_DIR=@LIBDIR@
 MERCURY_DEFAULT_OPT_LEVEL=-O2
 MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@
-MERCURY_C_COMPILER="@CC@"
-MERCURY_MATH_LIB="@MATH_LIB@"
+MERCURY_C_COMPILER=@CC@
+MERCURY_MATH_LIB=@MATH_LIB@
 # $(MATH_LIB) needs to be defined because it may
 # be used by the substitution for SHARED_LIBS.
 MATH_LIB=$(MERCURY_MATH_LIB)

--------------------------------------------------------------------------
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