[m-rev.] diff: fix another bug with mmc --make
Julien Fischer
juliensf at csse.unimelb.edu.au
Wed Nov 1 13:09:07 AEDT 2006
Estimated hours taken: 1.5
Branches: main, release
Fix a bug with mmc --make that shows up on Mac OS X.
compiler/make.program_target.m:
Quote the command used to invoke ranlib correctly.
Julien.
(This diff is against the release branch.)
Index: make.program_target.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make.program_target.m,v
retrieving revision 1.47.2.2
diff -u -r1.47.2.2 make.program_target.m
--- make.program_target.m 24 Oct 2006 08:29:49 -0000 1.47.2.2
+++ make.program_target.m 1 Nov 2006 02:03:25 -0000
@@ -1230,9 +1230,23 @@
io.write_string(InstallDir, !IO),
io.nl(!IO)
), !IO),
- globals.io_lookup_string_option(ranlib_command, RanLibCommand, !IO),
+ globals.io_lookup_string_option(ranlib_command, RanLibCommand0, !IO),
+ %
+ % NOTE: because some systems, e.g. Mac OS X, need to invoke ranlib
+ % with an option we need to break the ranlib command up in order to get
+ % the quoting correct, e.g. we want
+ %
+ % "ranlib" "-c" <archive>
+ %
+ % rather than
+ %
+ % "ranlib -c" <archive>
+ %
+ % on such systems.
+ %
+ RanLibCommand = string.words(RanLibCommand0),
Command = string.join_list(" ", list.map(quote_arg,
- [RanLibCommand, InstallDir / FileName ])),
+ RanLibCommand ++ [ InstallDir / FileName ])),
io.output_stream(OutputStream, !IO),
invoke_system_command(OutputStream, verbose, Command, Succeeded, !IO).
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list