Hello!

Am Montag, 27. Juni 2005 18:26 schrieb Andreas:
> >
> > http://lists.danga.com/pipermail/memcached/2005-April/001362.html
> > told me to include "-lsocket -lmalloc -lresolv" in LDFLAGS and
> > that helped. Configured again, symbol this seems to be available now.
> 
> You could edit configure.in and check for solaris, there is (dirty as  
> usual) code that checks for the BSDs and Darwin and addes something  
> to LDFLAGS, you could do the same for solaris.
> ...

Just for completeness: I finally managed to compile
the library under Solaris 8 using gcc 3.4.3.

However, there were some changes to the code in order
to make it work and just in case anyone likes to make
a similar attemt I'll post them here. Otherwise please
ignore the following text :)

diff -u -r DirectFB-0.9.22-original/include/dfb_types.h 
DirectFB-0.9.22-tmp/include/dfb_types.h
--- DirectFB-0.9.22-original/include/dfb_types.h        2004-04-29 
21:08:36.000000000 +0200
+++ DirectFB-0.9.22-tmp/include/dfb_types.h     2005-06-30 15:45:56.000000000 
+0200
@@ -3,10 +3,10 @@
 
 #include <sys/types.h>
 
-#define __u8  u_int8_t
-#define __u16 u_int16_t
-#define __u32 u_int32_t
-#define __u64 u_int64_t
+#define __u8  uint8_t
+#define __u16 uint16_t
+#define __u32 uint32_t
+#define __u64 uint64_t
 
 #define __s8  int8_t
 #define __s16 int16_t

diff -u -r DirectFB-0.9.22-original/lib/direct/interface.c 
DirectFB-0.9.22-tmp/lib/direct/interface.c
--- DirectFB-0.9.22-original/lib/direct/interface.c     2004-10-29 
23:26:48.000000000 +0200
+++ DirectFB-0.9.22-tmp/lib/direct/interface.c  2005-06-30 15:45:56.000000000 
+0200
@@ -31,9 +31,9 @@
 #include <dirent.h>
 #include <dlfcn.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <errno.h>
 #include <string.h>
+#include <stdlib.h>
 
 #include <direct/debug.h>
 #include <direct/interface.h>
@@ -140,7 +140,7 @@
       * Try to load it dynamically.
       */
      len = strlen(MODULEDIR"/interfaces/") + strlen(type) + 1;
-     interface_dir = alloca( len );
+     interface_dir = malloc( len );
      snprintf( interface_dir, len, MODULEDIR"/interfaces/%s", type );
 
      dir = opendir( interface_dir );
@@ -244,6 +244,7 @@
           else
                D_DLERROR( "Direct/Interface: Unable to dlopen `%s'!\n", buf );
      }
+     free(interface_dir);
 
      closedir( dir );
 
diff -u -r DirectFB-0.9.22-original/lib/direct/util.h 
DirectFB-0.9.22-tmp/lib/direct/util.h
--- DirectFB-0.9.22-original/lib/direct/util.h  2004-11-25 22:47:22.000000000 
+0100
+++ DirectFB-0.9.22-tmp/lib/direct/util.h       2005-06-30 15:45:56.000000000 
+0200
@@ -28,6 +28,7 @@
 #ifndef __DIRECT__UTIL_H__
 #define __DIRECT__UTIL_H__
 
+#include <stdlib.h>
 #include <direct/types.h>
 #include <direct/messages.h>
 
diff -u -r DirectFB-0.9.22-original/src/input/idirectfbinputbuffer.c 
DirectFB-0.9.22-tmp/src/input/idirectfbinputbuffer.c
--- DirectFB-0.9.22-original/src/input/idirectfbinputbuffer.c   2004-11-23 
02:14:18.000000000 +0100
+++ DirectFB-0.9.22-tmp/src/input/idirectfbinputbuffer.c        2005-06-30 
15:46:02.000000000 +0200
@@ -451,7 +451,7 @@
      }
 
      /* Create the file descriptor(s). */
-     if (socketpair( PF_LOCAL, SOCK_STREAM, 0, data->pipe_fds )) {
+     if (socketpair( PF_UNIX, SOCK_STREAM, 0, data->pipe_fds )) {
           pthread_mutex_unlock( &data->events_mutex );
           return errno2result( errno );
      }
diff -u -r DirectFB-0.9.22-original/src/misc/conf.c 
DirectFB-0.9.22-tmp/src/misc/conf.c
--- DirectFB-0.9.22-original/src/misc/conf.c    2005-02-23 10:40:06.000000000 
+0100
+++ DirectFB-0.9.22-tmp/src/misc/conf.c 2005-06-30 15:46:04.000000000 +0200
@@ -220,7 +220,7 @@
 static DFBResult
 parse_args( const char *args )
 {
-     char *buf = alloca( strlen(args) + 1 );
+     char *buf = malloc( strlen(args) + 1 );
 
      strcpy( buf, args );
 
@@ -258,6 +258,8 @@
 
           buf = next;
      }
+     
+     free(buf);
 
      return DFB_OK;
 }

diff -u -r DirectFB-0.9.22-original/src/misc/gfx_util.c 
DirectFB-0.9.22-tmp/src/misc/gfx_util.c
--- DirectFB-0.9.22-original/src/misc/gfx_util.c        2005-02-14 
20:17:10.000000000 +0100
+++ DirectFB-0.9.22-tmp/src/misc/gfx_util.c     2005-06-30 15:46:04.000000000 
+0200
@@ -263,8 +263,8 @@
           return 0;
      }
 
-     x_weights = (float *) alloca (n_x * sizeof (float));
-     y_weights = (float *) alloca (n_y * sizeof (float));
+     x_weights = (float *) malloc (n_x * sizeof (float));
+     y_weights = (float *) malloc (n_y * sizeof (float));
 
      if (!x_weights || !y_weights) {
           D_FREE( filter->weights );
@@ -335,6 +335,8 @@
                     }
                }
           }
+     free(x_weights);
+     free(y_weights);          
 
      return 1;
 }
@@ -475,7 +477,7 @@
           run_weights = filter.weights + ((sy >> (SCALE_SHIFT - 
SUBSAMPLE_BITS))
                                           & SUBSAMPLE_MASK) * filter.n_x * 
filter.n_y * SUBSAMPLE;
 
-          line_bufs = (__u32 **) alloca( filter.n_y * sizeof (void *) );
+          line_bufs = (__u32 **) malloc( filter.n_y * sizeof (void *) );
 
           for (j = 0; j < filter.n_y; j++) {
                if (y_start <  0)
@@ -531,6 +533,8 @@
           }
 
           sy += y_step;
+          
+          free(line_bufs);
      }
 
      D_FREE(filter.weights);

diff -u -r DirectFB-0.9.22-original/tools/dfbscreen.c 
DirectFB-0.9.22-tmp/tools/dfbscreen.c
--- DirectFB-0.9.22-original/tools/dfbscreen.c  2004-11-27 10:34:28.000000000 
+0100
+++ DirectFB-0.9.22-tmp/tools/dfbscreen.c       2005-06-30 15:46:04.000000000 
+0200
@@ -412,7 +412,7 @@
 {
      __u32  val  = 0;
      int    alen = strlen( arg );
-     char  *abuf = alloca( alen + 1 );
+     char  *abuf = malloc( alen + 1 );
 
      memcpy( abuf, arg, alen + 1 );
 
@@ -456,6 +456,8 @@
      }
 
      *((__u32*)option->value) = val;
+     
+     free(abuf);
 
      return true;
 }

_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to