[m-users.] Trouble building on MSYS2 Win10
Peter Wang
novalazy at gmail.com
Thu Apr 29 11:34:01 AEST 2021
On Wed, 28 Apr 2021 21:01:58 +0100 Mark Green <mgreen at brookes.ac.uk> wrote:
> I did try starting MSYS from a Windows Command Prompt, having updated the
> PATH in that Windows Command Prompt to include javac, but that also did not
> work, which implies that Mercury ignores the environment it was started in?
> There seems therefore to be no way to get this to work other than adding
> java to the default PATH for Windows which is a security risk. Is it
> necessary to do that?
The Mercury compiler gets the path to the Java compiler
from the --java-compiler option, which is configured in the
scripts/Mercury.config file, which gets installed somewhere.
The reason for the behaviour you are seeing is given in m4/mercury.m4:
# On Windows, the Java SDK has a high chance of being installed in a path
# containing spaces. The simplest solution is to keep only the basename.
# Everything will still work so long as the executables can be found on the
# PATH later.
AC_PATH_PROGS(JAVAC, javac)
case "$JAVAC" in
*" "*)
JAVAC=`basename "$JAVAC"`
;;
esac
AC_PATH_PROG(JAVA_INTERPRETER, java)
> Also, is there a way to tell make install to go ahead directly to the Java
> install? As it is it spends several hours building all the other grades,
> then throws them away because the already installed files are identical!
mmake install LIBGRADES=java
Peter
More information about the users
mailing list