Re: control-center won't compile on Solaris 2.7



Yep, some Redhat-specific code crept in there, aparrently.
Either use control-center-1.2.0, or apply this patch:

Index: configure.in
===================================================================
RCS file: /cvs/gnome/control-center/configure.in,v
retrieving revision 1.170.2.10
diff -u -r1.170.2.10 configure.in
--- configure.in        2000/08/04 08:42:14     1.170.2.10
+++ configure.in        2000/08/05 16:51:44
@@ -56,7 +56,7 @@
 ])])
 AC_SUBST(DL_LIB)
 
-AC_CHECK_FUNCS(usleep)
+AC_CHECK_FUNCS(usleep flockfile getline)
 
 dnl keyboard-properties-capplet
 AC_CHECK_HEADERS(X11/extensions/xf86misc.h, XF86MISC_LIBS="-lXxf86misc")
Index: capplets/theme-switcher/lister.c
===================================================================
RCS file: /cvs/gnome/control-center/capplets/theme-switcher/lister.c,v
retrieving revision 1.5.2.1
diff -u -r1.5.2.1 lister.c
--- capplets/theme-switcher/lister.c    2000/08/01 23:55:17     1.5.2.1
+++ capplets/theme-switcher/lister.c    2000/08/05 16:51:46
@@ -4,6 +4,91 @@
 #include <sys/types.h>
 #include <utime.h>
 #include <errno.h>
+#include <config.h>
+
+#ifndef HAVE_GETLINE
+/* The interface here is that of GNU libc's getline */
+static ssize_t
+getline (char **lineptr, size_t *n, FILE *stream)
+{
+#define EXPAND_CHUNK 16
+
+  int n_read = 0;
+  char *line = *lineptr;
+
+  g_return_val_if_fail (lineptr != NULL, -1);
+  g_return_val_if_fail (n != NULL, -1);
+  g_return_val_if_fail (stream != NULL, -1);
+  g_return_val_if_fail (*lineptr != NULL || *n == 0, -1);
+  
+#ifdef HAVE_FLOCKFILE
+  flockfile (stream);
+#endif  
+  
+  while (1)
+    {
+      int c;
+      
+#ifdef HAVE_FLOCKFILE
+      c = getc_unlocked (stream);
+#else
+      c = getc (stream);
+#endif      
+
+      if (c == EOF)
+        {
+          if (n_read > 0)
+           line[n_read] = '\0';
+          break;
+        }
+
+      if (n_read + 2 >= *n)
+        {
+         size_t new_size;
+
+         if (*n == 0)
+           new_size = 16;
+         else
+           new_size = *n * 2;
+
+         if (*n >= new_size)    /* Overflowed size_t */
+           line = NULL;
+         else
+           line = *lineptr ? realloc (*lineptr, new_size) : malloc (new_size);
+
+         if (line)
+           {
+             *lineptr = line;
+             *n = new_size;
+           }
+         else
+           {
+             if (*n > 0)
+               {
+                 (*lineptr)[*n - 1] = '\0';
+                 n_read = *n - 2;
+               }
+             break;
+           }
+        }
+
+      line[n_read] = c;
+      n_read++;
+
+      if (c == '\n')
+        {
+          line[n_read] = '\0';
+          break;
+        }
+    }
+
+#ifdef HAVE_FLOCKFILE
+  funlockfile (stream);
+#endif
+
+  return n_read - 1;
+}
+#endif /* ! HAVE_GETLINE */
 
 #define MARK_STRING "# -- THEME AUTO-WRITTEN DO NOT EDIT\n"
 static void


Aaron Ginn wrote:
> 
> I'm having difficulty getting control-center to compile on Solaris 2.7.
> Make errors out with this message:
> 
> ld: warning: file ../../control-center/.libs/libcapplet.so: attempted
> multiple inclusion of file
> Undefined                       first referenced
>  symbol                             in file
> getline                             lister.o
> ld: fatal: Symbol referencing errors. No output written to
> .libs/theme-selector-capplet
> collect2: ld returned 1 exit status
> make[3]: *** [theme-selector-capplet] Error 1
> make[3]: Leaving directory
> `/home/ginn/gnu-tools/download/gnome/control-center-1.2.1/capplets/theme-switcher'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory
> `/home/ginn/gnu-tools/download/gnome/control-center-1.2.1/capplets'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory
> `/home/ginn/gnu-tools/download/gnome/control-center-1.2.1'
> make: *** [all-recursive-am] Error 2
> 
> The function getline appears to be undefined.  If I look in the file
> lister.c, the first line is
> 
> #define _GNU_SOURCE             /* For getline() */
> 
> It doesn't appear that _GNU_SOURCE is being defined as anything.  Is
> this correct? Also, my header files that have been included are as
> follows:
> 
> #include "da.h"
> #include <sys/types.h>
> #include <utime.h>
> #include <errno.h>
> 
> In which header file is getline() defined, and why can't I see it?
> 
> Thanks,
> Aaron Ginn
> 

-- 
 ~~~~~~~~~~~~~~~~~~~~~~~~ Paul Barnfather ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
|  plb@clanger9.demon.co.uk  paul.barnfather@northern-electric.co.uk |
|      __           http://www.clanger9.demon.co.uk    .             |
     o--o-... 75TS                                    o'~o... 750SS





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