1 # geda-uri-viewer.m4 -*-Autoconf-*-
4 dnl Checks for default URI launcher method
5 dnl Copyright (C) 2011 Peter TB Brett <peter@peter-b.co.uk>
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 AC_DEFUN([AX_OPTION_URI_VIEWER],
24 AC_REQUIRE([AX_HOST])dnl
26 AC_ARG_VAR([URI_VIEWER], [Path to URI launcher executable])
28 AC_MSG_CHECKING([whether to use GIO to launch URIs])
30 [AS_HELP_STRING([--enable-gio],
31 [use GIO to launch URIs [default=auto]])],
32 [], [enable_gio=auto])
34 if test "X$enable_gio" = "Xauto" && test "X$OS_LINUX" = "Xyes"; then
39 if test "X$enable_gio" = "Xyes"; then
40 AC_DEFINE([SHOW_URI_GIO], [1],
41 [Define to 1 if GIO should be used to launch a default application for
44 AC_MSG_RESULT([$enable_gio])
47 AC_MSG_CHECKING([platform URI viewer])
49 if test "X$enable_gio" = "Xyes" || test "X$OS_WIN32_NATIVE" = "Xyes"; then
50 # We use an API function, so we don't need a URI viewer application
51 AC_MSG_RESULT([none required])
54 # If the user specified a viewer command, just use that.
55 if test "X$URI_VIEWER" = "X"; then
57 # On Cygwin, we use cygstart, because it takes care of any required
58 # translation between cygwin filenames and native filenames.
59 if test "X$OS_CYGWIN" = "Xyes"; then
62 # On Mac OS X, we can use open(1) to launch URIs.
63 elif test "X$OS_CARBON" = "Xyes"; then
66 # Default to xdg-open(1) on other platforms.
71 AC_DEFINE_UNQUOTED([SHOW_URI_COMMAND], ["$URI_VIEWER"],
72 [Command to launch default application for a URI.])
73 AC_MSG_RESULT([$URI_VIEWER])