aboutsummaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorOmair Majid <[email protected]>2011-03-07 11:10:42 -0500
committerOmair Majid <[email protected]>2011-03-07 11:10:42 -0500
commit6ee70462f3655208b658ab057e05c0f42d2b0afb (patch)
tree1a8fe5d5fd4d12968db3af28f88e1b75f43f4370 /acinclude.m4
parent9bc8e7fc91fa792f30093e8a24396d4aa5b9a9b5 (diff)
Add Proxy Auto Config (PAC) support
This patch adds support for reading, parsing and evaluating PAC files using rhino. 2011-03-07 Omair Majid <[email protected]> * NEWS: Update. * Makefile.am (RHINO_RUNTIME): Define to point to rhino jars, or empty. (RUNTIME, LAUNCHER_BOOTCLASSPATH, PLUGIN_BOOTCLASSPATH): Include RHINO_RUNTIME. (PHONY): Add check-pac-functions, clean-jrunscript and clean-tests. (check-local): New target. Depends on check-pac-functions. (check-pac-functions): New target. (jrunscript): New target. (clean-tests): New target. (clean-jrunscript): New target. (netx-source-files.txt): Remove rhino related files if not building with rhino. (build.properties): New target. (stamps/netx.stamp): Depend on build.properties and copy new files to build location. (clean-netx): Remove build.properties. (stamps/bootstrap-directory.stamp): Add java to bootstrap programs. * acinclude.m4 (IT_FIND_RHINO_JAR): New macro. * configure.ac: Invoke IT_FIND_RHINO_JAR. * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java: Add browserProxyAutoConfig. (initFromBrowserConfig): Initialize browserProxyAutoConfig if needed. (getFromBrowserPAC): Use browserProxyAutoConfig to find proxies. * netx/net/sourceforge/jnlp/resources/Messages.properties: Replace RPRoxyPacNotImplemented with RPRoxyPacNotSupported. * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java: Add pacEvaluator. (parseConfiguration): Initialize pacEvaluator if needed. (getFromPAC): Use pacEvaulator to find proxies. (getProxiesFromPacResult): New method. Converts a proxy string to a list or proxies. * netx/net/sourceforge/jnlp/runtime/PacEvaluator.java: New file. Defines a Java interface for a PAC evaluator. * netx/net/sourceforge/jnlp/runtime/FakePacEvaluator.java: New file. Dummy implementation of a PAC evaluator. * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java: New file. A rhino-based PAC evaluator. * netx/net/sourceforge/jnlp/runtime/PacEvaluatorFactory.java: New file. A factory for creating the right PAC evaulator. * netx/net/sourceforge/jnlp/runtime/pac-funcs.js: New file. Defines helper functions needed while evaluating PAC files. * tests/netx/pac/pac-funcs-test.js: New file. Tests the PAC helper functions.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m450
1 files changed, 50 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 9d06708..cd80f62 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -250,6 +250,56 @@ AC_DEFUN([FIND_ECJ_JAR],
AC_SUBST(ECJ_JAR)
])
+AC_DEFUN([IT_FIND_RHINO_JAR],
+[
+ AC_MSG_CHECKING([whether to include Javascript support via Rhino])
+ AC_ARG_WITH([rhino],
+ [AS_HELP_STRING(--with-rhino,specify location of the rhino jar)],
+ [
+ case "${withval}" in
+ yes)
+ RHINO_JAR=yes
+ ;;
+ no)
+ RHINO_JAR=no
+ ;;
+ *)
+ if test -f "${withval}"; then
+ RHINO_JAR="${withval}"
+ elif test -z "${withval}"; then
+ RHINO_JAR=yes
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR("The rhino jar ${withval} was not found.")
+ fi
+ ;;
+ esac
+ ],
+ [
+ RHINO_JAR=yes
+ ])
+ if test x"${RHINO_JAR}" = "xyes"; then
+ if test -e "/usr/share/java/rhino.jar"; then
+ RHINO_JAR=/usr/share/java/rhino.jar
+ elif test -e "/usr/share/java/js.jar"; then
+ RHINO_JAR=/usr/share/java/js.jar
+ elif test -e "/usr/share/rhino-1.6/lib/js.jar"; then
+ RHINO_JAR=/usr/share/rhino-1.6/lib/js.jar
+ fi
+ if test x"${RHINO_JAR}" = "xyes"; then
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR("A rhino jar was not found in /usr/share/java as either rhino.jar or js.jar.")
+ fi
+ fi
+ AC_MSG_RESULT(${RHINO_JAR})
+ AM_CONDITIONAL(WITH_RHINO, test x"${RHINO_JAR}" != "xno")
+dnl Clear RHINO_JAR if it doesn't contain a valid filename
+ if test x"${RHINO_JAR}" = "xno"; then
+ RHINO_JAR=
+ fi
+ AC_SUBST(RHINO_JAR)
+])
+
AC_DEFUN_ONCE([IT_CHECK_PLUGIN],
[
AC_MSG_CHECKING([whether to build the browser plugin])