Add --with-xdg-data-dirs to specify default search path for XDG data directories.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23343 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Mike Alexander 2013-10-27 21:57:42 +00:00
parent 0c5c0c7e19
commit 45f18a7eff
2 changed files with 11 additions and 6 deletions

View File

@ -750,6 +750,13 @@ fi
AM_CONDITIONAL([WITH_AQBANKING], [test x${want_aqbanking} = xyes])
AC_SUBST_FILE([MIGRATABLE_PREFS_AQBANKING])
AC_ARG_WITH(xdg-data-dirs,
[AS_HELP_STRING([--with-xdg-data-dirs],
[search path for system XDG data directories [default /usr/local/share/;/usr/share/]])],
[GNC_SYSTEM_XDG_DATA_DIRS=$withval],
[GNC_SYSTEM_XDG_DATA_DIRS="/usr/local/share;/usr/share"])
AC_SUBST(GNC_SYSTEM_XDG_DATA_DIRS)
AC_ARG_WITH(qt3-wizard-package,
[AS_HELP_STRING([--with-qt3-wizard-package=name],[name of package containing qt3-wizard (aqbanking)])],
[QT3_WIZARD_PACKAGE=$withval], [QT3_WIZARD_PACKAGE=aqbanking])

View File

@ -75,18 +75,16 @@ environment: environment.in ${top_builddir}/config.status Makefile
if CUSTOM_GNC_DBD_DIR
echo 'GNC_DBD_DIR=@GNC_DBD_DIR@' >> $@.tmp
endif
# Set XDG_DATA_DIRS if necessary. This is done in such a way that the value at
# run time overrides the value at compile time which overrides the default value
# The compile time value is added because GnuCash on X11 builds on MacPorts, which
# uses /opt/local/share as default instead of the Free Desktop defined standard paths
# /usr/local/share and /usr/share
# Set XDG_DATA_DIRS if necessary. The three components of the search path are the
# directory used by GnuCash, whatever was specified in the environment at run time, and
# the default value specified via configure.
if [ "a$(datadir)" != "a/usr/share" ] && [ "a$(datadir)" != "a/usr/local/share" ]; \
then \
echo >> $@.tmp; \
echo "# GnuCash was not installed in the default location" >> $@.tmp; \
echo "# XDG_DATA_DIRS will be set so that our documentation" >> $@.tmp; \
echo "# and gsettings schemas are found." >> $@.tmp; \
echo "XDG_DATA_DIRS=$(datadir);{XDG_DATA_DIRS};$(XDG_DATA_DIRS);/usr/local/share/;/usr/share/" >> $@.tmp; \
echo "XDG_DATA_DIRS=$(datadir);{XDG_DATA_DIRS};${GNC_SYSTEM_XDG_DATA_DIRS}" >> $@.tmp; \
fi
mv $@.tmp $@