missing NULL terminator in set_config_x
[geda-gaf.git] / m4 / geda-uri-viewer.m4
bloba8c219296cad3858384388a776d61823c05cbc27
1 # geda-uri-viewer.m4                                    -*-Autoconf-*-
2 # serial 1
4 dnl Checks for default URI launcher method
5 dnl Copyright (C) 2011  Peter TB Brett <peter@peter-b.co.uk>
6 dnl
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.
11 dnl
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.
16 dnl
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],
23   AC_PREREQ([2.69])dnl
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])
29   AC_ARG_ENABLE([gio],
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
35     enable_gio=yes
36   else
37     enable_gio=no
38   fi
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
42       a URI.])
43   fi
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])
53   else
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
60         URI_VIEWER=cygstart
62       # On Mac OS X, we can use open(1) to launch URIs.
63       elif test "X$OS_CARBON" = "Xyes"; then
64         URI_VIEWER=open
66       # Default to xdg-open(1) on other platforms.
67       else
68         URI_VIEWER=xdg-open
69       fi
70     fi
71     AC_DEFINE_UNQUOTED([SHOW_URI_COMMAND], ["$URI_VIEWER"],
72                        [Command to launch default application for a URI.])
73     AC_MSG_RESULT([$URI_VIEWER])
74   fi