mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-23 09:26:27 -06:00
Fix libdbi hardcoded driver directory usage
Patch by Bill Nottingham, with modifications to only set GNC_DBD_DIR if --with-dbi-dbd-path is explicitly set. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19191 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6745d5788d
commit
b5d8ff463f
@ -583,9 +583,9 @@ then
|
||||
AC_CHECK_HEADERS(dbi/dbi.h)
|
||||
if test "x$ac_cv_header_dbi_dbi_h" != xno; then
|
||||
AC_ARG_WITH( dbi-dbd-dir,
|
||||
[AS_HELP_STRING([--with-dbi-dbd-dir=PATH],[specify location of libdbi drivers @<:@default=/usr/lib/dbd@:>@])],
|
||||
[AS_HELP_STRING([--with-dbi-dbd-dir=PATH],[specify location of libdbi drivers @<:@default=${libdir}/dbd@:>@])],
|
||||
GNC_DBD_DIR="$with_dbi_dbd_dir",
|
||||
GNC_DBD_DIR="/usr/lib/dbd")
|
||||
GNC_DBD_DIR="")
|
||||
|
||||
LIBDBI_LIBS=-ldbi
|
||||
DBI_DIR=dbi
|
||||
@ -596,6 +596,7 @@ fi
|
||||
AC_SUBST(LIBDBI_LIBS)
|
||||
AC_SUBST(DBI_DIR)
|
||||
AC_SUBST(GNC_DBD_DIR)
|
||||
AM_CONDITIONAL(CUSTOM_GNC_DBD_DIR, [test x"$GNC_DBD_DIR" != "x"])
|
||||
|
||||
### --------------------------------------------------------------------------
|
||||
### Variables
|
||||
|
@ -1007,7 +1007,6 @@ void
|
||||
gnc_module_init_backend_dbi(void)
|
||||
{
|
||||
QofBackendProvider *prov;
|
||||
#define DEFAULT_DBD_DIR "/usr/lib/dbd"
|
||||
const gchar* driver_dir;
|
||||
int num_drivers;
|
||||
gboolean have_sqlite3_driver = FALSE;
|
||||
@ -1019,8 +1018,7 @@ gnc_module_init_backend_dbi(void)
|
||||
driver_dir = g_getenv( "GNC_DBD_DIR" );
|
||||
if ( driver_dir == NULL )
|
||||
{
|
||||
PWARN( "GNC_DBD_DIR not set: using %s\n", DEFAULT_DBD_DIR );
|
||||
driver_dir = DEFAULT_DBD_DIR;
|
||||
PINFO( "GNC_DBD_DIR not set: using libdbi built-in default\n");
|
||||
}
|
||||
|
||||
num_drivers = dbi_initialize( driver_dir );
|
||||
|
@ -25,10 +25,14 @@ GNC_TEST_DEPS = \
|
||||
--library-dir ${top_builddir}/src/gnc-module \
|
||||
--library-dir ${top_builddir}/src/engine
|
||||
|
||||
if CUSTOM_GNC_DBD_DIR
|
||||
gnc_dbd_dir_override = "GNC_DBD_DIR=@GNC_DBD_DIR@"
|
||||
endif
|
||||
|
||||
TESTS_ENVIRONMENT = \
|
||||
GNC_ACCOUNT_PATH=${top_srcdir}/accounts/C \
|
||||
SRCDIR=${srcdir} \
|
||||
GNC_DBD_DIR=@GNC_DBD_DIR@ \
|
||||
${gnc_dbd_dir_override} \
|
||||
$(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
|
||||
|
||||
check_PROGRAMS = \
|
||||
|
@ -55,6 +55,12 @@ config_DATA = environment
|
||||
if PLATFORM_OSX_QUARTZ
|
||||
PRE_RUN = . ${bindir}/gnucash-setup-env
|
||||
PLATFORM_FILES = gnucash-setup-env
|
||||
if CUSTOM_GNC_DBD_DIR
|
||||
gnc_dbd_dir_override = export GNC_DBD_DIR="@GNC_DBD_DIR@"
|
||||
else
|
||||
gnc_dbd_dir_override =
|
||||
endif
|
||||
|
||||
else
|
||||
PRE_RUN =
|
||||
PLATFORM_FILES =
|
||||
@ -93,7 +99,7 @@ gnucash-setup-env: gnucash-setup-env-osx.in ${top_builddir}/config.status Makefi
|
||||
rm -f $@.tmp
|
||||
sed < $< > $@.tmp \
|
||||
-e 's#@-BIN_DIR-@#${bindir}#g' \
|
||||
-e 's#@-GNC_DBD_DIR-@#${GNC_DBD_DIR}#g' \
|
||||
-e 's#@-gnc_dbd_dir_override-@#${gnc_dbd_dir_override}#g' \
|
||||
-e 's#@-GNC_STANDARD_REPORTS_DIR-@#${GNC_SHAREDIR}/guile-modules/gnucash/report/standard-reports#g' \
|
||||
-e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
|
||||
-e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
|
||||
@ -110,7 +116,6 @@ environment: ${GNUCASH_ENVIRONMENT}.in ${top_builddir}/config.status Makefile
|
||||
rm -f $@.tmp
|
||||
sed < $< > $@.tmp \
|
||||
-e 's#@-BIN_DIR-@#${bindir}#g' \
|
||||
-e 's#@-GNC_DBD_DIR-@#${GNC_DBD_DIR}#g' \
|
||||
-e 's#@-GNC_STANDARD_REPORTS_DIR-@#${GNC_SHAREDIR}/guile-modules/gnucash/report/standard-reports#g' \
|
||||
-e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
|
||||
-e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
|
||||
@ -118,6 +123,9 @@ environment: ${GNUCASH_ENVIRONMENT}.in ${top_builddir}/config.status Makefile
|
||||
-e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
|
||||
-e "s#@-TOP_SRC_DIR-@#`pwd`/${top_srcdir}#g" \
|
||||
-e 's#@-PREFIX-@#${prefix}#g'
|
||||
if CUSTOM_GNC_DBD_DIR
|
||||
echo 'GNC_DBD_DIR="@GNC_DBD_DIR@"' >> $@.tmp
|
||||
endif
|
||||
mv $@.tmp $@
|
||||
chmod u+x $@
|
||||
|
||||
|
@ -29,6 +29,5 @@
|
||||
#LD_LIBRARY_PATH={EXTRA_LIBS};${LD_LIBRARY_PATH}
|
||||
#DYLD_LIBRARY_PATH={EXTRA_LIBS};${DYLD_LIBRARY_PATH}
|
||||
|
||||
#GNC_DBD_DIR=@-GNC_DBD_DIR-@
|
||||
#GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@
|
||||
#GNC_DOT_DIR={HOME}/Library/Application Support/Gnucash
|
||||
#GNC_DOT_DIR={HOME}/Library/Application Support/Gnucash
|
||||
|
@ -25,5 +25,4 @@ EXTRA_LIBS={GNC_MODULE_PATH};@-GNC_LIB_INSTALLDIR-@;@-GNC_PKGLIB_INSTALLDIR-@
|
||||
LD_LIBRARY_PATH={EXTRA_LIBS};{LD_LIBRARY_PATH}
|
||||
DYLD_LIBRARY_PATH={EXTRA_LIBS};{DYLD_LIBRARY_PATH}
|
||||
|
||||
GNC_DBD_DIR=@-GNC_DBD_DIR-@
|
||||
GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@
|
||||
GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@
|
||||
|
@ -23,5 +23,4 @@ EXTRA_LIBS={GNC_MODULE_PATH};@-GNC_LIB_INSTALLDIR-@;@-GNC_PKGLIB_INSTALLDIR-@
|
||||
LD_LIBRARY_PATH={EXTRA_LIBS};{LD_LIBRARY_PATH}
|
||||
DYLD_LIBRARY_PATH={EXTRA_LIBS};{DYLD_LIBRARY_PATH}
|
||||
|
||||
GNC_DBD_DIR=@-GNC_DBD_DIR-@
|
||||
GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@
|
||||
GNC_STANDARD_REPORTS_DIR=@-GNC_STANDARD_REPORTS_DIR-@
|
||||
|
@ -25,8 +25,8 @@ EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_PKGLIB_INSTALLDIR-@"
|
||||
|
||||
LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
|
||||
DYLD_LIBRARY_PATH="${EXTRA_LIBS}:${DYLD_LIBRARY_PATH}"
|
||||
GNC_DBD_DIR="@-GNC_DBD_DIR-@"
|
||||
GNC_STANDARD_REPORTS_DIR="@-GNC_STANDARD_REPORTS_DIR-@"
|
||||
@-CUSTOM_GNC_DBD_DIR-@"
|
||||
|
||||
export GNC_MODULE_PATH
|
||||
export GUILE_LOAD_PATH
|
||||
|
@ -16,10 +16,14 @@ GNC_TEST_DEPS = \
|
||||
--library-dir ${top_builddir}/src/engine \
|
||||
--library-dir ${top_builddir}/src/backend/sql
|
||||
|
||||
if CUSTOM_GNC_DBD_DIR
|
||||
gnc_dbd_dir_override="GNC_DBD_DIR=@GNC_DBD_DIR@"
|
||||
endif
|
||||
|
||||
TESTS_ENVIRONMENT = \
|
||||
GNC_ACCOUNT_PATH=${top_srcdir}/accounts/C \
|
||||
SRCDIR=${srcdir} \
|
||||
GNC_DBD_DIR=@GNC_DBD_DIR@ \
|
||||
${gnc_dbd_dir_override} \
|
||||
$(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
|
||||
|
||||
check_PROGRAMS = \
|
||||
|
Loading…
Reference in New Issue
Block a user