+2001-01-17 Tor Lillqvist <tml@iki.fi>
+
+ * config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
+
+ * makefile.mingw.in
+ * makefile.msc.in: Use the GNU intl library.
+
+ * gwin32.c (g_win32_get_package_installation_directory): New
+ function. To be used by various GLib-using packages to get their
+ installation directory, which should be stored in the Registry by
+ some installer.
+
+ * gwin32.h: Declare it.
+
+ * testglib.c (main): Test it.
+
+ * gutils.c: On Win32, define GLIB_LOCALE_DIR using
+ g_win32_get_package_installation_directory().
+
+ * glib.def: Update.
+
Mon Jan 15 21:39:06 2001 Owen Taylor <otaylor@redhat.com>
* glib-2.0.pc.in (Libs) glib-config-2.0.in: Add @INTLLIBS@.
+2001-01-17 Tor Lillqvist <tml@iki.fi>
+
+ * config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
+
+ * makefile.mingw.in
+ * makefile.msc.in: Use the GNU intl library.
+
+ * gwin32.c (g_win32_get_package_installation_directory): New
+ function. To be used by various GLib-using packages to get their
+ installation directory, which should be stored in the Registry by
+ some installer.
+
+ * gwin32.h: Declare it.
+
+ * testglib.c (main): Test it.
+
+ * gutils.c: On Win32, define GLIB_LOCALE_DIR using
+ g_win32_get_package_installation_directory().
+
+ * glib.def: Update.
+
Mon Jan 15 21:39:06 2001 Owen Taylor <otaylor@redhat.com>
* glib-2.0.pc.in (Libs) glib-config-2.0.in: Add @INTLLIBS@.
+2001-01-17 Tor Lillqvist <tml@iki.fi>
+
+ * config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
+
+ * makefile.mingw.in
+ * makefile.msc.in: Use the GNU intl library.
+
+ * gwin32.c (g_win32_get_package_installation_directory): New
+ function. To be used by various GLib-using packages to get their
+ installation directory, which should be stored in the Registry by
+ some installer.
+
+ * gwin32.h: Declare it.
+
+ * testglib.c (main): Test it.
+
+ * gutils.c: On Win32, define GLIB_LOCALE_DIR using
+ g_win32_get_package_installation_directory().
+
+ * glib.def: Update.
+
Mon Jan 15 21:39:06 2001 Owen Taylor <otaylor@redhat.com>
* glib-2.0.pc.in (Libs) glib-config-2.0.in: Add @INTLLIBS@.
+2001-01-17 Tor Lillqvist <tml@iki.fi>
+
+ * config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
+
+ * makefile.mingw.in
+ * makefile.msc.in: Use the GNU intl library.
+
+ * gwin32.c (g_win32_get_package_installation_directory): New
+ function. To be used by various GLib-using packages to get their
+ installation directory, which should be stored in the Registry by
+ some installer.
+
+ * gwin32.h: Declare it.
+
+ * testglib.c (main): Test it.
+
+ * gutils.c: On Win32, define GLIB_LOCALE_DIR using
+ g_win32_get_package_installation_directory().
+
+ * glib.def: Update.
+
Mon Jan 15 21:39:06 2001 Owen Taylor <otaylor@redhat.com>
* glib-2.0.pc.in (Libs) glib-config-2.0.in: Add @INTLLIBS@.
+2001-01-17 Tor Lillqvist <tml@iki.fi>
+
+ * config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
+
+ * makefile.mingw.in
+ * makefile.msc.in: Use the GNU intl library.
+
+ * gwin32.c (g_win32_get_package_installation_directory): New
+ function. To be used by various GLib-using packages to get their
+ installation directory, which should be stored in the Registry by
+ some installer.
+
+ * gwin32.h: Declare it.
+
+ * testglib.c (main): Test it.
+
+ * gutils.c: On Win32, define GLIB_LOCALE_DIR using
+ g_win32_get_package_installation_directory().
+
+ * glib.def: Update.
+
Mon Jan 15 21:39:06 2001 Owen Taylor <otaylor@redhat.com>
* glib-2.0.pc.in (Libs) glib-config-2.0.in: Add @INTLLIBS@.
+2001-01-17 Tor Lillqvist <tml@iki.fi>
+
+ * config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
+
+ * makefile.mingw.in
+ * makefile.msc.in: Use the GNU intl library.
+
+ * gwin32.c (g_win32_get_package_installation_directory): New
+ function. To be used by various GLib-using packages to get their
+ installation directory, which should be stored in the Registry by
+ some installer.
+
+ * gwin32.h: Declare it.
+
+ * testglib.c (main): Test it.
+
+ * gutils.c: On Win32, define GLIB_LOCALE_DIR using
+ g_win32_get_package_installation_directory().
+
+ * glib.def: Update.
+
Mon Jan 15 21:39:06 2001 Owen Taylor <otaylor@redhat.com>
* glib-2.0.pc.in (Libs) glib-config-2.0.in: Add @INTLLIBS@.
+2001-01-17 Tor Lillqvist <tml@iki.fi>
+
+ * config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
+
+ * makefile.mingw.in
+ * makefile.msc.in: Use the GNU intl library.
+
+ * gwin32.c (g_win32_get_package_installation_directory): New
+ function. To be used by various GLib-using packages to get their
+ installation directory, which should be stored in the Registry by
+ some installer.
+
+ * gwin32.h: Declare it.
+
+ * testglib.c (main): Test it.
+
+ * gutils.c: On Win32, define GLIB_LOCALE_DIR using
+ g_win32_get_package_installation_directory().
+
+ * glib.def: Update.
+
Mon Jan 15 21:39:06 2001 Owen Taylor <otaylor@redhat.com>
* glib-2.0.pc.in (Libs) glib-config-2.0.in: Add @INTLLIBS@.
+2001-01-17 Tor Lillqvist <tml@iki.fi>
+
+ * config.h.win32.in: Define ENABLE_NLS and GETTEXT_PACKAGE.
+
+ * makefile.mingw.in
+ * makefile.msc.in: Use the GNU intl library.
+
+ * gwin32.c (g_win32_get_package_installation_directory): New
+ function. To be used by various GLib-using packages to get their
+ installation directory, which should be stored in the Registry by
+ some installer.
+
+ * gwin32.h: Declare it.
+
+ * testglib.c (main): Test it.
+
+ * gutils.c: On Win32, define GLIB_LOCALE_DIR using
+ g_win32_get_package_installation_directory().
+
+ * glib.def: Update.
+
Mon Jan 15 21:39:06 2001 Owen Taylor <otaylor@redhat.com>
* glib-2.0.pc.in (Libs) glib-config-2.0.in: Add @INTLLIBS@.
/* #undef HAVE_LIBW */
#define USE_LIBICONV 1
+
+#define ENABLE_NLS 1
+
+/* Dunno if this will expand correctly: */
+#define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
g_win32_closedir
g_win32_error_message
g_win32_ftruncate
+ g_win32_get_package_installation_directory
g_win32_getlocale
g_win32_opendir
g_win32_readdir
g_win32_closedir
g_win32_error_message
g_win32_ftruncate
+ g_win32_get_package_installation_directory
g_win32_getlocale
g_win32_opendir
g_win32_readdir
#include <libintl.h>
+#ifdef G_OS_WIN32
+
+#define GLIB_LOCALE_DIR \
+ g_strconcat (g_win32_get_package_installation_directory (GETTEXT_PACKAGE), \
+ G_DIR_SEPARATOR_S, \
+ "locale", \
+ NULL)
+#endif
+
int _glib_gettext_initialized = 0;
char *_glib_gettext_init (const char *str)
return retval;
}
+
+gchar *
+g_win32_get_package_installation_directory (gchar *package)
+{
+ static GHashTable *installation_dirs = NULL;
+ gchar *result;
+ gchar *key;
+ char win_dir[MAX_PATH];
+ gchar *sep;
+ HKEY reg_key = NULL;
+ DWORD type;
+ DWORD nbytes;
+
+ if (installation_dirs == NULL)
+ installation_dirs = g_hash_table_new (g_str_hash, g_str_equal);
+
+ result = g_hash_table_lookup (installation_dirs, package);
+
+ if (result && result[0])
+ return result;
+
+ key = g_strconcat ("Software\\", package, NULL);
+
+ nbytes = 0;
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, key, 0,
+ KEY_QUERY_VALUE, ®_key) != ERROR_SUCCESS
+ || RegQueryValueEx (reg_key, "InstallationDirectory", 0,
+ &type, NULL, &nbytes) != ERROR_SUCCESS
+ || type != REG_SZ)
+ {
+ /* Uh oh. Use a default %WinDir%\package value */
+ if (GetWindowsDirectory (win_dir, sizeof (win_dir)) == 0)
+ strcpy (win_dir, (GetVersion () >= 0x80000000 ? "C:\\windows" : "C:\\winnt"));
+ sep = (win_dir[strlen (win_dir) - 1] == '\\' ? "" : "\\");
+ result = g_strconcat (win_dir, sep, package, NULL);
+ }
+ else
+ {
+ result = g_malloc (nbytes + 1);
+ RegQueryValueEx (reg_key, "InstallationDirectory", 0,
+ &type, result, &nbytes);
+ result[nbytes] = '\0';
+ }
+ g_hash_table_insert (installation_dirs, package, result);
+
+ if (reg_key != NULL)
+ RegCloseKey (reg_key);
+
+ g_free (key);
+
+ return result;
+}
*/
gchar * g_win32_error_message (gint error);
+gchar * g_win32_get_package_installation_directory (gchar *package);
+
G_END_DECLS
#endif /* G_OS_WIN32 */
INCLUDES = -I .
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG
-DEPCFLAGS = $(LIBICONV_CFLAGS)
+DEPCFLAGS = $(INTL_CFLAGS) $(LIBICONV_CFLAGS)
DLLS_TO_BUILD = \
glib-$(GLIB_VER).dll \
################ glib
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
- ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(LIBICONV_LIBS) -luser32 -lwsock32
+ ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(INTL_LIBS) $(LIBICONV_LIBS) -luser32 -lwsock32
gspawn-win32-helper.exe : gspawn-win32-helper.c
$(CC) $(CFLAGS) -mwindows -DG_LOG_DOMAIN=\"gspawn-win32-helper\" -o $@ $< -L . -lglib-$(GLIB_VER)
## Makefile for building the GLib dlls with Microsoft C
-## Use: nmake -f makefile.msc install
+## Use: nmake -f makefile.msc
# Change this to wherever you want to install the DLLs. This directory
# should be in your PATH.
INCLUDES = -I .
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG
-DEPCFLAGS = $(LIBICONV_CFLAGS)
+DEPCFLAGS = $(INTL_CFLAGS) $(LIBICONV_CFLAGS)
DLLS_TO_BUILD = \
glib-$(GLIB_VER).dll \
################ glib
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
- $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
+ $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(INTL_LIBS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
gspawn-win32-helper.exe : gspawn-win32-helper.c glib-$(GLIB_VER).dll
$(CC) $(CFLAGS) -Fe$@ -DG_LOG_DOMAIN=\"gspawn-win32-helper\" gspawn-win32-helper.c glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:windows user32.lib
#include <libintl.h>
+#ifdef G_OS_WIN32
+
+#define GLIB_LOCALE_DIR \
+ g_strconcat (g_win32_get_package_installation_directory (GETTEXT_PACKAGE), \
+ G_DIR_SEPARATOR_S, \
+ "locale", \
+ NULL)
+#endif
+
int _glib_gettext_initialized = 0;
char *_glib_gettext_init (const char *str)
return retval;
}
+
+gchar *
+g_win32_get_package_installation_directory (gchar *package)
+{
+ static GHashTable *installation_dirs = NULL;
+ gchar *result;
+ gchar *key;
+ char win_dir[MAX_PATH];
+ gchar *sep;
+ HKEY reg_key = NULL;
+ DWORD type;
+ DWORD nbytes;
+
+ if (installation_dirs == NULL)
+ installation_dirs = g_hash_table_new (g_str_hash, g_str_equal);
+
+ result = g_hash_table_lookup (installation_dirs, package);
+
+ if (result && result[0])
+ return result;
+
+ key = g_strconcat ("Software\\", package, NULL);
+
+ nbytes = 0;
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, key, 0,
+ KEY_QUERY_VALUE, ®_key) != ERROR_SUCCESS
+ || RegQueryValueEx (reg_key, "InstallationDirectory", 0,
+ &type, NULL, &nbytes) != ERROR_SUCCESS
+ || type != REG_SZ)
+ {
+ /* Uh oh. Use a default %WinDir%\package value */
+ if (GetWindowsDirectory (win_dir, sizeof (win_dir)) == 0)
+ strcpy (win_dir, (GetVersion () >= 0x80000000 ? "C:\\windows" : "C:\\winnt"));
+ sep = (win_dir[strlen (win_dir) - 1] == '\\' ? "" : "\\");
+ result = g_strconcat (win_dir, sep, package, NULL);
+ }
+ else
+ {
+ result = g_malloc (nbytes + 1);
+ RegQueryValueEx (reg_key, "InstallationDirectory", 0,
+ &type, result, &nbytes);
+ result[nbytes] = '\0';
+ }
+ g_hash_table_insert (installation_dirs, package, result);
+
+ if (reg_key != NULL)
+ RegCloseKey (reg_key);
+
+ g_free (key);
+
+ return result;
+}
*/
gchar * g_win32_error_message (gint error);
+gchar * g_win32_get_package_installation_directory (gchar *package);
+
G_END_DECLS
#endif /* G_OS_WIN32 */
INCLUDES = -I .
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG
-DEPCFLAGS = $(LIBICONV_CFLAGS)
+DEPCFLAGS = $(INTL_CFLAGS) $(LIBICONV_CFLAGS)
DLLS_TO_BUILD = \
glib-$(GLIB_VER).dll \
################ glib
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
- ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(LIBICONV_LIBS) -luser32 -lwsock32
+ ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(INTL_LIBS) $(LIBICONV_LIBS) -luser32 -lwsock32
gspawn-win32-helper.exe : gspawn-win32-helper.c
$(CC) $(CFLAGS) -mwindows -DG_LOG_DOMAIN=\"gspawn-win32-helper\" -o $@ $< -L . -lglib-$(GLIB_VER)
## Makefile for building the GLib dlls with Microsoft C
-## Use: nmake -f makefile.msc install
+## Use: nmake -f makefile.msc
# Change this to wherever you want to install the DLLs. This directory
# should be in your PATH.
INCLUDES = -I .
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG
-DEPCFLAGS = $(LIBICONV_CFLAGS)
+DEPCFLAGS = $(INTL_CFLAGS) $(LIBICONV_CFLAGS)
DLLS_TO_BUILD = \
glib-$(GLIB_VER).dll \
################ glib
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
- $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
+ $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(INTL_LIBS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
gspawn-win32-helper.exe : gspawn-win32-helper.c glib-$(GLIB_VER).dll
$(CC) $(CFLAGS) -Fe$@ -DG_LOG_DOMAIN=\"gspawn-win32-helper\" gspawn-win32-helper.c glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:windows user32.lib
#ifdef G_OS_WIN32
g_print ("current locale: %s\n", g_win32_getlocale ());
+
+ g_print ("GLib installation directory (used for message catalogs): %s\n",
+ g_win32_get_package_installation_directory (GETTEXT_PACKAGE));
+ g_print ("GTK+ 2.0 installation directory, if available: %s\n",
+ g_win32_get_package_installation_directory ("gtk20"));
#endif
g_print ("checking file functions...\n");
#ifdef G_OS_WIN32
g_print ("current locale: %s\n", g_win32_getlocale ());
+
+ g_print ("GLib installation directory (used for message catalogs): %s\n",
+ g_win32_get_package_installation_directory (GETTEXT_PACKAGE));
+ g_print ("GTK+ 2.0 installation directory, if available: %s\n",
+ g_win32_get_package_installation_directory ("gtk20"));
#endif
g_print ("checking file functions...\n");