Patches for Solaris and separate compilation



Here are a set of diffs that I had to apply to the GNOME sources to
compile on a Solaris 2.6 system, using a separate build directory.  I
wrote a small comment to each diff.

The affected modules are

	ORBit
	balsa
	gxsnmp
	gnome-core  (control-center)
	libgtop


I think the following might not be necessary anymore, since ORBit
works much better now thank you.

Index: ORBit/src/IIOP/connection.c
===================================================================
RCS file: /cvs/gnome/ORBit/src/IIOP/connection.c,v
retrieving revision 1.47
diff -u -r1.47 connection.c
--- connection.c	1998/08/17 21:10:06	1.47
+++ connection.c	1998/08/20 15:26:10
@@ -848,6 +848,10 @@
     GIOPConnection *newcnx;
 
     newfd = accept(GIOP_CONNECTION_GET_FD(connection), &sock, &n);
+    if( newfd == -1 ) {
+      g_warning("accept failed: %s\n", strerror(errno));
+      return;
+    }
 
     newcnx = GIOP_CONNECTION(iiop_connection_from_fd(newfd,
 						     IIOP_CONNECTION(connection)));



This is said to be fixed "in CVS", but it's not in anoncvs.gnome.org
at least.

Index: ORBit/src/services/name/naming-client.c
===================================================================
RCS file: /cvs/gnome/ORBit/src/services/name/naming-client.c,v
retrieving revision 1.5
diff -u -r1.5 naming-client.c
--- naming-client.c	1998/08/18 01:05:28	1.5
+++ naming-client.c	1998/08/20 15:26:10
@@ -3,6 +3,7 @@
 #include <ctype.h>
 #include <string.h>
 #include <limits.h>
+#include <stdlib.h>
 
 typedef enum {nom_bind, rebind, bind_context, rebind_context, unbind, resolve, 
 	      new_context, bind_new_context, destroy, not_set} mode_type;
@@ -48,7 +49,7 @@
 {
   static CosNaming_Name name = { 0, 0, NULL };
   int i, n;
-  char *t;
+   int t;
 
   CORBA_free( name._buffer );
 
@@ -59,10 +60,12 @@
   name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf( n + 1 );
   name._length = n + 1;
   for(i = 0; i <= n; i++) {
-    t = strchr(string, '/');
-    name._buffer[ i ].id = strndup(string, t?(t - string):INT_MAX);
+    t = strcspn(string, "/\0");
+    name._buffer[ i ].id = /*g_*/malloc( t + 1 );
+    strncpy( name._buffer[ i ].id, string, t );
+    name._buffer[ i ].id[ t ] = 0;
     name._buffer[ i ].kind = name._buffer[i].id;
-    string = t + 1;
+    string += t + 1;
   }
   CORBA_sequence_set_release(&name, FALSE);
   return( &name );


Balsa creates header files in the build directory, and since my build
directory is not the same as my source directory, I had to add it to
the include path.

Index: balsa/libbalsa/Makefile.am
===================================================================
RCS file: /cvs/gnome/balsa/libbalsa/Makefile.am,v
retrieving revision 1.10
diff -u -r1.10 Makefile.am
--- Makefile.am	1998/08/13 01:15:26	1.10
+++ Makefile.am	1998/08/20 15:26:12
@@ -9,5 +9,5 @@
 
 libbalsa_a_LIBADD = @LIBOBJS@
 
-INCLUDES=-I. -I${top_srcdir}/src -I${top_srcdir}/libmutt \
+INCLUDES=-I. -I${top_srcdir}/src -I${top_srcdir}/libmutt -I${top_builddir}/libmutt -I$(top_srcdir) \
 	$(GNOME_INCLUDEDIR)


sys_errlist was not in any header file I could find, but it worked to
just declare it.  This probably needs a better solution.


Index: balsa/libmutt/protos.h
===================================================================
RCS file: /cvs/gnome/balsa/libmutt/protos.h,v
retrieving revision 1.6
diff -u -r1.6 protos.h
--- protos.h	1998/08/12 22:57:41	1.6
+++ protos.h	1998/08/20 15:26:12
@@ -317,11 +317,11 @@
 #ifndef HAVE_STRERROR
 #ifndef STDC_HEADERS
 extern int sys_nerr;
-extern char *sys_errlist[];
 #endif
 
 #define strerror(x) ((x) > 0 && (x) < sys_nerr) ? sys_errlist[(x)] : 0
 #endif /* !HAVE_STRERROR */
+extern char *sys_errlist[];
 
 /* AIX doesn't define these in any headers (sigh) */
 int strcasecmp (const char *, const char *);


Again, I had to fix the include path.  This is a little ugly, but it
is caused by header files being in both the source and build
directories, and also by the fact that the mutt header files are
included both using <mutt.h> and <libmutt/mutt.h>.

There was a symbol (some obstack function) used, which wasn't in
libc.  I found it in libiberty, and added -liberty to balsa_LDADD.

Index: balsa/src/Makefile.am
===================================================================
RCS file: /cvs/gnome/balsa/src/Makefile.am,v
retrieving revision 1.28
diff -u -r1.28 Makefile.am
--- Makefile.am	1998/08/12 00:53:50	1.28
+++ Makefile.am	1998/08/20 15:26:12
@@ -16,7 +16,7 @@
 	save-restore.c		\
 	sendmsg-window.c
 
-INCLUDES=-I. -I${top_srcdir}/libbalsa -I${top_srcdir}/libmutt $(GNOME_INCLUDEDIR)
+INCLUDES=-I. -I$(top_srcdir) -I../libmutt -I$(top_srcdir)/libbalsa -I${top_srcdir}/libmutt $(GNOME_INCLUDEDIR)
 
 balsa_LDADD = \
 	$(top_builddir)/libbalsa/libbalsa.a \
@@ -25,4 +25,5 @@
 	$(GNOME_LIBDIR) \
 	$(GNOMEUI_LIBS) \
 	$(GTKXMHTML_LIBS) \
-	$(INTLLIBS)
+	$(INTLLIBS)\
+	-liberty



MKINSTALLDIRS already has the right path.

Index: gnome-admin/gxsnmp/po/Makefile.in.in
===================================================================
RCS file: /cvs/gnome/gnome-admin/gxsnmp/po/Makefile.in.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in.in
--- Makefile.in.in	1998/05/08 09:10:39	1.1
+++ Makefile.in.in	1998/08/20 15:27:01
@@ -26,7 +26,7 @@
 
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
+MKINSTALLDIRS = @MKINSTALLDIRS@
 
 CC = @CC@
 GENCAT = @GENCAT@


builddir/sourcedir fix for control-center

Index: gnome-core/control-center/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-core/control-center/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- Makefile.am	1998/08/12 18:51:57	1.2
+++ Makefile.am	1998/08/20 15:27:05
@@ -29,4 +29,4 @@
 
 $(CORBA_SRCLIST): control-center.idl
 	orbit-idl $(srcdir)/control-center.idl
-main.c: $(CORBA_SRCLIST)
+$(srcdir)/main.c: $(CORBA_SRCLIST)


Use strrchr instead of rindex.  This is just a workaround using a
define.  The hardcoded path names are changed too...


Index: gnome-core/control-center/tree.c
===================================================================
RCS file: /cvs/gnome/gnome-core/control-center/tree.c,v
retrieving revision 1.2
diff -u -r1.2 tree.c
--- tree.c	1998/08/12 18:52:04	1.2
+++ tree.c	1998/08/20 15:27:05
@@ -11,6 +11,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#define rindex strrchr
+
 GdkPixmap *pixmap1;
 GdkPixmap *pixmap2;
 GdkPixmap *pixmap3;
@@ -27,8 +29,8 @@
 
         temp1 = strdup (first);
         temp2 = strdup (second);
-        (rindex(temp1, '/'))[0] = 0;
-        (rindex(temp2, '/'))[0] = 0;
+        *(rindex(temp1, '/')) = 0;
+        *(rindex(temp2, '/')) = 0;
 
         retval = !strcmp (rindex (temp1, '/'), rindex (temp2, '/'));
         g_free (temp1);
@@ -190,8 +192,8 @@
         gtk_signal_connect( GTK_OBJECT (retval),"tree_select_row", GTK_SIGNAL_FUNC (selected_row_callback), NULL);
 
         /*hard_coded for now... */
-        global_node = read_directory ("/home/jrb/gnomedevel/test1");
-        user_node = read_directory ("/home/jrb/gnomedevel/test2");
+        global_node = read_directory ("/home/davidk/src/gnome/cc-test1");
+        user_node = read_directory ("/home/davidk/src/gnome/cc-test2");
         merge_nodes (user_node, global_node);
 
         /* now we actually set up the tree... */


The compiler complained about a mismatch between int and pid_t.

Index: libgtop/include/glibtop/mountlist.h
===================================================================
RCS file: /cvs/gnome/libgtop/include/glibtop/mountlist.h,v
retrieving revision 1.6
diff -u -r1.6 mountlist.h
--- mountlist.h	1998/08/10 16:57:29	1.6
+++ mountlist.h	1998/08/20 15:28:52
@@ -57,7 +57,7 @@
 
 #define glibtop_get_mountlist_r		glibtop_get_mountlist_s
 
-extern glibtop_mountentry *glibtop_get_mountlist_l __P((glibtop *, glibtop_mountlist *, int));
+extern glibtop_mountentry *glibtop_get_mountlist_l __P((glibtop *, glibtop_mountlist *, pid_t));
 
 extern glibtop_mountentry *glibtop_get_mountlist_s __P((glibtop *, glibtop_mountlist *, int));
 

This was not updated correctly.

Index: libgtop/sysdeps/stub/proclist.c
===================================================================
RCS file: /cvs/gnome/libgtop/sysdeps/stub/proclist.c,v
retrieving revision 1.3
diff -u -r1.3 proclist.c
--- proclist.c	1998/07/13 22:31:50	1.3
+++ proclist.c	1998/08/20 15:28:56
@@ -32,7 +32,8 @@
  *   each buf->size big. The total size is stored in buf->total. */
 
 unsigned *
-glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf)
+glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
+			int64_t which, int64_t arg)
 {
 	memset (buf, 0, sizeof (glibtop_proclist));
 	return NULL;


-- 
David Kågedal        <davidk@lysator.liu.se> http://www.lysator.liu.se/~davidk/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]