[m-rev.] For review: Have configure decide whether to install the Java grade

James Goddard goddardjames at yahoo.com
Mon Feb 9 18:23:42 AEDT 2004


Estimated hours taken: 1.5
Branches: main

Have the configure script decide whether to install the Java grade.

configure.in:
	Add Java to the list of library grades to install by default,
	if the Java SDK is installed.

	Add the option to disable the Java grade.

aclocal.m4:
	Detect whether the Java SDK is installed.  Currently this is done
	simply by checking for javac.


Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.385
diff -u -d -r1.385 configure.in
--- configure.in	5 Feb 2004 09:26:32 -0000	1.385
+++ configure.in	9 Feb 2004 06:54:47 -0000
@@ -695,6 +695,11 @@
 MERCURY_CHECK_DOTNET
 
 #-----------------------------------------------------------------------------#
+# Java configuration
+#
+MERCURY_CHECK_JAVA
+
+#-----------------------------------------------------------------------------#
 mercury_check_for_functions () {
 
     for mercury_cv_func in "$@"
@@ -2434,6 +2439,10 @@
 [  --disable-dotnet-grades do not install the .NET grades],
 enable_dotnet_grades="$enableval",enable_dotnet_grades=yes)
 
+AC_ARG_ENABLE(java-grade,
+[  --disable-java-grade    do not install the Java grade],
+enable_java_grade="$enableval",enable_java_grade=yes)
+
 AC_ARG_ENABLE(libgrades,
 [  --enable-libgrades=...
                           install exactly the given versions of the library.
@@ -2452,6 +2461,7 @@
 	enable_hlc_prof_grades=no
 	enable_par_grades=no
 	enable_dotnet_grades=no
+	enable_java_grade=no
 fi
 
 #-----------------------------------------------------------------------------#
@@ -2605,6 +2615,12 @@
 if test $mercury_cv_microsoft_dotnet = yes -a "$enable_dotnet_grades" = yes
 then
     LIBGRADES="$LIBGRADES il"
+fi
+
+# add Java back-end grade, if Java is installed
+if test $mercury_cv_java = yes -a "$enable_java_grade" = yes
+then
+    LIBGRADES="$LIBGRADES java"
 fi
 
 # Allow the user to override the default list of library grades
Index: aclocal.m4
===================================================================
RCS file: /home/mercury1/repository/mercury/aclocal.m4,v
retrieving revision 1.21
diff -u -d -r1.21 aclocal.m4
--- aclocal.m4	6 Aug 2003 12:38:02 -0000	1.21
+++ aclocal.m4	9 Feb 2004 07:12:48 -0000
@@ -280,3 +280,24 @@
 ])
 
 #-----------------------------------------------------------------------------#
+#
+# Java configuration
+#
+AC_DEFUN(MERCURY_CHECK_JAVA,
+[
+AC_PATH_PROG(JAVAC, javac)
+
+AC_MSG_CHECKING(for Java SDK)
+AC_CACHE_VAL(mercury_cv_java, [
+if test "$JAVAC" != ""; then
+        mercury_cv_java="yes"
+else
+        mercury_cv_java="no"
+fi
+])
+AC_MSG_RESULT($mercury_cv_java)
+
+AC_SUBST(JAVAC)
+])
+
+#-----------------------------------------------------------------------------#
--------------------------------------------------------------------------
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