Permalink
Browse files

Fix a problem with the erlang grade on Windows.

m4/mercury.m4:
	Only keep the basename of ERLC and ERL if their initial values
	are qualified with directories whose names contains spaces.  This
	avoids build problems on Windows.  (We do the same thing for the
	Java tools.)
  • Loading branch information...
1 parent 5f74b30 commit bc38f5f9ac5a24ada1886f3ec0ba31c203842970 @juliensf juliensf committed Jul 30, 2013
Showing with 18 additions and 2 deletions.
  1. +18 −2 m4/mercury.m4
View
@@ -619,8 +619,24 @@ else
mercury_cv_erlang="no"
fi
-AC_SUBST(ERLC)
-AC_SUBST(ERL)
+# On Windows, Erlang/OTP 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.
+case "$ERLC" in
+ *" "*)
+ ERLC=`basename "$ERLC"`
+ ;;
+esac
+
+case "$ERL" in
+ *" "*)
+ ERL=`basename "$ERL"`
+ ;;
+esac
+
+AC_SUBST([ERLC])
+AC_SUBST([ERL])
])
#-----------------------------------------------------------------------------#

0 comments on commit bc38f5f

Please sign in to comment.