[m-dev.] for review: mmc produce an executable using MSVC
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Jun 16 10:18:12 AEST 2000
On 14-Jun-2000, Peter Ross <petdr at cs.mu.OZ.AU> wrote:
>
> Changes needed to get
> mmc --grade hlc.gc file.m
> producing an executable, using MSVC as the compiler.
Those changes look good, Pete.
I do see one problem with your changes:
>
> +case $# in
> + 0) LINKER_FLAGS="$UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT \
> + $ARCH_OPTS @LINK_OPT_SEP@ $LIBDIR_OPTS $RPATH_OPT_LIST $LIBS" ;;
> +
> + *) LINKER_FLAGS="$UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT \
> + $ARCH_OPTS $@ @LINK_OPT_SEP@ $LIBDIR_OPTS $RPATH_OPT_LIST $LIBS" ;;
> +esac
> +
> case $verbose in
> true)
> echo "ml: using grade \`$GRADE'"
> case $demangle in
> false)
> - echo $LINKER $UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT \
> - $ARCH_OPTS $LIBDIR_OPTS $RPATH_OPT_LIST "$@" $LIBS
> + echo $LINKER $LINKER_FLAGS
> ;;
> true)
> - echo $LINKER $UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT \
> - $ARCH_OPTS $LIBDIR_OPTS $RPATH_OPT_LIST "$@" $LIBS "|"
> + echo $LINKER $LINKER_FLAGS "|"
> echo "$DEMANGLER"
> ;;
> esac
> @@ -660,13 +666,7 @@
> exec $DEMANGLER --explain-link-errors 1>&2 < $PIPE &
> # execute $CC with stdout & stderr redirected to
> # go via the pipe to $DEMANGLER and then to stderr
> - case $# in
> - 0) $LINKER $UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT $ARCH_OPTS \
> - $LIBDIR_OPTS $RPATH_OPT_LIST $LIBS >$PIPE 2>&1 ;;
> -
> - *) $LINKER $UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT $ARCH_OPTS \
> - $LIBDIR_OPTS $RPATH_OPT_LIST "$@" $LIBS >$PIPE 2>&1 ;;
> - esac
> + $LINKER $LINKER_FLAGS >$PIPE 2>&1
> linker_status=$?
> # now we can remove the pipe; since is an open file, it will
> # stay around until $DEMANGLER exits
> @@ -676,11 +676,6 @@
> exit $linker_status
> ;;
> false)
> - case $# in
> - 0) exec $LINKER $UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT $ARCH_OPTS \
> - $LIBDIR_OPTS $RPATH_OPT_LIST $LIBS ;;
> - *) exec $LINKER $UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT $ARCH_OPTS \
> - $LIBDIR_OPTS $RPATH_OPT_LIST "$@" $LIBS ;;
> - esac
> + exec $LINKER $LINKER_FLAGS
> ;;
I think that change will do the wrong thing in the case where "$@"
includes arguments that contain spaces or other special characters.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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