[m-rev.] diff: fix MC++ compilation rule

Peter Ross pro at missioncriticalit.com
Wed Nov 20 20:53:49 AEDT 2002


fjh wrote:

> On 05-Nov-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > Fix a bug in my previous change to fix a bug in fjh's previous change.
> > Revert back to using '/out:', and instead add the flag '/link' so that
'/out:'
> > is passed to the linker instead to avoid problems compiling the library.
>
> That's not going to work, I'm pretty sure.  See MS_CL_LIBS in
> library/Mmakefile.  You'll end up passing "/link /out:... /link ..."
> when building the library in the il grade, and then the linker will
complain
> that "/link" is not a valid option.
>
It complains, but it is just a warning, not an error.

> What was wrong with the original approach of using `/o' (or was it `-o'?)?
>
The former rule for building IL files is

$(os_subdir)%.dll : %.cpp
        $(MS_CL) -CLR$(MS_CL_NOASM) $(ALL_MS_CLFLAGS) \
                -I`$(FIX_PATH_FOR_CL) $(MERC_C_INCL_DIR)` \
                -AI`$(FIX_PATH_FOR_CL) $(MERC_DLL_DIR)` $< \
                /LD $(MS_CL_LIBS) -o:$@
        rm -f $*.obj

MS_CL_LIBS comes before -o:$@ and so the line in library/Mmakefile means
that -o is now passed to the linker and it fails.  There are three possible
fixes at this point.
    * Add /link before $(MS_CL_LIBS) and change back to -out:$@
    * Move the -o:$@ before MS_CL_LIBS
    * Add a new variable MS_LINKER_ARGS and refer to that in
library/Mmakefile

I choose the first one because it is the closest to what happened previously
and hence the least likely to cause problems in other peoples Mmakefiles.

Pete


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.419 / Virus Database: 235 - Release Date: 11/14/2002

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