From: Arun Persaud Date: Tue, 14 Feb 2012 06:29:48 +0000 (-0800) Subject: add configure test for xdg-programs to install mime types; can be disabled for buildi... X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=343ecffd7b2225ba3ff66ff0985851948e258351;p=xboard.git add configure test for xdg-programs to install mime types; can be disabled for building of e.g. rpms in case the target system doesn't have the xdg-programs available, we test for them. Distributions often have their own macros to install these, so we add an enable option to configure --- diff --git a/Makefile.am b/Makefile.am index 88df0b9..3f0e37d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -174,7 +174,7 @@ xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi install-data-hook: install-mime-database uninstall-hook: uninstall-mime-database install-mime-database: - @-if test -z "$(DESTDIR)"; then \ + -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \ xdg-mime install --mode system --novendor xboard.xml ;\ xdg-desktop-menu install --mode system --novendor xboard-pgn-viewer.desktop;\ xdg-desktop-menu install --mode system --novendor xboard-fen-viewer.desktop;\ @@ -185,7 +185,7 @@ install-mime-database: xdg-icon-resource install --context mimetypes --size 48 pixmaps/cross48.xpm application-x-xboard-trn;\ fi uninstall-mime-database: - @-if test -z "$(DESTDIR)"; then \ + -if test -z "$(DESTDIR)" -a -n "$(XDG_MIME)" -a -n "$(XDG_DESKTOP_MENU)" -a -n "$(XDG_ICON_RESOURCE)" ; then \ xdg-mime uninstall --mode system --novendor xboard.xml;\ xdg-desktop-menu uninstall --mode system --novendor xboard-pgn-viewer.desktop;\ xdg-desktop-menu uninstall --mode system --novendor xboard-fen-viewer.desktop;\ diff --git a/configure.ac b/configure.ac index 52c7946..37bae05 100644 --- a/configure.ac +++ b/configure.ac @@ -416,6 +416,14 @@ X_LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS -lXmu -lX11 -lXt " AC_SUBST(X_CFLAGS) AC_SUBST(X_LIBS) +dnl | can we install desktop icons and mime associations? +AC_PATH_PROG([XDG_MIME],[xdg-mime]) +AC_SUBST(XDG_MIME) +AC_PATH_PROG([XDG_DESKTOP_MENU],[xdg-desktop-menu]) +AC_SUBST(XDG_DESKTOP_MENU) +AC_PATH_PROG([XDG_ICON_RESOURCE],[xdg-icon-resource]) +AC_SUBST(XDG_ICON_RESOURCE) + AC_CONFIG_FILES([Makefile cmail po/Makefile.in]) AC_CONFIG_COMMANDS([test-stamp-h],[test -z "$CONFIG_HEADERS" || date > stamp-h])