aboutsummaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorSaad Mohammad <[email protected]>2012-06-07 11:31:27 -0400
committerSaad Mohammad <[email protected]>2012-06-07 11:31:27 -0400
commitb56a958fe6c6041b0ca5d72bab6d84e998e218ff (patch)
tree8d91f06dd9f4ce32b6ee856bb22abdafc84c5547 /acinclude.m4
parentb791c7480534cf1739b38174e1fab8a7b272b8ec (diff)
Added the ability to configure (enable/disable/set custom path to) browsers
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m437
1 files changed, 37 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index a330d0f..eff60c8 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -880,3 +880,40 @@ AC_DEFUN_ONCE([IT_SET_VERSION],
AC_MSG_RESULT([${FULL_VERSION}])
AC_SUBST([FULL_VERSION])
])
+
+dnl Allows you to configure (enable/disable/set path to) the browser
+dnl REQUIRED Parameters:
+dnl [browser name, variable to store path, default command to run browser (if not provided, assume it's the same as the browser name]
+AC_DEFUN([IT_FIND_BROWSER],
+[
+ AC_ARG_WITH([$1],
+ [AS_HELP_STRING(--with-$1,specify the location of $1)],
+ [
+ if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then
+ $2=""
+ elif test -f "${withval}" ; then
+ $2="${withval}"
+ else
+ AC_MSG_CHECKING([for $1])
+ AC_MSG_RESULT([not found])
+ AC_MSG_FAILURE([invalid location specified to $1: ${withval}])
+ fi
+ ],
+ [
+ withval="yes"
+ ])
+
+ if test -f "${$2}"; then
+ AC_MSG_CHECKING([for $1])
+ AC_MSG_RESULT([${$2}])
+ elif test "${withval}" != "no"; then
+ if test $# -gt 2; then
+ AC_PATH_TOOL([$2], [$3], [], [])
+ else
+ AC_PATH_TOOL([$2], [$1], [], [])
+ fi
+ else
+ AC_MSG_CHECKING([for $1])
+ AC_MSG_RESULT([no])
+ fi
+])