mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-20 11:48:30 -06:00
Fix and clarify path names that were mixed up.
In particular, two different GNC_LIBDIR macros were defined: One in gncla-dir.h as libdir, and another one from configure.in as pkglibdir in the CFLAGS. This was a big mess. Now the pathnames should all follow automake conventions. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14835 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
40f7922f47
commit
791e8e484e
@ -4,10 +4,8 @@ SUBDIRS = . overrides test
|
||||
AM_CFLAGS = -I${top_builddir} ${GLIB_CFLAGS} ${GNOME_CFLAGS} ${GTK_CFLAGS} \
|
||||
${GUILE_INCS} \
|
||||
${QOF_CFLAGS} \
|
||||
-DPREFIX=\"${prefix}\" \
|
||||
-DSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
|
||||
-DDATADIR=\"${GNC_SHAREDIR}\" \
|
||||
-DLIBDIR=\"${GNC_LIBDIR}\" \
|
||||
-DPKGSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
|
||||
-DPKGDATADIR=\"${GNC_SHAREDIR}\" \
|
||||
-DGNC_HELPDIR=\"${GNC_HELPDIR}\" \
|
||||
-I${top_srcdir}/src \
|
||||
-I${top_srcdir}/src/core-utils \
|
||||
|
@ -85,8 +85,8 @@ gnc_print_unstable_message(void)
|
||||
/* Priority of paths: The default is set at build time. It may be
|
||||
overridden by environment variables, which may, in turn, be
|
||||
overridden by command line options. */
|
||||
static char *config_path = SYSCONFDIR;
|
||||
static char *share_path = DATADIR;
|
||||
static char *config_path = PKGSYSCONFDIR;
|
||||
static char *share_path = PKGDATADIR;
|
||||
static char *help_path = GNC_HELPDIR;
|
||||
|
||||
static void
|
||||
@ -157,6 +157,7 @@ load_system_config(void)
|
||||
if (is_system_config_loaded) return;
|
||||
|
||||
update_message("loading system configuration");
|
||||
/* FIXME: use runtime paths from gnc-path.c here */
|
||||
system_config = g_build_filename(config_path, "config", NULL);
|
||||
is_system_config_loaded = try_load(system_config);
|
||||
g_free(system_config);
|
||||
@ -512,12 +513,24 @@ int main(int argc, char ** argv)
|
||||
gnc_print_unstable_message();
|
||||
|
||||
if (add_quotes_file) {
|
||||
gchar *prefix = gnc_path_get_prefix ();
|
||||
gchar *pkgsysconfdir = gnc_path_get_pkgsysconfdir ();
|
||||
gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
|
||||
gchar *pkglibdir = gnc_path_get_pkglibdir ();
|
||||
/* This option needs to run without a display, so we can't
|
||||
initialize any GUI libraries. */
|
||||
gnome_program_init(
|
||||
"gnucash", VERSION, LIBGNOME_MODULE,
|
||||
argc, argv,
|
||||
GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
|
||||
GNOME_PARAM_APP_PREFIX, prefix,
|
||||
GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
|
||||
GNOME_PARAM_APP_DATADIR, pkgdatadir,
|
||||
GNOME_PARAM_APP_LIBDIR, pkglibdir,
|
||||
GNOME_PARAM_NONE);
|
||||
g_free (prefix);
|
||||
g_free (pkgsysconfdir);
|
||||
g_free (pkgdatadir);
|
||||
g_free (pkglibdir);
|
||||
scm_boot_guile(argc, argv, inner_main_add_price_quotes, 0);
|
||||
exit(0); /* never reached */
|
||||
}
|
||||
|
@ -4,10 +4,6 @@ PWD := $(shell pwd)
|
||||
pkglib_LTLIBRARIES = libgncmod-engine.la libgw-engine.la libgw-kvp.la
|
||||
|
||||
AM_CFLAGS = \
|
||||
-DPREFIX=\"${prefix}\" \
|
||||
-DSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
|
||||
-DDATADIR=\"${GNC_SHAREDIR}\" \
|
||||
-DLIBDIR=\"${GNC_LIBDIR}\" \
|
||||
-I${top_srcdir}/lib/libc \
|
||||
-I${top_srcdir}/src/core-utils \
|
||||
-I${top_srcdir}/src \
|
||||
@ -224,14 +220,18 @@ gwrap-files2: \
|
||||
touch $@
|
||||
( cd g-wrapped; $(LN_S) -f ../gw-kvp*.scm . )
|
||||
|
||||
gncla-dir.h: gncla-dir.h.in ${top_builddir}/config.status
|
||||
gncla-dir.h: gncla-dir.h.in ${top_builddir}/config.status Makefile
|
||||
rm -f $@.tmp
|
||||
sed < $< > $@.tmp \
|
||||
-e 's#@-LOCALE_DIR-@#${LOCALE_DIR}#g' \
|
||||
-e 's#@-GNC_ACCOUNTS_DIR-@#${GNC_ACCOUNTS_DIR}#g' \
|
||||
-e 's#@-GNC_GLADE_DIR-@#${GNC_GLADE_DIR}#g' \
|
||||
-e 's#@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@#${GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY}#g' \
|
||||
-e 's#@-libdir-@#${libdir}#g'
|
||||
-e 's#@-pkglibdir-@#${pkglibdir}#g' \
|
||||
-e 's#@-libdir-@#${libdir}#g' \
|
||||
-e 's#@-pkgsysconfdir-@#${GNC_CONFIGDIR}#g' \
|
||||
-e 's#@-pkgdatadir-@#${GNC_SHAREDIR}#g' \
|
||||
-e 's#@-prefix-@#${prefix}#g'
|
||||
mv $@.tmp $@
|
||||
|
||||
BUILT_SOURCES = iso-4217-currencies.c \
|
||||
|
@ -86,7 +86,7 @@ gnc_engine_init(int argc, char ** argv)
|
||||
gnc_engine_init_hook_t hook;
|
||||
GList * cur;
|
||||
gchar *tracefilename;
|
||||
gchar *pkglibdir;
|
||||
gchar *libdir;
|
||||
|
||||
if (1 == engine_is_initialized) return;
|
||||
|
||||
@ -107,16 +107,16 @@ gnc_engine_init(int argc, char ** argv)
|
||||
/* Now register our core types */
|
||||
cashobjects_register();
|
||||
|
||||
pkglibdir = gnc_path_get_pkglibdir ();
|
||||
libdir = gnc_path_get_libdir ();
|
||||
for (lib = libs; lib->lib ; lib++)
|
||||
{
|
||||
if (qof_load_backend_library(pkglibdir, lib->lib))
|
||||
if (qof_load_backend_library(libdir, lib->lib))
|
||||
{
|
||||
engine_is_initialized = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_message("failed to load %s from %s\n", lib->lib, pkglibdir);
|
||||
g_message("failed to load %s from %s\n", lib->lib, libdir);
|
||||
/* If this is a required library, stop now! */
|
||||
if (lib->required)
|
||||
{
|
||||
@ -124,7 +124,7 @@ gnc_engine_init(int argc, char ** argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
g_free (pkglibdir);
|
||||
g_free (libdir);
|
||||
|
||||
/* call any engine hooks */
|
||||
for (cur = engine_init_hooks; cur; cur = cur->next)
|
||||
|
@ -38,21 +38,21 @@ gchar *gnc_path_get_libdir()
|
||||
}
|
||||
|
||||
/** Returns the datadir path, usually
|
||||
* "$prefix/share". Needed for gnome_program_init().
|
||||
* "$prefix/share/gnucash". Needed for gnome_program_init().
|
||||
*
|
||||
* @returns A newly allocated string. */
|
||||
gchar *gnc_path_get_datadir()
|
||||
gchar *gnc_path_get_pkgdatadir()
|
||||
{
|
||||
return g_strdup (DATADIR);
|
||||
return g_strdup (PKGDATADIR);
|
||||
}
|
||||
|
||||
/** Returns the sysconfdir path, usually
|
||||
* "$prefix/etc". Needed for gnome_program_init().
|
||||
* "$prefix/etc/gnucash". Needed for gnome_program_init().
|
||||
*
|
||||
* @returns A newly allocated string. */
|
||||
gchar *gnc_path_get_sysconfdir()
|
||||
gchar *gnc_path_get_pkgsysconfdir()
|
||||
{
|
||||
return g_strdup (SYSCONFDIR);
|
||||
return g_strdup (PKGSYSCONFDIR);
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ gchar *gnc_path_get_sysconfdir()
|
||||
* @returns A newly allocated string. */
|
||||
gchar *gnc_path_get_pkglibdir()
|
||||
{
|
||||
return g_strdup (GNC_LIBDIR);
|
||||
return g_strdup (PKGLIBDIR);
|
||||
}
|
||||
|
||||
/** Returns the glade file path, usually
|
||||
|
@ -37,17 +37,17 @@ gchar *gnc_path_get_prefix(void);
|
||||
* @returns A newly allocated string. */
|
||||
gchar *gnc_path_get_libdir(void);
|
||||
|
||||
/** Returns the datadir path, usually
|
||||
* "$prefix/share". Needed for gnome_program_init(void).
|
||||
/** Returns the pkgdatadir path, usually
|
||||
* "$prefix/share/gnucash". Needed for gnome_program_init(void).
|
||||
*
|
||||
* @returns A newly allocated string. */
|
||||
gchar *gnc_path_get_datadir(void);
|
||||
gchar *gnc_path_get_pkgdatadir(void);
|
||||
|
||||
/** Returns the sysconfdir path, usually
|
||||
* "$prefix/etc". Needed for gnome_program_init(void).
|
||||
/** Returns the pkgsysconfdir path, usually
|
||||
* "$prefix/etc/gnucash". Needed for gnome_program_init(void).
|
||||
*
|
||||
* @returns A newly allocated string. */
|
||||
gchar *gnc_path_get_sysconfdir(void);
|
||||
gchar *gnc_path_get_pkgsysconfdir(void);
|
||||
|
||||
|
||||
/** Returns the pkglibdir path, usually
|
||||
|
@ -23,7 +23,12 @@
|
||||
* 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#define GNC_LIBDIR "@-libdir-@"
|
||||
#define PREFIX "@-prefix-@"
|
||||
#define PKGDATADIR "@-pkgdatadir-@"
|
||||
#define PKGSYSCONFDIR "@-pkgsysconfdir-@"
|
||||
|
||||
#define LIBDIR "@-libdir-@"
|
||||
#define PKGLIBDIR "@-pkglibdir-@"
|
||||
|
||||
#define LOCALE_DIR "@-LOCALE_DIR-@"
|
||||
|
||||
|
@ -195,23 +195,23 @@ gnc_gnome_init (int argc, char **argv, const char * version)
|
||||
char *fullname;
|
||||
GError *error = NULL;
|
||||
gchar *prefix = gnc_path_get_prefix ();
|
||||
gchar *sysconfdir = gnc_path_get_sysconfdir ();
|
||||
gchar *datadir = gnc_path_get_datadir ();
|
||||
gchar *libdir = gnc_path_get_libdir ();
|
||||
gchar *pkgsysconfdir = gnc_path_get_pkgsysconfdir ();
|
||||
gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
|
||||
gchar *pkglibdir = gnc_path_get_pkglibdir ();
|
||||
|
||||
gnc_gtk_add_rc_file();
|
||||
gnucash_program = gnome_program_init(
|
||||
"gnucash", version, LIBGNOMEUI_MODULE,
|
||||
argc, argv,
|
||||
GNOME_PARAM_APP_PREFIX, prefix,
|
||||
GNOME_PARAM_APP_SYSCONFDIR, sysconfdir,
|
||||
GNOME_PARAM_APP_DATADIR, datadir,
|
||||
GNOME_PARAM_APP_LIBDIR, libdir,
|
||||
GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
|
||||
GNOME_PARAM_APP_DATADIR, pkgdatadir,
|
||||
GNOME_PARAM_APP_LIBDIR, pkglibdir,
|
||||
GNOME_PARAM_NONE);
|
||||
g_free (prefix);
|
||||
g_free (sysconfdir);
|
||||
g_free (datadir);
|
||||
g_free (libdir);
|
||||
g_free (pkgsysconfdir);
|
||||
g_free (pkgdatadir);
|
||||
g_free (pkglibdir);
|
||||
|
||||
/* initialization required for gtkhtml */
|
||||
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
|
||||
|
Loading…
Reference in New Issue
Block a user