aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--acinclude.m473
-rw-r--r--configure.ac8
3 files changed, 86 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a9dfb0c..f18ea23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-03-08 Omair Majid <[email protected]>
+
+ * acinclude.m4 (IT_FIND_OPTIONAL_JAR): New macro.
+ * configure.ac: Do not call IT_FIND_RHINO. Use IT_FIND_OPTIONAL_JAR
+ instead.
+
2011-03-08 Denis Lila <[email protected]>
* netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java
diff --git a/acinclude.m4 b/acinclude.m4
index 1af5040..8ba89f0 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -250,6 +250,79 @@ AC_DEFUN([FIND_ECJ_JAR],
AC_SUBST(ECJ_JAR)
])
+#
+# IT_FIND_OPTIONAL_JAR
+# --------------------
+# Find an optional jar required for building and running
+#
+# $1 : jar/feature name
+# $2 : used to set $2_JAR and WITH_$2
+# $3 (optional) : used to specify additional file paths for searching
+#
+# Sets $2_JAR to the jar location (or blank if not found)
+# Defines WITH_$2 if jar is found
+# Sets $2_AVAILABLE to "true" if jar is found (or "false" if not)
+#
+AC_DEFUN([IT_FIND_OPTIONAL_JAR],
+[
+ AC_MSG_CHECKING([for $1 jar])
+ AC_ARG_WITH([$1],
+ [AS_HELP_STRING(--with-$1,specify location of the $1 jar)],
+ [
+ case "${withval}" in
+ yes)
+ $2_JAR=yes
+ ;;
+ no)
+ $2_JAR=no
+ ;;
+ *)
+ if test -f "${withval}"; then
+ $2_JAR="${withval}"
+ elif test -z "${withval}"; then
+ $2_JAR=yes
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR("The $1 jar ${withval} was not found.")
+ fi
+ ;;
+ esac
+ ],
+ [
+ $2_JAR=yes
+ ])
+ it_extra_paths_$1="$3"
+ if test "x${$2_JAR}" = "xyes"; then
+ for path in ${it_extra_paths_$1}; do
+ if test -f ${path}; then
+ $2_JAR=${path}
+ break
+ fi
+ done
+ fi
+ if test x"${$2_JAR}" = "xyes"; then
+ if test -f "/usr/share/java/$1.jar"; then
+ $2_JAR=/usr/share/java/$1.jar
+ fi
+ fi
+ if test x"${$2_JAR}" = "xyes"; then
+ $2_JAR=no
+ fi
+ AC_MSG_RESULT(${$2_JAR})
+ AM_CONDITIONAL(WITH_$2, test x"${$2_JAR}" != "xno")
+ # Clear $2_JAR if it doesn't contain a valid filename
+ if test x"${$2_JAR}" = "xno"; then
+ $2_JAR=
+ fi
+ if test -n "${$2_JAR}" ; then
+ $2_AVAILABLE=true
+ else
+ $2_AVAILABLE=false
+ fi
+ AC_SUBST($2_JAR)
+ AC_SUBST($2_AVAILABLE)
+])
+
AC_DEFUN([IT_FIND_RHINO_JAR],
[
AC_MSG_CHECKING([whether to include Javascript support via Rhino])
diff --git a/configure.ac b/configure.ac
index 64b8d80..850b293 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,6 @@ FIND_JAVAC
FIND_JAR
FIND_ECJ_JAR
IT_FIND_JAVADOC
-IT_FIND_RHINO_JAR
AC_CONFIG_FILES([javac], [chmod +x javac])
IT_SET_VERSION
@@ -80,6 +79,13 @@ IT_CHECK_FOR_CLASS(COM_SUN_JNDI_TOOLKIT_URL_URLUTIL, [com.sun.jndi.toolkit.url.U
IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef])
IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE
+#
+# Find optional depedencies
+#
+
+IT_FIND_OPTIONAL_JAR([rhino], RHINO,
+ [/usr/share/java/js.jar /usr/share/rhino-1.6/lib/js.jar])
+
AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript])
AC_CONFIG_FILES([build.properties])