Patch for Glade 0.5.9 under Win32

Date view Thread view Subject view Author view

From: Arnaud Charlet (charlet@ACT-Europe.FR)
Date: Wed Jul 19 2000 - 04:49:16 EDT


Hi Damon and others.

Here is the patch that I have applied to the 0.5.9 sources in order to
build Glade under Win32. Other than this patch, the steps required to
build Glade under windows are relatively straightforward:

- install Gtk+ as explained in Tor Lillqvist page
- create a gtk-config script that handles at least the --cflags and --libs
  options for your installation (simply a matter of copy/paste).
- then configure glade as follows:
  CC="gcc -fnative-struct -mno-cygwin -mwindows" ./configure
  make

The patch handles renaming of files under Win32, as done under OS/2 (remove
the file before renaming it). It also get rid of an unneeded gdkx.h.

Here is the patch:

--
*** glade/editor.c.old	Tue Jul 11 16:55:38 2000
--- glade/editor.c	Tue Jul 11 16:53:12 2000
***************
*** 19,25 ****
--- 19,27 ----
  #include <string.h>
  
  #include <gdk/gdkkeysyms.h>
+ #ifndef _WIN32
  #include <gdk/gdkx.h>
+ #endif
  
  #include <gtk/gtk.h>
  
*** glade/save.c.old	Tue Jul 11 16:55:18 2000
--- glade/save.c	Tue Jul 11 16:56:18 2000
***************
*** 115,121 ****
    if (glade_util_file_exists (filename))
      {
        backup_filename = g_strdup_printf ("%s.bak", filename);
! #ifdef __EMX__
        /* for OS/2 rename dosn't work if the dest. file exist ! remove it! */
        status = remove (backup_filename);
  #endif
--- 115,121 ----
    if (glade_util_file_exists (filename))
      {
        backup_filename = g_strdup_printf ("%s.bak", filename);
! #if defined (__EMX__) || defined (_WIN32)
        /* for OS/2 rename dosn't work if the dest. file exist ! remove it! */
        status = remove (backup_filename);
  #endif
*** glade/source.c.old	Tue Jul 11 16:55:24 2000
--- glade/source.c	Tue Jul 11 16:57:16 2000
***************
*** 2834,2839 ****
--- 2834,2842 ----
    if (glade_util_file_exists (filename))
      {
        backup_filename = g_strdup_printf ("%s.bak", filename);
+ #if defined (__EMX__) || defined (_WIN32)
+       remove (backup_filename);
+ #endif
        status = rename (filename, backup_filename);
  
        if (status == -1)
*** glade/utils.c.old	Tue Jul 11 17:38:02 2000
--- glade/utils.c	Tue Jul 11 17:39:44 2000
***************
*** 1277,1283 ****
--- 1277,1287 ----
  	  if (mkdir (directory, 0777) != 0)
  #endif
  	    {
+ #ifndef _WIN32
+ /* This happens under WIN32 when stat is confused by the filename, but this is
+    harmless, since we know that the directory exists after all. */
  	      return glade_error_new_system (_("Couldn't create directory:\n  %s\n"), directory);
+ #endif
  	    }
  	}
        else
*** intl/dcgettext.c.old	Tue Jul 11 17:23:06 2000
--- intl/dcgettext.c	Tue Jul 11 17:25:16 2000
***************
*** 225,230 ****
--- 225,235 ----
  #else
  static int enable_secure;
  # define ENABLE_SECURE (enable_secure == 1)
+ #ifdef _WIN32
+ # define DETERMINE_SECURE \
+   if (enable_secure == 0)						      \
+     enable_secure = -1;
+ #else
  # define DETERMINE_SECURE \
    if (enable_secure == 0)						      \
      {									      \
***************
*** 233,238 ****
--- 238,244 ----
        else								      \
  	enable_secure = -1;						      \
      }
+ #endif
  #endif
  
  /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
--

Arno

+---------------------------------------------------------------------+ To unsubscribe from this list, send a message to majordomo@ncis.pn.org with the line "unsubscribe glade-devel" in the body of the message.


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Aug 01 2000 - 19:30:25 EDT