diff --git a/Makefile b/Makefile index b60fff1..06bfa9d 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ MANDIRMODE = 755 INCLUDEDIR = $(INSTALLROOT)/include INCLUDEMODE = 644 INCLUDEDIRMODE = 755 -INSTALL ?= install +INSTALL ?= $(shell which install) PKGCONFIGDIR ?= $(INSTALLROOT)/lib/pkgconfig LOCALEDIR ?= $(INSTALLROOT)/share/locale @@ -134,7 +134,7 @@ gkrellm.pc_win: Makefile echo "Name: GKrellM" >> gkrellm.pc echo "Description: Extensible GTK system monitoring application" >> gkrellm.pc echo "Version: $(VERSION)" >> gkrellm.pc - echo "Requires: gtk+-2.0 >= 2.0.0" >> gkrellm.pc + echo "Requires: gtk+-2.0 >= 2.4.0" >> gkrellm.pc echo 'Cflags: -I$${prefix}/include' >> gkrellm.pc echo 'Libs: -L$${prefix}/lib -lgkrellm' >> gkrellm.pc @@ -143,7 +143,7 @@ gkrellm.pc: Makefile echo "Name: GKrellM" >> gkrellm.pc echo "Description: Extensible GTK system monitoring application" >> gkrellm.pc echo "Version: $(VERSION)" >> gkrellm.pc - echo "Requires: gtk+-2.0 >= 2.0.0" >> gkrellm.pc + echo "Requires: gtk+-2.0 >= 2.4.0" >> gkrellm.pc echo "Cflags: -I$(INCLUDEDIR)" >> gkrellm.pc install: install_gkrellm.pc @@ -186,17 +186,10 @@ install_solaris: install_gkrellm.pc (cd src && ${MAKE} install_solaris) (cd server && ${MAKE} install_solaris) -install_windows: - (${MAKE} INSTALL=/bin/install install_gkrellm.pc) - (cd po && ${MAKE} \ - INSTALL=/bin/install INSTALLDIR=$(INSTALLROOT) LOCALEDIR=$(INSTALLROOT)/share/locale \ - install) - (cd src && ${MAKE} \ - INSTALL=/bin/install INSTALLDIR=$(INSTALLROOT) LOCALEDIR=$(INSTALLROOT)/share/locale \ - install_windows) - (cd server && ${MAKE} \ - INSTALL=/bin/install SINSTALLDIR=$(INSTALLROOT) LOCALEDIR=$(INSTALLROOT)/share/locale \ - install_windows) +install_windows: install_gkrellm.pc + (cd po && ${MAKE} install) + (cd src && ${MAKE} install_windows) + (cd server && ${MAKE} install_windows) clean: (cd po && ${MAKE} clean) diff --git a/server/main.c b/server/main.c index 1dba9de..dc4c0b2 100644 --- a/server/main.c +++ b/server/main.c @@ -1609,23 +1609,20 @@ int main(int argc, char* argv[]) #ifdef ENABLE_NLS #ifdef LOCALEDIR #if defined(WIN32) - /* - Prepend app install path to relative locale dir, don't rely on CWD being correct - */ - if (!G_IS_DIR_SEPARATOR(LOCALEDIR[0])) + gchar *install_path; + gchar *locale_dir; + // Prepend app install path to locale dir + install_path = g_win32_get_package_installation_directory_of_module(NULL); + if (install_path != NULL) + { + locale_dir = g_build_filename(install_path, LOCALEDIR, NULL); + if (locale_dir != NULL) { - gchar* locale_dir; - locale_dir = g_win32_get_package_installation_subdirectory(NULL, NULL, LOCALEDIR); - if (locale_dir != NULL) - { - bindtextdomain(PACKAGE_D, locale_dir); - g_free(locale_dir); - } - } - else - { - bindtextdomain(PACKAGE_D, LOCALEDIR); + bindtextdomain(PACKAGE_D, locale_dir); + g_free(locale_dir); } + g_free(install_path); + } #else bindtextdomain(PACKAGE_D, LOCALEDIR); #endif /* !WIN32 */ diff --git a/src/main.c b/src/main.c index da9d9e6..b7f0ad9 100644 --- a/src/main.c +++ b/src/main.c @@ -2061,23 +2061,20 @@ main(gint argc, gchar **argv) #ifdef ENABLE_NLS #ifdef LOCALEDIR #if defined(WIN32) - /* - Prepend app install path to relative locale dir, don't rely on CWD being correct - */ - if (!G_IS_DIR_SEPARATOR(LOCALEDIR[0])) + gchar *install_path; + gchar *locale_dir; + // Prepend app install path to locale dir + install_path = g_win32_get_package_installation_directory_of_module(NULL); + if (install_path != NULL) + { + locale_dir = g_build_filename(install_path, LOCALEDIR, NULL); + if (locale_dir != NULL) { - gchar* locale_dir; - locale_dir = g_win32_get_package_installation_subdirectory(NULL, NULL, LOCALEDIR); - if (locale_dir != NULL) - { - bindtextdomain(PACKAGE, locale_dir); - g_free(locale_dir); - } - } - else - { - bindtextdomain(PACKAGE, LOCALEDIR); + bindtextdomain(PACKAGE, locale_dir); + g_free(locale_dir); } + g_free(install_path); + } #else bindtextdomain(PACKAGE, LOCALEDIR); #endif /* !WIN32 */