[m-rev.] For review: Set Java classpath automatically.

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Feb 12 10:52:05 AEDT 2004


On 11-Feb-2004, James Goddard <goddardjames at yahoo.com> wrote:
> Simplify use of the Java grade by automatically setting the classpath.
...
> compiler/modules.m:
> 	Remove the XXX comment that worrys about this issue.

s/worrys/worries/

> --- scripts/Mercury.config.bootstrap.in	11 Feb 2004 04:28:09 -0000	1.3
> +++ scripts/Mercury.config.bootstrap.in	11 Feb 2004 06:09:38 -0000
> @@ -29,6 +29,10 @@
>  # $(MATH_LIB) needs to be defined because it may
>  # be used by the substitution for SHARED_LIBS.
>  MATH_LIB=$(MERCURY_MATH_LIB)
> +# This needed for Java classpath.
> +INSTALL_JAVA_LIBRARY_DIR=$(MERCURY_STDLIB_DIR)/lib/java
> +# XXX Should this be derived from elsewhere?
> +STD_LIB_NAME=mer_std

No, defining it here is fine, so the XXX comment there should be deleted.
Instead, it should be replaced with a comment

	# If you change this, you will also need to change the files
	# indicated in scripts/c2init.in.

and then in scripts/c2init.in, you should add Mercury.config.bootstrap.in
and Mercury.config.in to the list quoted below:

 | # If you change one of these, or if you add a new one, you will also need
 | # to check the following files to see if corresponding changes are needed
 | # there as well:
 | #
 | #       Mmake.workspace
 | #       Mmakefile
 | #       compiler/compile_target_code.m
 | #       scripts/c2init.in
 | #       scripts/ml.in
 | #       tools/bootcheck,
 | #       tools/binary
 | #       tools/binary_step
 | #       tools/linear
 | #       tools/lmc
 | #       tools/lml
 | 
 | RT_LIB_NAME=mer_rt
 | STD_LIB_NAME=mer_std
 | TRACE_LIB_NAME=mer_trace
 | BROWSER_LIB_NAME=mer_browser
 | MDBCOMP_LIB_NAME=mer_mdbcomp
 | ANALYSIS_LIB_NAME=mer_analysis

Also I suggest putting a blank line before each comment line that does
not relate to the line above, i.e. one before "This needed for Java classpath."
and one before the comment for STD_LIB_NAME.

> @@ -52,6 +56,9 @@
>  		--cflags-for-gotos "@CFLAGS_FOR_GOTOS@" \
>  		--cflags-for-pic "@CFLAGS_FOR_PIC@" \
>  		--c-flag-to-name-object-file "@OBJFILE_OPT@" \
> +		--java-classpath "$(INSTALL_JAVA_LIBRARY_DIR)/$(STD_LIB_NAME).runtime.jar" \
> +		--java-classpath "$(INSTALL_JAVA_LIBRARY_DIR)/$(STD_LIB_NAME).jar" \

Is there any particular reason why the runtime library jar file is named
"$(STD_LIB_NAME).runtime.jar" rather than "$(RT_LIB_NAME).jar"?
The latter would be more consistent with the naming convention that
we use for the other back-ends.

> +		--java-classpath "." \

I don't think "." should be unconditionally added to the class path.
Isn't that wrong if the --use-subdirs option is enabled?

> --- scripts/Mercury.config.in	11 Feb 2004 03:50:06 -0000	1.8
> +++ scripts/Mercury.config.in	11 Feb 2004 06:09:29 -0000

Likewise here.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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