- win32: Makefile: install binaries into standard "bin" directory as done on unix and make standard value for INSTALL variable work on win32/msys as well (INSTALL=install somehow calls the wrong install binary for me)

- win32: main.c: simplify locating the locales directory
This commit is contained in:
Stefan Gehn 2008-10-24 18:34:38 +00:00
parent b2670d098c
commit 902e9ce6ab
3 changed files with 31 additions and 44 deletions

View File

@ -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)

View File

@ -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 */

View File

@ -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 */