gschem/po: Apply updated Dutch translations from Bert Timmerman
[geda-gaf/arnaud.git] / m4 / geda-desktop.m4
blob00b34ad29cf09129d605902f37dce3eae90920e4
1 # geda-desktop.m4                                       -*-Autoconf-*-
2 # serial 1.0
4 dnl MIME & desktop icon directories, and MIME database update options
5 dnl Copyright (C) 2009  Peter 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 # Check where KDE data should be installed (needed for KDE 3)
22 AC_DEFUN([AX_OPTION_KDE3_DATA],
24   AC_PREREQ([2.60])dnl
25   AC_MSG_CHECKING([whether to install KDE 3 desktop files])
27   AC_ARG_WITH([kdedatadir],
28     AS_HELP_STRING([--with-kdedatadir[[[=DIR]]]],
29       [install KDE 3 desktop files in DIR [[DIR=DATAROOTDIR]]]),
30     # If --with-kdedatadir was specified, need to handle three cases
31     # for its argument: "yes", "no" and an explicit path.
32     [ if test "X$with_kdedatadir" != "Xno"; then
33         AC_MSG_RESULT([yes])
34         AC_MSG_CHECKING([where to install KDE 3 desktop files])
35         # If a path was given to --with-kdedatadir, use that path;
36         # otherwise, use $datadir.
37         if test "X$with_kdedatadir" = "Xyes"; then
38           KDEDATADIR="$datarootdir"
39         else
40           KDEDATADIR="$with_kdedatadir"
41         fi
42         AC_MSG_RESULT([$KDEDATADIR])
43       else
44         AC_MSG_RESULT([no])
45       fi ],
46     [ AC_MSG_RESULT([no]) ])
48   AM_CONDITIONAL([ENABLE_KDE_DESKTOP_DATA],
49                  test "X$KDEDATADIR" != "X")
50   AC_SUBST([KDEDATADIR])
51 ])dnl AX_OPTION_KDE3_DATA
55 # Check where XDG data should be installed
56 AC_DEFUN([AX_OPTION_XDG_DATA],
58   AC_PREREQ([2.60])dnl
60   dnl Complain if icon-theme-installer is missing
61   AC_REQUIRE_AUX_FILE([icon-theme-installer])
62   ICON_THEME_INSTALLER="\${SHELL} $am_aux_dir/icon-theme-installer"
63   AC_SUBST([ICON_THEME_INSTALLER])
65   AC_MSG_CHECKING([where to install XDG desktop files])
66   AC_ARG_WITH([xdgdatadir],
67     AS_HELP_STRING([--with-xdgdatadir[[[=DIR]]]],
68       [install XDG desktop files in DIR [[DIR=DATAROOTDIR]]]))
70   if (test "X$with_xdgdatadir" = "X$yes") || (test "X$with_xdgdatadir" = "X"); then
71     with_xdgdatadir="$datarootdir"
72   fi
73   AC_MSG_RESULT([$with_xdgdatadir])
74   AC_SUBST([XDGDATADIR], [$with_xdgdatadir])
75 ])dnl AX_OPTION_XDG_DATA
79 # Check if the MIME database should be updated, and if so, find the
80 # update-mime-database program.
81 AC_DEFUN([AX_OPTION_XDG_DB],
83   AC_PREREQ([2.60])dnl
84   AC_ARG_VAR([UPDATE_MIME_DATABASE], [Path to update-mime-database executable])
85   AC_ARG_VAR([UPDATE_DESKTOP_DATABASE], [Path to update-desktop-database executable])
87   # Check if the user enabled updating of the MIME database
88   AC_MSG_CHECKING([whether 'make install' should update XDG databases])
89   AC_ARG_ENABLE([update-xdg-database],
90     [AS_HELP_STRING([--disable-update-xdg-database],
91       [do not update XDG database after installation])],
92     [], [enable_update_xdg_database=yes])
94   # If user didn't disable XDG database update, look for tools
95   if test "X$enable_update_xdg_database" = "Xyes"; then
96     AC_MSG_RESULT([yes])
98     # Check for update-mime-database
99     AC_CHECK_PROG([UPDATE_MIME_DATABASE], [update-mime-database],
100                   [update-mime-database], [no])
101     if test "X$UPDATE_MIME_DATABASE" = "Xno"; then
102       AC_MSG_ERROR([The update-mime-database tool could not be found. Ensure it is
103 installed and in your path, or configure with
104 --disable-update-xdg-database.])
105     fi
107     # Check for update-desktop-database
108     AC_CHECK_PROG([UPDATE_DESKTOP_DATABASE], [update-desktop-database],
109                   [update-desktop-database], [no])
110     if test "X$UPDATE_DESKTOP_DATABASE" = "Xno"; then
111       AC_MSG_ERROR([The update-desktop-database tool could not be found. Ensure it is
112 installed and in your path, or configure with
113 --disable-update-xdg-database.])
114     fi
115   else
116     AC_MSG_RESULT([no])
117   fi
119   AM_CONDITIONAL([ENABLE_UPDATE_XDG_DATABASE],
120                  test "X$enable_update_xdg_database" = "Xyes")
121   AC_SUBST([UPDATE_MIME_DATABASE])
122   AC_SUBST([UPDATE_DESKTOP_DATABASE])
123 ])dnl AX_OPTION_XDG_DB