Commit cc6f2562081d9dccdaf671583400d4a8da32409b
1 parent
aa8440cd
Exists in
master
and in
5 other branches
Fixing search for default configuration.
Showing
2 changed files
with
14 additions
and
1 deletions
Show diff stats
src/pw3270/common/Makefile.in
@@ -39,6 +39,7 @@ exec_prefix=@exec_prefix@ | @@ -39,6 +39,7 @@ exec_prefix=@exec_prefix@ | ||
39 | bindir=@bindir@ | 39 | bindir=@bindir@ |
40 | sbindir=@sbindir@ | 40 | sbindir=@sbindir@ |
41 | libdir=@libdir@ | 41 | libdir=@libdir@ |
42 | +datarootdir=@datarootdir@ | ||
42 | 43 | ||
43 | BASEDIR=@BASEDIR@ | 44 | BASEDIR=@BASEDIR@ |
44 | SRCDIR=$(BASEDIR)/.src/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/src/pw3270/$(MODULE_NAME) | 45 | SRCDIR=$(BASEDIR)/.src/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/src/pw3270/$(MODULE_NAME) |
@@ -63,6 +64,7 @@ CFLAGS= \ | @@ -63,6 +64,7 @@ CFLAGS= \ | ||
63 | @LIBV3270_CFLAGS@ \ | 64 | @LIBV3270_CFLAGS@ \ |
64 | @PW3270_CFLAGS@ \ | 65 | @PW3270_CFLAGS@ \ |
65 | -Wno-deprecated-declarations \ | 66 | -Wno-deprecated-declarations \ |
67 | + -DDATAROOTDIR=\"$(datarootdir)\" \ | ||
66 | @GTK_CFLAGS@ | 68 | @GTK_CFLAGS@ |
67 | 69 | ||
68 | LIBS= \ | 70 | LIBS= \ |
src/pw3270/common/config.c
@@ -223,7 +223,7 @@ | @@ -223,7 +223,7 @@ | ||
223 | // Search the application DATADIR | 223 | // Search the application DATADIR |
224 | // | 224 | // |
225 | { | 225 | { |
226 | - gchar *filename = g_build_filename(G_STRINGIFY(DATADIR),name,NULL); | 226 | + gchar *filename = g_build_filename(DATAROOTDIR,PACKAGE_NAME,name,NULL); |
227 | 227 | ||
228 | trace("Checking for %s",filename); | 228 | trace("Checking for %s",filename); |
229 | 229 | ||
@@ -641,6 +641,17 @@ gchar * filename_from_va(const gchar *first_element, va_list args) | @@ -641,6 +641,17 @@ gchar * filename_from_va(const gchar *first_element, va_list args) | ||
641 | } | 641 | } |
642 | #endif // HAVE_WIN_REGISTRY | 642 | #endif // HAVE_WIN_REGISTRY |
643 | 643 | ||
644 | +#ifdef _WIN32 | ||
645 | + for(p=0;p<G_N_ELEMENTS(appname) && !result;p++) | ||
646 | + { | ||
647 | + gchar * path = g_build_filename(g_win32_get_package_installation_directory_of_module(NULL),appname[p],suffix,NULL); | ||
648 | + trace("searching \"%s\"",path); | ||
649 | + if(g_file_test(path,G_FILE_TEST_EXISTS)) | ||
650 | + return path; | ||
651 | + g_free(path); | ||
652 | + } | ||
653 | +#endif // _WIN32 | ||
654 | + | ||
644 | // Check system data dirs | 655 | // Check system data dirs |
645 | const gchar * const * system_data_dirs = g_get_system_data_dirs(); | 656 | const gchar * const * system_data_dirs = g_get_system_data_dirs(); |
646 | for(p=0;p<G_N_ELEMENTS(appname);p++) | 657 | for(p=0;p<G_N_ELEMENTS(appname);p++) |