Libtool problems with Kaffe B4 and Cygnus WIN32

Pavel Roskin pavel_roskin at geocities.com
Mon Apr 26 09:45:00 PDT 1999


Hello!

> Anyway, here is a patch which links all the .o files needed by
> old_archive_cmds to .lo files if the .o files were never built.  It allows the
> kaffe build on cygwin to get much further.  It falls down for me when it tries
> to load the sysv shm and  ipc headers (sys/shm.h and sys/ipc.h) which don't
> exist on vanilla cygwin =(O|

Patch attached. There are still some problems with ICQJava, but
this is not very useful under Windows anyway :-)
All AWT tests work.

I've tested this patch on Linux too, both with enabled and disabled Xshm
on local and remote X-Servers. No problems.

Pavel Roskin
-------------- next part --------------
Index: configure.in
===================================================================
RCS file: /home/cvspublic/kaffe/configure.in,v
retrieving revision 1.98
diff -u -r1.98 configure.in
--- configure.in	1999/04/23 19:53:30	1.98
+++ configure.in	1999/04/26 16:41:51
@@ -507,6 +507,9 @@
   OLIBS=$LIBS
   LIBS="$ZIP_LIBS $M_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $OLIBS"
   AC_CHECK_LIBRARY(Xext,XShmQueryExtension,X_PRE_LIBS)
+  if test x"$ac_cv_lib_Xext_XShmQueryExtension" = x"yes"; then
+    AC_DEFINE(HAVE_SHM, 1, [Define to support X shared memory extension])
+  fi
   LIBS="$ZIP_LIBS $M_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $OLIBS"
   AC_CHECK_LIBRARY(jpeg,jpeg_read_header,JPEG_LIBS)
   AC_CHECK_LIBRARY(png,png_create_info_struct,PNG_LIBS)
Index: libraries/clib/awt/X/gra.c
===================================================================
RCS file: /home/cvspublic/kaffe/libraries/clib/awt/X/gra.c,v
retrieving revision 1.12
diff -u -r1.12 gra.c
--- gra.c	1999/03/12 00:18:25	1.12
+++ gra.c	1999/04/26 16:41:51
@@ -655,6 +655,7 @@
   DBG( awt_gra, ("drawAlphaImage: %x %x (%x, %x),  %d,%d  %d,%d  %d,%d  %x\n",
 				 gr, img, img->xImg, img->alpha, srcX, srcY, dstX, dstY, width, height, bgval));
 
+#ifdef HAVE_SHM
   if ( X->shm == USE_SHM ){
 	dstImg = createImage( width, height);
 	createXImage( X, dstImg);
@@ -663,10 +664,13 @@
 	  XShmGetImage( X->dsp, gr->drw, dstXim, dstX, dstY, 0xffffffff);
 	}
 	else {  /* Shm failed, backup to normal XImage */
+#endif
 	  Java_java_awt_Toolkit_imgFreeImage( 0, 0, dstImg);
 	  dstImg = 0;
+#ifdef HAVE_SHM
 	}
   }
+#endif
 
   if ( !dstXim ) {
 	dstXim = XGetImage( X->dsp, gr->drw, dstX, dstY, width, height, 0xffffffff, ZPixmap);
@@ -703,16 +707,20 @@
 	  }
 	}
 
+#ifdef HAVE_SHM
 	if ( dstImg != 0 ){
 	  XShmPutImage( X->dsp, gr->drw, gr->gc, dstXim, 0, 0, dstX, dstY, width, height, False);
 	  XSync( X->dsp, False);
 	  Java_java_awt_Toolkit_imgFreeImage( 0, 0, dstImg);
 	}
 	else {
+#endif
 	  XPutImage( X->dsp, gr->drw, gr->gc, dstXim, 0, 0, dstX, dstY, width, height);
 	  XFlush( X->dsp);
 	  XDestroyImage( dstXim);
+#ifdef HAVE_SHM
 	}
+#endif
 
 	XFLUSH( X, True);
   }
@@ -755,14 +763,18 @@
 	  XSetBackground( X->dsp, gr->gc, 0);
 
 	  /* draw the mask bitmap */
+#ifdef HAVE_SHM
 	  if ( img->shmiMask ){
 		XShmPutImage( X->dsp, gr->drw, gr->gc, img->xMask,
 					  srcX, srcY, dstX, dstY, width, height, False);
 	  }
 	  else {
+#endif
 		XPutImage( X->dsp, gr->drw, gr->gc, img->xMask,
 				   srcX, srcY, dstX, dstY, width, height);
+#ifdef HAVE_SHM
 	  }
+#endif
 
 	  /* restore gc values except of the function */
 	  XChangeGC( X->dsp, gr->gc, GCFunction|GCPlaneMask|GCForeground|GCBackground, &values);
@@ -774,14 +786,18 @@
 	}
 
 	/* this is the real image drawing */
+#ifdef HAVE_SHM
 	if ( img->shmiImg ){
 	  XShmPutImage( X->dsp, gr->drw, gr->gc, img->xImg,
 					srcX, srcY, dstX, dstY, width, height, False);
 	}
 	else {
+#endif
 	  XPutImage( X->dsp, gr->drw, gr->gc, img->xImg,
 				 srcX, srcY, dstX, dstY, width, height);
+#ifdef HAVE_SHM
 	}
+#endif
 
 	/* in case we had a mask, restore the original function */
 	if ( img->xMask )
@@ -841,9 +857,11 @@
   initScaledImage( X, tgt, img, dx0-x0, dy0-y0, dx1-x0, dy1-y0, sx0, sy0, sx1, sy1);
   Java_java_awt_Toolkit_graDrawImage ( env, clazz, gr, tgt, 0, 0,
 									   x0, y0, tgt->width, tgt->height, bgval);
+#ifdef HAVE_SHM
   if ( tgt->shmiImg ) {
 	XSync( X->dsp, False); /* since we're going to destroy tgt, process its drawing first */
   }
+#endif
   Java_java_awt_Toolkit_imgFreeImage( env, clazz, tgt);
 
   if ( tmpXImg ) {
Index: libraries/clib/awt/X/img.c
===================================================================
RCS file: /home/cvspublic/kaffe/libraries/clib/awt/X/img.c,v
retrieving revision 1.13
diff -u -r1.13 img.c
--- img.c	1999/03/12 00:18:25	1.13
+++ img.c	1999/04/26 16:41:52
@@ -37,6 +37,7 @@
   return img;
 }
 
+#ifdef HAVE_SHM
 int
 createShmXImage ( Toolkit* X, Image* img, int depth, int isMask )
 {
@@ -120,6 +121,7 @@
   if ( X->shm == SUSPEND_SHM )
 	X->shm = USE_SHM;
 }
+#endif /* HAVE_SHM */
 
 
 
@@ -142,6 +144,7 @@
   bitmap_pad = bytes_per_pix * 8;
   nPix = img->width * img->height;
 
+#ifdef HAVE_SHM
   if ( (X->shm == USE_SHM) && (nPix > X->shmThreshold) && (img->alpha == 0) ) {
 	if ( createShmXImage( X, img, depth, False) ){
 	  DBG( awt_img, ( "alloc Shm: %x %x %x (%dx%d) \n", img, img->xImg, img->shmiImg,
@@ -149,6 +152,7 @@
 	  return;
 	}
   }
+#endif
 
   data = AWT_CALLOC( nPix, bytes_per_pix);
   img->xImg = XCreateImage( X->dsp, vis, depth, ZPixmap, 0,
@@ -168,6 +172,7 @@
   nPix   = img->width * img->height;
   nBytes = bytes_per_line * img->height;
 
+#ifdef HAVE_SHM
   if ( (X->shm == USE_SHM) && (nPix > X->shmThreshold) ) {
 	if ( createShmXImage( X, img, 1, True) ){
 	  DBG( awt_img, ( "alloc Shm mask: %x %x %x (%dx%d) \n", img, img->xMask, img->shmiMask,
@@ -175,6 +180,7 @@
 	  return;
 	}
   }
+#endif
 
   data = AWT_MALLOC( nBytes);
   memset( data, 0xff, nBytes);
@@ -535,33 +541,41 @@
 	 */
 
 	if ( img->xImg ){
+#ifdef HAVE_SHM
 	  if ( img->shmiImg ) {
 		DBG( awt_img, ( "free Shm: %x %x %x (%dx%d)\n", img, img->xImg, img->shmiImg,
 						img->width, img->height));
 		destroyShmXImage( X, img, False);
 	  }
 	  else {
+#endif
 		DBG( awt_img, ( "free: %x %x (%dx%d)\n", img, img->xImg, img->width, img->height));
 		AWT_FREE( img->xImg->data);
 		img->xImg->data = 0;
 		XDestroyImage( img->xImg);
+#ifdef HAVE_SHM
 	  }
+#endif
 	  img->xImg = 0;
 	}
 
 	if ( img->xMask ){
+#ifdef HAVE_SHM
 	  if ( img->shmiMask ) {
 		DBG( awt_img, ( "free Shm mask: %x %x %x (%dx%d)\n", img, img->xMask, img->shmiMask,
 						img->width, img->height));
 		destroyShmXImage( X, img, True);
 	  }
 	  else {
+#endif
 		DBG( awt_img, ( "free mask: %x %x (%dx%d)\n", img, img->xMask,
 						img->width, img->height));
 		AWT_FREE( img->xMask->data);
 		img->xMask->data = 0;
 		XDestroyImage( img->xMask);
+#ifdef HAVE_SHM
 	  }
+#endif
 	  img->xMask = 0;
 	}
 
Index: libraries/clib/awt/X/tlk.c
===================================================================
RCS file: /home/cvspublic/kaffe/libraries/clib/awt/X/tlk.c,v
retrieving revision 1.10
diff -u -r1.10 tlk.c
--- tlk.c	1999/03/17 06:24:54	1.10
+++ tlk.c	1999/04/26 16:41:52
@@ -111,6 +111,7 @@
    * We just can use XShm in case we don't run remote, and we better don't rely on
    * XShmQueryExtension to make this distinction
    */
+#ifdef HAVE_SHM
   if ( (dspName[0] == ':') || (strncmp( "localhost", dspName, 9) == 0) ) {
 	if ( XShmQueryExtension( X->dsp) ){
 	  X->shm =  USE_SHM;
@@ -121,6 +122,7 @@
 	  X->shmThreshold = 4096;
 	}
   }
+#endif
 
   WM_PROTOCOLS     = XInternAtom( X->dsp, "WM_PROTOCOLS", False);
   WM_DELETE_WINDOW = XInternAtom( X->dsp, "WM_DELETE_WINDOW", False);
Index: libraries/clib/awt/X/toolkit.h
===================================================================
RCS file: /home/cvspublic/kaffe/libraries/clib/awt/X/toolkit.h,v
retrieving revision 1.15
diff -u -r1.15 toolkit.h
--- toolkit.h	1999/03/22 06:23:09	1.15
+++ toolkit.h	1999/04/26 16:41:52
@@ -22,9 +22,11 @@
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
+#ifdef HAVE_SHM
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include <X11/extensions/XShm.h>
+#endif
 
 #include <jni.h>
 #if defined(HAVE_STRING_H)
@@ -96,10 +98,14 @@
   Pixmap           pix;            /* pixmap for screen images */
 
   XImage           *xImg;          /* "real" image */
+#ifdef HAVE_SHM
   XShmSegmentInfo  *shmiImg;       /* Shm info for shared mem real image */
+#endif
 
   XImage           *xMask;         /* mask image for reduced alpha (on/off) images */
+#ifdef HAVE_SHM
   XShmSegmentInfo  *shmiMask;      /* Shm info for shared mem mask image */
+#endif
 
   AlphaImage       *alpha;         /* full alpha channel (for alpha != 0x00 or 0xff) */
 


More information about the kaffe mailing list